diff --git a/.rubocop_todo/rspec/factory_bot/avoid_create.yml b/.rubocop_todo/rspec/factory_bot/avoid_create.yml index 901641ed9913064077eefed9be813f636244de87..3201d5a837054b07277613856929af0e510a3595 100644 --- a/.rubocop_todo/rspec/factory_bot/avoid_create.yml +++ b/.rubocop_todo/rspec/factory_bot/avoid_create.yml @@ -535,8 +535,6 @@ RSpec/FactoryBot/AvoidCreate: - 'spec/serializers/project_mirror_entity_spec.rb' - 'spec/serializers/project_note_entity_spec.rb' - 'spec/serializers/project_serializer_spec.rb' - - 'spec/serializers/prometheus_alert_entity_spec.rb' - - 'spec/serializers/release_serializer_spec.rb' - 'spec/serializers/review_app_setup_entity_spec.rb' - 'spec/serializers/runner_entity_spec.rb' - 'spec/serializers/serverless/domain_entity_spec.rb' diff --git a/spec/serializers/prometheus_alert_entity_spec.rb b/spec/serializers/prometheus_alert_entity_spec.rb index 91a1e3377c246960670f25b4ae9bdc0aea987cb7..02da5a5bb8811ce81ce325a5608a576d97ae131b 100644 --- a/spec/serializers/prometheus_alert_entity_spec.rb +++ b/spec/serializers/prometheus_alert_entity_spec.rb @@ -3,8 +3,8 @@ require 'spec_helper' RSpec.describe PrometheusAlertEntity do - let(:user) { create(:user) } - let(:prometheus_alert) { create(:prometheus_alert) } + let(:user) { build_stubbed(:user) } + let(:prometheus_alert) { build_stubbed(:prometheus_alert) } let(:request) { double('prometheus_alert', current_user: user) } let(:entity) { described_class.new(prometheus_alert, request: request) } diff --git a/spec/serializers/release_serializer_spec.rb b/spec/serializers/release_serializer_spec.rb index b31172c3a50f16349687b1c4fc758ad61438e8de..e9f56e3453ebca9b91ae965b5e0c3e61a8604dc9 100644 --- a/spec/serializers/release_serializer_spec.rb +++ b/spec/serializers/release_serializer_spec.rb @@ -3,18 +3,13 @@ require 'spec_helper' RSpec.describe ReleaseSerializer do - let(:user) { create(:user) } - let(:project) { create :project } + let(:user) { build_stubbed(:user) } subject { described_class.new.represent(resource, current_user: user) } - before do - project.add_developer(user) - end - describe '#represent' do context 'when a single object is being serialized' do - let(:resource) { create(:release, project: project) } + let(:resource) { build_stubbed(:release) } it 'serializes the label object' do expect(subject[:tag]).to eq resource.tag @@ -26,7 +21,7 @@ end context 'when multiple objects are being serialized' do - let(:resource) { create_list(:release, 3) } + let(:resource) { build_stubbed_list(:release, 3) } it 'serializes the array of releases' do expect(subject.size).to eq(3)