Commit 1db1896e authored by Kamil Trzcinski's avatar Kamil Trzcinski
Browse files

Rename mattermost_command to mattermost_slash_commands

parent 73ba59fb6ab6
......@@ -92,7 +92,7 @@ def update_forks_visibility_level
has_one :assembla_service, dependent: :destroy
has_one :asana_service, dependent: :destroy
has_one :gemnasium_service, dependent: :destroy
has_one :mattermost_command_service, dependent: :destroy
has_one :mattermost_slash_commands_service, dependent: :destroy
has_one :slack_service, dependent: :destroy
has_one :buildkite_service, dependent: :destroy
has_one :bamboo_service, dependent: :destroy
......
class MattermostCommandService < ChatService
class MattermostSlashCommandsService < ChatService
include TriggersHelper
prop_accessor :token
......@@ -16,7 +16,7 @@ def description
end
def to_param
'mattermost_command'
'mattermost_slash_commands'
end
def help
......
......@@ -213,7 +213,7 @@ def self.available_services_names
hipchat
irker
jira
mattermost_command
mattermost_slash_commands
pipelines_email
pivotaltracker
pushover
......
......@@ -128,7 +128,7 @@ project:
- emails_on_push_service
- builds_email_service
- pipelines_email_service
- mattermost_command_service
- mattermost_slash_commands_service
- irker_service
- pivotaltracker_service
- hipchat_service
......
require 'spec_helper'
describe MattermostCommandService, models: true do
describe MattermostSlashCommandsService, models: true do
describe "Associations" do
it { is_expected.to respond_to :token }
end
......@@ -66,7 +66,7 @@
end
let(:service) do
project.create_mattermost_command_service(
project.create_mattermost_slash_commands_service(
properties: { token: 'token' }
)
end
......@@ -82,7 +82,7 @@
context 'when the user is authenticated' do
let!(:chat_name) { create(:chat_name, service: service) }
let(:service) do
project.create_mattermost_command_service(
project.create_mattermost_slash_commands_service(
properties: { token: 'token' }
)
end
......
......@@ -36,7 +36,7 @@
it { is_expected.to have_one(:hipchat_service).dependent(:destroy) }
it { is_expected.to have_one(:flowdock_service).dependent(:destroy) }
it { is_expected.to have_one(:assembla_service).dependent(:destroy) }
it { is_expected.to have_one(:mattermost_command_service).dependent(:destroy) }
it { is_expected.to have_one(:mattermost_slash_commands_service).dependent(:destroy) }
it { is_expected.to have_one(:gemnasium_service).dependent(:destroy) }
it { is_expected.to have_one(:buildkite_service).dependent(:destroy) }
it { is_expected.to have_one(:bamboo_service).dependent(:destroy) }
......
......@@ -91,7 +91,7 @@
describe 'POST /projects/:id/services/:slug/trigger' do
let!(:project) { create(:empty_project) }
let(:service_name) { 'mattermost_command' }
let(:service_name) { 'mattermost_slash_commands' }
context 'no service is available' do
it 'returns a not found message' do
......@@ -107,14 +107,14 @@
context 'the service is not active' do
let!(:inactive_service) do
project.create_mattermost_command_service(
project.create_mattermost_slash_commands_service(
active: false,
properties: { token: 'token' }
)
end
it 'when the service is inactive' do
post api("/projects/#{project.id}/services/mattermost_command/trigger")
post api("/projects/#{project.id}/services/mattermost_slash_commands/trigger")
expect(response).to have_http_status(404)
end
......@@ -122,14 +122,14 @@
context 'the service is active' do
let!(:active_service) do
project.create_mattermost_command_service(
project.create_mattermost_slash_commands_service(
active: true,
properties: { token: 'token' }
)
end
it 'retusn status 200' do
post api("/projects/#{project.id}/services/mattermost_command/trigger"), params
post api("/projects/#{project.id}/services/mattermost_slash_commands/trigger"), params
expect(response).to have_http_status(200)
end
......@@ -137,7 +137,7 @@
context 'when the project can not be found' do
it 'returns a generic 404' do
post api("/projects/404/services/mattermost_command/trigger"), params
post api("/projects/404/services/mattermost_slash_commands/trigger"), params
expect(response).to have_http_status(404)
expect(json_response["message"]).to eq("404 Service Not Found")
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment