summaryrefslogtreecommitdiff
path: root/spec/models/commit_spec.rb
diff options
context:
space:
mode:
authorDmitriy Zaporozhets <dzaporozhets@gitlab.com>2015-03-04 17:25:59 +0000
committerDmitriy Zaporozhets <dzaporozhets@gitlab.com>2015-03-04 17:25:59 +0000
commitc4f1bdd8ae3ec242ea1634b59c8731bee4ef804d (patch)
tree58cebf4042cf5fe5ff1a693e495023cd5647fb99 /spec/models/commit_spec.rb
parentfeffb36dea7830deefd1e756fbe2a82301df2061 (diff)
parenta9f9fb35f99e0e0708834e3db203a6b904bd1e43 (diff)
downloadgitlab-ci-c4f1bdd8ae3ec242ea1634b59c8731bee4ef804d.tar.gz
Merge branch 'jobs_tabs' into 'master'
Deploy jobs Implements #153 ![joxi_screenshot_1425465268516](https://dev.gitlab.org/gitlab/gitlab-ci/uploads/23960cfff46ac6c7d1d0ded528917306/joxi_screenshot_1425465268516.png) See merge request !124
Diffstat (limited to 'spec/models/commit_spec.rb')
-rw-r--r--spec/models/commit_spec.rb19
1 files changed, 18 insertions, 1 deletions
diff --git a/spec/models/commit_spec.rb b/spec/models/commit_spec.rb
index 40ccbe4..b1c1400 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,21 @@ 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
+ 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