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
Léo-Paul Géneau
gitlab-ce
Commits
8bcc911b
Commit
8bcc911b
authored
Jan 24, 2017
by
Luke "Jared" Bennett
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added error message and test
parent
85f0229b
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
13 additions
and
1 deletion
+13
-1
app/views/projects/mattermosts/_no_teams.html.haml
app/views/projects/mattermosts/_no_teams.html.haml
+3
-0
app/views/projects/mattermosts/new.html.haml
app/views/projects/mattermosts/new.html.haml
+1
-1
spec/features/projects/services/mattermost_slash_command_spec.rb
...atures/projects/services/mattermost_slash_command_spec.rb
+9
-0
No files found.
app/views/projects/mattermosts/_no_teams.html.haml
View file @
8bcc911b
=
content_for
:flash_message
do
.alert.alert-danger
=
@teams
if
@teams
.
is_a?
(
String
)
%p
%p
You aren’t a member of any team on the Mattermost instance at
You aren’t a member of any team on the Mattermost instance at
%strong
=
Gitlab
.
config
.
mattermost
.
host
%strong
=
Gitlab
.
config
.
mattermost
.
host
...
...
app/views/projects/mattermosts/new.html.haml
View file @
8bcc911b
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
.inline.pull-right
.inline.pull-right
=
custom_icon
(
'mattermost_logo'
,
size:
48
)
=
custom_icon
(
'mattermost_logo'
,
size:
48
)
%h3
Install Mattermost Command
%h3
Install Mattermost Command
-
if
@teams
.
empty?
-
if
@teams
.
is_a?
(
String
)
||
@teams
.
empty?
=
render
'no_teams'
=
render
'no_teams'
-
else
-
else
=
render
'team_selection'
=
render
'team_selection'
spec/features/projects/services/mattermost_slash_command_spec.rb
View file @
8bcc911b
...
@@ -99,6 +99,15 @@ feature 'Setup Mattermost slash commands', feature: true do
...
@@ -99,6 +99,15 @@ feature 'Setup Mattermost slash commands', feature: true do
expect
(
select_element
.
all
(
'option'
).
count
).
to
eq
(
3
)
expect
(
select_element
.
all
(
'option'
).
count
).
to
eq
(
3
)
end
end
it
'shows an error alert with the error message if there is an error requesting teams'
do
allow_any_instance_of
(
MattermostSlashCommandsService
).
to
receive
(
:list_teams
)
{
'test mattermost error message'
}
click_link
'Add to Mattermost'
expect
(
page
).
to
have_selector
(
'.alert'
)
expect
(
page
).
to
have_content
(
'test mattermost error message'
)
end
def
stub_teams
(
count:
0
)
def
stub_teams
(
count:
0
)
teams
=
create_teams
(
count
)
teams
=
create_teams
(
count
)
...
...
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