summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKamil Trzcinski <ayufan@ayufan.eu>2016-12-20 19:54:13 +0100
committerKamil Trzcinski <ayufan@ayufan.eu>2016-12-20 19:54:13 +0100
commite9c14918e51828dfbfa2879d5a04f74d08fae290 (patch)
treed9b89209f5597fa45ed161a22ed69213da70eb8c
parent61d09a7b15ef9ae2e23359f1afb87b0adbda4dd4 (diff)
parent8d3ed21f2389a3a68dac56c077bc85591bed8b0b (diff)
downloadgitlab-ce-e9c14918e51828dfbfa2879d5a04f74d08fae290.tar.gz
Merge branch 'zj-mattermost-slash-config' of gitlab.com:gitlab-org/gitlab-ce into zj-mattermost-slash-config
-rw-r--r--app/views/projects/mattermosts/_team_selection.html.haml9
-rw-r--r--spec/features/projects/services/mattermost_slash_command_spec.rb40
2 files changed, 11 insertions, 38 deletions
diff --git a/app/views/projects/mattermosts/_team_selection.html.haml b/app/views/projects/mattermosts/_team_selection.html.haml
index 376592e66c9..7980f7c9a72 100644
--- a/app/views/projects/mattermosts/_team_selection.html.haml
+++ b/app/views/projects/mattermosts/_team_selection.html.haml
@@ -4,7 +4,9 @@
%hr
= form_for(:mattermost, method: :post, url: namespace_project_mattermost_path(@project.namespace, @project)) do |f|
%h4 Team
- %p Select or create the team where the slash commands will be used in
+ %p
+ = @teams.one? ? 'The team' : 'Select the team'
+ where the slash commands will be used in
- selected_id = @teams.keys.first if @teams.one?
= f.select(:team_id, mattermost_teams_options(@teams), {}, { class: 'form-control', selected: "#{selected_id}", disabled: @teams.one? })
.help-block
@@ -22,8 +24,9 @@
%p Choose the word that will trigger commands
= f.text_field(:trigger, value: @project.path, class: 'form-control')
.help-block
- %p Trigger word must be unique, and cannot begin with a slash or contain any spaces. Use the word that works best for your team.
- %p Fill in the word that works best for your team.
+ %p
+ Trigger word must be unique, and can't begin with a slash or contain any spaces.
+ Use the word that works best for your team.
%p
Suggestions:
%code= 'gitlab'
diff --git a/spec/features/projects/services/mattermost_slash_command_spec.rb b/spec/features/projects/services/mattermost_slash_command_spec.rb
index 4c08d1e6e65..521eedeae9e 100644
--- a/spec/features/projects/services/mattermost_slash_command_spec.rb
+++ b/spec/features/projects/services/mattermost_slash_command_spec.rb
@@ -32,49 +32,19 @@ feature 'Setup Mattermost slash commands', feature: true do
end
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
+ allow(Gitlab.config.mattermost).to receive(:enabled).and_return(true)
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
+ it 'shows the add to mattermost button' do
+ expect(page).to have_link 'Add to Mattermost'
end
end
+
describe 'mattermost service is not enabled' do
before do
- Gitlab.config.mattermost.enabled = false
+ allow(Gitlab.config.mattermost).to receive(:enabled).and_return(false)
end
it 'shows the correct trigger url' do