summaryrefslogtreecommitdiff
path: root/spec/models/commit_spec.rb
diff options
context:
space:
mode:
authorValery Sizov <valery@gitlab.com>2015-01-07 12:00:04 -0800
committerValery Sizov <valery@gitlab.com>2015-01-07 13:27:02 -0800
commit9d898f8b0508f43dfffb694d5f480a09bf400a0f (patch)
tree666345dd39ef5a6116776d8edea9b99291e54435 /spec/models/commit_spec.rb
parent01333d40882bfb1d05ba5d0cca2ded0c461aac9a (diff)
downloadgitlab-ci-9d898f8b0508f43dfffb694d5f480a09bf400a0f.tar.gz
Fix scheduled retrying
Diffstat (limited to 'spec/models/commit_spec.rb')
-rw-r--r--spec/models/commit_spec.rb13
1 files changed, 13 insertions, 0 deletions
diff --git a/spec/models/commit_spec.rb b/spec/models/commit_spec.rb
index 430f62f..79cec87 100644
--- a/spec/models/commit_spec.rb
+++ b/spec/models/commit_spec.rb
@@ -49,6 +49,19 @@ describe Commit do
it('returns with the most recently created build') { should eq(@second) }
end
+ describe :retry do
+ before do
+ @first = FactoryGirl.create :build, commit: commit, created_at: Date.yesterday
+ @second = FactoryGirl.create :build, commit: commit
+ end
+
+ it "creates new build" do
+ commit.builds.count.should == 2
+ commit.retry
+ commit.builds.count.should == 3
+ end
+ end
+
describe :ci_skip? do
let(:project) { FactoryGirl.create(:project) }
let(:commit) { FactoryGirl.create(:commit, project: project) }