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
Léo-Paul Géneau
gitlab-ce
Commits
bca10385
Commit
bca10385
authored
Jan 26, 2018
by
Matija Čupić
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add CalloutsController specs
parent
c4667f87
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
39 additions
and
0 deletions
+39
-0
spec/controllers/callouts_controller_spec.rb
spec/controllers/callouts_controller_spec.rb
+39
-0
No files found.
spec/controllers/callouts_controller_spec.rb
0 → 100644
View file @
bca10385
require
'spec_helper'
describe
CalloutsController
do
let
(
:user
)
{
create
(
:user
)
}
before
do
sign_in
(
user
)
end
describe
"POST #dismiss"
do
subject
{
post
:dismiss
,
feature_name:
'feature_name'
,
format: :json
}
context
'when callout entry does not exist'
do
it
'should create a callout entry with dismissed state'
do
expect
{
subject
}.
to
change
{
Callout
.
count
}.
by
(
1
)
end
it
'should return success'
do
subject
expect
(
response
).
to
have_gitlab_http_status
(
:ok
)
end
end
context
'when callout entry already exists'
do
let!
(
:callout
)
{
create
(
:callout
,
feature_name:
'feature_name'
,
user:
user
)
}
it
'should update it with a dismissed state'
do
expect
{
subject
}.
to
change
{
callout
.
reload
.
dismissed_state
}.
from
(
false
).
to
(
true
)
end
it
'should return success'
do
subject
expect
(
response
).
to
have_gitlab_http_status
(
:ok
)
end
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