Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Jérome Perrin
gitlab-ce
Commits
db8a8afc
Commit
db8a8afc
authored
Mar 28, 2017
by
Rémy Coutable
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add a new `stub_mattermost_setting` stub helper to properly stub Mattermost settings
Signed-off-by:
Rémy Coutable
<
remy@rymai.me
>
parent
ad831ace
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
7 additions
and
3 deletions
+7
-3
spec/features/groups_spec.rb
spec/features/groups_spec.rb
+1
-1
spec/features/projects/services/mattermost_slash_command_spec.rb
...atures/projects/services/mattermost_slash_command_spec.rb
+1
-1
spec/services/groups/create_service_spec.rb
spec/services/groups/create_service_spec.rb
+1
-1
spec/support/stub_configuration.rb
spec/support/stub_configuration.rb
+4
-0
No files found.
spec/features/groups_spec.rb
View file @
db8a8afc
...
...
@@ -46,7 +46,7 @@ feature 'Group', feature: true do
describe
'Mattermost team creation'
do
before
do
allow
(
Settings
.
mattermost
).
to
receive_messages
(
enabled:
mattermost_enabled
)
stub_mattermost_setting
(
enabled:
mattermost_enabled
)
visit
new_group_path
end
...
...
spec/features/projects/services/mattermost_slash_command_spec.rb
View file @
db8a8afc
...
...
@@ -7,7 +7,7 @@ feature 'Setup Mattermost slash commands', :feature, :js do
let
(
:mattermost_enabled
)
{
true
}
before
do
Settings
.
mattermost
[
'enabled'
]
=
mattermost_enabled
stub_mattermost_setting
(
enabled:
mattermost_enabled
)
project
.
team
<<
[
user
,
:master
]
login_as
(
user
)
visit
edit_namespace_project_service_path
(
project
.
namespace
,
project
,
service
)
...
...
spec/services/groups/create_service_spec.rb
View file @
db8a8afc
...
...
@@ -44,7 +44,7 @@ describe Groups::CreateService, '#execute', services: true do
let!
(
:service
)
{
described_class
.
new
(
user
,
params
)
}
before
do
Settings
.
mattermost
[
'enabled'
]
=
true
stub_mattermost_setting
(
enabled:
true
)
end
it
'create the chat team with the group'
do
...
...
spec/support/stub_configuration.rb
View file @
db8a8afc
...
...
@@ -21,6 +21,10 @@ module StubConfiguration
allow
(
Gitlab
.
config
.
incoming_email
).
to
receive_messages
(
messages
)
end
def
stub_mattermost_setting
(
messages
)
allow
(
Gitlab
.
config
.
mattermost
).
to
receive_messages
(
messages
)
end
private
# Modifies stubbed messages to also stub possible predicate versions
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment