diff --git a/.gitignore b/.gitignore index e685de0..e2b6566 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ spec/support/tmp/**/* spec/support/log/*.log -pkg \ No newline at end of file +pkg +.ruby-version diff --git a/app/views/pagseguro/_pagseguro_form.html.erb b/app/views/pagseguro/_pagseguro_form.html.erb index 4802d2f..0892c5a 100644 --- a/app/views/pagseguro/_pagseguro_form.html.erb +++ b/app/views/pagseguro/_pagseguro_form.html.erb @@ -5,7 +5,7 @@ <%= hidden_field_tag "tipo", "CP" %> <%= hidden_field_tag "moeda", "BRL" %> <%= hidden_field_tag "ref_transacao", order.id %> - <%= hidden_field_tag "tipo_frete", order.shipping_type if order.shipping_type %> + <%= hidden_field_tag "frete", order.shipping_type if order.shipping_type %> <% order.products.each_with_index do |product, i| %> <% i += 1 %> @@ -21,6 +21,6 @@ <%= hidden_field_tag PagSeguro::Order::BILLING_MAPPING[name.to_sym], value %> <% end %> - <%= submit_tag options[:submit] %> + <%= submit_tag options[:submit], options.fetch(:submit_options, {}) %> diff --git a/spec/helpers/helper_spec.rb b/spec/helpers/helper_spec.rb index 337be4d..604deff 100644 --- a/spec/helpers/helper_spec.rb +++ b/spec/helpers/helper_spec.rb @@ -8,7 +8,7 @@ end subject { - Nokogiri::HTML(helper.pagseguro_form(@order)).css("form").first + Nokogiri::HTML(helper.pagseguro_form(@order, :submit_options => { :class => 'foo' })).css("form").first } context "with default attributes" do @@ -20,7 +20,7 @@ it { should have_input(:name => "ref_transacao", :value => "I1001") } it { should_not have_input(:name => "tipo_frete") } it { should have_input(:name => "email_cobranca", :value => "john@doe.com") } - it { should have_input(:type => "submit", :value => "Pagar com PagSeguro") } + it { should have_input(:type => "submit", :value => "Pagar com PagSeguro", :class => 'foo') } end it "should include shipping type" do