diff options
author | Valery Sizov <valery@gitlab.com> | 2015-01-07 12:00:04 -0800 |
---|---|---|
committer | Valery Sizov <valery@gitlab.com> | 2015-01-07 13:27:02 -0800 |
commit | 9d898f8b0508f43dfffb694d5f480a09bf400a0f (patch) | |
tree | 666345dd39ef5a6116776d8edea9b99291e54435 /spec/models/commit_spec.rb | |
parent | 01333d40882bfb1d05ba5d0cca2ded0c461aac9a (diff) | |
download | gitlab-ci-9d898f8b0508f43dfffb694d5f480a09bf400a0f.tar.gz |
Fix scheduled retrying
Diffstat (limited to 'spec/models/commit_spec.rb')
-rw-r--r-- | spec/models/commit_spec.rb | 13 |
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) } |