Skip to content

Latest commit

 

History

History
55 lines (35 loc) · 1.15 KB

README.rst

File metadata and controls

55 lines (35 loc) · 1.15 KB

How do I ...

Use suspenders:

$ gem install suspenders
$ suspenders the-name-of-your-project-here
$ cd the-name-of-your-project-here/
$ bin/setup
$ rake

Use capybara-webkit. In your Gemfile:

gem "capybara-webkit"

In spec/support/capybara_webkit.rb (for Rspec):

Capybara.javascript_driver = :webkit

Capybara::Webkit.configure do |config|
  config.block_unknown_urls
end

When writing a spec, you must set the :js flag for that test to make use of capybara-webkit. For example, in spec/features/user_signs_in_spec.rb:

feature "Authentication", :js do
  scenario "A user signing in" do
    create(:user, email: "[email protected]", password: "sekrit")

    sign_in_as email: "[email protected]", password: "sekrit"

    expect(page).to have_text("Welcome!")
  end
end