Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLin Jen-Shin <godfat@godfat.org>2016-10-20 12:14:31 +0300
committerLin Jen-Shin <godfat@godfat.org>2016-10-20 12:14:31 +0300
commite5de4c77acbc128d1e8b8a0c3e469542ead8202f (patch)
treeb78b8a994814f5edb82011ab6641837b6d516eb8 /spec/models/ci
parentcefc7eb15bd7526a7c40fc0a1ca3534c2a12a0ef (diff)
parentb5cee66612fca4f1fb9791f1c8615039d1703df3 (diff)
Merge remote-tracking branch 'upstream/master' into pipeline-notifications
* upstream/master: (221 commits) Differentiate the expire from leave event Use LabelsFinder on Fogbuz importer Use LabelsFinder on Google Code importer Change the order of tested methods in project_members_controller_spec Remove show_menu_above attribute from issuable dropdowns. Spaces before `}`! Avoid touch label links that does not belongs to project when moving it Remove order by label type on LabelsFinder Rename Labels::CreateService to Labels::FindOrCreateService Add self.project_foreign_key on both Issue and MergeRequest Only show label type for projects that belong to a group Disable subscribing to group-level labels Remove unused method Project#all_labels Update specs to cope with new label types and priorities Fix max number of permitted priorities per project label Fix GitHub importer spec Update CHANGELOG Add support to group labels to SlashCommands::InterpretService Use join instead of subquery on Label.unprioritized scope Warn user deleting a group label affect all projects within the group ...
Diffstat (limited to 'spec/models/ci')
-rw-r--r--spec/models/ci/pipeline_spec.rb24
1 files changed, 19 insertions, 5 deletions
diff --git a/spec/models/ci/pipeline_spec.rb b/spec/models/ci/pipeline_spec.rb
index 4032029b80b..ab05150c97e 100644
--- a/spec/models/ci/pipeline_spec.rb
+++ b/spec/models/ci/pipeline_spec.rb
@@ -88,24 +88,38 @@ describe Ci::Pipeline, models: true do
context 'no failed builds' do
before do
- FactoryGirl.create :ci_build, name: "rspec", pipeline: pipeline, status: 'success'
+ create_build('rspec', 'success')
end
- it 'be not retryable' do
+ it 'is not retryable' do
is_expected.to be_falsey
end
+
+ context 'one canceled job' do
+ before do
+ create_build('rubocop', 'canceled')
+ end
+
+ it 'is retryable' do
+ is_expected.to be_truthy
+ end
+ end
end
context 'with failed builds' do
before do
- FactoryGirl.create :ci_build, name: "rspec", pipeline: pipeline, status: 'running'
- FactoryGirl.create :ci_build, name: "rubocop", pipeline: pipeline, status: 'failed'
+ create_build('rspec', 'running')
+ create_build('rubocop', 'failed')
end
- it 'be retryable' do
+ it 'is retryable' do
is_expected.to be_truthy
end
end
+
+ def create_build(name, status)
+ create(:ci_build, name: name, status: status, pipeline: pipeline)
+ end
end
describe '#stages' do