summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKamil Trzcinski <ayufan@ayufan.eu>2016-07-19 14:30:09 +0200
committerKamil Trzcinski <ayufan@ayufan.eu>2016-07-19 14:54:18 +0200
commit6208c24d1f3ba4ac341c969bc61996903c2b4ff7 (patch)
treedf573741aa376fca89a31864545ed07e9eb0acd9
parent41fa516bb67e97e59ad8a38fe8296bbd3a091c82 (diff)
downloadgitlab-ce-6208c24d1f3ba4ac341c969bc61996903c2b4ff7.tar.gz
Move when tests before to make it no conflict with manual-actions
-rw-r--r--spec/models/build_spec.rb36
1 files changed, 27 insertions, 9 deletions
diff --git a/spec/models/build_spec.rb b/spec/models/build_spec.rb
index 7f301d7ef00..06d984c7a40 100644
--- a/spec/models/build_spec.rb
+++ b/spec/models/build_spec.rb
@@ -792,10 +792,10 @@ describe Ci::Build, models: true do
context 'if config does not have a questioned job' do
let(:config) do
YAML.dump({
- test_other: {
- script: 'Hello World'
- }
- })
+ test_other: {
+ script: 'Hello World'
+ }
+ })
end
it { is_expected.to eq('on_success') }
@@ -804,11 +804,11 @@ describe Ci::Build, models: true do
context 'if config has when' do
let(:config) do
YAML.dump({
- test: {
- script: 'Hello World',
- when: 'always'
- }
- })
+ test: {
+ script: 'Hello World',
+ when: 'always'
+ }
+ })
end
it { is_expected.to eq('always') }
@@ -816,4 +816,22 @@ describe Ci::Build, models: true do
end
end
end
+
+ describe '#retryable?' do
+ context 'when build is running' do
+ before { build.run! }
+
+ it 'should return false' do
+ expect(build.retryable?).to be false
+ end
+ end
+
+ context 'when build is finished' do
+ before { build.success! }
+
+ it 'should return true' do
+ expect(build.retryable?).to be true
+ end
+ end
+ end
end