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
精彩评论