Skip to main content

Posts

Showing posts with the label helpers

Testing view helpers

I'm currently working on a Rails plugin used for generating iPhone specific HTML meta-tags. I'm trying to use ActionView::TestCase for unit tests but keep getting the same error. See file contents and error below. Any ideas or help would be much appreciated. test_helper.rb require 'rubygems' require 'test/unit' require 'active_support' require 'action_view' require File.join(File.dirname(__FILE__), '..', 'lib', 'iphone_helper') iphone_test_helper.rb require 'test_helper' class IphoneHelperTest < ActionView::TestCase test 'br' do tag = tag('br') assert_tag_in tag, '<br />' end end error RuntimeError: In order to use #url_for, you must include routing helpers explicitly. For instance, `include Rails.application.routes.url_helpers