Equivalent scrapbook

…note on Rspec

#shoulda mathchers in shoulda note


http://cheat.errtheblog.com/s/rspec/


group :test, :development do
  gem "rspec-rails", "~> 2.6"
end

rails g rspec:install
rails g rspec:model platform

###the file##

require 'spec_helper'

describe Something do
  fixtures :platforms


end


###  factory ### 

FactoryGirl.define do

  factory :junk_food, :class => Category do
     title 'Junk Food'
  end

end

# Factory.define :comment do |c| 
#   c.body { Faker::Lorem.paragraph } 
# end

Factory.create :comment


it "must have a last name" do
    subject.should have(1).error_on(:last_name)
end