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:
Stan Hu 2019-05-19 04:01:16 -07:00
parent 52d24e66ce
commit d707e2a49f
2 changed files with 4 additions and 0 deletions

View File

@ -3,6 +3,8 @@
require 'spec_helper'
describe Ci::PipelineSchedule do
subject { build(:ci_pipeline_schedule) }
it { is_expected.to belong_to(:project) }
it { is_expected.to belong_to(:owner) }

View File

@ -5,6 +5,8 @@ require 'spec_helper'
describe Clusters::Cluster do
it_behaves_like 'having unique enum values'
subject { build(:cluster) }
it { is_expected.to belong_to(:user) }
it { is_expected.to have_many(:cluster_projects) }
it { is_expected.to have_many(:projects) }