diff options
author | Stan Hu <stanhu@gmail.com> | 2019-05-19 14:01:16 +0300 |
---|---|---|
committer | Stan Hu <stanhu@gmail.com> | 2019-05-22 09:19:07 +0300 |
commit | d707e2a49f2efe4670b5ebe62fb61554640ca7e9 (patch) | |
tree | 2e4c31abb2b890eb803bdef4d2b5fba022a5c98a /spec/models | |
parent | 52d24e66cec1fa6c0100adb64effd2073869cd8b (diff) |
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.
Diffstat (limited to 'spec/models')
-rw-r--r-- | spec/models/ci/pipeline_schedule_spec.rb | 2 | ||||
-rw-r--r-- | spec/models/clusters/cluster_spec.rb | 2 |
2 files changed, 4 insertions, 0 deletions
diff --git a/spec/models/ci/pipeline_schedule_spec.rb b/spec/models/ci/pipeline_schedule_spec.rb index 1bfc14d2839..42d4769a921 100644 --- a/spec/models/ci/pipeline_schedule_spec.rb +++ b/spec/models/ci/pipeline_schedule_spec.rb @@ -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) } diff --git a/spec/models/clusters/cluster_spec.rb b/spec/models/clusters/cluster_spec.rb index 58203da5b22..f9d8ffd06e0 100644 --- a/spec/models/clusters/cluster_spec.rb +++ b/spec/models/clusters/cluster_spec.rb @@ -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) } |