diff --git a/app/controllers/users/registrations_controller.rb b/app/controllers/users/registrations_controller.rb index fbf1328..a4663ba 100644 --- a/app/controllers/users/registrations_controller.rb +++ b/app/controllers/users/registrations_controller.rb @@ -40,7 +40,7 @@ class Users::RegistrationsController < Devise::RegistrationsController # If you have extra params to permit, append them to the sanitizer. def configure_sign_up_params - devise_parameter_sanitizer.for(:sign_up) << :soft_token + devise_parameter_sanitizer.permit(:sign_up, keys: [:soft_token]) end # If you have extra params to permit, append them to the sanitizer. diff --git a/config/initializers/devise_permitted_parameters.rb b/config/initializers/devise_permitted_parameters.rb index 2c898f9..1be016b 100644 --- a/config/initializers/devise_permitted_parameters.rb +++ b/config/initializers/devise_permitted_parameters.rb @@ -8,8 +8,8 @@ module DevisePermittedParameters protected def configure_permitted_parameters - devise_parameter_sanitizer.for(:sign_up) << :name - devise_parameter_sanitizer.for(:account_update) << :name + devise_parameter_sanitizer.permit(:sign_up, keys: [:name]) + devise_parameter_sanitizer.permit(:account_update, keys: [:name]) end end diff --git a/spec/features/tables/table_show_spec.rb b/spec/features/tables/table_show_spec.rb index 6f0f6d8..5b5f810 100644 --- a/spec/features/tables/table_show_spec.rb +++ b/spec/features/tables/table_show_spec.rb @@ -13,18 +13,18 @@ feature 'Table show', :devise do # Given I am not signed in # When I visit a table # Then I see the table attributes - scenario 'visitor can see the table', js: true do - expect(page).to have_selector "#table-#{@table.id} > h1", @table.title + scenario 'visitor can see the table' do + expect(page).to have_text @table.title end - scenario 'visitor can see the seats', js: true do + scenario 'visitor can see the seats' do #TODO: Race condition exists without have_content - expect(page).to have_content "Sit" + expect(page).to have_button "Sit" @seat_count = page.find_all(".seat").length expect(@seat_count).to eq @table.seats.count end - scenario 'visitor can see the current game', js: true do + scenario 'visitor can see the current game' do #TODO: Write a better expectation expect(page).to have_content "Hand to beat" end @@ -43,14 +43,14 @@ feature 'Table show', :devise do # Given I am signed in # When I click a table # Then I see the table attributes - scenario 'user can see the table', js: true do + scenario 'user can see the table' do expect(page).to have_content "Sign out" - expect(page).to have_selector "#table-#{@table.id} > h1", @table.title + expect(page).to have_content @table.title expect(current_path).to eq table_path(@table) end - scenario 'user can see the current game', js: true do - expect(page).to have_content "Sit" + scenario 'user can see the current game' do + expect(page).to have_button "Sit" end end diff --git a/spec/support/helpers/session_helpers.rb b/spec/support/helpers/session_helpers.rb index ffc216c..9017142 100644 --- a/spec/support/helpers/session_helpers.rb +++ b/spec/support/helpers/session_helpers.rb @@ -11,7 +11,6 @@ module Features def signin(email, password) visit new_user_session_path sleep 2 - page.save_screenshot fill_in 'Email', with: email fill_in 'Password', with: password click_button 'Log in'