Skip to content

Commit

Permalink
use doc_number in views
Browse files Browse the repository at this point in the history
  • Loading branch information
mhfs committed Apr 6, 2012
1 parent 9e2eb67 commit 99484f8
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/entity.rb
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ def initialize
end end


def document_number def document_number
document.number document.human_number
end end


private private
Expand Down
4 changes: 4 additions & 0 deletions spec/company_spec.rb
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@
subject.document.should be_instance_of(Cnpj) subject.document.should be_instance_of(Cnpj)
end end


it "should have document number" do
subject.document_number.should eq(subject.document.to_s)
end

it "should generate name" do it "should generate name" do
subject.name.should be_instance_of(String) subject.name.should be_instance_of(String)
end end
Expand Down
4 changes: 4 additions & 0 deletions spec/person_spec.rb
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@
subject.document.should be_instance_of(Cpf) subject.document.should be_instance_of(Cpf)
end end


it "should have document number" do
subject.document_number.should eq(subject.document.to_s)
end

it "should generate name" do it "should generate name" do
subject.name.should be_instance_of(String) subject.name.should be_instance_of(String)
end end
Expand Down
2 changes: 1 addition & 1 deletion views/_entity.haml
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@
%br %br


.clippy= clippy "doc_#{entity.object_id}" .clippy= clippy "doc_#{entity.object_id}"
%span{ :id => "doc_#{entity.object_id}" }= entity.document %span{ :id => "doc_#{entity.object_id}" }= entity.document_number

0 comments on commit 99484f8

Please sign in to comment.