Advertisement
saasbook

spec_using_factory.rb

Feb 13th, 2016
252
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 0.30 KB | None | 0 0
  1. # in spec/models/movie_spec.rb
  2. describe Movie do
  3.   it 'should include rating and year in full name' do
  4.     # 'build' creates but doesn't save object; 'create' also saves it
  5.     movie = FactoryGirl.build(:movie, :title => 'Milk', :rating => 'R')
  6.     expect(movie.name_with_rating).to eq 'Milk (R)'
  7.   end
  8. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement