forked from openhood/paypal
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
FIX: Fixed problem with "uninitialized constant ActionView" (Tests to…
…o old). CHG: Changed tests accordingly to Jonathan S. Katz changes. (specifically the change of cmd and redirect_cmd fields).
- Loading branch information
1 parent
635a98b
commit 9b65f7b
Showing
1 changed file
with
14 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 | ||
|
@@ -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 | ||
|
||
|
@@ -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 | ||
|
||
|
@@ -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 | ||
|
||
|
@@ -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 | ||
|
||
|
@@ -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 | ||
|
||
|
@@ -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 | ||
|
||
|
@@ -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 | ||
|
||
|