From: Andy Allan Date: Thu, 9 Mar 2017 11:04:29 +0000 (+0000) Subject: Use user factory for oauth_token model test. X-Git-Tag: live~3616^2~5 X-Git-Url: https://git.openstreetmap.org/rails.git/commitdiff_plain/8a6956eb22311cdf78eb32f05210d1c5034b26e1?hp=5e78831d5c6f3e37b9ebcbb3ca12654858349034 Use user factory for oauth_token model test. --- diff --git a/test/models/oauth_token_test.rb b/test/models/oauth_token_test.rb index c2df0d131..4b0e39e9a 100644 --- a/test/models/oauth_token_test.rb +++ b/test/models/oauth_token_test.rb @@ -1,8 +1,6 @@ require "test_helper" class OauthTokenTest < ActiveSupport::TestCase - api_fixtures - ## # check that after calling invalidate! on a token, it is invalid. def test_token_invalidation @@ -17,7 +15,7 @@ class OauthTokenTest < ActiveSupport::TestCase def test_token_authorisation tok = RequestToken.create(:client_application => create(:client_application)) assert_equal false, tok.authorized?, "Token should be created unauthorised." - tok.authorize!(users(:public_user)) + tok.authorize!(create(:user)) assert_equal true, tok.authorized?, "Token should now be authorised." tok.invalidate! assert_equal false, tok.authorized?, "Token should now be invalid."