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

Rename mattermost_command to mattermost_slash_commands

parent c72c76fd
......@@ -92,7 +92,7 @@ class Project < ActiveRecord::Base
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 @@ class MattermostCommandService < ChatService
end
def to_param
'mattermost_command'
'mattermost_slash_commands'
end
def help
......
......@@ -213,7 +213,7 @@ class Service < ActiveRecord::Base
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 @@ describe MattermostCommandService, models: true do
end
let(:service) do
project.create_mattermost_command_service(
project.create_mattermost_slash_commands_service(
properties: { token: 'token' }
)
end
......@@ -82,7 +82,7 @@ describe MattermostCommandService, models: true do
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 @@ describe Project, models: true do
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 API::API, api: true do
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 @@ describe API::API, api: true do
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 @@ describe API::API, api: true do
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 @@ describe API::API, api: true do
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