spec/lib/opay/helpers/payu_helper_spec.rb in opay-1.1.3 vs spec/lib/opay/helpers/payu_helper_spec.rb in opay-1.1.4
- old
+ new
@@ -4,10 +4,11 @@
describe Helpers::PayuHelper, type: :helper do
context 'form tag' do
before do
@order = Order.create! name: 'first order', amount: 1000 # 10 zł
+ Opay.config.process_payments_localy = false
end
it 'creates form tag' do
html = helper.opay_form_for(@order) do |f|
f.payment_info first_name: 'Jan', last_name: 'Kowalski', email: 'kowalski@gmail.com', desc: 'Test payment', client_ip: '127.0.0.1'
@@ -40,9 +41,19 @@
html = helper.payu_form_for(@order) do |f|
f.payment_info first_name: 'Jan', last_name: 'Kowalski', email: 'kowalski@gmail.com', desc: 'Test payment', client_ip: '127.0.0.1'
end
html.should have_css('input[name="pay_type"][value="t"]')
+ end
+
+ it 'works localy' do
+ Opay.config.process_payments_localy = true
+
+ html = helper.payu_form_for(@order) do |f|
+ f.payment_info first_name: 'Jan', last_name: 'Kowalski', email: 'kowalski@gmail.com', desc: 'Test payment', client_ip: '127.0.0.1'
+ end
+
+ html.should have_css('form[action="/opay/payu/paygw/UTF/NewPayment"]')
end
end
end
end