Add feature testing support

This commit is contained in:
Martin Lensment 2014-08-18 12:26:55 +03:00
parent eaa9b015e2
commit d9240aa4f8
12 changed files with 123 additions and 37 deletions

View file

@ -4,6 +4,7 @@ require 'spec_helper'
require File.expand_path("../../config/environment", __FILE__)
require 'rspec/rails'
require 'shoulda/matchers'
require 'capybara/poltergeist'
# Requires supporting ruby files with custom matchers and macros, etc, in
# spec/support/ and its subdirectories. Files matching `spec/**/*_spec.rb` are
@ -39,6 +40,10 @@ RSpec.configure do |config|
DatabaseCleaner.strategy = :truncation
end
config.before(:each, js: true) do
DatabaseCleaner.strategy = :truncation
end
config.before(:each) do
DatabaseCleaner.start
end
@ -47,6 +52,8 @@ RSpec.configure do |config|
DatabaseCleaner.clean
end
Capybara.javascript_driver = :poltergeist
# RSpec Rails can automatically mix in different behaviours to your tests
# based on their file location, for example enabling you to call `get` and
# `post` in specs under `spec/controllers`.