pushing mailer spec for ilya
This commit is contained in:
parent
cb23fd495b
commit
747ab761a0
3 changed files with 25 additions and 1 deletions
|
|
@ -14,7 +14,7 @@ module RakeHelpers
|
|||
backer_name = backers[n+offset][0].to_s.strip
|
||||
backer_email = backers[n+offset][1].to_s.gsub('.ksr', '').strip
|
||||
puts "sending email to: #{backer_name} #{backer_email}"
|
||||
Invitation.create_invitee(:email => backer_email, :name => backer_name, :invites => 5)
|
||||
Invitation.create_invitee(:email => backer_email, :name => backer_name, :invites => 5) unless User.find_by_email(backer_email)
|
||||
end
|
||||
churn_through
|
||||
end
|
||||
|
|
|
|||
4
spec/fixtures/test.csv
vendored
Normal file
4
spec/fixtures/test.csv
vendored
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
Backer,Email,
|
||||
maxwell salzberg, mbs348@foo.com
|
||||
billy mcgee, billy@foo.com
|
||||
big foo, bar@moms.com
|
||||
|
20
spec/lib/rake_helper_spec.rb
Normal file
20
spec/lib/rake_helper_spec.rb
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
# Copyright (c) 2010, Diaspora Inc. This file is
|
||||
# licensed under the Affero General Public License version 3 or later. See
|
||||
# the COPYRIGHT file.
|
||||
|
||||
require 'spec_helper'
|
||||
require File.join(Rails.root, 'lib/rake_helpers.rb')
|
||||
describe RakeHelpers do
|
||||
before do
|
||||
@csv = File.join(Rails.root, 'spec/fixtures/test.csv')
|
||||
end
|
||||
describe '#process_emails' do
|
||||
it 'should send emails to each backer' do
|
||||
pending
|
||||
Invitation.should_receive(:create_invitee).exactly(3).times
|
||||
RakeHelpers::process_emails(@csv, 100, 0)
|
||||
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Loading…
Reference in a new issue