summaryrefslogtreecommitdiff
path: root/spec/models/commit_spec.rb
diff options
context:
space:
mode:
authorKamil Trzcinski <ayufan@ayufan.eu>2015-07-10 14:56:09 +0200
committerKamil Trzcinski <ayufan@ayufan.eu>2015-07-10 16:04:35 +0200
commitefdf54f25a83462a750cacd4ea7919c7d38e67d1 (patch)
treee1823788941ac74352446c065a26b79eb22f985d /spec/models/commit_spec.rb
parentd841ed56d39db1b33947b9b9c0291beaa7dcdd43 (diff)
downloadgitlab-ci-efdf54f25a83462a750cacd4ea7919c7d38e67d1.tar.gz
Allow to specify flexible list of types in yaml
``` types: - test - deploy - notify rspec: script: "rspec" rubocop: script: "rubocop" staging: type: deploy script: "echo deploy" only: - master production: type: deploy script: "echo production" only: - tags dockerhub: type: notify script: "curl http://docker/hub/web/hook" downstream: type: notify script: "curl http://build/downstream/jobs" ``` This will trigger two test jobs in parallel, when finished it will trigged either staging or production, when finished it will trigger dockerhub and downstream in parallel.
Diffstat (limited to 'spec/models/commit_spec.rb')
-rw-r--r--spec/models/commit_spec.rb17
1 files changed, 13 insertions, 4 deletions
diff --git a/spec/models/commit_spec.rb b/spec/models/commit_spec.rb
index 0038e36..2074781 100644
--- a/spec/models/commit_spec.rb
+++ b/spec/models/commit_spec.rb
@@ -132,15 +132,24 @@ describe Commit do
it { commit.sha.should start_with(subject) }
end
- describe "create_deploy_builds" do
- it "creates deploy build" do
+ describe :create_next_builds do
+ it "creates builds for next type" do
config_processor = GitlabCiYamlProcessor.new(gitlab_ci_yaml)
commit.stub(:config_processor).and_return(config_processor)
- commit.create_deploy_builds
+ commit.create_builds.should be_true
commit.builds.reload
-
commit.builds.size.should == 2
+
+ commit.create_next_builds.should be_true
+ commit.builds.reload
+ commit.builds.size.should == 4
+
+ commit.create_next_builds.should be_true
+ commit.builds.reload
+ commit.builds.size.should == 5
+
+ commit.create_next_builds.should be_false
end
end