Created
February 14, 2014 18:25
-
-
Save stevedev/9006256 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
describe "testing mah scopes" do | |
before do | |
People.destroy_all | |
end | |
let!(:senior) { create(:person, age: 77) } | |
let!(:teen) { create(:person, age: 16) } | |
describe ".seniors" do | |
it "should return all seniors" do | |
people = Person.seniors.all | |
people.should include senior | |
people.should_not include teen | |
end | |
end | |
describe ".teens" do | |
it "should return seniors again" do | |
people = Person.teens.all | |
people.should include teen | |
people.should_not include senior | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment