Skip to content

Commit

Permalink
FIX: Fixed problem with "uninitialized constant ActionView" (Tests to…
Browse files Browse the repository at this point in the history
…o old).

CHG: Changed tests accordingly to Jonathan S. Katz changes. (specifically the change of cmd and redirect_cmd fields).
  • Loading branch information
rhaseven7h committed Oct 16, 2008
1 parent 635a98b commit 9b65f7b
Showing 1 changed file with 14 additions and 17 deletions.
31 changes: 14 additions & 17 deletions test/helper_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,16 @@
require 'test/unit'
require 'paypal'

require_gem 'money'
require_gem 'actionpack' rescue LoadError raise(StandardErrror.new("This test needs ActionPack installed as gem to run"))
require 'rubygems'
require 'actionpack' rescue LoadError raise(StandardErrror.new("This test needs ActionPack installed as gem to run"))
require 'action_controller'
require 'action_view'
require 'money'


# Little hack class which pretends to be a active controller
class TestController
class TestController < ActionController::Base
allow_forgery_protection
include Paypal::Helpers
include ActionView::Helpers::TagHelper
include ActionView::Helpers::FormHelper
Expand Down Expand Up @@ -51,13 +55,12 @@ def test_paypal_setup_with_money
assert_inputs({ "amount" => "500.00",
"business" => "[email protected]",
"charset" => "utf-8",
"cmd" => "_ext-enter",
"cmd" => "_xclick",
"currency_code" => "USD",
"item_name" => "Store purchase",
"item_number" => "100",
"no_note" => "1",
"no_shipping" => "1",
"redirect_cmd" => "_xclick",
"quantity" => "1"}, actual)
end

Expand All @@ -66,14 +69,13 @@ def test_paypal_setup_with_money_and_tax
assert_inputs({ "amount" => "500.00",
"business" => "[email protected]",
"charset" => "utf-8",
"cmd" => "_ext-enter",
"cmd" => "_xclick",
"currency_code" => "USD",
"item_name" => "Store purchase",
"item_number" => "100",
"no_note" => "1",
"no_shipping" => "1",
"quantity" => "1",
"redirect_cmd" => "_xclick",
"tax" => "5.00"}, actual)
end

Expand All @@ -82,14 +84,13 @@ def test_paypal_setup_with_money_and_invoice
assert_inputs({ "amount" => "500.00",
"business" => "[email protected]",
"charset" => "utf-8",
"cmd" => "_ext-enter",
"cmd" => "_xclick",
"currency_code" => "USD",
"invoice" => "Cool invoice!",
"item_name" => "Store purchase",
"item_number" => "100",
"no_note" => "1",
"no_shipping" => "1",
"redirect_cmd" => "_xclick",
"quantity" => "1"}, actual)
end

Expand All @@ -98,15 +99,14 @@ def test_paypal_setup_with_money_and_custom
assert_inputs({ "amount" => "500.00",
"business" => "[email protected]",
"charset" => "utf-8",
"cmd" => "_ext-enter",
"cmd" => "_xclick",
"currency_code" => "USD",
"custom" => "Custom",
"item_name" => "Store purchase",
"item_number" => "100",
"no_note" => "1",
"no_shipping" => "1",
"quantity" => "1",
"redirect_cmd" => "_xclick",
}, actual)
end

Expand All @@ -115,13 +115,12 @@ def test_paypal_setup_with_float
assert_inputs({ "amount" => "50.00",
"business" => "[email protected]",
"charset" => "utf-8",
"cmd" => "_ext-enter",
"cmd" => "_xclick",
"currency_code" => "CAD",
"item_name" => "Store purchase",
"item_number" => "100",
"no_note" => "1",
"no_shipping" => "1",
"redirect_cmd" => "_xclick",
"quantity" => "1"}, actual)
end

Expand All @@ -130,13 +129,12 @@ def test_paypal_setup_with_string
assert_inputs({ "amount" => "50.00",
"business" => "[email protected]",
"charset" => "utf-8",
"cmd" => "_ext-enter",
"cmd" => "_xclick",
"currency_code" => "CAD",
"item_name" => "Store purchase",
"item_number" => "100",
"no_note" => "1",
"no_shipping" => "1",
"redirect_cmd" => "_xclick",
"quantity" => "1"}, actual)
end

Expand All @@ -146,15 +144,14 @@ def test_paypal_setup_options
"business" => "[email protected]",
"cancel_return" => "http://www.bigbusiness.com",
"charset" => "utf-8",
"cmd" => "_ext-enter",
"cmd" => "_xclick",
"currency_code" => "USD",
"item_name" => "MegaBob's shop purchase",
"item_number" => "100",
"no_note" => "0",
"no_shipping" => "0",
"notify_url" => "http://www.bigbusiness.com",
"quantity" => "1",
"redirect_cmd" => "_xclick",
"return" => "http://www.bigbusiness.com"}, actual )
end

Expand Down

0 comments on commit 9b65f7b

Please sign in to comment.