mirror of
https://github.com/discourse/discourse.git
synced 2024-11-24 06:56:01 +08:00
7ef482a292
* FIX: Use pluralized string * REFACTOR: Fix misuse of pluralized string * REFACTOR: Fix misuse of pluralized string * DEV: Remove linting of `one` key in MessageFormat string, it doesn't work * REFACTOR: Fix misuse of pluralized string This also ensures that the URL works on subfolder and shows the site setting link only for admins instead of staff. The string is quite complicated, so the best option was to switch to MessageFormat. * REFACTOR: Fix misuse of pluralized string * FIX: Use pluralized string This also ensures that the URL works on subfolder and shows the site setting link only for admins instead of staff. * REFACTOR: Correctly pluralize reaction tooltips in chat This also ensures that maximum 5 usernames are shown and fixes the number of "others" which was off by 1 if the current user reacted on a message. * REFACTOR: Use translatable string as comma separator * DEV: Add comment to translation to clarify the meaning of `%{identifier}` * REFACTOR: Use translatable comma separator and use explicit interpolation keys * REFACTOR: Don't interpolate lowercase channel status * REFACTOR: Fix misuse of pluralized string * REFACTOR: Don't interpolate channel status * REFACTOR: Use %{count} interpolation key * REFACTOR: Fix misuse of pluralized string * REFACTOR: Correctly pluralize DM chat channel titles
59 lines
1.5 KiB
Ruby
59 lines
1.5 KiB
Ruby
# frozen_string_literal: true
|
|
|
|
RSpec.describe "Closed channel", type: :system, js: true do
|
|
fab!(:channel_1) { Fabricate(:chat_channel) }
|
|
|
|
let(:chat) { PageObjects::Pages::Chat.new }
|
|
let(:channel) { PageObjects::Pages::ChatChannel.new }
|
|
|
|
before { chat_system_bootstrap }
|
|
|
|
context "when regular user" do
|
|
fab!(:current_user) { Fabricate(:user) }
|
|
|
|
before do
|
|
channel_1.add(current_user)
|
|
sign_in(current_user)
|
|
end
|
|
|
|
it "shows the closed status" do
|
|
channel_1.closed!(Discourse.system_user)
|
|
chat.visit_channel_settings(channel_1)
|
|
chat.visit_channel(channel_1)
|
|
|
|
expect(page).to have_content(I18n.t("js.chat.channel_status.closed_header"))
|
|
end
|
|
|
|
it "disables the composer" do
|
|
channel_1.closed!(Discourse.system_user)
|
|
chat.visit_channel_settings(channel_1)
|
|
chat.visit_channel(channel_1)
|
|
|
|
expect(page).to have_field(
|
|
placeholder: I18n.t("js.chat.placeholder_new_message_disallowed.closed"),
|
|
disabled: true,
|
|
)
|
|
end
|
|
end
|
|
|
|
context "when admin" do
|
|
fab!(:current_user) { Fabricate(:admin) }
|
|
|
|
before do
|
|
channel_1.add(current_user)
|
|
sign_in(current_user)
|
|
end
|
|
|
|
it "disables the composer" do
|
|
channel_1.closed!(Discourse.system_user)
|
|
chat.visit_channel_settings(channel_1)
|
|
chat.visit_channel(channel_1)
|
|
|
|
expect(page).to have_no_field(
|
|
placeholder: I18n.t("js.chat.placeholder_new_message_disallowed.closed"),
|
|
disabled: true,
|
|
)
|
|
end
|
|
end
|
|
end
|