X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/b9988bdbc859fea2b1822c8ce594b39ca33da70e..407a5f218ca3e2bae6fdd2b8c06a73388d490ddf:/test/integration/user_blocks_test.rb diff --git a/test/integration/user_blocks_test.rb b/test/integration/user_blocks_test.rb index 96717e092..5147733e3 100644 --- a/test/integration/user_blocks_test.rb +++ b/test/integration/user_blocks_test.rb @@ -7,7 +7,7 @@ class UserBlocksTest < ActionDispatch::IntegrationTest get "/api/#{Settings.api_version}/user/details" assert_response :unauthorized - get "/api/#{Settings.api_version}/user/details", :headers => basic_authorization_header(blocked_user.display_name, "test") + get "/api/#{Settings.api_version}/user/details", :headers => bearer_authorization_header(blocked_user) assert_response :success # now block the user @@ -18,7 +18,7 @@ class UserBlocksTest < ActionDispatch::IntegrationTest :ends_at => Time.now.utc + 5.minutes, :deactivates_at => Time.now.utc + 5.minutes ) - get "/api/#{Settings.api_version}/user/details", :headers => basic_authorization_header(blocked_user.display_name, "test") + get "/api/#{Settings.api_version}/user/details", :headers => bearer_authorization_header(blocked_user) assert_response :forbidden end @@ -33,7 +33,7 @@ class UserBlocksTest < ActionDispatch::IntegrationTest :ends_at => Time.now.utc + 5.minutes, :deactivates_at => Time.now.utc + 5.minutes ) - get "/api/#{Settings.api_version}/user/details", :headers => basic_authorization_header(blocked_user.display_name, "test") + get "/api/#{Settings.api_version}/user/details", :headers => bearer_authorization_header(blocked_user) assert_response :forbidden # revoke the ban @@ -53,7 +53,7 @@ class UserBlocksTest < ActionDispatch::IntegrationTest reset! # access the API again. this time it should work - get "/api/#{Settings.api_version}/user/details", :headers => basic_authorization_header(blocked_user.display_name, "test") + get "/api/#{Settings.api_version}/user/details", :headers => bearer_authorization_header(blocked_user) assert_response :success end end