trek (owner)

Revisions

gist: 135558 Download_button fork
public
Public Clone URL: git://gist.github.com/135558.git
Ruby
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
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