summaryrefslogtreecommitdiff
path: root/spec/models/concerns
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2019-10-01 12:05:59 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2019-10-01 12:05:59 +0000
commit9e27f0d920cc3891fa7644c5cc0bc280c519fb20 (patch)
tree9784dd99270f2009159b19077412bf83d13123a4 /spec/models/concerns
parent1bab0ba591263cd739af2d2c7c3f1b03678a59b6 (diff)
downloadgitlab-ce-9e27f0d920cc3891fa7644c5cc0bc280c519fb20.tar.gz
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/models/concerns')
-rw-r--r--spec/models/concerns/has_status_spec.rb35
1 files changed, 24 insertions, 11 deletions
diff --git a/spec/models/concerns/has_status_spec.rb b/spec/models/concerns/has_status_spec.rb
index 09fb2fff521..21e4dda6dab 100644
--- a/spec/models/concerns/has_status_spec.rb
+++ b/spec/models/concerns/has_status_spec.rb
@@ -3,12 +3,15 @@
require 'spec_helper'
describe HasStatus do
- describe '.status' do
- subject { CommitStatus.status }
+ describe '.slow_composite_status' do
+ using RSpec::Parameterized::TableSyntax
+
+ subject { CommitStatus.slow_composite_status }
shared_examples 'build status summary' do
context 'all successful' do
let!(:statuses) { Array.new(2) { create(type, status: :success) } }
+
it { is_expected.to eq 'success' }
end
@@ -165,16 +168,26 @@ describe HasStatus do
end
end
- context 'ci build statuses' do
- let(:type) { :ci_build }
-
- it_behaves_like 'build status summary'
+ where(:ci_composite_status) do
+ [false, true]
end
- context 'generic commit statuses' do
- let(:type) { :generic_commit_status }
+ with_them do
+ before do
+ stub_feature_flags(ci_composite_status: ci_composite_status)
+ end
+
+ context 'ci build statuses' do
+ let(:type) { :ci_build }
- it_behaves_like 'build status summary'
+ it_behaves_like 'build status summary'
+ end
+
+ context 'generic commit statuses' do
+ let(:type) { :generic_commit_status }
+
+ it_behaves_like 'build status summary'
+ end
end
end
@@ -372,8 +385,8 @@ describe HasStatus do
end
end
- describe '.status_sql' do
- subject { Ci::Build.status_sql }
+ describe '.legacy_status_sql' do
+ subject { Ci::Build.legacy_status_sql }
it 'returns SQL' do
puts subject