X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/ec5754a9bd56dbb802a2897851ebf71deb017f89..c54ad72f93232370a223e88509d1f1be68bf1ddc:/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