use database_cleaner (#12822)
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11974 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
parent
b29288c50a
commit
17378152bf
1
Gemfile
1
Gemfile
|
@ -82,6 +82,7 @@ group :test do
|
||||||
if RUBY_VERSION >= '1.9.3'
|
if RUBY_VERSION >= '1.9.3'
|
||||||
gem "capybara", "~> 2.1.0"
|
gem "capybara", "~> 2.1.0"
|
||||||
gem "selenium-webdriver"
|
gem "selenium-webdriver"
|
||||||
|
gem "database_cleaner"
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -30,6 +30,8 @@ Capybara.register_driver :selenium do |app|
|
||||||
Capybara::Selenium::Driver.new(app, :browser => :remote)
|
Capybara::Selenium::Driver.new(app, :browser => :remote)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
DatabaseCleaner.strategy = :truncation
|
||||||
|
|
||||||
module Redmine
|
module Redmine
|
||||||
module UiTest
|
module UiTest
|
||||||
# Base class for UI tests
|
# Base class for UI tests
|
||||||
|
@ -60,6 +62,7 @@ module Redmine
|
||||||
teardown do
|
teardown do
|
||||||
Capybara.reset_sessions! # Forget the (simulated) browser state
|
Capybara.reset_sessions! # Forget the (simulated) browser state
|
||||||
Capybara.use_default_driver # Revert Capybara.current_driver to Capybara.default_driver
|
Capybara.use_default_driver # Revert Capybara.current_driver to Capybara.default_driver
|
||||||
|
DatabaseCleaner.clean
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue