5 class ActiveListsControllerTest < ActionDispatch::IntegrationTest
7 # test all routes which lead to this controller
10 { :path => "/api/0.6/user/blocks/active", :method => :get },
11 { :controller => "api/user_blocks/active_lists", :action => "show" }
14 { :path => "/api/0.6/user/blocks/active.json", :method => :get },
15 { :controller => "api/user_blocks/active_lists", :action => "show", :format => "json" }
19 def test_show_no_auth_header
20 get api_user_blocks_active_list_path
21 assert_response :unauthorized
24 def test_show_no_permission
26 user_auth_header = bearer_authorization_header(user, :scopes => %w[])
28 get api_user_blocks_active_list_path, :headers => user_auth_header
29 assert_response :forbidden
34 user_auth_header = bearer_authorization_header(user, :scopes => %w[read_prefs])
35 create(:user_block, :expired, :user => user)
37 get api_user_blocks_active_list_path, :headers => user_auth_header
38 assert_response :success
39 assert_dom "user_block", :count => 0