从 Rspec - Controllers 运行以下代码后,我从该get
方法中得到一个错误
it "assigns @MyItems" do
my_item = mock(:mypay_items)
my_item = mock( MyItem)
MyItem.should_receive(:all).and_return(my)
get 'index'
assigns[:my_items].should eql(my_items)
response.should be_success
end
这会导致错误:
undefined method `get' for #<RSpec::Core::ExampleGroup::Nested_1:0x34b6ae0>