openstreetmap-website/test/system/user_suspension_test.rb
Andy Allan 1a11c4dc19 Use a state machine for user status
The user status is a bit complex, since there are various states and
not all transitions between them make sense.

Using AASM means that we can name and restrict the transitions, which
hopefully makes them easier to reason about.
2022-01-12 18:16:14 +00:00

15 lines
398 B
Ruby

require "application_system_test_case"
class UserSuspensionTest < ApplicationSystemTestCase
test "User shown a message when suspended mid-session" do
user = create(:user)
sign_in_as(user)
visit edit_account_path
assert_content "My Settings"
user.suspend!
visit edit_account_path
assert_content "This decision will be reviewed by an administrator shortly"
end
end