summaryrefslogtreecommitdiff
path: root/spec/models
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2020-04-02 18:08:11 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2020-04-02 18:08:11 +0000
commit8a7efa45c38ed3200d173d2c3207a8154e583c16 (patch)
tree1bb4d579b95c79aae4946a06fefa089e5549b722 /spec/models
parent53b1f4eaa2a451aaba908a5fee7ce97a930021ac (diff)
downloadgitlab-ce-8a7efa45c38ed3200d173d2c3207a8154e583c16.tar.gz
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/models')
-rw-r--r--spec/models/ci/pipeline_spec.rb2
-rw-r--r--spec/models/commit_status_spec.rb6
-rw-r--r--spec/models/concerns/has_status_spec.rb2
-rw-r--r--spec/models/user_spec.rb6
4 files changed, 11 insertions, 5 deletions
diff --git a/spec/models/ci/pipeline_spec.rb b/spec/models/ci/pipeline_spec.rb
index 425194ba0e3..844e50dbb58 100644
--- a/spec/models/ci/pipeline_spec.rb
+++ b/spec/models/ci/pipeline_spec.rb
@@ -1924,7 +1924,7 @@ describe Ci::Pipeline, :mailer do
describe '#update_status' do
context 'when pipeline is empty' do
it 'updates does not change pipeline status' do
- expect(pipeline.statuses.latest.slow_composite_status).to be_nil
+ expect(pipeline.statuses.latest.slow_composite_status(project: project)).to be_nil
expect { pipeline.update_legacy_status }
.to change { pipeline.reload.status }
diff --git a/spec/models/commit_status_spec.rb b/spec/models/commit_status_spec.rb
index 40d9afcdd14..73b81b2225a 100644
--- a/spec/models/commit_status_spec.rb
+++ b/spec/models/commit_status_spec.rb
@@ -423,7 +423,7 @@ describe CommitStatus do
end
it 'returns a correct compound status' do
- expect(described_class.all.slow_composite_status).to eq 'running'
+ expect(described_class.all.slow_composite_status(project: project)).to eq 'running'
end
end
@@ -433,7 +433,7 @@ describe CommitStatus do
end
it 'returns status that indicates success' do
- expect(described_class.all.slow_composite_status).to eq 'success'
+ expect(described_class.all.slow_composite_status(project: project)).to eq 'success'
end
end
@@ -444,7 +444,7 @@ describe CommitStatus do
end
it 'returns status according to the scope' do
- expect(described_class.latest.slow_composite_status).to eq 'success'
+ expect(described_class.latest.slow_composite_status(project: project)).to eq 'success'
end
end
end
diff --git a/spec/models/concerns/has_status_spec.rb b/spec/models/concerns/has_status_spec.rb
index 99d09af80d0..68047f24ec3 100644
--- a/spec/models/concerns/has_status_spec.rb
+++ b/spec/models/concerns/has_status_spec.rb
@@ -6,7 +6,7 @@ describe HasStatus do
describe '.slow_composite_status' do
using RSpec::Parameterized::TableSyntax
- subject { CommitStatus.slow_composite_status }
+ subject { CommitStatus.slow_composite_status(project: nil) }
shared_examples 'build status summary' do
context 'all successful' do
diff --git a/spec/models/user_spec.rb b/spec/models/user_spec.rb
index 61c871ead92..291c628bfde 100644
--- a/spec/models/user_spec.rb
+++ b/spec/models/user_spec.rb
@@ -4400,6 +4400,12 @@ describe User, :do_not_mock_admin_mode do
it { is_expected.to be expected_result }
end
+
+ context 'when email is of Gitlab and is not confirmed' do
+ let(:user) { build(:user, email: 'test@gitlab.com', confirmed_at: nil) }
+
+ it { is_expected.to be false }
+ end
end
describe '#current_highest_access_level' do