Advertisement
saasbook

rspec_summary_example.rb

Jan 10th, 2012
219
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 0.45 KB | None | 0 0
  1. require 'spec_helper'
  2. # always required for Rails apps - in spec/support/spec_helper.rb
  3.  
  4. describe MoviesController do # outermost 'describe' usually for the class
  5.   describe 'creating new movie' do # inner 'describe' for a method
  6.     before(:each) do
  7.       # executed before EACH example
  8.       @submit = {:title => 'Milk', :rating => 'R'}
  9.     end
  10.     it 'should call Movie#create!' do
  11.       Movie.should_receive(:create!).with(hash_including :title => 'Milk')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement