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
1
Merge Requests
1
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
nexedi
gitlab-ce
Commits
1db1896e
Commit
1db1896e
authored
Nov 18, 2016
by
Kamil Trzcinski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Rename mattermost_command to mattermost_slash_commands
parent
c72c76fd
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
15 additions
and
15 deletions
+15
-15
app/models/project.rb
app/models/project.rb
+1
-1
app/models/project_services/mattermost_slash_commands_service.rb
...els/project_services/mattermost_slash_commands_service.rb
+2
-2
app/models/service.rb
app/models/service.rb
+1
-1
spec/lib/gitlab/import_export/all_models.yml
spec/lib/gitlab/import_export/all_models.yml
+1
-1
spec/models/project_services/mattermost_slash_commands_service_spec.rb
...roject_services/mattermost_slash_commands_service_spec.rb
+3
-3
spec/models/project_spec.rb
spec/models/project_spec.rb
+1
-1
spec/requests/api/services_spec.rb
spec/requests/api/services_spec.rb
+6
-6
No files found.
app/models/project.rb
View file @
1db1896e
...
@@ -92,7 +92,7 @@ class Project < ActiveRecord::Base
...
@@ -92,7 +92,7 @@ class Project < ActiveRecord::Base
has_one
:assembla_service
,
dependent: :destroy
has_one
:assembla_service
,
dependent: :destroy
has_one
:asana_service
,
dependent: :destroy
has_one
:asana_service
,
dependent: :destroy
has_one
:gemnasium_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
:slack_service
,
dependent: :destroy
has_one
:buildkite_service
,
dependent: :destroy
has_one
:buildkite_service
,
dependent: :destroy
has_one
:bamboo_service
,
dependent: :destroy
has_one
:bamboo_service
,
dependent: :destroy
...
...
app/models/project_services/mattermost_
command
_service.rb
→
app/models/project_services/mattermost_
slash_commands
_service.rb
View file @
1db1896e
class
Mattermost
Command
Service
<
ChatService
class
Mattermost
SlashCommands
Service
<
ChatService
include
TriggersHelper
include
TriggersHelper
prop_accessor
:token
prop_accessor
:token
...
@@ -16,7 +16,7 @@ class MattermostCommandService < ChatService
...
@@ -16,7 +16,7 @@ class MattermostCommandService < ChatService
end
end
def
to_param
def
to_param
'mattermost_
command
'
'mattermost_
slash_commands
'
end
end
def
help
def
help
...
...
app/models/service.rb
View file @
1db1896e
...
@@ -213,7 +213,7 @@ class Service < ActiveRecord::Base
...
@@ -213,7 +213,7 @@ class Service < ActiveRecord::Base
hipchat
hipchat
irker
irker
jira
jira
mattermost_
command
mattermost_
slash_commands
pipelines_email
pipelines_email
pivotaltracker
pivotaltracker
pushover
pushover
...
...
spec/lib/gitlab/import_export/all_models.yml
View file @
1db1896e
...
@@ -128,7 +128,7 @@ project:
...
@@ -128,7 +128,7 @@ project:
-
emails_on_push_service
-
emails_on_push_service
-
builds_email_service
-
builds_email_service
-
pipelines_email_service
-
pipelines_email_service
-
mattermost_
command
_service
-
mattermost_
slash_commands
_service
-
irker_service
-
irker_service
-
pivotaltracker_service
-
pivotaltracker_service
-
hipchat_service
-
hipchat_service
...
...
spec/models/project_services/mattermost_
command
_service_spec.rb
→
spec/models/project_services/mattermost_
slash_commands
_service_spec.rb
View file @
1db1896e
require
'spec_helper'
require
'spec_helper'
describe
Mattermost
Command
Service
,
models:
true
do
describe
Mattermost
SlashCommands
Service
,
models:
true
do
describe
"Associations"
do
describe
"Associations"
do
it
{
is_expected
.
to
respond_to
:token
}
it
{
is_expected
.
to
respond_to
:token
}
end
end
...
@@ -66,7 +66,7 @@ describe MattermostCommandService, models: true do
...
@@ -66,7 +66,7 @@ describe MattermostCommandService, models: true do
end
end
let
(
:service
)
do
let
(
:service
)
do
project
.
create_mattermost_
command
_service
(
project
.
create_mattermost_
slash_commands
_service
(
properties:
{
token:
'token'
}
properties:
{
token:
'token'
}
)
)
end
end
...
@@ -82,7 +82,7 @@ describe MattermostCommandService, models: true do
...
@@ -82,7 +82,7 @@ describe MattermostCommandService, models: true do
context
'when the user is authenticated'
do
context
'when the user is authenticated'
do
let!
(
:chat_name
)
{
create
(
:chat_name
,
service:
service
)
}
let!
(
:chat_name
)
{
create
(
:chat_name
,
service:
service
)
}
let
(
:service
)
do
let
(
:service
)
do
project
.
create_mattermost_
command
_service
(
project
.
create_mattermost_
slash_commands
_service
(
properties:
{
token:
'token'
}
properties:
{
token:
'token'
}
)
)
end
end
...
...
spec/models/project_spec.rb
View file @
1db1896e
...
@@ -36,7 +36,7 @@ describe Project, models: true do
...
@@ -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
(
:hipchat_service
).
dependent
(
:destroy
)
}
it
{
is_expected
.
to
have_one
(
:flowdock_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
(
: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
(
:gemnasium_service
).
dependent
(
:destroy
)
}
it
{
is_expected
.
to
have_one
(
:buildkite_service
).
dependent
(
:destroy
)
}
it
{
is_expected
.
to
have_one
(
:buildkite_service
).
dependent
(
:destroy
)
}
it
{
is_expected
.
to
have_one
(
:bamboo_service
).
dependent
(
:destroy
)
}
it
{
is_expected
.
to
have_one
(
:bamboo_service
).
dependent
(
:destroy
)
}
...
...
spec/requests/api/services_spec.rb
View file @
1db1896e
...
@@ -91,7 +91,7 @@ describe API::API, api: true do
...
@@ -91,7 +91,7 @@ describe API::API, api: true do
describe
'POST /projects/:id/services/:slug/trigger'
do
describe
'POST /projects/:id/services/:slug/trigger'
do
let!
(
:project
)
{
create
(
:empty_project
)
}
let!
(
:project
)
{
create
(
:empty_project
)
}
let
(
:service_name
)
{
'mattermost_
command
'
}
let
(
:service_name
)
{
'mattermost_
slash_commands
'
}
context
'no service is available'
do
context
'no service is available'
do
it
'returns a not found message'
do
it
'returns a not found message'
do
...
@@ -107,14 +107,14 @@ describe API::API, api: true do
...
@@ -107,14 +107,14 @@ describe API::API, api: true do
context
'the service is not active'
do
context
'the service is not active'
do
let!
(
:inactive_service
)
do
let!
(
:inactive_service
)
do
project
.
create_mattermost_
command
_service
(
project
.
create_mattermost_
slash_commands
_service
(
active:
false
,
active:
false
,
properties:
{
token:
'token'
}
properties:
{
token:
'token'
}
)
)
end
end
it
'when the service is inactive'
do
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
)
expect
(
response
).
to
have_http_status
(
404
)
end
end
...
@@ -122,14 +122,14 @@ describe API::API, api: true do
...
@@ -122,14 +122,14 @@ describe API::API, api: true do
context
'the service is active'
do
context
'the service is active'
do
let!
(
:active_service
)
do
let!
(
:active_service
)
do
project
.
create_mattermost_
command
_service
(
project
.
create_mattermost_
slash_commands
_service
(
active:
true
,
active:
true
,
properties:
{
token:
'token'
}
properties:
{
token:
'token'
}
)
)
end
end
it
'retusn status 200'
do
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
)
expect
(
response
).
to
have_http_status
(
200
)
end
end
...
@@ -137,7 +137,7 @@ describe API::API, api: true do
...
@@ -137,7 +137,7 @@ describe API::API, api: true do
context
'when the project can not be found'
do
context
'when the project can not be found'
do
it
'returns a generic 404'
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
(
response
).
to
have_http_status
(
404
)
expect
(
json_response
[
"message"
]).
to
eq
(
"404 Service Not Found"
)
expect
(
json_response
[
"message"
]).
to
eq
(
"404 Service Not Found"
)
...
...
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