mirror of
https://github.com/TracksApp/tracks.git
synced 2025-12-22 02:00:12 +01:00
Changes you will need to make: * In your environment.rb, you will need to update references to a few files per environment.rb.tmpl * In your environment.rb, you will need to specify the local time zone of the computer that is running your Tracks install. Other notes on my changes: * Modified our code to take advantage of Rails 2.1's slick time zone support. * Upgraded will_paginate for compatibility * Hacked the Selenium on Rails plugin, which has not been updated in some time and does not support Rails 2.1 * Verified that all tests pass on my machine, including Selenium tests -- I'd like confirmation from others, too.
44 lines
1.1 KiB
Ruby
44 lines
1.1 KiB
Ruby
require 'test/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 < Test::Unit::TestCase
|
|
SECRET_KEY_MIN_LENGTH = 128
|
|
APP_NAME = "foo"
|
|
|
|
def setup
|
|
@generator = Rails::SecretKeyGenerator.new(APP_NAME)
|
|
end
|
|
|
|
def test_secret_key_generation
|
|
assert @generator.generate_secret.length >= SECRET_KEY_MIN_LENGTH
|
|
end
|
|
|
|
Rails::SecretKeyGenerator::GENERATORS.each do |generator|
|
|
if Rails::SecretKeyGenerator.send("supports_#{generator}?")
|
|
define_method("test_secret_key_generation_with_#{generator}") do
|
|
assert @generator.send("generate_secret_with_#{generator}").length >= SECRET_KEY_MIN_LENGTH
|
|
end
|
|
end
|
|
end
|
|
end
|