diff options
author | Douglas Barbosa Alexandre <dbalexandre@gmail.com> | 2019-02-21 22:57:14 +0300 |
---|---|---|
committer | Douglas Barbosa Alexandre <dbalexandre@gmail.com> | 2019-02-21 22:57:14 +0300 |
commit | 7ff0c8ae57e6a88c86afae4f8e08bfacfb34d761 (patch) | |
tree | 9d9d003616b9b010697eb63ccde941e075c3e96c /spec | |
parent | 1f4e5fe7b191211520f2a0f415a34dac641326a7 (diff) | |
parent | b85b6590e50ac8ae6fa2fda64a58dc83f6ca615f (diff) |
Merge branch 'ce-9858-follow-up-on-a-bug-that-happens-when-using-a-factory-built-object-in-the-where-block-of-rspec-parameterized-tablesyntax' into 'master'
Fix and document an RSpec::Parameterized::TableSyntax edge-case
See merge request gitlab-org/gitlab-ce!25438
Diffstat (limited to 'spec')
-rw-r--r-- | spec/models/prometheus_metric_spec.rb | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/spec/models/prometheus_metric_spec.rb b/spec/models/prometheus_metric_spec.rb index 2b978c1c8ff..3610408c138 100644 --- a/spec/models/prometheus_metric_spec.rb +++ b/spec/models/prometheus_metric_spec.rb @@ -4,7 +4,6 @@ require 'spec_helper' describe PrometheusMetric do subject { build(:prometheus_metric) } - let(:other_project) { build(:project) } it_behaves_like 'having unique enum values' @@ -16,17 +15,17 @@ describe PrometheusMetric do describe 'common metrics' do using RSpec::Parameterized::TableSyntax - where(:common, :project, :result) do - false | other_project | true - false | nil | false - true | other_project | false - true | nil | true + where(:common, :with_project, :result) do + false | true | true + false | false | false + true | true | false + true | false | true end with_them do before do subject.common = common - subject.project = project + subject.project = with_project ? build(:project) : nil end it { expect(subject.valid?).to eq(result) } |