Revisions
-
Steven Harman revised this gist
Nov 1, 2012 . 1 changed file with 6 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -31,6 +31,11 @@ DatabaseCleaner.strategy = :truncation end # Reset so other non-request specs don't have to deal with slow truncation. config.after type: :request do DatabaseCleaner.strategy = :transaction end config.before do DatabaseCleaner.start WebMock.disable_net_connect!(:allow_localhost => true) @@ -43,4 +48,4 @@ Capybara.javascript_driver = :webkit Capybara.ignore_hidden_elements = false end -
Steven Harman revised this gist
Nov 1, 2012 . 2 changed files with 9 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -35,6 +35,11 @@ DatabaseCleaner.start end # Reset so other non-request specs don't have to deal with slow truncation. config.after type: :request do DatabaseCleaner.strategy = :transaction end config.before do WebMock.disable_net_connect!(:allow_localhost => true) ActionMailer::Base.deliveries.clear This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,3 +1,7 @@ config.before type: :request do DatabaseCleaner.strategy = :truncation end config.after type: :request do DatabaseCleaner.strategy = :transaction end -
stevenharman revised this gist
Apr 7, 2012 . 2 changed files with 0 additions and 4 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -7,8 +7,6 @@ require 'factory_girl' require 'factory_girl_rails' Dir[Rails.root.join("spec/support/**/*.rb")].each {|f| require f} RSpec.configure do |config| This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -7,8 +7,6 @@ require 'factory_girl' require 'factory_girl_rails' Dir[Rails.root.join("spec/support/**/*.rb")].each {|f| require f} RSpec.configure do |config| -
stevenharman revised this gist
Apr 6, 2012 . 7 changed files with 16 additions and 0 deletions.There are no files selected for viewing
File renamed without changes.File renamed without changes.This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1 @@ config.use_transactional_fixtures = false This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,4 @@ config.before :suite do DatabaseCleaner.strategy = :transaction DatabaseCleaner.clean_with(:truncation) end This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,3 @@ config.before type: :request do DatabaseCleaner.strategy = :truncation end This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,5 @@ config.before do DatabaseCleaner.start WebMock.disable_net_connect!(:allow_localhost => true) ActionMailer::Base.deliveries.clear end This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,3 @@ config.after do DatabaseCleaner.clean end -
stevenharman revised this gist
Apr 6, 2012 . 2 changed files with 2 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -12,7 +12,7 @@ Dir[Rails.root.join("spec/support/**/*.rb")].each {|f| require f} RSpec.configure do |config| config.use_transactional_fixtures = false config.infer_base_class_for_anonymous_controllers = false config.include JsonSpec::Helpers This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -13,7 +13,7 @@ RSpec.configure do |config| config.use_transactional_fixtures = false config.infer_base_class_for_anonymous_controllers = false config.include JsonSpec::Helpers -
stevenharman revised this gist
Apr 6, 2012 . 2 changed files with 0 additions and 6 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -32,9 +32,6 @@ # Request specs cannot use a transaction because Capybara runs in a # separate thread with a different database connection. config.before type: :request do DatabaseCleaner.strategy = :truncation DatabaseCleaner.start This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -29,9 +29,6 @@ # Request specs cannot use a transaction because Capybara runs in a # separate thread with a different database connection. config.before type: :request do DatabaseCleaner.strategy = :truncation end -
stevenharman created this gist
Apr 6, 2012 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,56 @@ ENV["RAILS_ENV"] ||= 'test' require File.expand_path("../../config/environment", __FILE__) require 'rspec/rails' require 'rspec/autorun' require 'capybara/rspec' require 'webmock/rspec' require 'factory_girl' require 'factory_girl_rails' # Requires supporting ruby files with custom matchers and macros, etc, # in spec/support/ and its subdirectories. Dir[Rails.root.join("spec/support/**/*.rb")].each {|f| require f} RSpec.configure do |config| config.use_transactional_fixtures = false # database_cleaner handles this config.infer_base_class_for_anonymous_controllers = false config.include JsonSpec::Helpers config.include LoginHelper, type: :request config.include ActivitySpecHelper, type: :request config.include RoomSpecHelper, type: :request config.include AutocompleteSpecHelper, type: :request config.before :suite do DatabaseCleaner.clean_with :truncation end config.before type: :model do DatabaseCleaner.strategy = :transaction DatabaseCleaner.start end # Request specs cannot use a transaction because Capybara runs in a # separate thread with a different database connection. # # We tried <http://blog.plataformatec.com.br/2011/12/three-tips-to-improve-the-performance-of-your-test-suite/>, # but were still seeing test pollution. config.before type: :request do DatabaseCleaner.strategy = :truncation DatabaseCleaner.start end config.before do WebMock.disable_net_connect!(:allow_localhost => true) ActionMailer::Base.deliveries.clear end config.after do Timecop.return DatabaseCleaner.clean end end Capybara.javascript_driver = :webkit Capybara.default_wait_time = 5 Capybara.ignore_hidden_elements = false This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,51 @@ ENV["RAILS_ENV"] ||= 'test' require File.expand_path("../../config/environment", __FILE__) require 'rspec/rails' require 'rspec/autorun' require 'capybara/rspec' require 'webmock/rspec' require 'factory_girl' require 'factory_girl_rails' # Requires supporting ruby files with custom matchers and macros, etc, # in spec/support/ and its subdirectories. Dir[Rails.root.join("spec/support/**/*.rb")].each {|f| require f} RSpec.configure do |config| config.use_transactional_fixtures = false # database_cleaner handles this config.infer_base_class_for_anonymous_controllers = false config.include JsonSpec::Helpers config.include LoginHelper, type: :request config.include ActivitySpecHelper, type: :request config.include RoomSpecHelper, type: :request config.include AutocompleteSpecHelper, type: :request config.before :suite do DatabaseCleaner.strategy = :transaction DatabaseCleaner.clean_with(:truncation) end # Request specs cannot use a transaction because Capybara runs in a # separate thread with a different database connection. # # We tried <http://blog.plataformatec.com.br/2011/12/three-tips-to-improve-the-performance-of-your-test-suite/>, # but were still seeing test pollution. config.before type: :request do DatabaseCleaner.strategy = :truncation end config.before do DatabaseCleaner.start WebMock.disable_net_connect!(:allow_localhost => true) ActionMailer::Base.deliveries.clear end config.after do DatabaseCleaner.clean end Capybara.javascript_driver = :webkit Capybara.ignore_hidden_elements = false end