summaryrefslogtreecommitdiff
path: root/spec/models/commit_spec.rb
diff options
context:
space:
mode:
authorValery Sizov <vsv2711@gmail.com>2015-02-27 14:58:19 +0200
committerValery Sizov <vsv2711@gmail.com>2015-03-02 14:32:13 +0200
commit00d79e159086e55d8e06c55e0bdd5ee5b1779f34 (patch)
tree472715adae5aadfd4421f10658b68170a84d1102 /spec/models/commit_spec.rb
parent83835d271fa8fb04fae5c422afeacfba6f061629 (diff)
downloadgitlab-ci-00d79e159086e55d8e06c55e0bdd5ee5b1779f34.tar.gz
Deploy jobs
Diffstat (limited to 'spec/models/commit_spec.rb')
-rw-r--r--spec/models/commit_spec.rb21
1 files changed, 20 insertions, 1 deletions
diff --git a/spec/models/commit_spec.rb b/spec/models/commit_spec.rb
index 79cec87..4c106ad 100644
--- a/spec/models/commit_spec.rb
+++ b/spec/models/commit_spec.rb
@@ -16,7 +16,7 @@ require 'spec_helper'
describe Commit do
let(:project) { FactoryGirl.create :project }
- let(:commit) { FactoryGirl.create :commit }
+ let(:commit) { FactoryGirl.create :commit, project: project }
let(:commit_with_project) { FactoryGirl.create :commit, project: project }
it { should belong_to(:project) }
@@ -159,4 +159,23 @@ describe Commit do
it { should eq(project.gitlab?) }
end
+
+ describe "run_deploy_job" do
+ before do
+ job = FactoryGirl.create :job, project: project
+ job1 = FactoryGirl.create :job, project: project
+ FactoryGirl.create :job, job_type: :deploy, project: project
+ # binding.pry
+
+ FactoryGirl.create :build, commit: commit, status: :success, job: job
+ FactoryGirl.create :build, commit: commit, status: :success, job: job1
+ project.reload
+ end
+
+ it "creates new build for deploy" do
+ commit.run_deploy_job(commit.ref)
+
+ commit.builds.count.should == 3
+ end
+ end
end