Created
April 13, 2012 22:52
-
-
Save hyperbolic-motion/2380657 to your computer and use it in GitHub Desktop.
Rspec: test factory works as advertised
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' | |
# ------------------------------------------------- | |
# Just build a model instance using a factory | |
# and assert that it is valid | |
# | |
# Model => model class | |
# @base_model => model instance | |
# :model => factory name | |
# | |
# Note: | |
# config.include FactoryGirl::Syntax::Methods | |
# must be in the spec_helper.rb | |
# ------------------------------------------------- | |
describe Model do | |
before do | |
@base_model = build(:model) | |
end | |
subject {@base_model} | |
it {should be_valid} | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment