On Jun 17, 2011, at 2:20 PM, Kai Schlamp wrote:
> Here is also the spec helper I use for my integration tests:
>
> ENV["RAILS_ENV"] ||= 'test'
> require File.expand_path("../../config/environment", __FILE__)
> require 'rspec/rails'
> require 'webrat'
> require 'capybara/rspec'
> require "database_cleaner"
>
> Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each {|f| require f}
>
> RSpec.configure do |config|
> config.filter_run :focus => true
> config.run_all_when_everything_filtered = true
> config.filter_run_excluding :exclude => true
> config.use_transactional_fixtures = false
> config.mock_with :rspec
>
> config.before(:all) do
> DatabaseCleaner.strategy = :truncation
> DatabaseCleaner.clean
> end
>
> config.after(:each) do
> DatabaseCleaner.clean
> Sunspot.remove_all!
> end
> end
>
> Webrat.configure do |config|
> config.mode = :rails
> end
Webrat and Capybara are not compatible, as they each do similar things in
different ways. This wasn't a visible issue in rspec-rails-2.5 because capybara
was only mixed in to request specs, but 2.6 mixes it into view and helper specs
as well.
HTH,
David
_______________________________________________
rspec-users mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/rspec-users