Permalink
Browse files

Trick tests on url_for

git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@66 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
  • Loading branch information...
1 parent 8e4edec commit 1e4a936bd08f330062fedf2a32110f23ade0a322 @dhh dhh committed Dec 7, 2004
Showing with 9 additions and 0 deletions.
  1. +9 −0 actionpack/test/template/active_record_helper_test.rb
@@ -3,13 +3,15 @@
require File.dirname(__FILE__) + '/../../lib/action_view/helpers/form_helper'
require File.dirname(__FILE__) + '/../../lib/action_view/helpers/text_helper'
require File.dirname(__FILE__) + '/../../lib/action_view/helpers/tag_helper'
+require File.dirname(__FILE__) + '/../../lib/action_view/helpers/url_helper'
# require File.dirname(__FILE__) + '/../../lib/action_view/helpers/active_record_helper'
class ActiveRecordHelperTest < Test::Unit::TestCase
include ActionView::Helpers::FormHelper
include ActionView::Helpers::ActiveRecordHelper
include ActionView::Helpers::TextHelper
include ActionView::Helpers::TagHelper
+ include ActionView::Helpers::UrlHelper
Post = Struct.new("Post", :title, :author_name, :body, :secret, :written_on)
Column = Struct.new("Column", :type, :name, :human_name)
@@ -38,6 +40,13 @@ def Post.content_columns() [ Column.new(:string, "title", "Title"), Column.new(:
@post.body = "Back to the hill and over it again!"
@post.secret = 1
@post.written_on = Date.new(2004, 6, 15)
+
+ @controller = Class.new do
+ def url_for(options, *parameters_for_method_reference)
+ options[:action]
+ end
+ end
+ @controller = @controller.new
end
def test_generic_input_tag

0 comments on commit 1e4a936

Please sign in to comment.