Created
December 19, 2012 18:35
-
-
Save luisalima/4339197 to your computer and use it in GitHub Desktop.
Testing models without vs. with shoulda
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
# without shoulda... tons of code :-) | |
it "should belong to person" do | |
Model.reflect_on_association(:person).macro.should == :belongs_to | |
end | |
# with shoulda... one-liner! | |
it{should belong_to(:person)} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment