diff options
author | Peter Leitzen <pleitzen@gitlab.com> | 2019-07-16 11:03:49 +0300 |
---|---|---|
committer | Grzegorz Bizon <grzegorz@gitlab.com> | 2019-07-16 11:03:49 +0300 |
commit | 7b87ed14991737930eb8f353feec9e6c8af6c1ac (patch) | |
tree | a5c22c297184ed7b00156d3a9a7f3edf19c19a41 /spec/controllers/groups | |
parent | e38a3bba1b32754a11e805093f306135beee55dd (diff) |
Cleanup usages of `JSON.parse` in specs
Prefer `json_response` where applicable.
Diffstat (limited to 'spec/controllers/groups')
-rw-r--r-- | spec/controllers/groups/boards_controller_spec.rb | 4 | ||||
-rw-r--r-- | spec/controllers/groups/milestones_controller_spec.rb | 2 |
2 files changed, 2 insertions, 4 deletions
diff --git a/spec/controllers/groups/boards_controller_spec.rb b/spec/controllers/groups/boards_controller_spec.rb index 5e0f64ccca4..e4232c2c1ab 100644 --- a/spec/controllers/groups/boards_controller_spec.rb +++ b/spec/controllers/groups/boards_controller_spec.rb @@ -63,10 +63,8 @@ describe Groups::BoardsController do list_boards format: :json - parsed_response = JSON.parse(response.body) - expect(response).to match_response_schema('boards') - expect(parsed_response.length).to eq 1 + expect(json_response.length).to eq 1 end context 'with unauthorized user' do diff --git a/spec/controllers/groups/milestones_controller_spec.rb b/spec/controllers/groups/milestones_controller_spec.rb index 19b18091aef..bf164aeed38 100644 --- a/spec/controllers/groups/milestones_controller_spec.rb +++ b/spec/controllers/groups/milestones_controller_spec.rb @@ -73,7 +73,7 @@ describe Groups::MilestonesController do it 'lists legacy group milestones and group milestones' do get :index, params: { group_id: group.to_param }, format: :json - milestones = JSON.parse(response.body) + milestones = json_response expect(milestones.count).to eq(2) expect(milestones.first["title"]).to eq("group milestone") |