Permalink
Browse files

use doc_number in views

  • Loading branch information...
1 parent 9e2eb67 commit 99484f864259768d6757cf45c2ffff78dcc7fdd1 @mhfs committed Apr 6, 2012
Showing with 10 additions and 2 deletions.
  1. +1 −1 lib/entity.rb
  2. +4 −0 spec/company_spec.rb
  3. +4 −0 spec/person_spec.rb
  4. +1 −1 views/_entity.haml
View
@@ -7,7 +7,7 @@ def initialize
end
def document_number
- document.number
+ document.human_number
end
private
View
@@ -12,6 +12,10 @@
subject.document.should be_instance_of(Cnpj)
end
+ it "should have document number" do
+ subject.document_number.should eq(subject.document.to_s)
+ end
+
it "should generate name" do
subject.name.should be_instance_of(String)
end
View
@@ -12,6 +12,10 @@
subject.document.should be_instance_of(Cpf)
end
+ it "should have document number" do
+ subject.document_number.should eq(subject.document.to_s)
+ end
+
it "should generate name" do
subject.name.should be_instance_of(String)
end
View
@@ -5,4 +5,4 @@
%br
.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.