summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--registration.rb4
-rw-r--r--spec/registration_spec.rb3
2 files changed, 2 insertions, 5 deletions
diff --git a/registration.rb b/registration.rb
index e8ddd6f..2888387 100644
--- a/registration.rb
+++ b/registration.rb
@@ -24,15 +24,13 @@ class RegistrationApp < Sinatra::Base
post '/submit' do
if request.form_data?
- #p request['band']
@band = Band.new(request['band'])
if @band.valid?
generate_pdf_for @band
send_registration_emails_for @band
erb :submitted
else
- session['errors'] = @band.errors
- redirect to('/')
+ erb :index
end
end
end
diff --git a/spec/registration_spec.rb b/spec/registration_spec.rb
index 6532f3e..33df205 100644
--- a/spec/registration_spec.rb
+++ b/spec/registration_spec.rb
@@ -88,11 +88,10 @@ describe RegistrationApp do
end
it 'should reject request and go back to the registration form' do
- expect(last_response.status).to eq(302)
+ expect(last_response.body).to match /form id="registration-form"/
end
it 'should display an error message' do
- follow_redirect!
expect(last_response.body).to include "Du må ha med minst én låt"
end
end