Capybara Test Helpers

The perfect companion for your integration tests.
Icons/chart bar
Used 20 times
Created by
M Maximo Mussini

Usage
Capybara Test Helpers allows you to easily encapsulate logic in your integration tests.

Write tests that everyone can understand, and leverage your Ruby skills to keep them easy to read and easy to change.

Visit the documentation website to check out the guides, searchable API reference, and examples.

Run this command in your Rails app directory in the terminal:

rails app:template LOCATION="https://railsbytes.com/script/zyvs8Z"
Template Source

Review the code before running this template on your machine.

run 'spring stop'

gem_group :development, :test do
  gem "rspec-rails"
  gem 'capybara_test_helpers'
end

Bundler.with_unbundled_env { run "bundle install" }


rails_command "generate rspec:install"
rails_command "generate test_helper base"

inject_into_file 'spec/rails_helper.rb', after: "require 'spec_helper'" do <<~RB
require 'capybara_test_helpers/rspec'
require Rails.root.join('test_helpers/base_test_helper')

RB
end
Comments

Sign up or Login to leave a comment.