]> git.openstreetmap.org Git - rails.git/blob - test/system/user_location_change_test.rb
Add what's updated to profile update flash messages
[rails.git] / test / system / user_location_change_test.rb
1 require "application_system_test_case"
2
3 class UserLocationChangeTest < ApplicationSystemTestCase
4   def setup
5     stub_request(:get, /.*gravatar.com.*d=404/).to_return(:status => 404)
6   end
7
8   test "User can change their location" do
9     user = create(:user)
10     sign_in_as(user)
11
12     visit user_path(user)
13
14     within_content_body do
15       assert_no_text :all, "Home location"
16     end
17
18     within_content_body do
19       click_on "Edit Profile"
20     end
21     within_content_heading do
22       click_on "Location"
23     end
24
25     within_content_body do
26       fill_in "Home Location Name", :with => "Test Place"
27       click_on "Update Profile"
28     end
29
30     assert_text "Profile location updated."
31
32     within_content_body do
33       assert_text :all, "Home location Test Place"
34     end
35   end
36 end