2016-12-13 57 views
1

根据水豚的readme在Github上我有权要求豚/在我的spec_helper轨文件安装宝石后:为什么不我需要需要“水豚/轨”中spec_helper

require 'capybara/rails' 

但即使我离开了在spec_helper需要声明,我仍然可以使用下面的水豚语法:

scenario "successfully creates a new user account" do 
    visit "users#index" 
    fill_in "user_email", with: "[email protected]" 
    click_button "Create User" 
    expect(page).to have_content "User successfully created" 
    end 

是否有事可做与轨道摹RSpec的:install命令?我对语法的工作原因感到困惑;该应用程序如何知道?

回答

0

所有需要水豚/铁轨的人都会设置Capybara.app并将机架测试驱动程序配置为尊重链接上的任何data-method属性。除此之外,它不影响水豚。如果您已经以其他方式配置了Capybara.app,那么事情会正常工作。您可能还需要在您的rails_helper.rb而不是spec_helper.rb