X-Git-Url: https://git.openstreetmap.org/rails.git/blobdiff_plain/36f6d8d85d9549d7652a425600a54cae7be04b4d..e21b9b2bf16d8d27312a82ae4ede5500e618fe88:/test/controllers/users_controller_test.rb?ds=sidebyside diff --git a/test/controllers/users_controller_test.rb b/test/controllers/users_controller_test.rb index 10c5c3bee..23c67794a 100644 --- a/test/controllers/users_controller_test.rb +++ b/test/controllers/users_controller_test.rb @@ -556,14 +556,11 @@ class UsersControllerTest < ActionDispatch::IntegrationTest assert_response :not_found # Test a normal user - user = create(:user, :home_lon => 1.1, :home_lat => 1.1) - friend_user = create(:user, :home_lon => 1.2, :home_lat => 1.2) - create(:friendship, :befriender => user, :befriendee => friend_user) - create(:changeset, :user => friend_user) + user = create(:user) get user_path(user) assert_response :success - assert_select "div#userinformation" do + assert_select "div.content-heading" do assert_select "a[href^='/user/#{ERB::Util.u(user.display_name)}/history']", 1 assert_select "a[href='/user/#{ERB::Util.u(user.display_name)}/traces']", 1 assert_select "a[href='/user/#{ERB::Util.u(user.display_name)}/diary']", 1 @@ -582,7 +579,7 @@ class UsersControllerTest < ActionDispatch::IntegrationTest create(:user_block, :user => blocked_user) get user_path(blocked_user) assert_response :success - assert_select "div#userinformation" do + assert_select "div.content-heading" do assert_select "a[href^='/user/#{ERB::Util.u(blocked_user.display_name)}/history']", 1 assert_select "a[href='/user/#{ERB::Util.u(blocked_user.display_name)}/traces']", 1 assert_select "a[href='/user/#{ERB::Util.u(blocked_user.display_name)}/diary']", 1 @@ -598,7 +595,7 @@ class UsersControllerTest < ActionDispatch::IntegrationTest create(:user_block, :creator => moderator_user) get user_path(moderator_user) assert_response :success - assert_select "div#userinformation" do + assert_select "div.content-heading" do assert_select "a[href^='/user/#{ERB::Util.u(moderator_user.display_name)}/history']", 1 assert_select "a[href='/user/#{ERB::Util.u(moderator_user.display_name)}/traces']", 1 assert_select "a[href='/user/#{ERB::Util.u(moderator_user.display_name)}/diary']", 1 @@ -615,7 +612,7 @@ class UsersControllerTest < ActionDispatch::IntegrationTest # Test the normal user get user_path(user) assert_response :success - assert_select "div#userinformation" do + assert_select "div.content-heading" do assert_select "a[href^='/user/#{ERB::Util.u(user.display_name)}/history']", 1 assert_select "a[href='/traces/mine']", 1 assert_select "a[href='/user/#{ERB::Util.u(user.display_name)}/diary']", 1 @@ -626,18 +623,13 @@ class UsersControllerTest < ActionDispatch::IntegrationTest 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_for(create(:moderator_user)) # Test the normal user get user_path(user) assert_response :success - assert_select "div#userinformation" do + assert_select "div.content-heading" do assert_select "a[href^='/user/#{ERB::Util.u(user.display_name)}/history']", 1 assert_select "a[href='/user/#{ERB::Util.u(user.display_name)}/traces']", 1 assert_select "a[href='/user/#{ERB::Util.u(user.display_name)}/diary']", 1 @@ -657,23 +649,23 @@ class UsersControllerTest < ActionDispatch::IntegrationTest get user_path(agreed_user) assert_response :success - assert_select "div#userinformation" do - assert_select "p", :count => 0, :text => /Contributor terms/ + assert_select "div.content-heading" do + assert_select "dt", :count => 0, :text => /Contributor terms/ end get user_path(seen_user) assert_response :success # put @response.body - assert_select "div#userinformation" do - assert_select "p", :count => 1, :text => /Contributor terms/ - assert_select "p", /Declined/ + assert_select "div.content-heading" do + assert_select "dt", :count => 1, :text => /Contributor terms/ + assert_select "dd", /Declined/ end get user_path(not_seen_user) assert_response :success - assert_select "div#userinformation" do - assert_select "p", :count => 1, :text => /Contributor terms/ - assert_select "p", /Undecided/ + assert_select "div.content-heading" do + assert_select "dt", :count => 1, :text => /Contributor terms/ + assert_select "dd", /Undecided/ end end