diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-06-19 00:10:06 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-06-19 00:10:06 +0300 |
commit | cb0a625459525122d2736a895a728edb3b8ea4ff (patch) | |
tree | a3a830de41cdc0eb71c380f8e751faa1410a724a /spec/controllers/projects | |
parent | dd6e32bf47776514b8fe2abcfe7998503f16baab (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/controllers/projects')
-rw-r--r-- | spec/controllers/projects/merge_requests/diffs_controller_spec.rb | 14 | ||||
-rw-r--r-- | spec/controllers/projects/services_controller_spec.rb | 12 |
2 files changed, 12 insertions, 14 deletions
diff --git a/spec/controllers/projects/merge_requests/diffs_controller_spec.rb b/spec/controllers/projects/merge_requests/diffs_controller_spec.rb index 4fcb63ac616..a0818601562 100644 --- a/spec/controllers/projects/merge_requests/diffs_controller_spec.rb +++ b/spec/controllers/projects/merge_requests/diffs_controller_spec.rb @@ -88,8 +88,6 @@ RSpec.describe Projects::MergeRequests::DiffsController do let(:merge_request) { create(:merge_request_with_diffs, target_project: project, source_project: project) } before do - stub_feature_flags(diffs_gradual_load: false) - project.add_maintainer(user) sign_in(user) end @@ -486,7 +484,7 @@ RSpec.describe Projects::MergeRequests::DiffsController do namespace_id: project.namespace.to_param, project_id: project, id: merge_request.iid, - page: 1, + page: 0, per_page: 20, format: 'json' } @@ -517,7 +515,7 @@ RSpec.describe Projects::MergeRequests::DiffsController do it_behaves_like 'serializes diffs with expected arguments' do let(:collection) { Gitlab::Diff::FileCollection::MergeRequestDiffBatch } - let(:expected_options) { collection_arguments(current_page: 1, total_pages: 1).merge(merge_ref_head_diff: false) } + let(:expected_options) { collection_arguments(current_page: nil, total_pages: 20).merge(merge_ref_head_diff: false) } end it_behaves_like 'successful request' @@ -557,7 +555,7 @@ RSpec.describe Projects::MergeRequests::DiffsController do it_behaves_like 'serializes diffs with expected arguments' do let(:collection) { Gitlab::Diff::FileCollection::MergeRequestDiffBatch } let(:expected_options) do - collection_arguments(current_page: 1, total_pages: 1) + collection_arguments(current_page: nil, total_pages: 20) end end @@ -576,18 +574,18 @@ RSpec.describe Projects::MergeRequests::DiffsController do it_behaves_like 'serializes diffs with expected arguments' do let(:collection) { Gitlab::Diff::FileCollection::MergeRequestDiffBatch } - let(:expected_options) { collection_arguments(current_page: 1, total_pages: 1) } + let(:expected_options) { collection_arguments(current_page: nil, total_pages: 20) } end it_behaves_like 'successful request' end context 'with smaller diff batch params' do - subject { go(page: 2, per_page: 5) } + subject { go(page: 5, per_page: 5) } it_behaves_like 'serializes diffs with expected arguments' do let(:collection) { Gitlab::Diff::FileCollection::MergeRequestDiffBatch } - let(:expected_options) { collection_arguments(current_page: 2, next_page: 3, total_pages: 4) } + let(:expected_options) { collection_arguments(current_page: nil, next_page: nil, total_pages: 20) } end it_behaves_like 'successful request' diff --git a/spec/controllers/projects/services_controller_spec.rb b/spec/controllers/projects/services_controller_spec.rb index aad65880795..9bb9e13231e 100644 --- a/spec/controllers/projects/services_controller_spec.rb +++ b/spec/controllers/projects/services_controller_spec.rb @@ -258,8 +258,8 @@ RSpec.describe Projects::ServicesController do end end - context 'Prometheus service' do - let!(:service) { create(:prometheus_service, project: project) } + context 'Prometheus integration' do + let!(:service) { create(:prometheus_integration, project: project) } let(:service_params) { { manual_configuration: '1', api_url: 'http://example.com' } } context 'feature flag :settings_operations_prometheus_service is enabled' do @@ -276,8 +276,8 @@ RSpec.describe Projects::ServicesController do expect(controller).to set_flash.now[:alert].to(expected_alert) end - it 'does not modify service' do - expect { put :update, params: project_params.merge(service: service_params) }.not_to change { project.prometheus_service.reload.attributes } + it 'does not modify integration' do + expect { put :update, params: project_params.merge(service: service_params) }.not_to change { project.prometheus_integration.reload.attributes } end end @@ -286,8 +286,8 @@ RSpec.describe Projects::ServicesController do stub_feature_flags(settings_operations_prometheus_service: false) end - it 'modifies service' do - expect { put :update, params: project_params.merge(service: service_params) }.to change { project.prometheus_service.reload.attributes } + it 'modifies integration' do + expect { put :update, params: project_params.merge(service: service_params) }.to change { project.prometheus_integration.reload.attributes } end end end |