VRFS-1483
This commit is contained in:
parent
4ba18a88ee
commit
d15c1dbdfd
|
|
@ -21,13 +21,13 @@ module JamRuby
|
|||
event :enable do
|
||||
transitions :from => :disabled, :to => :pending
|
||||
end
|
||||
event :do_test_run, :after => :running_tests do
|
||||
event :do_test_run, :before => :running_tests do
|
||||
transitions :from => [:pending, :tested, :batched], :to => :testing
|
||||
end
|
||||
event :did_test_run do
|
||||
transitions :from => :testing, :to => :tested
|
||||
end
|
||||
event :do_batch_run, :after => Proc.new { running_batch } do
|
||||
event :do_batch_run, :before => :running_batch do
|
||||
transitions :from => [:tested, :pending, :batched], :to => :batching
|
||||
end
|
||||
event :did_batch_run do
|
||||
|
|
@ -51,6 +51,10 @@ module JamRuby
|
|||
BatchMailer.send_batch_email(self.id, user_ids).deliver
|
||||
end
|
||||
end
|
||||
|
||||
def test_count
|
||||
self.test_emails.split(',').count
|
||||
end
|
||||
|
||||
def test_users
|
||||
self.test_emails.split(',').collect do |ee|
|
||||
|
|
|
|||
|
|
@ -16,6 +16,10 @@ describe BatchMailer do
|
|||
|
||||
it { mail.multipart?.should == true } # because we send plain + html
|
||||
it { mail.text_part.decode_body.should match(/#{Regexp.escape(batch.body)}/) }
|
||||
|
||||
it { batch.testing?.should == true }
|
||||
binding.pry
|
||||
it { batch.qualified_count.should == batch.test_count }
|
||||
end
|
||||
|
||||
end
|
||||
|
|
|
|||
Loading…
Reference in New Issue