diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2019-12-02 12:06:45 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2019-12-02 12:06:45 +0000 |
commit | bffcdf9bca11a4d43cc40e3f382f03088d36f7c6 (patch) | |
tree | c773436393b7a59b5f6b14388b9fa6402a9bd198 /spec/controllers | |
parent | 259c0cc0c4f8a49001b33d1bee577f4422e16d62 (diff) | |
download | gitlab-ce-bffcdf9bca11a4d43cc40e3f382f03088d36f7c6.tar.gz |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/controllers')
-rw-r--r-- | spec/controllers/projects/error_tracking_controller_spec.rb | 32 |
1 files changed, 19 insertions, 13 deletions
diff --git a/spec/controllers/projects/error_tracking_controller_spec.rb b/spec/controllers/projects/error_tracking_controller_spec.rb index 45f3188baae..ab99e44e4ca 100644 --- a/spec/controllers/projects/error_tracking_controller_spec.rb +++ b/spec/controllers/projects/error_tracking_controller_spec.rb @@ -50,8 +50,6 @@ describe Projects::ErrorTrackingController do let(:external_url) { 'http://example.com' } context 'no data' do - let(:params) { project_params(format: :json) } - let(:permitted_params) do ActionController::Parameters.new({}).permit! end @@ -72,11 +70,13 @@ describe Projects::ErrorTrackingController do end end - context 'with a search_term and sort params' do - let(:params) { project_params(format: :json, search_term: 'something', sort: 'last_seen') } - + context 'with extra params' do + let(:cursor) { '1572959139000:0:0' } + let(:search_term) { 'something' } + let(:sort) { 'last_seen' } + let(:params) { project_params(format: :json, search_term: search_term, sort: sort, cursor: cursor) } let(:permitted_params) do - ActionController::Parameters.new(search_term: 'something', sort: 'last_seen').permit! + ActionController::Parameters.new(search_term: search_term, sort: sort, cursor: cursor).permit! end before do @@ -88,7 +88,7 @@ describe Projects::ErrorTrackingController do context 'service result is successful' do before do expect(list_issues_service).to receive(:execute) - .and_return(status: :success, issues: [error]) + .and_return(status: :success, issues: [error], pagination: {}) expect(list_issues_service).to receive(:external_url) .and_return(external_url) end @@ -100,13 +100,16 @@ describe Projects::ErrorTrackingController do expect(response).to have_gitlab_http_status(:ok) expect(response).to match_response_schema('error_tracking/index') - expect(json_response['external_url']).to eq(external_url) - expect(json_response['errors']).to eq([error].as_json) + expect(json_response).to eq( + 'errors' => [error].as_json, + 'pagination' => {}, + 'external_url' => external_url + ) end end end - context 'without params' do + context 'without extra params' do before do expect(ErrorTracking::ListIssuesService) .to receive(:new).with(project, user, {}) @@ -116,7 +119,7 @@ describe Projects::ErrorTrackingController do context 'service result is successful' do before do expect(list_issues_service).to receive(:execute) - .and_return(status: :success, issues: [error]) + .and_return(status: :success, issues: [error], pagination: {}) expect(list_issues_service).to receive(:external_url) .and_return(external_url) end @@ -128,8 +131,11 @@ describe Projects::ErrorTrackingController do expect(response).to have_gitlab_http_status(:ok) expect(response).to match_response_schema('error_tracking/index') - expect(json_response['external_url']).to eq(external_url) - expect(json_response['errors']).to eq([error].as_json) + expect(json_response).to eq( + 'errors' => [error].as_json, + 'pagination' => {}, + 'external_url' => external_url + ) end end |