summaryrefslogtreecommitdiffstats
path: root/spec/registration_spec.rb
diff options
context:
space:
mode:
authorHarald Eilertsen <haraldei@anduin.net>2015-11-21 18:04:38 +0100
committerHarald Eilertsen <haraldei@anduin.net>2015-11-21 18:04:38 +0100
commit46636b7984220677e886b92174c2fb36aa5492c6 (patch)
treeca5d81e992aa9cf0b6b63e99fa6584941472037d /spec/registration_spec.rb
parent4a9954e3a68982c2f84a843ac3d41ccdc1530596 (diff)
downloadnorsk-urskog-registrations-46636b7984220677e886b92174c2fb36aa5492c6.tar.gz
norsk-urskog-registrations-46636b7984220677e886b92174c2fb36aa5492c6.tar.bz2
norsk-urskog-registrations-46636b7984220677e886b92174c2fb36aa5492c6.zip
Make rspec output nicer.
Diffstat (limited to 'spec/registration_spec.rb')
-rw-r--r--spec/registration_spec.rb34
1 files changed, 16 insertions, 18 deletions
diff --git a/spec/registration_spec.rb b/spec/registration_spec.rb
index 60d6ac9..8d04d89 100644
--- a/spec/registration_spec.rb
+++ b/spec/registration_spec.rb
@@ -28,7 +28,7 @@ describe RegistrationApp do
end
end
- describe 'POST submit' do
+ describe 'submitting a form' do
include Mail::Matchers
before :each do
@@ -95,47 +95,45 @@ describe RegistrationApp do
shared_examples_for('form with errors') do |args|
let(:band_params) { create_band_params(args) }
- describe "form with errors" do
- before :each do
- post '/submit', 'band' => band_params
- end
+ before :each do
+ post '/submit', 'band' => band_params
+ end
- it 'should go back to the registration form' do
- expect(last_response.body).to match(/form id="registration-form"/)
- end
+ it 'should go back to the registration form' do
+ expect(last_response.body).to match(/form id="registration-form"/)
+ end
- it 'should display an error message' do
- expect(last_response.body).to include("Det er feil i skjemaet")
- end
+ it 'should display an error message' do
+ expect(last_response.body).to include("Det er feil i skjemaet")
end
end
context 'with no songs' do
- it_behaves_like('form with errors', {:songs => 0})
+ include_examples('form with errors', {:songs => 0})
end
context 'without a band name' do
- it_behaves_like('form with errors', {:name => ''})
+ include_examples('form with errors', {:name => ''})
end
context 'with a band name with only spaces' do
- it_behaves_like('form with errors', {:name => ' '})
+ include_examples('form with errors', {:name => ' '})
end
context 'with no contact' do
- it_behaves_like('form with errors', {:contact_name => ''})
+ include_examples('form with errors', {:contact_name => ''})
end
context 'with no contact address' do
- it_behaves_like('form with errors', {:contact_addr => ''})
+ include_examples('form with errors', {:contact_addr => ''})
end
context 'with no contact phone' do
- it_behaves_like('form with errors', {:contact_phone => ''})
+ include_examples('form with errors', {:contact_phone => ''})
end
context 'with no contact email' do
- it_behaves_like('form with errors', {:contact_email => ''})
+ include_examples('form with errors', {:contact_email => ''})
end
end
end