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