aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack
diff options
context:
space:
mode:
authorDavid Heinemeier Hansson <david@loudthinking.com>2005-02-23 15:05:04 +0000
committerDavid Heinemeier Hansson <david@loudthinking.com>2005-02-23 15:05:04 +0000
commitfd6abf0a59c91717ce30f5728ee6150184241d78 (patch)
treeeb573a0388ece86e584147b3b650ea2236ee4815 /actionpack
parent41ea6963a38880e47dbc1cd75dd91a1df184ba66 (diff)
downloadrails-fd6abf0a59c91717ce30f5728ee6150184241d78.tar.gz
rails-fd6abf0a59c91717ce30f5728ee6150184241d78.tar.bz2
rails-fd6abf0a59c91717ce30f5728ee6150184241d78.zip
Fixed tests
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@767 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'actionpack')
-rw-r--r--actionpack/test/template/form_options_helper_test.rb4
-rw-r--r--actionpack/test/template/url_helper_test.rb7
2 files changed, 8 insertions, 3 deletions
diff --git a/actionpack/test/template/form_options_helper_test.rb b/actionpack/test/template/form_options_helper_test.rb
index 606a5fe35b..83edcb8637 100644
--- a/actionpack/test/template/form_options_helper_test.rb
+++ b/actionpack/test/template/form_options_helper_test.rb
@@ -1,7 +1,7 @@
require 'test/unit'
require File.dirname(__FILE__) + '/../../lib/action_view/helpers/form_options_helper'
-class TimeZone
+class MockTimeZone
attr_reader :name
def initialize( name )
@@ -21,6 +21,8 @@ class TimeZone
end
end
+ActionView::Helpers::FormOptionsHelper::TimeZone = MockTimeZone
+
class FormOptionsHelperTest < Test::Unit::TestCase
include ActionView::Helpers::FormOptionsHelper
diff --git a/actionpack/test/template/url_helper_test.rb b/actionpack/test/template/url_helper_test.rb
index cb0e3fe2e2..6e94d98ebe 100644
--- a/actionpack/test/template/url_helper_test.rb
+++ b/actionpack/test/template/url_helper_test.rb
@@ -2,6 +2,8 @@ require 'test/unit'
require File.dirname(__FILE__) + '/../../lib/action_view/helpers/url_helper'
require File.dirname(__FILE__) + '/../../lib/action_view/helpers/tag_helper'
+RequestMock = Struct.new("Request", :request_uri)
+
class UrlHelperTest < Test::Unit::TestCase
include ActionView::Helpers::UrlHelper
include ActionView::Helpers::TagHelper
@@ -40,11 +42,12 @@ class UrlHelperTest < Test::Unit::TestCase
end
def test_link_unless_current
- @params = { "controller" => "weblog", "action" => "show"}
+ @request = RequestMock.new("http://www.world.com")
assert_equal "Showing", link_to_unless_current("Showing", :action => "show", :controller => "weblog")
+ @request = RequestMock.new("http://www.notworld.com")
assert "<a href=\"http://www.world.com\">Listing</a>", link_to_unless_current("Listing", :action => "list", :controller => "weblog")
- @params = { "controller" => "weblog", "action" => "show", "id" => "1"}
+ @request = RequestMock.new("http://www.world.com")
assert_equal "Showing", link_to_unless_current("Showing", :action => "show", :controller => "weblog", :id => 1)
end