Posts [ 3 ]

Topic: rails3 and rspec2 - no route matches

Hi, I have some problem with my fresh application based on ror 3.0.3. My rspec test for controller:

require 'spec_helper'
describe TasksController do
describe "GET #index" do
before(:each) do
@tasks = [mock_model(Task), mock_model(Task)]
Task.stub!(:all).and_return(@tasks)
get :index
end
it { assigns(:tasks).should eq(@tasks) }
it { assert_template("index")}
end
describe "GET #new" do
before(:each) do
get :new
end
it { assert_template("new")}
end
end