diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index 12c0e8e0..c4e269b9 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -9,8 +9,8 @@ class ApplicationController < ActionController::Base end def after_sign_in_path_for(resource) - if session[:return_to] and - not session[:return_to].start_with?(user_registration_path) + if session[:return_to] && + (not session[:return_to].start_with?(user_registration_path)) logger.debug "Returning to #{session[:return_to]}" session[:return_to] else diff --git a/spec/features/conference_spec.rb b/spec/features/conference_spec.rb index 25339575..058cd3d6 100644 --- a/spec/features/conference_spec.rb +++ b/spec/features/conference_spec.rb @@ -17,7 +17,8 @@ feature Conference do click_button 'Create Conference' - expect(page.find('#flash_notice').text).to eq('Conference was successfully created.') + expect(page.find('#flash_notice').text). + to eq('Conference was successfully created.') expect(Conference.count).to eq(expected_count) end @@ -32,7 +33,8 @@ feature Conference do fill_in 'conference_social_tag', with: 'NewCon' click_button 'Update Conference' - expect(page.find('#flash_notice').text).to eq('Conference was successfully updated.') + expect(page.find('#flash_notice').text). + to eq('Conference was successfully updated.') conference.reload expect(conference.title).to eq('New Con') diff --git a/spec/support/login_macros.rb b/spec/support/login_macros.rb index 3694a12b..ad6abe3c 100644 --- a/spec/support/login_macros.rb +++ b/spec/support/login_macros.rb @@ -1,5 +1,4 @@ module LoginMacros - def sign_in(user) visit new_user_session_path