Created
March 15, 2012 21:22
-
-
Save nazgob/2047053 to your computer and use it in GitHub Desktop.
should test your models like a pro
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
should validate_presence_of(:name) | |
should ensure_length_of(:name).is_at_most(15) | |
should ensure_length_of(:name).is_at_least(5) | |
should ensure_length_of(:name).is_at_least(5).is_at_most(15) | |
should have_many(:tweets) | |
should validate_uniqueness_of(:name) | |
should validate_numericality_of(:age) | |
should_not allow_value("wutlol").for(:email) | |
should allow_value("[email protected]").for(:email) | |
should ensure_inclusion_of(:age).in_range(1..100) | |
should_not allow_mass_assignment_of(:password) | |
should belong_to(:me) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment