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
Boxiang Sun
gitlab-ce
Commits
69397d55
Commit
69397d55
authored
Jun 10, 2016
by
Robert Schilling
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Assert response body
parent
f3abd18c
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
1 deletion
+12
-1
spec/requests/api/todos_spec.rb
spec/requests/api/todos_spec.rb
+12
-1
No files found.
spec/requests/api/todos_spec.rb
View file @
69397d55
...
@@ -35,6 +35,16 @@ describe API::Todos, api: true do
...
@@ -35,6 +35,16 @@ describe API::Todos, api: true do
expect
(
response
.
status
).
to
eq
(
200
)
expect
(
response
.
status
).
to
eq
(
200
)
expect
(
json_response
).
to
be_an
Array
expect
(
json_response
).
to
be_an
Array
expect
(
json_response
.
length
).
to
eq
(
3
)
expect
(
json_response
.
length
).
to
eq
(
3
)
expect
(
json_response
[
0
][
'id'
]).
to
eq
(
pending_3
.
id
)
expect
(
json_response
[
0
][
'project'
]).
to
be_a
Hash
expect
(
json_response
[
0
][
'author'
]).
to
be_a
Hash
expect
(
json_response
[
0
][
'target_id'
]).
to
be_present
expect
(
json_response
[
0
][
'target_type'
]).
to
be_present
expect
(
json_response
[
0
][
'target_reference'
]).
to
be_present
expect
(
json_response
[
0
][
'target_url'
]).
to
be_present
expect
(
json_response
[
0
][
'body'
]).
to
be_present
expect
(
json_response
[
0
][
'state'
]).
to
eq
(
'pending'
)
expect
(
json_response
[
0
][
'created_at'
]).
to
be_present
end
end
context
'and using the author filter'
do
context
'and using the author filter'
do
...
@@ -69,7 +79,6 @@ describe API::Todos, api: true do
...
@@ -69,7 +79,6 @@ describe API::Todos, api: true do
context
'and using the project filter'
do
context
'and using the project filter'
do
it
'filters based on project_id param'
do
it
'filters based on project_id param'
do
project_2
.
team
<<
[
john_doe
,
:developer
]
get
api
(
'/todos'
,
john_doe
),
{
project_id:
project_2
.
id
}
get
api
(
'/todos'
,
john_doe
),
{
project_id:
project_2
.
id
}
expect
(
response
.
status
).
to
eq
(
200
)
expect
(
response
.
status
).
to
eq
(
200
)
...
@@ -113,6 +122,8 @@ describe API::Todos, api: true do
...
@@ -113,6 +122,8 @@ describe API::Todos, api: true do
delete
api
(
'/todos'
,
john_doe
)
delete
api
(
'/todos'
,
john_doe
)
expect
(
response
.
status
).
to
eq
(
200
)
expect
(
response
.
status
).
to
eq
(
200
)
expect
(
json_response
).
to
be_an
Array
expect
(
json_response
.
length
).
to
eq
(
3
)
expect
(
pending_1
.
reload
).
to
be_done
expect
(
pending_1
.
reload
).
to
be_done
expect
(
pending_2
.
reload
).
to
be_done
expect
(
pending_2
.
reload
).
to
be_done
expect
(
pending_3
.
reload
).
to
be_done
expect
(
pending_3
.
reload
).
to
be_done
...
...
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