Commit b48ce2ea051a18ef1fc169080aba6b294095a0ac

Authored by AntonioTerceiro
1 parent cda240b9

ActionItem16: making tests pass



git-svn-id: https://svn.colivre.coop.br/svn/noosfero/trunk@849 3f533792-8f58-4932-b0fe-aaf55b0a4547
app/models/create_enterprise.rb
... ... @@ -122,4 +122,8 @@ class CreateEnterprise < Task
122 122 _('Your request for registering the enterprise %{enterprise} at %{environment} was NOT approved by the validator organization.') % { :enterprise => self.name, :environment => self.environment }
123 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 129 end
... ...
app/models/task.rb
... ... @@ -49,7 +49,7 @@ class Task < ActiveRecord::Base
49 49  
50 50 target_msg = task.target_notification_message
51 51 unless target_msg.nil?
52   - TaskMailer.deliver_target_notification(self, target_msg)
  52 + TaskMailer.deliver_target_notification(task, target_msg)
53 53 end
54 54 end
55 55  
... ...
test/unit/create_enterprise_test.rb
... ... @@ -140,4 +140,8 @@ class CreateEnterpriseTest < Test::Unit::TestCase
140 140 assert task.valid?
141 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 147 end
... ...