diff options
author | Robert Schilling <rschilling@student.tugraz.at> | 2016-06-10 13:02:41 +0200 |
---|---|---|
committer | Robert Schilling <rschilling@student.tugraz.at> | 2016-07-01 10:49:34 +0200 |
commit | 69397d559f837cb55fd50d5d0459523854dcec06 (patch) | |
tree | eb102cca7548bc6fae3e84d3f6f254354e176e0c /spec | |
parent | f3abd18c9c7da9c53bea2f08c2326a15ba5948f3 (diff) | |
download | gitlab-ce-69397d559f837cb55fd50d5d0459523854dcec06.tar.gz |
Assert response body
Diffstat (limited to 'spec')
-rw-r--r-- | spec/requests/api/todos_spec.rb | 13 |
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 |