Commit ac5682c0 authored by Heinrich Lee Yu's avatar Heinrich Lee Yu

Fix new specs failing after changing FactoryBot

These specs require some associations to be persisted
parent c284d0cc
......@@ -3,7 +3,7 @@
require 'spec_helper'
RSpec.describe Geo::SnippetRepositoryReplicator do
let(:model_record) { build(:snippet_repository) }
let(:model_record) { build(:snippet_repository, snippet: create(:snippet)) }
include_examples 'a repository replicator'
end
......@@ -48,7 +48,8 @@ RSpec.describe Git::WikiPushService do
end
context 'with a group wiki' do
let_it_be(:wiki) { build(:group_wiki) }
let_it_be(:group) { create(:group) }
let_it_be(:wiki) { build(:group_wiki, group: group) }
it 'does not trigger a wiki update' do
expect(wiki).not_to receive(:index_wiki_blobs)
......
......@@ -137,7 +137,8 @@ RSpec.describe PostReceive do
end
context 'with a group wiki' do
let(:wiki) { build(:group_wiki) }
let_it_be(:group) { create(:group) }
let(:wiki) { build(:group_wiki, group: group) }
it 'calls Git::WikiPushService#execute' do
expect_next_instance_of(::Git::WikiPushService) do |service|
......
......@@ -122,7 +122,7 @@ RSpec.describe Ci::PipelinesForMergeRequestFinder do
end
context 'with unsaved merge request' do
let(:merge_request) { build(:merge_request) }
let(:merge_request) { build(:merge_request, source_project: create(:project, :repository)) }
let!(:pipeline) do
create(:ci_empty_pipeline, project: project,
......
......@@ -6,7 +6,7 @@ RSpec.describe Ci::TriggerSerializer do
describe '#represent' do
let(:represent) { described_class.new.represent(trigger) }
let(:trigger) { build(:ci_trigger) }
let(:trigger) { build_stubbed(:ci_trigger) }
it 'matches schema' do
expect(represent.to_json).to match_schema('entities/trigger')
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment