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/boards | |
parent | e38a3bba1b32754a11e805093f306135beee55dd (diff) |
Cleanup usages of `JSON.parse` in specs
Prefer `json_response` where applicable.
Diffstat (limited to 'spec/controllers/boards')
-rw-r--r-- | spec/controllers/boards/issues_controller_spec.rb | 8 | ||||
-rw-r--r-- | spec/controllers/boards/lists_controller_spec.rb | 4 |
2 files changed, 3 insertions, 9 deletions
diff --git a/spec/controllers/boards/issues_controller_spec.rb b/spec/controllers/boards/issues_controller_spec.rb index 6cad060d888..246d6f9e0f9 100644 --- a/spec/controllers/boards/issues_controller_spec.rb +++ b/spec/controllers/boards/issues_controller_spec.rb @@ -52,10 +52,8 @@ describe Boards::IssuesController do list_issues user: user, board: board, list: list2 - parsed_response = JSON.parse(response.body) - expect(response).to match_response_schema('entities/issue_boards') - expect(parsed_response['issues'].length).to eq 2 + expect(json_response['issues'].length).to eq 2 expect(development.issues.map(&:relative_position)).not_to include(nil) end @@ -123,10 +121,8 @@ describe Boards::IssuesController do list_issues user: user, board: board - parsed_response = JSON.parse(response.body) - expect(response).to match_response_schema('entities/issue_boards') - expect(parsed_response['issues'].length).to eq 2 + expect(json_response['issues'].length).to eq 2 end end diff --git a/spec/controllers/boards/lists_controller_spec.rb b/spec/controllers/boards/lists_controller_spec.rb index e1f75fa3395..418ca6f3210 100644 --- a/spec/controllers/boards/lists_controller_spec.rb +++ b/spec/controllers/boards/lists_controller_spec.rb @@ -26,10 +26,8 @@ describe Boards::ListsController do read_board_list user: user, board: board - parsed_response = JSON.parse(response.body) - expect(response).to match_response_schema('lists') - expect(parsed_response.length).to eq 3 + expect(json_response.length).to eq 3 end context 'with unauthorized user' do |