summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZ.J. van de Weg <git@zjvandeweg.nl>2016-12-20 20:11:02 +0100
committerZ.J. van de Weg <git@zjvandeweg.nl>2016-12-20 20:11:02 +0100
commit2393d30da232db04faa8da9e1a958cec22ffb6e8 (patch)
tree99af01df83bbfa59a46fc5af2c939c39f9f7e202
parente9c14918e51828dfbfa2879d5a04f74d08fae290 (diff)
downloadgitlab-ce-2393d30da232db04faa8da9e1a958cec22ffb6e8.tar.gz
Fix rubocop errors [ci skip]
-rw-r--r--app/models/project_services/mattermost_slash_commands_service.rb6
-rw-r--r--lib/mattermost/client.rb2
-rw-r--r--spec/features/projects/services/mattermost_slash_command_spec.rb1
-rw-r--r--spec/models/project_services/mattermost_slash_commands_service_spec.rb6
4 files changed, 7 insertions, 8 deletions
diff --git a/app/models/project_services/mattermost_slash_commands_service.rb b/app/models/project_services/mattermost_slash_commands_service.rb
index 4c2b7d64f1f..fc1e7d79d08 100644
--- a/app/models/project_services/mattermost_slash_commands_service.rb
+++ b/app/models/project_services/mattermost_slash_commands_service.rb
@@ -24,13 +24,13 @@ class MattermostSlashCommandsService < ChatSlashCommandsService
create(command(params))
update(active: true, token: token) if token
- rescue => Mattermost::Error => e
- false, e.message
+ rescue Mattermost::Error => e
+ [false, e.message]
end
def list_teams(user)
Mattermost::Team.new(user).all
- rescue => Mattermost::Error => e
+ rescue Mattermost::Error
[]
end
diff --git a/lib/mattermost/client.rb b/lib/mattermost/client.rb
index 6eaaed34063..fa3c9fa27bd 100644
--- a/lib/mattermost/client.rb
+++ b/lib/mattermost/client.rb
@@ -34,7 +34,7 @@ module Mattermost
end
json_response
- rescue JSON::JSONError => e
+ rescue JSON::JSONError
raise ClientError('Cannot parse response')
end
end
diff --git a/spec/features/projects/services/mattermost_slash_command_spec.rb b/spec/features/projects/services/mattermost_slash_command_spec.rb
index 521eedeae9e..73ecf86aded 100644
--- a/spec/features/projects/services/mattermost_slash_command_spec.rb
+++ b/spec/features/projects/services/mattermost_slash_command_spec.rb
@@ -41,7 +41,6 @@ feature 'Setup Mattermost slash commands', feature: true do
end
end
-
describe 'mattermost service is not enabled' do
before do
allow(Gitlab.config.mattermost).to receive(:enabled).and_return(false)
diff --git a/spec/models/project_services/mattermost_slash_commands_service_spec.rb b/spec/models/project_services/mattermost_slash_commands_service_spec.rb
index 9fb6132d171..07662d2d89a 100644
--- a/spec/models/project_services/mattermost_slash_commands_service_spec.rb
+++ b/spec/models/project_services/mattermost_slash_commands_service_spec.rb
@@ -10,13 +10,13 @@ describe MattermostSlashCommandsService, :models do
before do
allow_any_instance_of(Mattermost::Session).to
- receive(:with_session).and_yield
+ receive(:with_session).and_yield
end
subject do
service.configure!(user, team_id: 'abc',
- trigger: 'gitlab', url: 'http://trigger.url',
- icon_url: 'http://icon.url/icon.png')
+ trigger: 'gitlab', url: 'http://trigger.url',
+ icon_url: 'http://icon.url/icon.png')
end
context 'the requests succeeds' do