1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00
rails--rails/activemodel/test/cases/railtie_test.rb
Carlos Antonio da Silva 26a3b70cc4 Merge pull request #8320 from senny/active_model_log_folder
Log output from activemodel's railtie_test directly to STDOUT.

There's no logging going on here, but since we initialize the app, the
logger is set and the folder is automatically created. With this change,
the default logger is not created, so there is no logging folder anymore.

Conflicts:
	activemodel/test/cases/railtie_test.rb
2012-11-26 15:32:25 -02:00

29 lines
719 B
Ruby

require 'cases/helper'
require 'active_support/testing/isolation'
class RailtieTest < ActiveModel::TestCase
include ActiveSupport::Testing::Isolation
def setup
require 'active_model/railtie'
@app ||= Class.new(::Rails::Application) do
config.eager_load = false
config.logger = Logger.new(STDOUT)
end
end
test 'secure password min_cost is false in the development environment' do
Rails.env = 'development'
@app.initialize!
assert_equal false, ActiveModel::SecurePassword.min_cost
end
test 'secure password min_cost is true in the test environment' do
Rails.env = 'test'
@app.initialize!
assert_equal true, ActiveModel::SecurePassword.min_cost
end
end