Skip to content
Snippets Groups Projects
Commit 39cfebdc authored by Kamil Trzcinski's avatar Kamil Trzcinski
Browse files

Fixed specs

parent ee86182f
No related branches found
No related tags found
No related merge requests found
Loading
Loading
@@ -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
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment