Commit 26ba13f2 authored by Sean McGivern's avatar Sean McGivern

Merge branch '30172-fix-mattermost-enabled-setting-not-properly-stubbed' into 'master'

Add a new `stub_mattermost_setting` stub helper to properly stub Mattermost settings

Closes #30172

See merge request !10288
parents a7dda3c7 db8a8afc
...@@ -46,7 +46,7 @@ feature 'Group', feature: true do ...@@ -46,7 +46,7 @@ feature 'Group', feature: true do
describe 'Mattermost team creation' do describe 'Mattermost team creation' do
before do before do
allow(Settings.mattermost).to receive_messages(enabled: mattermost_enabled) stub_mattermost_setting(enabled: mattermost_enabled)
visit new_group_path visit new_group_path
end end
......
...@@ -7,7 +7,7 @@ feature 'Setup Mattermost slash commands', :feature, :js do ...@@ -7,7 +7,7 @@ feature 'Setup Mattermost slash commands', :feature, :js do
let(:mattermost_enabled) { true } let(:mattermost_enabled) { true }
before do before do
Settings.mattermost['enabled'] = mattermost_enabled stub_mattermost_setting(enabled: mattermost_enabled)
project.team << [user, :master] project.team << [user, :master]
login_as(user) login_as(user)
visit edit_namespace_project_service_path(project.namespace, project, service) visit edit_namespace_project_service_path(project.namespace, project, service)
......
...@@ -44,7 +44,7 @@ describe Groups::CreateService, '#execute', services: true do ...@@ -44,7 +44,7 @@ describe Groups::CreateService, '#execute', services: true do
let!(:service) { described_class.new(user, params) } let!(:service) { described_class.new(user, params) }
before do before do
Settings.mattermost['enabled'] = true stub_mattermost_setting(enabled: true)
end end
it 'create the chat team with the group' do it 'create the chat team with the group' do
......
...@@ -21,6 +21,10 @@ module StubConfiguration ...@@ -21,6 +21,10 @@ module StubConfiguration
allow(Gitlab.config.incoming_email).to receive_messages(messages) allow(Gitlab.config.incoming_email).to receive_messages(messages)
end end
def stub_mattermost_setting(messages)
allow(Gitlab.config.mattermost).to receive_messages(messages)
end
private private
# Modifies stubbed messages to also stub possible predicate versions # Modifies stubbed messages to also stub possible predicate versions
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment