1 require "application_system_test_case"
3 class ProfileLinksChangeTest < ApplicationSystemTestCase
4 test "can't change description when unauthorized" do
10 assert_no_link "Edit Description"
14 test "can't change description of another user" do
16 another_user = create(:user)
19 visit user_path(another_user)
21 within_content_body do
22 assert_no_link "Edit Description"
26 test "can change description" do
28 check_description_change(user)
31 test "can change description when have a description" do
32 user = create(:user, :description => "My old profile description")
33 check_description_change(user)
36 test "can change description when have a link" do
38 create(:social_link, :user => user)
39 check_description_change(user)
42 test "can change description when have a description and a link" do
43 user = create(:user, :description => "My old profile description")
44 create(:social_link, :user => user)
45 check_description_change(user)
50 def check_description_change(user)
54 within_content_body do
55 click_on "Edit Description"
56 fill_in "Profile Description", :with => "This is my updated OSM profile!"
57 click_on "Update Profile"
60 assert_text "Profile description updated."
62 within_content_body do
63 assert_text "This is my updated OSM profile!"