]> git.openstreetmap.org Git - rails.git/blob - test/system/user_status_change_test.rb
Merge pull request #5303 from tomhughes/remember-me
[rails.git] / test / system / user_status_change_test.rb
1 require "application_system_test_case"
2
3 class UserStatusChangeTest < ApplicationSystemTestCase
4   def setup
5     admin = create(:administrator_user)
6     sign_in_as(admin)
7   end
8
9   test "Admin can unsuspend a user" do
10     user = create(:user, :suspended)
11     visit user_path(user)
12     accept_confirm do
13       click_on "Unsuspend"
14     end
15
16     assert_no_content "Unsuspend"
17     user.reload
18     assert_equal "active", user.status
19   end
20
21   test "Admin can confirm a user" do
22     user = create(:user, :suspended)
23     visit user_path(user)
24     accept_confirm do
25       click_on "Confirm"
26     end
27
28     assert_no_content "Unsuspend"
29     user.reload
30     assert_equal "confirmed", user.status
31   end
32 end