-
Notifications
You must be signed in to change notification settings - Fork 8.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
FIX: Broken group messages inboxes when group name is mixed case
This is a follow up to 1cbc65b where visiting a group with a mixed case name would result in an error.
- Loading branch information
Showing
5 changed files
with
66 additions
and
52 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
# frozen_string_literal: true | ||
|
||
module PageObjects | ||
module Pages | ||
class UserPrivateMessages < PageObjects::Pages::Base | ||
def visit(user) | ||
page.visit "/u/#{user.username}/messages" | ||
self | ||
end | ||
|
||
def visit_group_inbox(user, group) | ||
page.visit "/u/#{user.username}/messages/group/#{group.name}" | ||
self | ||
end | ||
|
||
def has_right_inbox_dropdown_value?(value) | ||
has_css?(".user-nav-messages-dropdown .combo-box-header[data-name='#{value}']") | ||
end | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
# 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 |