require File.dirname(__FILE__) + '/../spec_helper' describe RegistrationsController do before(:all) do Registration = mock(Class) end describe "new" do before(:each) do @mock_registration = mock(Registration) Registration.should_receive(:new).and_return(@mock_registration) get(:new, :course_id => '1') end it { should assign_to(:registration).with(@mock_registration) } it { should render_template(:new) } it { should respond_with(:success) } end end describe RegistrationsController, 'routing' do it { should route(:get, '/rails-july-2009/new').to(:action => 'new', :course_id => 'rails-july-2009') } end