OSDN Git Service

メールでテストが落ちる時があるのを修正
authorTaro Matsuzawa aka. btm <btm@tech.email.ne.jp>
Thu, 17 Mar 2011 06:13:47 +0000 (15:13 +0900)
committerTaro Matsuzawa aka. btm <btm@tech.email.ne.jp>
Thu, 17 Mar 2011 06:13:47 +0000 (15:13 +0900)
app/models/mail.rb
spec/fixtures/mails.yml
spec/models/mail_spec.rb

index d3b7571..622fce6 100644 (file)
@@ -3,7 +3,7 @@ class Mail < ActiveRecord::Base
   THRESHOLD = 5
   def self.post_all_mail
     mails = Mail.find(:all, :conditions=>'sent_at is null', :order=>'created_at')
-    mails = mails.find_all do |m|
+    mails = mails.each do |m|
       customer = Customer.find_by_email_and_activate(m.to_address, Customer::TOUROKU)
       customer && customer.reachable
     end
index a3896d7..cb0e81f 100644 (file)
@@ -2,5 +2,5 @@
 one:\r
   id: 1\r
   from_address: "from@kbmj.com"\r
-  to_address: "to@kbmj.com"\r
+  to_address: "sho-chan@example.com"\r
   message: "mailTest"\r
index 00da6d7..a23bd21 100644 (file)
@@ -1,7 +1,7 @@
 require File.expand_path(File.dirname(__FILE__) + '/../spec_helper')\r
 \r
 describe Mail do\r
-  fixtures :customers\r
+  fixtures :customers, :mails\r
   before(:each) do\r
     @mails = Mail.new\r
   end\r