require File.dirname(__FILE__) + '/../../test_helper' begin if respond_to? :gem gem 'actionpack' else require_gem 'actionpack' end rescue LoadError raise StandardError, "This test needs ActionPack installed as gem to run" end require 'action_controller' require 'action_controller/test_process' require 'active_merchant/billing/integrations/action_view_helper' class ActionViewHelperTest < Test::Unit::TestCase include ActiveMerchant::Billing::Integrations::ActionViewHelper include ActionView::Helpers::FormHelper include ActionView::Helpers::FormTagHelper include ActionView::Helpers::UrlHelper include ActionView::Helpers::TagHelper include ActionView::Helpers::TextHelper def setup @controller = Class.new do attr_reader :url_for_options def url_for(options, *parameters_for_method_reference) @url_for_options = options end end @controller = @controller.new end def test_basic_payment_service _erbout = '' payment_service_for('order-1','test', :service => :bogus){} expected = [ '
', '', '', "
" ] _erbout.each_line do |line| assert expected.include?(line.chomp), "Failed to match #{line}" end end def test_payment_service_no_block_given assert_raise(ArgumentError){ payment_service_for } end end