Skip to content

Commit

Permalink
Method name improvement
Browse files Browse the repository at this point in the history
  • Loading branch information
Rafael Guimarães committed Oct 13, 2016
1 parent 6225d8d commit 236aee5
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion app/helpers/invoices_helper.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module InvoicesHelper

def build_url(external_politic_id, year, external_document_id)
def build_receipt_url(external_politic_id, year, external_document_id)
link = "http://www.camara.leg.br/cota-parlamentar/documentos/publ/"
link << external_politic_id.to_s + '/'
link << year.to_s + '/'
Expand Down
2 changes: 1 addition & 1 deletion app/views/deputados/despesas/index.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
<td align="right" ><%= number_to_currency(despesa.valor_glosa) %></td>
<td align="right" ><%= number_to_currency(despesa.valor_documento) %></td>
<td align="center" >
<a href="<%= build_url(despesa.nu_deputado_id, despesa.num_ano, despesa.ide_documento) %>" target="_blank" >
<a href="<%= build_receipt(despesa.nu_deputado_id, despesa.num_ano, despesa.ide_documento) %>" target="_blank" >
<span class="glyphicon glyphicon-circle-arrow-down" ></span> Visualizar
</a>
</td>
Expand Down
4 changes: 2 additions & 2 deletions spec/helpers/invoices_helper_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@

let(:invoice) { create(:despesa, nu_deputado_id: '12345', num_ano: 2015, ide_documento: '12345') }

describe '#build_url' do
describe '#build_receipt_url' do
it "should return corret url" do
url = helper.build_url(invoice.nu_deputado_id, invoice.num_ano, invoice.ide_documento)
url = helper.build_receipt_url(invoice.nu_deputado_id, invoice.num_ano, invoice.ide_documento)

expect(url).to eq('http://www.camara.leg.br/cota-parlamentar/documentos/publ/12345/2015/12345.pdf')
end
Expand Down

0 comments on commit 236aee5

Please sign in to comment.