diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-06-17 13:07:47 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-06-17 13:07:47 +0300 |
commit | d670c3006e6e44901bce0d53cc4768d1d80ffa92 (patch) | |
tree | 8f65743c232e5b76850c4cc264ba15e1185815ff /spec/serializers | |
parent | a5f4bba440d7f9ea47046a0a561d49adf0a1e6d4 (diff) |
Add latest changes from gitlab-org/gitlab@14-0-stable-ee
Diffstat (limited to 'spec/serializers')
-rw-r--r-- | spec/serializers/merge_request_poll_widget_entity_spec.rb | 18 | ||||
-rw-r--r-- | spec/serializers/service_event_entity_spec.rb | 8 | ||||
-rw-r--r-- | spec/serializers/service_field_entity_spec.rb | 7 |
3 files changed, 13 insertions, 20 deletions
diff --git a/spec/serializers/merge_request_poll_widget_entity_spec.rb b/spec/serializers/merge_request_poll_widget_entity_spec.rb index c88555226a9..9a0e25516cb 100644 --- a/spec/serializers/merge_request_poll_widget_entity_spec.rb +++ b/spec/serializers/merge_request_poll_widget_entity_spec.rb @@ -229,21 +229,13 @@ RSpec.describe MergeRequestPollWidgetEntity do expect(subject[:mergeable]).to eq(true) end - context 'when async_mergeability_check is passed' do - let(:options) { { async_mergeability_check: true } } - - it 'returns false' do - expect(subject[:mergeable]).to eq(false) + context 'when check_mergeability_async_in_widget is disabled' do + before do + stub_feature_flags(check_mergeability_async_in_widget: false) end - context 'when check_mergeability_async_in_widget is disabled' do - before do - stub_feature_flags(check_mergeability_async_in_widget: false) - end - - it 'calculates mergeability and returns true' do - expect(subject[:mergeable]).to eq(true) - end + it 'calculates mergeability and returns true' do + expect(subject[:mergeable]).to eq(true) end end end diff --git a/spec/serializers/service_event_entity_spec.rb b/spec/serializers/service_event_entity_spec.rb index 64baa57fd6d..91254c7dd27 100644 --- a/spec/serializers/service_event_entity_spec.rb +++ b/spec/serializers/service_event_entity_spec.rb @@ -5,15 +5,15 @@ require 'spec_helper' RSpec.describe ServiceEventEntity do let(:request) { double('request') } - subject { described_class.new(event, request: request, service: service).as_json } + subject { described_class.new(event, request: request, service: integration).as_json } before do - allow(request).to receive(:service).and_return(service) + allow(request).to receive(:service).and_return(integration) end describe '#as_json' do context 'service without fields' do - let(:service) { create(:emails_on_push_service, push_events: true) } + let(:integration) { create(:emails_on_push_integration, push_events: true) } let(:event) { 'push' } it 'exposes correct attributes' do @@ -25,7 +25,7 @@ RSpec.describe ServiceEventEntity do end context 'service with fields' do - let(:service) { create(:slack_service, note_events: false, note_channel: 'note-channel') } + let(:integration) { create(:slack_service, note_events: false, note_channel: 'note-channel') } let(:event) { 'note' } it 'exposes correct attributes' do diff --git a/spec/serializers/service_field_entity_spec.rb b/spec/serializers/service_field_entity_spec.rb index 007042e1087..20ca98416f8 100644 --- a/spec/serializers/service_field_entity_spec.rb +++ b/spec/serializers/service_field_entity_spec.rb @@ -55,10 +55,11 @@ RSpec.describe ServiceFieldEntity do end context 'EmailsOnPush Service' do - let(:service) { create(:emails_on_push_service, send_from_committer_email: '1') } + let(:integration) { create(:emails_on_push_integration, send_from_committer_email: '1') } + let(:service) { integration } # TODO: remove when https://gitlab.com/gitlab-org/gitlab/-/issues/330300 is complete context 'field with type checkbox' do - let(:field) { service.global_fields.find { |field| field[:name] == 'send_from_committer_email' } } + let(:field) { integration.global_fields.find { |field| field[:name] == 'send_from_committer_email' } } it 'exposes correct attributes and casts value to Boolean' do expected_hash = { @@ -77,7 +78,7 @@ RSpec.describe ServiceFieldEntity do end context 'field with type select' do - let(:field) { service.global_fields.find { |field| field[:name] == 'branches_to_be_notified' } } + let(:field) { integration.global_fields.find { |field| field[:name] == 'branches_to_be_notified' } } it 'exposes correct attributes' do expected_hash = { |