From 16215289d0a2e5c0ef4572a1a838340757bddccd Mon Sep 17 00:00:00 2001 From: Rob H Date: Wed, 9 Jul 2014 11:41:16 +1000 Subject: [PATCH] Spec for payment method clean_name translation --- spec/models/spree/payment_method_spec.rb | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/spec/models/spree/payment_method_spec.rb b/spec/models/spree/payment_method_spec.rb index bed15fdbef..394ff490a2 100644 --- a/spec/models/spree/payment_method_spec.rb +++ b/spec/models/spree/payment_method_spec.rb @@ -15,5 +15,15 @@ module Spree pm.save pm.errors.to_a.should == ["Name can't be blank", "At least one hub must be selected"] end + + it "generates a clean name for known Payment Method types" do + Spree::PaymentMethod::Check.clean_name.should == "Cash/EFT/etc. (payments for which automatic validation is not required)" + Spree::Gateway::Migs.clean_name.should == "MasterCard Internet Gateway Service (MIGS)" + Spree::BillingIntegration::PaypalExpressUk.clean_name.should == "PayPal Express (UK)" + Spree::BillingIntegration::PaypalExpress.clean_name.should == "PayPal Express" + + # Testing else condition + Spree::Gateway::BogusSimple.clean_name.should == "BogusSimple" + end end end