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
0
Merge Requests
0
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
Jérome Perrin
gitlab-ce
Commits
47621989
Commit
47621989
authored
Nov 14, 2016
by
Z.J. van de Weg
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove duplication of implementations
parent
9191f538
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
3 additions
and
28 deletions
+3
-28
app/controllers/chat_ops_controller.rb
app/controllers/chat_ops_controller.rb
+0
-10
app/models/project_services/chat_service.rb
app/models/project_services/chat_service.rb
+2
-1
app/models/project_services/mattermost_chat_service.rb
app/models/project_services/mattermost_chat_service.rb
+1
-1
config/routes.rb
config/routes.rb
+0
-5
spec/controllers/chat_ops_controller_spec.rb
spec/controllers/chat_ops_controller_spec.rb
+0
-11
No files found.
app/controllers/chat_ops_controller.rb
deleted
100644 → 0
View file @
9191f538
class
ChatOpsController
<
ApplicationController
respond_to
:json
skip_before_action
:verify_authenticity_token
skip_before_action
:authenticate_user!
def
trigger
render
json:
{
ok:
true
}
end
end
app/models/project_services/chat_service.rb
View file @
47621989
# Base class for Chat services
# Base class for Chat services
# This class is not meant to be used directly, but only to inherrit from.
class
ChatService
<
Service
class
ChatService
<
Service
default_value_for
:category
,
'chat'
default_value_for
:category
,
'chat'
...
@@ -12,7 +13,7 @@ class ChatService < Service
...
@@ -12,7 +13,7 @@ class ChatService < Service
end
end
def
trigger
(
params
)
def
trigger
(
params
)
# implement inside child
raise
NotImplementedError
end
end
def
chat_user_params
(
params
)
def
chat_user_params
(
params
)
...
...
app/models/project_services/mattermost_chat_service.rb
View file @
47621989
...
@@ -5,7 +5,7 @@ class MattermostChatService < ChatService
...
@@ -5,7 +5,7 @@ class MattermostChatService < ChatService
end
end
def
description
def
description
'
S
elf-hosted Slack-alternative'
'
Mattermost is an open source, s
elf-hosted Slack-alternative'
end
end
def
to_param
def
to_param
...
...
config/routes.rb
View file @
47621989
...
@@ -68,11 +68,6 @@ Rails.application.routes.draw do
...
@@ -68,11 +68,6 @@ Rails.application.routes.draw do
# Notification settings
# Notification settings
resources
:notification_settings
,
only:
[
:create
,
:update
]
resources
:notification_settings
,
only:
[
:create
,
:update
]
# For slash commands to POST
namespace
:chat_ops
do
post
:trigger
end
draw
:import
draw
:import
draw
:uploads
draw
:uploads
draw
:explore
draw
:explore
...
...
spec/controllers/chat_ops_controller_spec.rb
deleted
100644 → 0
View file @
9191f538
require
'rails_helper'
RSpec
.
describe
ChatOpsController
,
type: :controller
do
describe
"POST #trigger"
do
it
"returns http success"
do
post
:trigger
expect
(
response
).
to
have_http_status
(
:success
)
end
end
end
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