From: Andy Allan Date: Wed, 15 Mar 2017 15:53:47 +0000 (+0000) Subject: Use user factory for user_terms_seen integration test. X-Git-Tag: live~3535 X-Git-Url: https://git.openstreetmap.org/rails.git/commitdiff_plain/a6a1a6baa59cf45eb0af25d8142416f941113ca1?hp=8ccd7364cda55f247f2aa8c622466facd3f4fa65 Use user factory for user_terms_seen integration test. --- diff --git a/test/integration/user_terms_seen_test.rb b/test/integration/user_terms_seen_test.rb index e8d3df07a..ad0c3b211 100644 --- a/test/integration/user_terms_seen_test.rb +++ b/test/integration/user_terms_seen_test.rb @@ -1,15 +1,13 @@ require "test_helper" class UserTermsSeenTest < ActionDispatch::IntegrationTest - fixtures :users - def setup stub_hostip_requests end def test_api_blocked with_terms_seen(true) do - user = users(:terms_not_seen_user) + user = create(:user, :terms_seen => false) get "/api/#{API_VERSION}/user/preferences", nil, auth_header(user.display_name, "test") assert_response :forbidden @@ -25,7 +23,7 @@ class UserTermsSeenTest < ActionDispatch::IntegrationTest def test_terms_presented_at_login with_terms_seen(true) do - user = users(:terms_not_seen_user) + user = create(:user, :terms_seen => false) # try to log in get_via_redirect "/login" @@ -51,7 +49,7 @@ class UserTermsSeenTest < ActionDispatch::IntegrationTest def test_terms_cant_be_circumvented with_terms_seen(true) do - user = users(:terms_not_seen_user) + user = create(:user, :terms_seen => false) # try to log in get_via_redirect "/login"