2022-12-14 07:14:01 +08:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2023-06-07 09:26:58 +08:00
|
|
|
describe "Viewing user staff info as an admin", type: :system do
|
2023-11-10 06:47:59 +08:00
|
|
|
fab!(:user)
|
|
|
|
fab!(:admin)
|
2022-12-14 07:14:01 +08:00
|
|
|
let(:user_page) { PageObjects::Pages::User.new }
|
|
|
|
|
|
|
|
before { sign_in(admin) }
|
|
|
|
|
|
|
|
context "for warnings" do
|
|
|
|
fab!(:topic) { Fabricate(:private_message_topic, user: admin, recipient: user) }
|
|
|
|
fab!(:user_warning) { UserWarning.create!(user: user, created_by: admin, topic: topic) }
|
|
|
|
|
|
|
|
it "should display the right link to user's warnings with the right count in text" do
|
2023-04-12 17:13:37 +08:00
|
|
|
user_page.visit(user).click_staff_info_warnings_link(user, warnings_count: 1)
|
2022-12-14 07:14:01 +08:00
|
|
|
|
|
|
|
expect(user_page).to have_warning_messages_path(user)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|