diff --git a/config/database.yml b/config/database.yml index ad7d699..742c84b 100644 --- a/config/database.yml +++ b/config/database.yml @@ -11,7 +11,7 @@ development: # Do not set this db to the same as development or production. test: &test adapter: sqlite3 - database: db/test.sqlite3 + database: ':memory:' pool: 5 timeout: 5000 @@ -22,4 +22,4 @@ production: timeout: 5000 cucumber: - <<: *test \ No newline at end of file + <<: *test diff --git a/features/support/env.rb b/features/support/env.rb index 6c40c8f..9066d1b 100644 --- a/features/support/env.rb +++ b/features/support/env.rb @@ -48,3 +48,5 @@ end # DatabaseCleaner.strategy = :transaction # end # + +load "#{Rails.root.to_s}/db/schema.rb" diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index 9b8b02c..0918c69 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -1,27 +1,16 @@ # This file is copied to spec/ when you run 'rails generate rspec:install' -ENV["RAILS_ENV"] ||= 'test' -require File.expand_path("../../config/environment", __FILE__) +ENV['RAILS_ENV'] ||= 'test' +require File.expand_path('../../config/environment', __FILE__) require 'rspec/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} +Dir[Rails.root.join('spec/support/**/*.rb')].each {|f| require f} RSpec.configure do |config| - # == Mock Framework - # - # If you prefer to use mocha, flexmock or RR, uncomment the appropriate line: - # - # config.mock_with :mocha - # config.mock_with :flexmock - # config.mock_with :rr config.mock_with :rspec - - # Remove this line if you're not using ActiveRecord or ActiveRecord fixtures config.fixture_path = "#{::Rails.root}/spec/fixtures" - - # 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 end + +load "#{Rails.root.to_s}/db/schema.rb" diff --git a/spec/support/decrease_bcrypt_cost_factor.rb b/spec/support/decrease_bcrypt_cost_factor.rb new file mode 100644 index 0000000..0099be0 --- /dev/null +++ b/spec/support/decrease_bcrypt_cost_factor.rb @@ -0,0 +1,8 @@ +module BCrypt + class Engine + [:DEFAULT_COST, :MIN_COST].each do |sym| + remove_const sym + const_set sym, 1 + end + end +end