Ensure subject passes validations
Rails 5 requires that belongs_to associations have the associated record present. These tests were failing because they had nil values.
This commit is contained in:
parent
52d24e66ce
commit
d707e2a49f
2 changed files with 4 additions and 0 deletions
|
@ -3,6 +3,8 @@
|
||||||
require 'spec_helper'
|
require 'spec_helper'
|
||||||
|
|
||||||
describe Ci::PipelineSchedule do
|
describe Ci::PipelineSchedule do
|
||||||
|
subject { build(:ci_pipeline_schedule) }
|
||||||
|
|
||||||
it { is_expected.to belong_to(:project) }
|
it { is_expected.to belong_to(:project) }
|
||||||
it { is_expected.to belong_to(:owner) }
|
it { is_expected.to belong_to(:owner) }
|
||||||
|
|
||||||
|
|
|
@ -5,6 +5,8 @@ require 'spec_helper'
|
||||||
describe Clusters::Cluster do
|
describe Clusters::Cluster do
|
||||||
it_behaves_like 'having unique enum values'
|
it_behaves_like 'having unique enum values'
|
||||||
|
|
||||||
|
subject { build(:cluster) }
|
||||||
|
|
||||||
it { is_expected.to belong_to(:user) }
|
it { is_expected.to belong_to(:user) }
|
||||||
it { is_expected.to have_many(:cluster_projects) }
|
it { is_expected.to have_many(:cluster_projects) }
|
||||||
it { is_expected.to have_many(:projects) }
|
it { is_expected.to have_many(:projects) }
|
||||||
|
|
Loading…
Reference in a new issue