require 'test_helper'

class MovieReviewsIntegrationTest < ActionController::IntegrationTest
  fixtures :movies, :reviews
  def test_should_create_review
    get '/movies/reviews/new'
    assert_difference('Review.count') do
      post 'movies/reviews/create', :review => { :reviewer_name => 'Jake', :review_text => 'mesmerizing'}, 
           :movie_id => movies(:dune).id
    end       
    assert_redirected_to "movies/reviews/#{assigns(:review).id}"
    follow_redirect!
    assert_select /mesm/
  end  
end  