# banning pages
get "/user/:display_name/blocks" => "user_blocks#blocks_on", :as => "user_blocks_on"
get "/user/:display_name/blocks_by" => "user_blocks#blocks_by", :as => "user_blocks_by"
- get "/blocks/new/:display_name" => "user_blocks#new", :as => "new_user_block"
- resources :user_blocks, :except => :new
+ resources :user_blocks, :path_names => { :new => "new/:display_name" }
match "/user/:display_name/blocks/revoke_all" => "user_blocks#revoke_all", :via => [:get, :post], :as => "revoke_all_user_blocks"
# issues and reports
assert_select "a[href='/user/#{ERB::Util.u(user.display_name)}/account']", 0
assert_select "a[href='/user/#{ERB::Util.u(user.display_name)}/blocks']", 0
assert_select "a[href='/user/#{ERB::Util.u(user.display_name)}/blocks_by']", 0
- assert_select "a[href='/blocks/new/#{ERB::Util.u(user.display_name)}']", 0
+ assert_select "a[href='/user_blocks/new/#{ERB::Util.u(user.display_name)}']", 0
end
# Test a user who has been blocked
assert_select "a[href='/user/#{ERB::Util.u(blocked_user.display_name)}/account']", 0
assert_select "a[href='/user/#{ERB::Util.u(blocked_user.display_name)}/blocks']", 1
assert_select "a[href='/user/#{ERB::Util.u(blocked_user.display_name)}/blocks_by']", 0
- assert_select "a[href='/blocks/new/#{ERB::Util.u(blocked_user.display_name)}']", 0
+ assert_select "a[href='/user_blocks/new/#{ERB::Util.u(blocked_user.display_name)}']", 0
end
# Test a moderator who has applied blocks
assert_select "a[href='/user/#{ERB::Util.u(moderator_user.display_name)}/account']", 0
assert_select "a[href='/user/#{ERB::Util.u(moderator_user.display_name)}/blocks']", 0
assert_select "a[href='/user/#{ERB::Util.u(moderator_user.display_name)}/blocks_by']", 1
- assert_select "a[href='/blocks/new/#{ERB::Util.u(moderator_user.display_name)}']", 0
+ assert_select "a[href='/user_blocks/new/#{ERB::Util.u(moderator_user.display_name)}']", 0
end
# Login as a normal user
assert_select "a[href='/account/edit']", 1
assert_select "a[href='/user/#{ERB::Util.u(user.display_name)}/blocks']", 0
assert_select "a[href='/user/#{ERB::Util.u(user.display_name)}/blocks_by']", 0
- assert_select "a[href='/blocks/new/#{ERB::Util.u(user.display_name)}']", 0
+ assert_select "a[href='/user_blocks/new/#{ERB::Util.u(user.display_name)}']", 0
assert_select "a[href='/api/0.6/user/#{ERB::Util.u(user.id)}']", 0
end
assert_select "a[href='/account/edit']", 0
assert_select "a[href='/user/#{ERB::Util.u(user.display_name)}/blocks']", 0
assert_select "a[href='/user/#{ERB::Util.u(user.display_name)}/blocks_by']", 0
- assert_select "a[href='/blocks/new/#{ERB::Util.u(user.display_name)}']", 1
+ assert_select "a[href='/user_blocks/new/#{ERB::Util.u(user.display_name)}']", 1
assert_select "a[href='/api/0.6/user/#{ERB::Util.u(user.id)}']", 1
end
end