Fix unreachable code (#1140) in ConferenceRegistrationController#new

Remove the unreachable code from ConferenceRegistrationController#new
Rework the  error message logic in ConferenceRegistrationController#new
Fix redirect to #edit when the user is registered
Refactor ConferenceRegistrationController#new spec and add more tests
This commit is contained in:
AEtherC0r3 2017-02-02 01:28:22 +02:00
parent b46a721a7d
commit 88e1646e87
3 changed files with 215 additions and 52 deletions

View file

@ -46,7 +46,7 @@ class ApplicationController < ActionController::Base
rescue_from CanCan::AccessDenied do |exception|
Rails.logger.debug "Access denied on #{exception.action} #{exception.subject.inspect}"
message = exception.message
message << ' Maybe you need to sign in?' unless current_user
message << ' Maybe you need to sign in?' unless @ignore_not_signed_in_user || current_user
redirect_to root_path, alert: message
end