Sha256: af2bfb7856e8d761fd6ea132499384029e84e787f52859787e442b5580e079d4

Contents?: true

Size: 912 Bytes

Versions: 5

Compression:

Stored size: 912 Bytes

Contents

require 'abstract_unit'

# Must set before requiring generator libs.
if defined?(RAILS_ROOT)
  RAILS_ROOT.replace "#{File.dirname(__FILE__)}/fixtures"
else
  RAILS_ROOT = "#{File.dirname(__FILE__)}/fixtures"
end

$LOAD_PATH.unshift "#{File.dirname(__FILE__)}/../lib"

require 'initializer'

# Mocks out the configuration
module Rails
  def self.configuration
    Rails::Configuration.new
  end
end

require 'rails_generator'
require 'rails_generator/secret_key_generator'
require 'rails_generator/generators/applications/app/app_generator'

class SecretKeyGenerationTest < ActiveSupport::TestCase
  SECRET_KEY_MIN_LENGTH = 128
  APP_NAME = "foo"

  def setup
    @generator = Rails::SecretKeyGenerator.new(APP_NAME)
  end

  def test_secret_key_generation
    assert_deprecated /ActiveSupport::SecureRandom\.hex\(64\)/ do
      assert @generator.generate_secret.length >= SECRET_KEY_MIN_LENGTH
    end
  end
end

Version data entries

5 entries across 5 versions & 3 rubygems

Version Path
kajam-1.0.3.rc2 vendor/rails/railties/test/secret_key_generation_test.rb
radiant-1.0.0.rc2 vendor/rails/railties/test/secret_key_generation_test.rb
radiant-1.0.0.rc1 vendor/rails/railties/test/secret_key_generation_test.rb
radiant-0.9.0.rc2 vendor/rails/railties/test/secret_key_generation_test.rb
usher-0.7.0 spec/rails2_3/vendor/rails/vendor/rails/railties/test/secret_key_generation_test.rb