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
b67ad2db
Commit
b67ad2db
authored
Dec 19, 2016
by
Luke "Jared" Bennett
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added integration tests
parent
9d774459
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
53 additions
and
14 deletions
+53
-14
spec/features/projects/services/mattermost_slash_command_spec.rb
...atures/projects/services/mattermost_slash_command_spec.rb
+53
-14
No files found.
spec/features/projects/services/mattermost_slash_command_spec.rb
View file @
b67ad2db
...
...
@@ -10,23 +10,18 @@ feature 'Setup Mattermost slash commands', feature: true do
before
do
project
.
team
<<
[
user
,
:master
]
login_as
(
user
)
visit
edit_namespace_project_service_path
(
project
.
namespace
,
project
,
service
)
end
describe
'user visit
e
s the mattermost slash command config page'
,
js:
true
do
describe
'user visits the mattermost slash command config page'
,
js:
true
do
it
'shows a help message'
do
visit
edit_namespace_project_service_path
(
project
.
namespace
,
project
,
service
)
wait_for_ajax
expect
(
page
).
to
have_content
(
"This service allows GitLab users to perform common"
)
end
end
describe
'saving a token'
do
let
(
:token
)
{
(
'a'
..
'z'
).
to_a
.
join
}
it
'shows the token after saving'
do
visit
edit_namespace_project_service_path
(
project
.
namespace
,
project
,
service
)
token
=
(
'a'
..
'z'
).
to_a
.
join
fill_in
'service_token'
,
with:
token
click_on
'Save'
...
...
@@ -35,14 +30,58 @@ feature 'Setup Mattermost slash commands', feature: true do
expect
(
value
).
to
eq
(
token
)
end
end
describe
'the trigger url'
do
it
'shows the correct url'
do
visit
edit_namespace_project_service_path
(
project
.
namespace
,
project
,
service
)
describe
'mattermost service is enabled'
do
let
(
:info
)
{
find
(
'.services-installation-info'
)
}
before
do
Gitlab
.
config
.
mattermost
.
enabled
=
true
end
it
'shows the correct mattermost url'
do
expect
(
page
).
to
have_content
Gitlab
.
config
.
mattermost
.
host
end
describe
'mattermost service is active'
do
before
do
service
.
active
=
true
end
it
'shows that mattermost is active'
do
expect
(
info
).
to
have_content
'Installed'
expect
(
info
).
not_to
have_content
'Not installed'
end
it
'shows the edit mattermost button'
do
expect
(
info
).
to
have_button
'Edit Mattermost'
end
end
describe
'mattermost service is not active'
do
before
do
service
.
active
=
false
end
it
'shows that mattermost is not active'
do
expect
(
info
).
to
have_content
'Not installed'
end
it
'shows the add to mattermost button'
do
expect
(
info
).
to
have_button
'Add to Mattermost'
end
end
end
describe
'mattermost service is not enabled'
do
before
do
Gitlab
.
config
.
mattermost
.
enabled
=
false
end
it
'shows the correct trigger url'
do
value
=
find_field
(
'request_url'
).
value
value
=
find_field
(
'request_url'
).
value
e
xpect
(
value
).
to
match
(
"api/v3/projects/
#{
project
.
id
}
/services/mattermost_slash_commands/trigger"
)
expect
(
value
).
to
match
(
"api/v3/projects/
#{
project
.
id
}
/services/mattermost_slash_commands/trigger"
)
e
nd
end
end
end
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