Thank you very much for all your help, this made everything crystal clear!
--
View this message in context:
http://www.nabble.com/Setting-instance-variables-for-controllers-tp19283500p19295990.html
Sent from the rspec-users mailing list archive at Nabble.com.
__
On Sep 3, 2008, at 10:53 AM, Scott Taylor wrote:
On Sep 3, 2008, at 10:40 AM, Maurício Linhares wrote:
You don't need to set the instance variable, you can stub the find
call:
Or you could also stub the call to User::find.
Also - you don't *WANT* to set the instance variable - it's an
On Sep 3, 2008, at 10:40 AM, Maurício Linhares wrote:
You don't need to set the instance variable, you can stub the find
call:
Or you could also stub the call to User::find.
Also - you don't *WANT* to set the instance variable - it's an
encapsulation violation - there is nothing in the p
You don't need to set the instance variable, you can stub the find call:
describe CartController do
describe "index" do
before do
@user = mock_model( User )
end
it "should render 'cart_full' if @user is set" do
# This is where I need to set @user
User.stub!( :find ).with('
Hi everyone,
I have been trying to find an answer to this question and have not been able
to. Any help is greatly appreciated.
I am using Rails 2.1.0 and Rspec 1.1.4.
How can I set an instance variable in my Rspec test that is then available
to my controller while the test is running? For examp