From 9d898f8b0508f43dfffb694d5f480a09bf400a0f Mon Sep 17 00:00:00 2001 From: Valery Sizov Date: Wed, 7 Jan 2015 12:00:04 -0800 Subject: Fix scheduled retrying --- spec/models/commit_spec.rb | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'spec/models/commit_spec.rb') 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) } -- cgit v1.2.1