1 require "application_system_test_case"
3 class ProfileCompanyChangeTest < ApplicationSystemTestCase
4 test "can't change company when unauthorized" do
10 assert_no_button "Edit Profile Details"
11 assert_no_link "Edit Company"
15 test "can't change company of another user" do
17 another_user = create(:user)
20 visit user_path(another_user)
22 within_content_body do
23 assert_no_button "Edit Profile Details"
24 assert_no_link "Edit Company"
28 test "can change company" do
34 within_content_body do
35 click_on "Edit Profile Details"
36 click_on "Edit Company"
37 fill_in "Company", :with => "Test Co."
38 click_on "Update Profile"
41 assert_text "Profile company updated."
43 within_content_body do
44 assert_text :all, "Company Test Co."
46 click_on "Edit Profile Details"
47 click_on "Edit Company"
48 fill_in "Company", :with => "Test More Co."
49 click_on "Update Profile"
52 assert_text "Profile company updated."
54 within_content_body do
55 assert_text :all, "Company Test More Co."