BigW Consortium Gitlab
Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gitlab-ce
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Forest Godfrey
gitlab-ce
Commits
1dbcd5ec
Unverified
Commit
1dbcd5ec
authored
Feb 02, 2018
by
Matija Čupić
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Refactor CalloutsController
parent
8f942a05
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
10 additions
and
8 deletions
+10
-8
callouts_controller.rb
app/controllers/callouts_controller.rb
+7
-3
routes.rb
config/routes.rb
+1
-3
callouts_controller_spec.rb
spec/controllers/callouts_controller_spec.rb
+2
-2
No files found.
app/controllers/callouts_controller.rb
View file @
1dbcd5ec
class
CalloutsController
<
ApplicationController
def
dismiss
def
create
if
ensure_callout
respond_to
{
|
format
|
format
.
json
{
head
:ok
}
}
respond_to
do
|
format
|
format
.
json
{
head
:ok
}
end
else
respond_to
{
|
format
|
format
.
json
{
head
:bad_request
}
}
respond_to
do
|
format
|
format
.
json
{
head
:bad_request
}
end
end
end
...
...
config/routes.rb
View file @
1dbcd5ec
...
...
@@ -62,9 +62,7 @@ Rails.application.routes.draw do
end
# Callouts
namespace
:callouts
do
post
:dismiss
end
resources
:callouts
,
only:
[
:create
]
end
# Koding route
...
...
spec/controllers/callouts_controller_spec.rb
View file @
1dbcd5ec
...
...
@@ -7,8 +7,8 @@ describe CalloutsController do
sign_in
(
user
)
end
describe
"POST #
dismiss
"
do
subject
{
post
:
dismiss
,
feature_name:
'feature_name'
,
format: :json
}
describe
"POST #
create
"
do
subject
{
post
:
create
,
feature_name:
'feature_name'
,
format: :json
}
context
'when callout entry does not exist'
do
it
'should create a callout entry with dismissed state'
do
...
...
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