Last active
August 29, 2015 13:57
-
-
Save rockwood/9419760 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'spec_helper' | |
describe Assignment do | |
describe "#percentage" do | |
specify do | |
assignment = Assignment.new(score: 5, total: 10) | |
expect(assignment.percentage).to eq(50) | |
end | |
end | |
describe ".average" do | |
specify do | |
assignment1 = Assignment.create(score: 8, total: 10) | |
assignment2 = Assignment.create(score: 4, total: 10) | |
expect(Assignment.average_percentage).to eq(60) | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment