Commit b683b3e48e1ab948caca34403ee8dd99206bc4b8

Authored by AntonioTerceiro
1 parent 06ed6bdd

ActionItem14: writing task messages for CreateEnterprise.



git-svn-id: https://svn.colivre.coop.br/svn/noosfero/trunk@696 3f533792-8f58-4932-b0fe-aaf55b0a4547
app/models/create_enterprise.rb
@@ -52,6 +52,10 @@ class CreateEnterprise < Task @@ -52,6 +52,10 @@ class CreateEnterprise < Task
52 self.region_id = value.id 52 self.region_id = value.id
53 end 53 end
54 54
  55 + def environment
  56 + region ? region.environment : nil
  57 + end
  58 +
55 # Rejects the enterprise registration request. 59 # Rejects the enterprise registration request.
56 def reject 60 def reject
57 cancel 61 cancel
@@ -85,13 +89,18 @@ class CreateEnterprise < Task @@ -85,13 +89,18 @@ class CreateEnterprise < Task
85 _('Enterprise registration: "%s"') % self.name 89 _('Enterprise registration: "%s"') % self.name
86 end 90 end
87 91
88 - #def task_created_message  
89 - #end 92 + def task_created_message
  93 + _('Your request for registering enterprise "%{enterprise}" at %{environment} was just received. It will be reviewed by the chosen validator organization you chose, according to its methods and creteria.
  94 +
  95 + You will be notified as soon as the validator organization has a position about your request.') % { :enterprise => self.name, :environment => self.environment }
  96 + end
90 97
91 - #def task_finished_message  
92 - #end 98 + def task_finished_message
  99 + _('Your request fo registering the enterprise "%{enterprise}" was approved. You can access %{environment} now and start entering ') % { :enterprise => self.name, :environment => self.environment }
  100 + end
93 101
94 - #def task_cancelled_message  
95 - #end 102 + def task_cancelled_message
  103 + _('Your request for registering the enterprise %{enterprise} at %{environment} was NOT approved by the validator organization.') % { :enterprise => self.name, :environment => self.environment }
  104 + end
96 105
97 end 106 end
test/unit/create_enterprise_test.rb
@@ -104,6 +104,7 @@ class CreateEnterpriseTest < Test::Unit::TestCase @@ -104,6 +104,7 @@ class CreateEnterpriseTest < Test::Unit::TestCase
104 104
105 assert !enterprise.new_record? 105 assert !enterprise.new_record?
106 assert_equal person.user, enterprise.user 106 assert_equal person.user, enterprise.user
  107 + assert_equal environment, enterprise.environment
107 end 108 end
108 109
109 should 'override message methods from Task' do 110 should 'override message methods from Task' do