Add basic end-to-end test for admin moderation interface (#29424)
This commit is contained in:
@@ -21,6 +21,12 @@ module ProfileStories
|
||||
click_on I18n.t('auth.login')
|
||||
end
|
||||
|
||||
def as_a_logged_in_admin
|
||||
# This is a bit awkward, but this avoids code duplication.
|
||||
as_a_logged_in_user
|
||||
bob.update!(role: UserRole.find_by!(name: 'Admin'))
|
||||
end
|
||||
|
||||
def with_alice_as_local_user
|
||||
@alice_bio = '@alice and @bob are fictional characters commonly used as' \
|
||||
'placeholder names in #cryptology, as well as #science and' \
|
||||
|
||||
@@ -109,6 +109,9 @@ RSpec.configure do |config|
|
||||
# Also needs to be set per-example here because of the database cleaner.
|
||||
Setting.registrations_mode = 'open'
|
||||
|
||||
# Load seeds so we have the default roles otherwise cleared by `DatabaseCleaner`
|
||||
Rails.application.load_seed
|
||||
|
||||
example.run
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user