# Test a normal user
user = create(:user)
+ create(:friend, :befriender => user)
get :show, :params => { :display_name => user.display_name }
assert_response :success
assert_select "div#userinformation" do
assert_select "a[href='/blocks/new/#{ERB::Util.u(user.display_name)}']", 0
end
+ # Friends shouldn't be visible as we're not logged in
+ assert_select "div#friends-container", :count => 0
+
# Test a user who has been blocked
blocked_user = create(:user)
create(:user_block, :user => blocked_user)
assert_select "a[href='/blocks/new/#{ERB::Util.u(user.display_name)}']", 0
end
+ # Friends should be visible as we're now logged in
+ assert_select "div#friends-container" do
+ assert_select "div.contact-activity", :count => 1
+ end
+
# Login as a moderator
session[:user] = create(:moderator_user).id