discourse/spec/system/viewing_user_private_messages_spec.rb
Alan Guo Xiang Tan 57c96ed03d
FIX: Broken group messages inboxes when group name is mixed case (#22183)
This is a follow up to 1cbc65ba79 where
visiting a group with a mixed case name would result in an error.
2023-06-19 17:36:04 +08:00

31 lines
1023 B
Ruby

# frozen_string_literal: true
describe "Viewing user private messages", type: :system do
fab!(:user) { Fabricate(:user, username: "mIxed_caSE_usERNAME") }
fab!(:user2) { Fabricate(:user) }
let(:user_private_messages_page) { PageObjects::Pages::UserPrivateMessages.new }
before { sign_in(user) }
describe "when the user has group messages" do
fab!(:group) do
Fabricate(:group, name: "miXeD_caSE_name", has_messages: true).tap { |g| g.add(user) }
end
before { SiteSetting.personal_message_enabled_groups = Group::AUTO_GROUPS[:everyone] }
it "allows the user to view the default messages inbox" do
user_private_messages_page.visit(user)
expect(user_private_messages_page).to have_right_inbox_dropdown_value("Inbox")
end
it "allows the user to view the group messages inbox of a group" do
user_private_messages_page.visit_group_inbox(user, group)
expect(user_private_messages_page).to have_right_inbox_dropdown_value("miXeD_caSE_name")
end
end
end