Add test for conference registration controller show and destroy action

After failed delete, user should be redirected to registration show and not
root.
This commit is contained in:
Aditya Prakash 2016-03-23 11:42:40 +05:30
parent 80a06b99b4
commit 19157ac81d
3 changed files with 96 additions and 2 deletions

View file

@ -90,8 +90,8 @@ class ConferenceRegistrationsController < ApplicationController
redirect_to root_path,
notice: "You are not registered for #{@conference.title} anymore!"
else
redirect_to root_path,
error: "Could not update your registration for #{@conference.title}: "\
redirect_to conference_conference_registrations_path(@conference.short_title),
error: "Could not delete your registration for #{@conference.title}: "\
"#{@registration.errors.full_messages.join('. ')}."
end
end