test/unit/integrations/notifications/notification_test.rb in activemerchant-1.3.2 vs test/unit/integrations/notifications/notification_test.rb in activemerchant-1.4.0
- old
+ new
@@ -28,9 +28,22 @@
def test_notification_data_with_period
notification = Notification.new(http_raw_data_with_period)
assert_equal 'clicked', notification.params['checkout.x']
end
+ def test_valid_sender_always_true_in_testmode
+ assert_equal ActiveMerchant::Billing::Base.integration_mode, :test
+ assert @notification.valid_sender?(nil)
+ assert @notification.valid_sender?('localhost')
+ end
+
+ def test_valid_sender_always_true_when_no_ips
+ ActiveMerchant::Billing::Base.integration_mode = :production
+ assert @notification.valid_sender?(nil)
+ assert @notification.valid_sender?('localhost')
+ ActiveMerchant::Billing::Base.integration_mode = :test
+ end
+
private
def http_raw_data
"mc_gross=500.00&address_status=confirmed&payer_id=EVMXCLDZJV77Q&tax=0.00&address_street=164+Waverley+Street&payment_date=15%3A23%3A54+Apr+15%2C+2005+PDT&payment_status=Completed&address_zip=K2P0V6&first_name=Tobias&mc_fee=15.05&address_country_code=CA&address_name=Tobias+Luetke¬ify_version=1.7&custom=&payer_status=unverified&business=tobi%40leetsoft.com&address_country=Canada&address_city=Ottawa&quantity=1&payer_email=tobi%40snowdevil.ca&verify_sign=AEt48rmhLYtkZ9VzOGAtwL7rTGxUAoLNsuf7UewmX7UGvcyC3wfUmzJP&txn_id=6G996328CK404320L&payment_type=instant&last_name=Luetke&address_state=Ontario&receiver_email=tobi%40leetsoft.com&payment_fee=&receiver_id=UQ8PDYXJZQD9Y&txn_type=web_accept&item_name=Store+Purchase&mc_currency=CAD&item_number=&test_ipn=1&payment_gross=&shipping=0.00"
end