Commit b683b3e48e1ab948caca34403ee8dd99206bc4b8
1 parent
06ed6bdd
Exists in
master
and in
22 other branches
ActionItem14: writing task messages for CreateEnterprise.
git-svn-id: https://svn.colivre.coop.br/svn/noosfero/trunk@696 3f533792-8f58-4932-b0fe-aaf55b0a4547
Showing
2 changed files
with
16 additions
and
6 deletions
Show diff stats
app/models/create_enterprise.rb
... | ... | @@ -52,6 +52,10 @@ class CreateEnterprise < Task |
52 | 52 | self.region_id = value.id |
53 | 53 | end |
54 | 54 | |
55 | + def environment | |
56 | + region ? region.environment : nil | |
57 | + end | |
58 | + | |
55 | 59 | # Rejects the enterprise registration request. |
56 | 60 | def reject |
57 | 61 | cancel |
... | ... | @@ -85,13 +89,18 @@ class CreateEnterprise < Task |
85 | 89 | _('Enterprise registration: "%s"') % self.name |
86 | 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 | 106 | end | ... | ... |
test/unit/create_enterprise_test.rb
... | ... | @@ -104,6 +104,7 @@ class CreateEnterpriseTest < Test::Unit::TestCase |
104 | 104 | |
105 | 105 | assert !enterprise.new_record? |
106 | 106 | assert_equal person.user, enterprise.user |
107 | + assert_equal environment, enterprise.environment | |
107 | 108 | end |
108 | 109 | |
109 | 110 | should 'override message methods from Task' do | ... | ... |