Commit b48ce2ea051a18ef1fc169080aba6b294095a0ac
1 parent
cda240b9
Exists in
master
and in
22 other branches
ActionItem16: making tests pass
git-svn-id: https://svn.colivre.coop.br/svn/noosfero/trunk@849 3f533792-8f58-4932-b0fe-aaf55b0a4547
Showing
3 changed files
with
9 additions
and
1 deletions
Show diff stats
app/models/create_enterprise.rb
@@ -122,4 +122,8 @@ class CreateEnterprise < Task | @@ -122,4 +122,8 @@ class CreateEnterprise < Task | ||
122 | _('Your request for registering the enterprise %{enterprise} at %{environment} was NOT approved by the validator organization.') % { :enterprise => self.name, :environment => self.environment } | 122 | _('Your request for registering the enterprise %{enterprise} at %{environment} was NOT approved by the validator organization.') % { :enterprise => self.name, :environment => self.environment } |
123 | end | 123 | end |
124 | 124 | ||
125 | + def target_notification_message | ||
126 | + _('Enterprise "%{enterprise}" just requested to enter %{environment}. You have to approve or reject it through the "Pending Validations" section in your control panel.') % { :enterprise => self.name, :environment => self.environment } | ||
127 | + end | ||
128 | + | ||
125 | end | 129 | end |
app/models/task.rb
@@ -49,7 +49,7 @@ class Task < ActiveRecord::Base | @@ -49,7 +49,7 @@ class Task < ActiveRecord::Base | ||
49 | 49 | ||
50 | target_msg = task.target_notification_message | 50 | target_msg = task.target_notification_message |
51 | unless target_msg.nil? | 51 | unless target_msg.nil? |
52 | - TaskMailer.deliver_target_notification(self, target_msg) | 52 | + TaskMailer.deliver_target_notification(task, target_msg) |
53 | end | 53 | end |
54 | end | 54 | end |
55 | 55 |
test/unit/create_enterprise_test.rb
@@ -140,4 +140,8 @@ class CreateEnterpriseTest < Test::Unit::TestCase | @@ -140,4 +140,8 @@ class CreateEnterpriseTest < Test::Unit::TestCase | ||
140 | assert task.valid? | 140 | assert task.valid? |
141 | end | 141 | end |
142 | 142 | ||
143 | + should 'provide a message to be sent to the target' do | ||
144 | + assert_not_nil CreateEnterprise.new.target_notification_message | ||
145 | + end | ||
146 | + | ||
143 | end | 147 | end |