How to resolve Rails model namespace collision

后端 未结 3 1058
别跟我提以往
别跟我提以往 2020-12-15 00:36

The story so far:

I have a rails app with a model named \"Term\". All is well until trying to install Cucumber. Upon running

rake cucumber

3条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2020-12-15 01:05

    I did get a namespace collision with my application model Node and Capybara::Node in my specs. It was sufficient for me to explicitly state toplevel namespace in specs to fix the problem:

    it "should find the specified node scoped under the current user" do
      ::Node.should have_received(:find_by_id_for_user).with(node.id, user)
    end
    

提交回复
热议问题