Commit a6dbbaaf authored by Stan Hu's avatar Stan Hu

Merge branch 'fix-remote-mirror-spec' into 'master'

Use parent strategy for associations in factories - Remote Mirror spec

See merge request gitlab-org/gitlab!41354
parents d8556610 52368d34
......@@ -442,16 +442,18 @@ RSpec.describe RemoteMirror, :mailer do
end
describe '#disabled?' do
let_it_be(:project) { create(:project, :repository) }
subject { remote_mirror.disabled? }
context 'when disabled' do
let(:remote_mirror) { build(:remote_mirror, enabled: false) }
let(:remote_mirror) { build(:remote_mirror, project: project, enabled: false) }
it { is_expected.to be_truthy }
end
context 'when enabled' do
let(:remote_mirror) { build(:remote_mirror, enabled: true) }
let(:remote_mirror) { build(:remote_mirror, project: project, enabled: true) }
it { is_expected.to be_falsy }
end
......
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