我有一些使用 rails spec
(以及capybara
and factory girl
)的测试并且通过就好了
describe "project creation" do
before(:each) do
@project = FactoryGirl.create(:project)
end
it "create projects fluently" do
visit root_path
@project.should validate_presence_of(:title)
end
end
然后我安装了spring
,当我运行时spring rspec spec/features/projects_spec.rb
,它会抛出
Failure/Error: @project.should validate_presence_of(:title)
NoMethodError:
undefined method `validate_presence_of' for #<RSpec::Core::ExampleGroup...
怎么会这样