Commit 6f8b800a authored by Heinrich Lee Yu's avatar Heinrich Lee Yu Committed by Eugenia Grieff

Fix ci subscriptions project spec

We need to pass in a downstream project because we call
`subject.dup.save` in the spec and `dup` won't duplicate the unsaved
association.

Passing in a persisted model means calling `dup` would just copy over
the same `downstream_project_id`.
parent fe53dd56
......@@ -3,7 +3,8 @@
require 'spec_helper'
RSpec.describe Ci::Subscriptions::Project do
let(:upstream_project) { create(:project, :public) }
let_it_be(:upstream_project) { create(:project, :public) }
let_it_be(:downstream_project) { create(:project) }
describe 'Relations' do
it { is_expected.to belong_to(:downstream_project).required }
......@@ -11,7 +12,7 @@ RSpec.describe Ci::Subscriptions::Project do
end
it_behaves_like 'includes Limitable concern' do
subject { build(:ci_subscriptions_project, upstream_project: upstream_project) }
subject { build(:ci_subscriptions_project, upstream_project: upstream_project, downstream_project: downstream_project) }
end
describe 'Validations' do
......
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