开发者

RSpec2 model class collision with Capybara class

I have a model class named "Driver" in my project. After trying to do some tes开发者_开发知识库ts, Rspec threw this error:

NoMethodError: undefined method `create!' for Capybara::Driver:Module

So I think there's a problem in the way RSpec detects the classes or something. Here's the spec (simplified obviously):

require 'spec_helper'

describe Driver do
    it "works! a driver can be created!" do
      Driver.create!
    end
end

I'm using

rspec-* (2.0.0)
capybara (0.4.0)
rails (3.0.0)

Anyone faced something similar?


I think you should be able to do this instead and remove the collision:

describe "::Driver" do
end
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜