A platform for community discussion. Free, open, simple.
DEV: Fix a constant redefinition warning (#20842)
Jarek Radosz65b1381575c6
diff --git a/plugins/chat/spec/system/channel_selector_modal_spec.rb b/plugins/chat/spec/system/channel_selector_modal_spec.rbindex 2cb9f5713fb..0b133238d94 100644--- a/plugins/chat/spec/system/channel_selector_modal_spec.rb+++ b/plugins/chat/spec/system/channel_selector_modal_spec.rb@@ -5,6 +5,7 @@ RSpec.describe "Channel selector modal", type: :system, js: true dolet(:chat_page) { PageObjects::Pages::Chat.new }let(:channel_page) { PageObjects::Pages::ChatChannel.new }+ let(:key_modifier) { RUBY_PLATFORM =~ /darwin/i ? :meta : :control }before dochat_system_bootstrap@@ -12,13 +13,11 @@ RSpec.describe "Channel selector modal", type: :system, js: true dovisit("/")end- KEY_MODIFIER = RUBY_PLATFORM =~ /darwin/i ? :meta : :control-context "when used with public channel" dofab!(:channel_1) { Fabricate(:category_channel) }it "works" do- find("body").send_keys([KEY_MODIFIER, "k"])+ find("body").send_keys([key_modifier, "k"])find("#chat-channel-selector-input").fill_in(with: channel_1.title)find(".chat-channel-selection-row[data-id='#{channel_1.id}']").clickchannel_page.send_message("Hello world")@@ -31,7 +30,7 @@ RSpec.describe "Channel selector modal", type: :system, js: true dofab!(:user_1) { Fabricate(:user) }it "works" do- find("body").send_keys([KEY_MODIFIER, "k"])+ find("body").send_keys([key_modifier, "k"])find("#chat-channel-selector-input").fill_in(with: user_1.username)find(".chat-channel-selection-row[data-id='#{user_1.id}']").clickchannel_page.send_message("Hello world")@@ -44,7 +43,7 @@ RSpec.describe "Channel selector modal", type: :system, js: true dofab!(:dm_channel_1) { Fabricate(:direct_message_channel, users: [current_user]) }it "works" do- find("body").send_keys([KEY_MODIFIER, "k"])+ find("body").send_keys([key_modifier, "k"])find("#chat-channel-selector-input").fill_in(with: current_user.username)find(".chat-channel-selection-row[data-id='#{dm_channel_1.id}']").clickchannel_page.send_message("Hello world")@@ -58,7 +57,7 @@ RSpec.describe "Channel selector modal", type: :system, js: true doit "it doesn’t include current channel" dochat_page.visit_channel(channel_1)- find("body").send_keys([KEY_MODIFIER, "k"])+ find("body").send_keys([key_modifier, "k"])find("#chat-channel-selector-input").clickexpect(page).to have_no_css(".chat-channel-selection-row[data-id='#{channel_1.id}']")@@ -71,7 +70,7 @@ RSpec.describe "Channel selector modal", type: :system, js: true doit "it doesn’t include limited access channel" dochat_page.visit_channel(channel_1)- find("body").send_keys([KEY_MODIFIER, "k"])+ find("body").send_keys([key_modifier, "k"])find("#chat-channel-selector-input").fill_in(with: channel_1.title)expect(page).to have_no_css(".chat-channel-selection-row[data-id='#{channel_1.id}']")diff --git a/plugins/chat/spec/system/shortcuts/chat_composer_spec.rb b/plugins/chat/spec/system/shortcuts/chat_composer_spec.rbindex be1d9098994..54a4f8ac83b 100644--- a/plugins/chat/spec/system/shortcuts/chat_composer_spec.rb+++ b/plugins/chat/spec/system/shortcuts/chat_composer_spec.rb@@ -6,8 +6,7 @@ RSpec.describe "Shortcuts | chat composer", type: :system, js: true dolet(:chat) { PageObjects::Pages::Chat.new }let(:channel_page) { PageObjects::Pages::ChatChannel.new }-- KEY_MODIFIER = RUBY_PLATFORM =~ /darwin/i ? :meta : :control+ let(:key_modifier) { RUBY_PLATFORM =~ /darwin/i ? :meta : :control }before dochat_system_bootstrap@@ -25,7 +24,7 @@ RSpec.describe "Shortcuts | chat composer", type: :system, js: true dochat.visit_channel(channel_1)within(".chat-composer-input") do |composer|- composer.send_keys([KEY_MODIFIER, "b"])+ composer.send_keys([key_modifier, "b"])expect(composer.value).to eq("**strong text**")end@@ -37,7 +36,7 @@ RSpec.describe "Shortcuts | chat composer", type: :system, js: true dochat.visit_channel(channel_1)within(".chat-composer-input") do |composer|- composer.send_keys([KEY_MODIFIER, "i"])+ composer.send_keys([key_modifier, "i"])expect(composer.value).to eq("_emphasized text_")end@@ -49,7 +48,7 @@ RSpec.describe "Shortcuts | chat composer", type: :system, js: true dochat.visit_channel(channel_1)within(".chat-composer-input") do |composer|- composer.send_keys([KEY_MODIFIER, "e"])+ composer.send_keys([key_modifier, "e"])expect(composer.value).to eq("`indent preformatted text by 4 spaces`")end