From 9fa591cd707bfc5a67184498f20b5221f2cc9778 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dalto=20Curvelano=20Ju=CC=81nior?= Date: Tue, 17 Sep 2013 01:55:24 -0300 Subject: [PATCH 1/3] =?UTF-8?q?Atualizando=20helper=20para=20formu=C3=A1ri?= =?UTF-8?q?os.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Atualizado para passar opções para o helper submit_tag do rails. --- app/views/pagseguro/_pagseguro_form.html.erb | 2 +- spec/helpers/helper_spec.rb | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/views/pagseguro/_pagseguro_form.html.erb b/app/views/pagseguro/_pagseguro_form.html.erb index 4802d2f..874655f 100644 --- a/app/views/pagseguro/_pagseguro_form.html.erb +++ b/app/views/pagseguro/_pagseguro_form.html.erb @@ -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 From 6f57e67ada5a4653bfbe128842528964eaeeffad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dalto=20Curvelano=20Ju=CC=81nior?= Date: Tue, 17 Sep 2013 01:59:29 -0300 Subject: [PATCH 2/3] Ignorando arquivo .ruby-version. --- .gitignore | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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 From f765938bcc91a50b141daa930875635e568cfa80 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dalto=20Curvelano=20Ju=CC=81nior?= Date: Tue, 24 Sep 2013 02:01:32 -0300 Subject: [PATCH 3/3] Alterando nome do campo de frete. --- app/views/pagseguro/_pagseguro_form.html.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/pagseguro/_pagseguro_form.html.erb b/app/views/pagseguro/_pagseguro_form.html.erb index 874655f..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 %>