diff options
Diffstat (limited to 'spec/support')
-rw-r--r-- | spec/support/database_cleaner.rb | 15 | ||||
-rw-r--r-- | spec/support/devise.rb | 8 | ||||
-rw-r--r-- | spec/support/refinery.rb | 8 |
3 files changed, 31 insertions, 0 deletions
diff --git a/spec/support/database_cleaner.rb b/spec/support/database_cleaner.rb new file mode 100644 index 0000000..a104c53 --- /dev/null +++ b/spec/support/database_cleaner.rb @@ -0,0 +1,15 @@ +require 'database_cleaner' + +RSpec.configure do |config| + config.before(:suite) do + DatabaseCleaner.strategy = :truncation + end + + config.before(:each) do + DatabaseCleaner.start + end + + config.after(:each) do + DatabaseCleaner.clean + end +end diff --git a/spec/support/devise.rb b/spec/support/devise.rb new file mode 100644 index 0000000..9dc6823 --- /dev/null +++ b/spec/support/devise.rb @@ -0,0 +1,8 @@ +require 'devise' + +RSpec.configure do |config| + config.mock_with :rspec + config.use_transactional_fixtures = false + + config.include Devise::TestHelpers, :type => :controller +end diff --git a/spec/support/refinery.rb b/spec/support/refinery.rb new file mode 100644 index 0000000..2b180db --- /dev/null +++ b/spec/support/refinery.rb @@ -0,0 +1,8 @@ +require 'refinery/testing/factories' +require 'refinery/testing/controller_macros' +require 'refinery/testing/request_macros' + +RSpec.configure do |config| + config.extend Refinery::ControllerMacros::Authentication, :type => :controller + config.extend Refinery::RequestMacros::Authentication, :type => :request +end |