I have an error of undefined method.
can anyone help me to solve it.
I follow the tutorial to practicing testing controller of rails, and
now i got stuck with the error… plz help
describe “UserController” do
describe “GET index” do
it “should be successful” do
get ‘index’
response.should be_success
end
it "render the index template" do
get :index
response.should render_template('index')
end
it "assigns all users as @users" do
u = Factory(:user)
get :index
assigns[:users].should == [p]
end
end
end
it gives the the require error. However. I have a spec_helper.rb in
the spec dicrectory… kind of confusing
I have an error of undefined method.
can anyone help me to solve it.
I follow the tutorial to practicing testing controller of rails, and
now i got stuck with the error… plz help
rspec probably doesn’t understand that you’re testing a controller.
if your spec file looks like
require ‘spec_helper’
describe SomeController do
…
end
then it should detect that you’re speccing a controller
Fred
describe “UserController” do
describe “GET index” do
it “should be successful” do
get ‘index’
response.should be_success
end
it "render the index template" do
get :index
response.should render_template('index')
end
it "assigns all users as @users" do
u = Factory(:user)
get :index
assigns[:users].should == [p]
end
end
end
but i gives me error of require (first line), However I have
spec_helper.rb in spec directory
plzz help
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.