Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Schilling <rschilling@student.tugraz.at>2016-06-10 14:02:41 +0300
committerRobert Schilling <rschilling@student.tugraz.at>2016-07-01 11:49:34 +0300
commit69397d559f837cb55fd50d5d0459523854dcec06 (patch)
treeeb102cca7548bc6fae3e84d3f6f254354e176e0c /spec/requests/api/todos_spec.rb
parentf3abd18c9c7da9c53bea2f08c2326a15ba5948f3 (diff)
Assert response body
Diffstat (limited to 'spec/requests/api/todos_spec.rb')
-rw-r--r--spec/requests/api/todos_spec.rb13
1 files changed, 12 insertions, 1 deletions
diff --git a/spec/requests/api/todos_spec.rb b/spec/requests/api/todos_spec.rb
index 147028ba1c9..1960db59c99 100644
--- a/spec/requests/api/todos_spec.rb
+++ b/spec/requests/api/todos_spec.rb
@@ -35,6 +35,16 @@ describe API::Todos, api: true do
expect(response.status).to eq(200)
expect(json_response).to be_an Array
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
context 'and using the author filter' do
@@ -69,7 +79,6 @@ describe API::Todos, api: true do
context 'and using the project filter' 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 }
expect(response.status).to eq(200)
@@ -113,6 +122,8 @@ describe API::Todos, api: true do
delete api('/todos', john_doe)
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_2.reload).to be_done
expect(pending_3.reload).to be_done