Displaying 1 result from an estimated 1 matches for "mock_product".
2011 Jul 06
0
undefined method `assigns' and undefined method `post'
...now i got stuck with the error.. plz help
error:
undefined method `post'' for
#<Spec::Example::ExampleGroup::Subclass_1:0xb7754114>
undefined method `assigns'' for
#<Spec::Example::ExampleGroup::Subclass_1:0xb785d1b4>
Test file
describe "GET Index" do
def mock_product(stubs={})
@mock_user ||= mock_model(User, stubs).as_null_object
end
def setup
@user = User.new
end
please give me some help ..
thanks
Yennie
it "assigns all users as @users" do
@user.stub(:all){[mock_user]}
assigns(:users).should eq([mock_user])
end
end...