mirror of
https://github.com/TracksApp/tracks.git
synced 2026-02-28 18:10:15 +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,5 +1,5 @@
|
|||
require File.dirname(__FILE__) + '/../abstract_unit'
|
||||
require File.dirname(__FILE__) + '/fake_models'
|
||||
require 'abstract_unit'
|
||||
require 'controller/fake_models'
|
||||
|
||||
module Fun
|
||||
class GamesController < ActionController::Base
|
||||
|
|
@ -20,6 +20,18 @@ class TestController < ActionController::Base
|
|||
render :template => "test/hello_world"
|
||||
end
|
||||
|
||||
def render_hello_world_with_forward_slash
|
||||
render :template => "/test/hello_world"
|
||||
end
|
||||
|
||||
def render_template_in_top_directory
|
||||
render :template => 'shared'
|
||||
end
|
||||
|
||||
def render_template_in_top_directory_with_slash
|
||||
render :template => '/shared'
|
||||
end
|
||||
|
||||
def render_hello_world_from_variable
|
||||
@person = "david"
|
||||
render :text => "hello #{@person}"
|
||||
|
|
@ -57,6 +69,20 @@ class TestController < ActionController::Base
|
|||
render :text => "hello world", :status => 404
|
||||
end
|
||||
|
||||
def render_custom_code_rjs
|
||||
render :update, :status => 404 do |page|
|
||||
page.replace :foo, :partial => 'partial'
|
||||
end
|
||||
end
|
||||
|
||||
def render_text_with_nil
|
||||
render :text => nil
|
||||
end
|
||||
|
||||
def render_text_with_false
|
||||
render :text => false
|
||||
end
|
||||
|
||||
def render_nothing_with_appendix
|
||||
render :text => "appended"
|
||||
end
|
||||
|
|
@ -74,6 +100,15 @@ class TestController < ActionController::Base
|
|||
render :xml => "<blah/>", :content_type => "application/atomsvc+xml"
|
||||
end
|
||||
|
||||
def render_line_offset
|
||||
begin
|
||||
render :inline => '<% raise %>', :locals => {:foo => 'bar'}
|
||||
rescue => exc
|
||||
end
|
||||
line = exc.backtrace.first
|
||||
render :text => line
|
||||
end
|
||||
|
||||
def heading
|
||||
head :ok
|
||||
end
|
||||
|
|
@ -119,14 +154,6 @@ class TestController < ActionController::Base
|
|||
:locals => { :local_name => name }
|
||||
end
|
||||
|
||||
def accessing_local_assigns_in_inline_template_with_string_keys
|
||||
name = params[:local_name]
|
||||
ActionView::Base.local_assigns_support_string_keys = true
|
||||
render :inline => "<%= 'Goodbye, ' + local_name %>",
|
||||
:locals => { "local_name" => name }
|
||||
ActionView::Base.local_assigns_support_string_keys = false
|
||||
end
|
||||
|
||||
def formatted_html_erb
|
||||
end
|
||||
|
||||
|
|
@ -213,6 +240,30 @@ class RenderTest < Test::Unit::TestCase
|
|||
assert_template "test/hello_world"
|
||||
end
|
||||
|
||||
def test_line_offset
|
||||
get :render_line_offset
|
||||
line = @response.body
|
||||
assert(line =~ %r{:(\d+):})
|
||||
assert_equal "1", $1
|
||||
end
|
||||
|
||||
def test_render_with_forward_slash
|
||||
get :render_hello_world_with_forward_slash
|
||||
assert_template "test/hello_world"
|
||||
end
|
||||
|
||||
def test_render_in_top_directory
|
||||
get :render_template_in_top_directory
|
||||
assert_template "shared"
|
||||
assert_equal "Elastica", @response.body
|
||||
end
|
||||
|
||||
def test_render_in_top_directory_with_slash
|
||||
get :render_template_in_top_directory_with_slash
|
||||
assert_template "shared"
|
||||
assert_equal "Elastica", @response.body
|
||||
end
|
||||
|
||||
def test_render_from_variable
|
||||
get :render_hello_world_from_variable
|
||||
assert_equal "hello david", @response.body
|
||||
|
|
@ -263,6 +314,23 @@ class RenderTest < Test::Unit::TestCase
|
|||
assert_equal 'hello world', @response.body
|
||||
end
|
||||
|
||||
def test_render_custom_code_rjs
|
||||
get :render_custom_code_rjs
|
||||
assert_response 404
|
||||
assert_equal %(Element.replace("foo", "partial html");), @response.body
|
||||
end
|
||||
|
||||
def test_render_text_with_nil
|
||||
get :render_text_with_nil
|
||||
assert_response 200
|
||||
assert_equal '', @response.body
|
||||
end
|
||||
|
||||
def test_render_text_with_false
|
||||
get :render_text_with_false
|
||||
assert_equal 'false', @response.body
|
||||
end
|
||||
|
||||
def test_render_nothing_with_appendix
|
||||
get :render_nothing_with_appendix
|
||||
assert_response 200
|
||||
|
|
@ -343,11 +411,6 @@ class RenderTest < Test::Unit::TestCase
|
|||
assert_equal "Goodbye, Local David", @response.body
|
||||
end
|
||||
|
||||
def test_accessing_local_assigns_in_inline_template_with_string_keys
|
||||
get :accessing_local_assigns_in_inline_template_with_string_keys, :local_name => "Local David"
|
||||
assert_equal "Goodbye, Local David", @response.body
|
||||
end
|
||||
|
||||
def test_render_200_should_set_etag
|
||||
get :render_hello_world_from_variable
|
||||
assert_equal etag_for("hello david"), @response.headers['ETag']
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue