mirror of
https://github.com/TracksApp/tracks.git
synced 2026-02-19 21:58:09 +01:00
Upgraded to Rails 2.1. This can have wide ranging consequences, so please help track down any issues introduced by the upgrade. Requires environment.rb modifications.
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.
This commit is contained in:
parent
f3bae73868
commit
901a58f8a3
1086 changed files with 51452 additions and 19526 deletions
|
|
@ -1,8 +1,8 @@
|
|||
require "#{File.dirname(__FILE__)}/../abstract_unit"
|
||||
require 'abstract_unit'
|
||||
require 'action_view/helpers/benchmark_helper'
|
||||
|
||||
class BenchmarkHelperTest < Test::Unit::TestCase
|
||||
include ActionView::Helpers::BenchmarkHelper
|
||||
class BenchmarkHelperTest < ActionView::TestCase
|
||||
tests ActionView::Helpers::BenchmarkHelper
|
||||
|
||||
class MockLogger
|
||||
attr_reader :logged
|
||||
|
|
@ -16,32 +16,20 @@ class BenchmarkHelperTest < Test::Unit::TestCase
|
|||
end
|
||||
end
|
||||
|
||||
def setup
|
||||
@logger = MockLogger.new
|
||||
end
|
||||
|
||||
def test_without_logger_or_block
|
||||
@logger = nil
|
||||
assert_nothing_raised { benchmark }
|
||||
def controller
|
||||
@controller ||= Struct.new(:logger).new(MockLogger.new)
|
||||
end
|
||||
|
||||
def test_without_block
|
||||
assert_raise(LocalJumpError) { benchmark }
|
||||
assert @logger.logged.empty?
|
||||
end
|
||||
|
||||
def test_without_logger
|
||||
@logger = nil
|
||||
i_was_run = false
|
||||
benchmark { i_was_run = true }
|
||||
assert !i_was_run
|
||||
assert controller.logger.logged.empty?
|
||||
end
|
||||
|
||||
def test_defaults
|
||||
i_was_run = false
|
||||
benchmark { i_was_run = true }
|
||||
assert i_was_run
|
||||
assert 1, @logger.logged.size
|
||||
assert 1, controller.logger.logged.size
|
||||
assert_last_logged
|
||||
end
|
||||
|
||||
|
|
@ -49,7 +37,7 @@ class BenchmarkHelperTest < Test::Unit::TestCase
|
|||
i_was_run = false
|
||||
benchmark('test_run') { i_was_run = true }
|
||||
assert i_was_run
|
||||
assert 1, @logger.logged.size
|
||||
assert 1, controller.logger.logged.size
|
||||
assert_last_logged 'test_run'
|
||||
end
|
||||
|
||||
|
|
@ -57,13 +45,13 @@ class BenchmarkHelperTest < Test::Unit::TestCase
|
|||
i_was_run = false
|
||||
benchmark('debug_run', :debug) { i_was_run = true }
|
||||
assert i_was_run
|
||||
assert 1, @logger.logged.size
|
||||
assert 1, controller.logger.logged.size
|
||||
assert_last_logged 'debug_run', :debug
|
||||
end
|
||||
|
||||
private
|
||||
def assert_last_logged(message = 'Benchmarking', level = :info)
|
||||
last = @logger.logged.last
|
||||
last = controller.logger.logged.last
|
||||
assert 2, last.size
|
||||
assert_equal level, last.first
|
||||
assert 1, last[1].size
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue