diff --git a/config/environments/test.rb b/config/environments/test.rb index 0702df7..a7706f5 100644 --- a/config/environments/test.rb +++ b/config/environments/test.rb @@ -22,14 +22,15 @@ Rails.application.configure do "Cache-Control" => "public, max-age=#{1.hour.to_i}" } - # Show full error reports and disable caching. - config.consider_all_requests_local = true + # Hide full error reports. + config.consider_all_requests_local = false + # Render exception templates instead of raising exceptions. + config.action_dispatch.show_exceptions = true + + # Disable caching. config.action_controller.perform_caching = false config.cache_store = :null_store - # Raise exceptions instead of rendering exception templates. - config.action_dispatch.show_exceptions = false - # Disable request forgery protection in test environment. config.action_controller.allow_forgery_protection = false diff --git a/test/application_system_test_case.rb b/test/application_system_test_case.rb index 981223f..f3ac457 100644 --- a/test/application_system_test_case.rb +++ b/test/application_system_test_case.rb @@ -4,7 +4,7 @@ class ApplicationSystemTestCase < ActionDispatch::SystemTestCase # NOTE: remove when capabilities no longer used by Rails Selenium::WebDriver.logger.ignore(:capabilities) - driven_by :selenium, using: :headless_firefox, screen_size: [1600, 900] + driven_by :selenium, using: :headless_firefox, screen_size: [2400, 1600] def sign_in(user: users.select(&:confirmed?).sample, password: randomize_user_password!(user)) visit new_user_session_url diff --git a/test/system/users_test.rb b/test/system/users_test.rb index 250691a..9510237 100644 --- a/test/system/users_test.rb +++ b/test/system/users_test.rb @@ -101,12 +101,11 @@ class UsersTest < ApplicationSystemTestCase end end - test "users index visible only for admin" do + test "users index forbidden for non admin" do sign_in user: users.reject(&:admin?).select(&:confirmed?).sample - assert_raise ApplicationController::AccessForbidden do - visit users_path - end + visit users_path assert has_no_link?t('layouts.application.users') + assert_title "Access is forbidden to this page (403)" end test "update e-mail" do