Ruby on rails Rails 3使用Rspec、嵌套资源和继承的资源获取错误的模拟模型

Ruby on rails Rails 3使用Rspec、嵌套资源和继承的资源获取错误的模拟模型,ruby-on-rails,testing,rspec,rspec2,inherited-resources,Ruby On Rails,Testing,Rspec,Rspec2,Inherited Resources,我正在尝试使用Rspec和模拟模型测试嵌套控制器,但出现以下错误: Failure/Error: it { assigns[:store].should equal(mock_store) } expected #<Store:2198414660> => #<Store:0x83092544 @name="Store_1008"> got #<User:2198383140> => #<User:0x8308aa24

我正在尝试使用Rspec和模拟模型测试嵌套控制器,但出现以下错误:

Failure/Error: it { assigns[:store].should equal(mock_store) } 
   expected #<Store:2198414660> => #<Store:0x83092544 @name="Store_1008">
        got #<User:2198383140> => #<User:0x8308aa24 @name="User_1009">
app/controllers/api/v1/stores_controller.rb

class Api::V1::StoresController < Api::ApiController
  belongs_to :user
  actions :all
end
谢谢你抽出时间

class Api::V1::StoresController < Api::ApiController
  belongs_to :user
  actions :all
end
class Api::ApiController < InheritedResources::Base
  respond_to :json
end
* inherited_resources (1.2.2)
* rails (3.0.7)
* rspec (2.5.0)
* rspec-core (2.5.2)
* rspec-expectations (2.5.0)
* rspec-mocks (2.5.0)
* rspec-rails (2.5.0)