diff options
author | Kamil Trzcinski <ayufan@ayufan.eu> | 2015-07-10 14:59:00 +0200 |
---|---|---|
committer | Kamil Trzcinski <ayufan@ayufan.eu> | 2015-07-10 14:59:00 +0200 |
commit | 39cfebdcf4225a9384ddb59578adeaec4b11d06d (patch) | |
tree | 11f4d5fd251909dbb993ea5afcc0be825946b157 | |
parent | ee86182f40011de68f8a3ed3eafe3ff436cfeb3c (diff) | |
download | gitlab-ci-39cfebdcf4225a9384ddb59578adeaec4b11d06d.tar.gz |
Fixed specs
-rw-r--r-- | spec/models/commit_spec.rb | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/spec/models/commit_spec.rb b/spec/models/commit_spec.rb index 14d6d99..0038e36 100644 --- a/spec/models/commit_spec.rb +++ b/spec/models/commit_spec.rb @@ -167,18 +167,25 @@ describe Commit do let(:commit) { FactoryGirl.create :commit, project: project } it "calculates average when there are two builds with coverage" do - FactoryGirl.create :build, coverage: 30, commit: commit - FactoryGirl.create :build, coverage: 40, commit: commit + FactoryGirl.create :build, name: "rspec", coverage: 30, commit: commit + FactoryGirl.create :build, name: "rubocop", coverage: 40, commit: commit commit.coverage.should == "35.00" end it "calculates average when there are two builds with coverage and one with nil" do - FactoryGirl.create :build, coverage: 30, commit: commit - FactoryGirl.create :build, coverage: 40, commit: commit + FactoryGirl.create :build, name: "rspec", coverage: 30, commit: commit + FactoryGirl.create :build, name: "rubocop", coverage: 40, commit: commit FactoryGirl.create :build, commit: commit commit.coverage.should == "35.00" end + it "calculates average when there are two builds with coverage and one is retried" do + FactoryGirl.create :build, name: "rspec", coverage: 30, commit: commit + FactoryGirl.create :build, name: "rubocop", coverage: 30, commit: commit + FactoryGirl.create :build, name: "rubocop", coverage: 40, commit: commit + commit.coverage.should == "35.00" + end + it "calculates average when there is one build without coverage" do FactoryGirl.create :build, commit: commit commit.coverage.should be_nil |