Commit 9a8821912be11abcb3fb50540710085d3672be5f

Authored by AntonioTerceiro
1 parent f126e441

ActionItem16: listing pending validations for an organization



git-svn-id: https://svn.colivre.coop.br/svn/noosfero/trunk@840 3f533792-8f58-4932-b0fe-aaf55b0a4547
app/models/organization.rb
@@ -23,4 +23,8 @@ class Organization < Profile @@ -23,4 +23,8 @@ class Organization < Profile
23 restrictions = self.validation_info ? self.validation_info.restrictions : nil 23 restrictions = self.validation_info ? self.validation_info.restrictions : nil
24 restrictions || ('<em>' + _('(not informed)') + '</em>') 24 restrictions || ('<em>' + _('(not informed)') + '</em>')
25 end 25 end
  26 +
  27 + def pending_validations
  28 + CreateEnterprise.pending_for(self)
  29 + end
26 end 30 end
test/unit/organization_test.rb
@@ -61,7 +61,9 @@ class OrganizationTest &lt; Test::Unit::TestCase @@ -61,7 +61,9 @@ class OrganizationTest &lt; Test::Unit::TestCase
61 end 61 end
62 62
63 should 'list pending enterprise validations' do 63 should 'list pending enterprise validations' do
64 - flunk 'not yet' 64 + org = Organization.new
  65 + CreateEnterprise.expects(:pending_for).with(org).returns([])
  66 + assert_equal [], org.pending_validations
65 end 67 end
66 68
67 end 69 end