Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
heptapod
heptapod
Commits
8245b6f452cb
Commit
47621989
authored
Nov 14, 2016
by
Z.J. van de Weg
Browse files
Remove duplication of implementations
parent
7c1cea29d933
Changes
5
Hide whitespace changes
Inline
Side-by-side
app/controllers/chat_ops_controller.rb
deleted
100644 → 0
View file @
7c1cea29
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 @
8245b6f4
# Base class for Chat services
# This class is not meant to be used directly, but only to inherrit from.
class
ChatService
<
Service
default_value_for
:category
,
'chat'
...
...
@@ -12,7 +13,7 @@ def supported_events
end
def
trigger
(
params
)
# implement inside child
raise
NotImplementedError
end
def
chat_user_params
(
params
)
...
...
app/models/project_services/mattermost_chat_service.rb
View file @
8245b6f4
...
...
@@ -5,7 +5,7 @@ def title
end
def
description
'
S
elf-hosted Slack-alternative'
'
Mattermost is an open source, s
elf-hosted Slack-alternative'
end
def
to_param
...
...
config/routes.rb
View file @
8245b6f4
...
...
@@ -68,11 +68,6 @@
# Notification settings
resources
:notification_settings
,
only:
[
:create
,
:update
]
# For slash commands to POST
namespace
:chat_ops
do
post
:trigger
end
draw
:import
draw
:uploads
draw
:explore
...
...
spec/controllers/chat_ops_controller_spec.rb
deleted
100644 → 0
View file @
7c1cea29
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