Set db cleaning strategy to truncation when running epp tests

This commit is contained in:
Martin Lensment 2014-06-20 15:00:50 +03:00
parent b377fda73f
commit 120538bfed
6 changed files with 37 additions and 11 deletions

View file

@ -17,7 +17,6 @@ describe 'EPP Session', type: :epp do
it 'logs in epp user' do
response = Nokogiri::XML(server.send_request(read_body('login.xml')))
result = response.css('epp response result').first
expect(result[:code]).to eq('1000')

View file

@ -25,7 +25,27 @@ RSpec.configure do |config|
# If you're not using ActiveRecord, or you'd prefer not to run each of your
# examples within a transaction, remove the following line or assign false
# instead of true.
config.use_transactional_fixtures = true
config.use_transactional_fixtures = false
config.before(:suite) do
DatabaseCleaner.clean_with(:truncation)
end
config.before(:each) do
DatabaseCleaner.strategy = :transaction
end
config.before(:each, type: :epp) do
DatabaseCleaner.strategy = :truncation
end
config.before(:each) do
DatabaseCleaner.start
end
config.after(:each) do
DatabaseCleaner.clean
end
# RSpec Rails can automatically mix in different behaviours to your tests
# based on their file location, for example enabling you to call `get` and