mail_spy 0.0.3 → 0.0.4

Sign up to get free protection for your applications and to get access to all the features.
data/README.rdoc CHANGED
@@ -33,7 +33,7 @@ Mailspy is centered around email templates and instances of those templates
33
33
 
34
34
  To create a template:
35
35
 
36
- MailSpy.add_template(template_name, html_erb, text_erb, template_values_definition)
36
+ MailSpy.create_template(template_name, html_erb, text_erb, template_values_definition)
37
37
 
38
38
  * Template name must be unique to all templates
39
39
  * html, and text are the contents for a multipart email
@@ -43,7 +43,7 @@ MailSpy.add_template(template_name, html_erb, text_erb, template_values_definiti
43
43
 
44
44
  To create a instance:
45
45
 
46
- MailSpy.add_instance(options)
46
+ MailSpy.create_email(options)
47
47
 
48
48
  required options include:
49
49
 
@@ -32,7 +32,7 @@ module MailSpy
32
32
 
33
33
  # Scheduling and completion
34
34
  field :schedule_at, :type => DateTime
35
- field :sent, :type => Boolean
35
+ field :sent, :type => Boolean, :default => false
36
36
  index :schedule_at
37
37
 
38
38
  # Record keeping of what happened
@@ -5,7 +5,7 @@ module MailSpy
5
5
  # Programmatically add email templates with a schema of search and
6
6
  # replaceable text
7
7
  #
8
- def add_template(name, html_erb, text_erb, template_values_definition)
8
+ def create_template(name, html_erb, text_erb, template_values_definition)
9
9
  MailSpy::EmailTemplate.create!(
10
10
  {
11
11
  :name => name,
@@ -18,7 +18,7 @@ module MailSpy
18
18
  # ------------------------------------------- ADD INSTANCE
19
19
  # Adds a instance of a email template to the queue to send
20
20
  #
21
- def add_instance(options)
21
+ def create_email(options)
22
22
  options.to_options!
23
23
 
24
24
  required_options = [
@@ -27,7 +27,7 @@ module MailSpy
27
27
  to_options = [:to, :cc, :bcc]
28
28
 
29
29
  # Ensure that we have the required options
30
- required_options.each { |ro| raise "add_instance call missing #{ro}" unless options.include? ro }
30
+ required_options.each { |ro| raise "create_email call missing #{ro}" unless options.include? ro }
31
31
 
32
32
  # Make sure we have someone to send to
33
33
  has_sender = options.keys.select { |option| to_options.include? option.intern }.present?
@@ -36,7 +36,7 @@ module MailSpy
36
36
  # Make sure we have a template
37
37
  options[:template_name]
38
38
  template = MailSpy::EmailTemplate.first(conditions: {name: options[:template_name]})
39
- raise "No template: #{options[:template_name]} found, try add_template first" unless template
39
+ raise "No template: #{options[:template_name]} found, try create_template first" unless template
40
40
 
41
41
 
42
42
  # Make sure that
@@ -1,3 +1,3 @@
1
1
  module MailSpy
2
- VERSION = "0.0.3"
2
+ VERSION = "0.0.4"
3
3
  end
@@ -6839,3 +6839,310 @@ MONGODB dummy_test['mail_spy_email_templates'].remove({})
6839
6839
  MONGODB dummy_test['$cmd'].find({"count"=>"mail_spy_emails", "query"=>{}, "fields"=>nil}).limit(-1)
6840
6840
  MONGODB dummy_test['mail_spy_emails'].remove({})
6841
6841
   (0.1ms) rollback transaction
6842
+ MONGODB [WARNING] Please note that logging negatively impacts client-side performance. You should set your logging level no lower than :info in production.
6843
+ MONGODB admin['$cmd'].find({:ismaster=>1}).limit(-1)
6844
+  (0.3ms) begin transaction
6845
+ MONGODB dummy_test['system.namespaces'].find({})
6846
+ MONGODB dummy_test['mail_spy_email_templates'].insert([{"_id"=>BSON::ObjectId('4f26fa05816134db90000001'), "name"=>"a test template", "html_erb"=>"A link : <%= track_link 'My home', 'www.google.com' %> <br> A Bug <%= tracking_bug %>", "text_erb"=>"A link : <%= track_link 'My home', 'www.google.com' %> <br> A Bug <%= tracking_bug %>", "template_values_definition"=>{}, "updated_at"=>2012-01-30 20:13:57 UTC, "created_at"=>2012-01-30 20:13:57 UTC}])
6847
+ MONGODB dummy_test['mail_spy_email_templates'].find({:name=>"a test template"}).limit(-1).sort([[:_id, :asc]])
6848
+ MONGODB dummy_test['system.namespaces'].find({})
6849
+ MONGODB dummy_test['mail_spy_emails'].insert([{"_id"=>BSON::ObjectId('4f26fa05816134db90000002'), "to"=>"trcarden@gmail.com", "from"=>"test@test.com", "reply_to"=>"testGuy", "subject"=>"test subject", "template_name"=>"a test template", "template_values"=>{}, "campaign"=>"test campaign", "stream"=>"test stream", "component"=>"test component", "schedule_at"=>2012-01-30 20:13:57 UTC, "updated_at"=>2012-01-30 20:13:57 UTC, "created_at"=>2012-01-30 20:13:57 UTC}])
6850
+ MONGODB dummy_test['mail_spy_emails'].update({"_id"=>BSON::ObjectId('4f26fa05816134db90000002')}, {"$set"=>{"email_template_id"=>BSON::ObjectId('4f26fa05816134db90000001')}})
6851
+ MONGODB dummy_test['mail_spy_emails'].find({}).limit(-1).sort([[:_id, :asc]])
6852
+ MONGODB dummy_test['mail_spy_email_templates'].find({:_id=>BSON::ObjectId('4f26fa05816134db90000001')}).limit(-1).sort([[:_id, :asc]])
6853
+ Rendered inline template (19.7ms)
6854
+ Rendered inline template (1.2ms)
6855
+ MONGODB dummy_test['$cmd'].find({"count"=>"mail_spy_email_templates", "query"=>{}, "fields"=>nil}).limit(-1)
6856
+ MONGODB dummy_test['mail_spy_email_templates'].remove({})
6857
+ MONGODB dummy_test['$cmd'].find({"count"=>"mail_spy_emails", "query"=>{}, "fields"=>nil}).limit(-1)
6858
+ MONGODB dummy_test['mail_spy_emails'].remove({})
6859
+  (0.1ms) rollback transaction
6860
+  (0.0ms) begin transaction
6861
+ MONGODB dummy_test['$cmd'].find({"count"=>"mail_spy_email_templates", "query"=>{}, "fields"=>nil}).limit(-1)
6862
+ MONGODB dummy_test['mail_spy_email_templates'].remove({})
6863
+ MONGODB dummy_test['$cmd'].find({"count"=>"mail_spy_emails", "query"=>{}, "fields"=>nil}).limit(-1)
6864
+ MONGODB dummy_test['mail_spy_emails'].remove({})
6865
+  (0.1ms) rollback transaction
6866
+  (0.0ms) begin transaction
6867
+ MONGODB dummy_test['$cmd'].find({"count"=>"mail_spy_email_templates", "query"=>{}, "fields"=>nil}).limit(-1)
6868
+ MONGODB dummy_test['mail_spy_email_templates'].remove({})
6869
+ MONGODB dummy_test['$cmd'].find({"count"=>"mail_spy_emails", "query"=>{}, "fields"=>nil}).limit(-1)
6870
+ MONGODB dummy_test['mail_spy_emails'].remove({})
6871
+ MONGODB dummy_test['mail_spy_email_templates'].insert([{"_id"=>BSON::ObjectId('4f26fa05816134db90000003'), "name"=>"test", "html_erb"=>"Hello World", "text_erb"=>"Hello World", "template_values_definition"=>{}, "updated_at"=>2012-01-30 20:13:57 UTC, "created_at"=>2012-01-30 20:13:57 UTC}])
6872
+ MONGODB dummy_test['mail_spy_email_templates'].find({:name=>"test"}).limit(-1).sort([[:_id, :asc]])
6873
+ MONGODB dummy_test['mail_spy_emails'].insert([{"_id"=>BSON::ObjectId('4f26fa05816134db90000004'), "to"=>"test@test.com", "from"=>"test@test.com", "reply_to"=>"testGuy", "subject"=>"test subject", "template_name"=>"test", "template_values"=>{}, "campaign"=>"test campaign", "stream"=>"test stream", "component"=>"test component", "schedule_at"=>2012-01-30 20:13:57 UTC, "updated_at"=>2012-01-30 20:13:57 UTC, "created_at"=>2012-01-30 20:13:57 UTC}])
6874
+ MONGODB dummy_test['mail_spy_emails'].update({"_id"=>BSON::ObjectId('4f26fa05816134db90000004')}, {"$set"=>{"email_template_id"=>BSON::ObjectId('4f26fa05816134db90000003')}})
6875
+  (0.1ms) rollback transaction
6876
+  (0.0ms) begin transaction
6877
+ MONGODB dummy_test['$cmd'].find({"count"=>"mail_spy_email_templates", "query"=>{}, "fields"=>nil}).limit(-1)
6878
+ MONGODB dummy_test['mail_spy_email_templates'].remove({})
6879
+ MONGODB dummy_test['$cmd'].find({"count"=>"mail_spy_emails", "query"=>{}, "fields"=>nil}).limit(-1)
6880
+ MONGODB dummy_test['mail_spy_emails'].remove({})
6881
+ MONGODB dummy_test['mail_spy_email_templates'].insert([{"_id"=>BSON::ObjectId('4f26fa05816134db90000005'), "name"=>"test", "html_erb"=>"Hello World", "text_erb"=>"Hello World", "template_values_definition"=>{}, "updated_at"=>2012-01-30 20:13:57 UTC, "created_at"=>2012-01-30 20:13:57 UTC}])
6882
+  (0.0ms) rollback transaction
6883
+  (0.0ms) begin transaction
6884
+ MONGODB dummy_test['$cmd'].find({"count"=>"mail_spy_email_templates", "query"=>{}, "fields"=>nil}).limit(-1)
6885
+ MONGODB dummy_test['mail_spy_email_templates'].remove({})
6886
+ MONGODB dummy_test['$cmd'].find({"count"=>"mail_spy_emails", "query"=>{}, "fields"=>nil}).limit(-1)
6887
+ MONGODB dummy_test['mail_spy_emails'].remove({})
6888
+ MONGODB dummy_test['mail_spy_email_templates'].insert([{"_id"=>BSON::ObjectId('4f26fa05816134db90000006'), "name"=>"test", "html_erb"=>"Hello World", "text_erb"=>"Hello World", "template_values_definition"=>{}, "updated_at"=>2012-01-30 20:13:57 UTC, "created_at"=>2012-01-30 20:13:57 UTC}])
6889
+  (0.0ms) rollback transaction
6890
+  (0.0ms) begin transaction
6891
+ MONGODB dummy_test['$cmd'].find({"count"=>"mail_spy_email_templates", "query"=>{}, "fields"=>nil}).limit(-1)
6892
+ MONGODB dummy_test['mail_spy_email_templates'].remove({})
6893
+ MONGODB dummy_test['$cmd'].find({"count"=>"mail_spy_emails", "query"=>{}, "fields"=>nil}).limit(-1)
6894
+ MONGODB dummy_test['mail_spy_emails'].remove({})
6895
+ MONGODB dummy_test['mail_spy_email_templates'].insert([{"_id"=>BSON::ObjectId('4f26fa05816134db90000007'), "name"=>"test", "html_erb"=>"Hello World", "text_erb"=>"Hello World", "template_values_definition"=>{}, "updated_at"=>2012-01-30 20:13:57 UTC, "created_at"=>2012-01-30 20:13:57 UTC}])
6896
+  (0.0ms) rollback transaction
6897
+  (0.0ms) begin transaction
6898
+ MONGODB dummy_test['$cmd'].find({"count"=>"mail_spy_email_templates", "query"=>{}, "fields"=>nil}).limit(-1)
6899
+ MONGODB dummy_test['mail_spy_email_templates'].remove({})
6900
+ MONGODB dummy_test['$cmd'].find({"count"=>"mail_spy_emails", "query"=>{}, "fields"=>nil}).limit(-1)
6901
+ MONGODB dummy_test['mail_spy_emails'].remove({})
6902
+ MONGODB dummy_test['mail_spy_email_templates'].insert([{"_id"=>BSON::ObjectId('4f26fa05816134db90000008'), "name"=>"test", "html_erb"=>"Hello World", "text_erb"=>"Hello World", "template_values_definition"=>{}, "updated_at"=>2012-01-30 20:13:57 UTC, "created_at"=>2012-01-30 20:13:57 UTC}])
6903
+ MONGODB dummy_test['mail_spy_email_templates'].find({:name=>"NOT HERE"}).limit(-1).sort([[:_id, :asc]])
6904
+  (0.0ms) rollback transaction
6905
+  (0.0ms) begin transaction
6906
+ MONGODB dummy_test['$cmd'].find({"count"=>"mail_spy_email_templates", "query"=>{}, "fields"=>nil}).limit(-1)
6907
+ MONGODB dummy_test['mail_spy_email_templates'].remove({})
6908
+ MONGODB dummy_test['$cmd'].find({"count"=>"mail_spy_emails", "query"=>{}, "fields"=>nil}).limit(-1)
6909
+ MONGODB dummy_test['mail_spy_emails'].remove({})
6910
+ MONGODB dummy_test['mail_spy_email_templates'].insert([{"_id"=>BSON::ObjectId('4f26fa05816134db90000009'), "name"=>"test", "html_erb"=>"Hello World", "text_erb"=>"Hello World", "template_values_definition"=>{}, "updated_at"=>2012-01-30 20:13:57 UTC, "created_at"=>2012-01-30 20:13:57 UTC}])
6911
+ MONGODB dummy_test['mail_spy_email_templates'].find({:name=>"test"}).limit(-1).sort([[:_id, :asc]])
6912
+ MONGODB dummy_test['mail_spy_emails'].insert([{"_id"=>BSON::ObjectId('4f26fa05816134db9000000a'), "to"=>"trcarden@gmail.com", "from"=>"test@test.com", "reply_to"=>"testGuy", "subject"=>"test subject", "template_name"=>"test", "template_values"=>{}, "campaign"=>"test campaign", "stream"=>"test stream", "component"=>"test component", "schedule_at"=>2012-01-30 20:13:57 UTC, "updated_at"=>2012-01-30 20:13:57 UTC, "created_at"=>2012-01-30 20:13:57 UTC}])
6913
+ MONGODB dummy_test['mail_spy_emails'].update({"_id"=>BSON::ObjectId('4f26fa05816134db9000000a')}, {"$set"=>{"email_template_id"=>BSON::ObjectId('4f26fa05816134db90000009')}})
6914
+ MONGODB dummy_test['mail_spy_emails'].find({:schedule_at=>{"$lte"=>2012-01-30 20:13:57 UTC}, :sent=>false}, {:_id=>1}).limit(-1)
6915
+  (0.1ms) rollback transaction
6916
+  (0.0ms) begin transaction
6917
+ MONGODB dummy_test['$cmd'].find({"count"=>"mail_spy_email_templates", "query"=>{}, "fields"=>nil}).limit(-1)
6918
+ MONGODB dummy_test['mail_spy_email_templates'].remove({})
6919
+ MONGODB dummy_test['$cmd'].find({"count"=>"mail_spy_emails", "query"=>{}, "fields"=>nil}).limit(-1)
6920
+ MONGODB dummy_test['mail_spy_emails'].remove({})
6921
+  (0.0ms) rollback transaction
6922
+  (0.1ms) begin transaction
6923
+ MONGODB dummy_test['mail_spy_email_templates'].insert([{"_id"=>BSON::ObjectId('4f26fa05816134db9000000b'), "name"=>"a test template", "html_erb"=>"A link : <%= track_link 'My home', 'www.google.com' %> <br> A Bug <%= tracking_bug %>", "text_erb"=>"A link : <%= track_link 'My home', 'www.google.com' %> <br> A Bug <%= tracking_bug %>", "template_values_definition"=>{}, "updated_at"=>2012-01-30 20:13:57 UTC, "created_at"=>2012-01-30 20:13:57 UTC}])
6924
+ MONGODB dummy_test['mail_spy_email_templates'].find({:name=>"a test template"}).limit(-1).sort([[:_id, :asc]])
6925
+ MONGODB dummy_test['mail_spy_emails'].insert([{"_id"=>BSON::ObjectId('4f26fa05816134db9000000c'), "to"=>"trcarden@gmail.com", "from"=>"test@test.com", "reply_to"=>"testGuy", "subject"=>"test subject", "template_name"=>"a test template", "template_values"=>{}, "campaign"=>"test campaign", "stream"=>"test stream", "component"=>"test component", "schedule_at"=>2012-01-30 20:13:57 UTC, "updated_at"=>2012-01-30 20:13:57 UTC, "created_at"=>2012-01-30 20:13:57 UTC}])
6926
+ MONGODB dummy_test['mail_spy_emails'].update({"_id"=>BSON::ObjectId('4f26fa05816134db9000000c')}, {"$set"=>{"email_template_id"=>BSON::ObjectId('4f26fa05816134db9000000b')}})
6927
+ MONGODB dummy_test['mail_spy_emails'].find({}).limit(-1).sort([[:_id, :asc]])
6928
+ Processing by MailSpy::TrackingController#action as HTML
6929
+ Parameters: {"eid"=>"4f26fa05816134db9000000c", "action_type"=>"Conversion", "count"=>"3"}
6930
+ MONGODB dummy_test['mail_spy_emails'].find({:_id=>BSON::ObjectId('4f26fa05816134db9000000c')}).limit(-1).sort([[:_id, :asc]])
6931
+ MONGODB dummy_test['mail_spy_emails'].update({"_id"=>BSON::ObjectId('4f26fa05816134db9000000c')}, {"$push"=>{"actions"=>{"count"=>3, "_id"=>BSON::ObjectId('4f26fa05816134db9000000d'), "action_type"=>"Conversion", "updated_at"=>2012-01-30 20:13:57 UTC, "created_at"=>2012-01-30 20:13:57 UTC}}})
6932
+ Completed 200 OK in 5ms (ActiveRecord: 0.0ms)
6933
+ MONGODB dummy_test['mail_spy_emails'].find({:_id=>BSON::ObjectId('4f26fa05816134db9000000c')}).limit(-1)
6934
+ MONGODB dummy_test['$cmd'].find({"count"=>"mail_spy_email_templates", "query"=>{}, "fields"=>nil}).limit(-1)
6935
+ MONGODB dummy_test['mail_spy_email_templates'].remove({})
6936
+ MONGODB dummy_test['$cmd'].find({"count"=>"mail_spy_emails", "query"=>{}, "fields"=>nil}).limit(-1)
6937
+ MONGODB dummy_test['mail_spy_emails'].remove({})
6938
+  (0.1ms) rollback transaction
6939
+  (0.0ms) begin transaction
6940
+ MONGODB dummy_test['mail_spy_email_templates'].insert([{"_id"=>BSON::ObjectId('4f26fa05816134db9000000e'), "name"=>"a test template", "html_erb"=>"A link : <%= track_link 'My home', 'www.google.com' %> <br> A Bug <%= tracking_bug %>", "text_erb"=>"A link : <%= track_link 'My home', 'www.google.com' %> <br> A Bug <%= tracking_bug %>", "template_values_definition"=>{}, "updated_at"=>2012-01-30 20:13:57 UTC, "created_at"=>2012-01-30 20:13:57 UTC}])
6941
+ MONGODB dummy_test['mail_spy_email_templates'].find({:name=>"a test template"}).limit(-1).sort([[:_id, :asc]])
6942
+ MONGODB dummy_test['mail_spy_emails'].insert([{"_id"=>BSON::ObjectId('4f26fa05816134db9000000f'), "to"=>"trcarden@gmail.com", "from"=>"test@test.com", "reply_to"=>"testGuy", "subject"=>"test subject", "template_name"=>"a test template", "template_values"=>{}, "campaign"=>"test campaign", "stream"=>"test stream", "component"=>"test component", "schedule_at"=>2012-01-30 20:13:57 UTC, "updated_at"=>2012-01-30 20:13:57 UTC, "created_at"=>2012-01-30 20:13:57 UTC}])
6943
+ MONGODB dummy_test['mail_spy_emails'].update({"_id"=>BSON::ObjectId('4f26fa05816134db9000000f')}, {"$set"=>{"email_template_id"=>BSON::ObjectId('4f26fa05816134db9000000e')}})
6944
+ MONGODB dummy_test['mail_spy_emails'].find({}).limit(-1).sort([[:_id, :asc]])
6945
+ Processing by MailSpy::TrackingController#bug as HTML
6946
+ Parameters: {"eid"=>"4f26fa05816134db9000000f"}
6947
+ MONGODB dummy_test['mail_spy_emails'].find({:_id=>BSON::ObjectId('4f26fa05816134db9000000f')}).limit(-1).sort([[:_id, :asc]])
6948
+ MONGODB dummy_test['mail_spy_emails'].update({"_id"=>BSON::ObjectId('4f26fa05816134db9000000f')}, {"$push"=>{"actions"=>{"count"=>1, "_id"=>BSON::ObjectId('4f26fa05816134db90000010'), "action_type"=>"open", "updated_at"=>2012-01-30 20:13:57 UTC, "created_at"=>2012-01-30 20:13:57 UTC}}})
6949
+ Completed 200 OK in 3ms (ActiveRecord: 0.0ms)
6950
+ MONGODB dummy_test['mail_spy_emails'].find({:_id=>BSON::ObjectId('4f26fa05816134db9000000f')}).limit(-1)
6951
+ MONGODB dummy_test['$cmd'].find({"count"=>"mail_spy_email_templates", "query"=>{}, "fields"=>nil}).limit(-1)
6952
+ MONGODB dummy_test['mail_spy_email_templates'].remove({})
6953
+ MONGODB dummy_test['$cmd'].find({"count"=>"mail_spy_emails", "query"=>{}, "fields"=>nil}).limit(-1)
6954
+ MONGODB dummy_test['mail_spy_emails'].remove({})
6955
+  (0.1ms) rollback transaction
6956
+  (0.0ms) begin transaction
6957
+ MONGODB dummy_test['mail_spy_email_templates'].insert([{"_id"=>BSON::ObjectId('4f26fa05816134db90000011'), "name"=>"a test template", "html_erb"=>"A link : <%= track_link 'My home', 'www.google.com' %> <br> A Bug <%= tracking_bug %>", "text_erb"=>"A link : <%= track_link 'My home', 'www.google.com' %> <br> A Bug <%= tracking_bug %>", "template_values_definition"=>{}, "updated_at"=>2012-01-30 20:13:57 UTC, "created_at"=>2012-01-30 20:13:57 UTC}])
6958
+ MONGODB dummy_test['mail_spy_email_templates'].find({:name=>"a test template"}).limit(-1).sort([[:_id, :asc]])
6959
+ MONGODB dummy_test['mail_spy_emails'].insert([{"_id"=>BSON::ObjectId('4f26fa05816134db90000012'), "to"=>"trcarden@gmail.com", "from"=>"test@test.com", "reply_to"=>"testGuy", "subject"=>"test subject", "template_name"=>"a test template", "template_values"=>{}, "campaign"=>"test campaign", "stream"=>"test stream", "component"=>"test component", "schedule_at"=>2012-01-30 20:13:57 UTC, "updated_at"=>2012-01-30 20:13:57 UTC, "created_at"=>2012-01-30 20:13:57 UTC}])
6960
+ MONGODB dummy_test['mail_spy_emails'].update({"_id"=>BSON::ObjectId('4f26fa05816134db90000012')}, {"$set"=>{"email_template_id"=>BSON::ObjectId('4f26fa05816134db90000011')}})
6961
+ MONGODB dummy_test['mail_spy_emails'].find({}).limit(-1).sort([[:_id, :asc]])
6962
+ Processing by MailSpy::TrackingController#link as HTML
6963
+ Parameters: {"eid"=>"4f26fa05816134db90000012", "url"=>"http://google.com", "n"=>"0"}
6964
+ MONGODB dummy_test['mail_spy_emails'].find({:_id=>BSON::ObjectId('4f26fa05816134db90000012')}).limit(-1).sort([[:_id, :asc]])
6965
+ MONGODB dummy_test['mail_spy_emails'].update({"_id"=>BSON::ObjectId('4f26fa05816134db90000012')}, {"$push"=>{"actions"=>{"count"=>1, "_id"=>BSON::ObjectId('4f26fa05816134db90000013'), "action_type"=>"click", "details"=>{:url=>"http://google.com", :link_number=>"0"}, "updated_at"=>2012-01-30 20:13:57 UTC, "created_at"=>2012-01-30 20:13:57 UTC}}})
6966
+ Redirected to http://google.com
6967
+ Completed 302 Found in 3ms (ActiveRecord: 0.0ms)
6968
+ MONGODB dummy_test['mail_spy_emails'].find({:_id=>BSON::ObjectId('4f26fa05816134db90000012')}).limit(-1)
6969
+ MONGODB dummy_test['$cmd'].find({"count"=>"mail_spy_email_templates", "query"=>{}, "fields"=>nil}).limit(-1)
6970
+ MONGODB dummy_test['mail_spy_email_templates'].remove({})
6971
+ MONGODB dummy_test['$cmd'].find({"count"=>"mail_spy_emails", "query"=>{}, "fields"=>nil}).limit(-1)
6972
+ MONGODB dummy_test['mail_spy_emails'].remove({})
6973
+  (0.1ms) rollback transaction
6974
+  (0.0ms) begin transaction
6975
+ MONGODB dummy_test['mail_spy_email_templates'].insert([{"_id"=>BSON::ObjectId('4f26fa05816134db90000014'), "name"=>"a test template", "html_erb"=>"A link : <%= track_link 'My home', 'www.google.com' %> <br> A Bug <%= tracking_bug %>", "text_erb"=>"A link : <%= track_link 'My home', 'www.google.com' %> <br> A Bug <%= tracking_bug %>", "template_values_definition"=>{}, "updated_at"=>2012-01-30 20:13:57 UTC, "created_at"=>2012-01-30 20:13:57 UTC}])
6976
+ MONGODB dummy_test['mail_spy_email_templates'].find({:name=>"a test template"}).limit(-1).sort([[:_id, :asc]])
6977
+ MONGODB dummy_test['mail_spy_emails'].insert([{"_id"=>BSON::ObjectId('4f26fa05816134db90000015'), "to"=>"trcarden@gmail.com", "from"=>"test@test.com", "reply_to"=>"testGuy", "subject"=>"test subject", "template_name"=>"a test template", "template_values"=>{}, "campaign"=>"test campaign", "stream"=>"test stream", "component"=>"test component", "schedule_at"=>2012-01-30 20:13:57 UTC, "updated_at"=>2012-01-30 20:13:57 UTC, "created_at"=>2012-01-30 20:13:57 UTC}])
6978
+ MONGODB dummy_test['mail_spy_emails'].update({"_id"=>BSON::ObjectId('4f26fa05816134db90000015')}, {"$set"=>{"email_template_id"=>BSON::ObjectId('4f26fa05816134db90000014')}})
6979
+ MONGODB dummy_test['mail_spy_emails'].find({}).limit(-1).sort([[:_id, :asc]])
6980
+ MONGODB dummy_test['$cmd'].find({"count"=>"mail_spy_email_templates", "query"=>{}, "fields"=>nil}).limit(-1)
6981
+ MONGODB dummy_test['mail_spy_email_templates'].remove({})
6982
+ MONGODB dummy_test['$cmd'].find({"count"=>"mail_spy_emails", "query"=>{}, "fields"=>nil}).limit(-1)
6983
+ MONGODB dummy_test['mail_spy_emails'].remove({})
6984
+  (0.1ms) rollback transaction
6985
+  (0.1ms) begin transaction
6986
+  (0.0ms) rollback transaction
6987
+ MONGODB [WARNING] Please note that logging negatively impacts client-side performance. You should set your logging level no lower than :info in production.
6988
+ MONGODB admin['$cmd'].find({:ismaster=>1}).limit(-1)
6989
+  (0.3ms) begin transaction
6990
+ MONGODB dummy_test['system.namespaces'].find({})
6991
+ MONGODB dummy_test['$cmd'].find({"count"=>"mail_spy_email_templates", "query"=>{}, "fields"=>nil}).limit(-1)
6992
+ MONGODB dummy_test['mail_spy_email_templates'].remove({})
6993
+ MONGODB dummy_test['system.namespaces'].find({})
6994
+ MONGODB dummy_test['$cmd'].find({"count"=>"mail_spy_emails", "query"=>{}, "fields"=>nil}).limit(-1)
6995
+ MONGODB dummy_test['mail_spy_emails'].remove({})
6996
+ MONGODB dummy_test['mail_spy_email_templates'].insert([{"_id"=>BSON::ObjectId('4f26fa20816134db96000001'), "name"=>"test", "html_erb"=>"Hello World", "text_erb"=>"Hello World", "template_values_definition"=>{}, "updated_at"=>2012-01-30 20:14:24 UTC, "created_at"=>2012-01-30 20:14:24 UTC}])
6997
+ MONGODB dummy_test['mail_spy_email_templates'].find({:name=>"test"}).limit(-1).sort([[:_id, :asc]])
6998
+ MONGODB dummy_test['mail_spy_emails'].insert([{"_id"=>BSON::ObjectId('4f26fa20816134db96000002'), "to"=>"test@test.com", "from"=>"test@test.com", "reply_to"=>"testGuy", "subject"=>"test subject", "template_name"=>"test", "template_values"=>{}, "campaign"=>"test campaign", "stream"=>"test stream", "component"=>"test component", "schedule_at"=>2012-01-30 20:14:24 UTC, "updated_at"=>2012-01-30 20:14:24 UTC, "created_at"=>2012-01-30 20:14:24 UTC}])
6999
+ MONGODB dummy_test['mail_spy_emails'].update({"_id"=>BSON::ObjectId('4f26fa20816134db96000002')}, {"$set"=>{"email_template_id"=>BSON::ObjectId('4f26fa20816134db96000001')}})
7000
+  (0.1ms) rollback transaction
7001
+  (0.0ms) begin transaction
7002
+ MONGODB dummy_test['$cmd'].find({"count"=>"mail_spy_email_templates", "query"=>{}, "fields"=>nil}).limit(-1)
7003
+ MONGODB dummy_test['mail_spy_email_templates'].remove({})
7004
+ MONGODB dummy_test['$cmd'].find({"count"=>"mail_spy_emails", "query"=>{}, "fields"=>nil}).limit(-1)
7005
+ MONGODB dummy_test['mail_spy_emails'].remove({})
7006
+ MONGODB dummy_test['mail_spy_email_templates'].insert([{"_id"=>BSON::ObjectId('4f26fa20816134db96000003'), "name"=>"test", "html_erb"=>"Hello World", "text_erb"=>"Hello World", "template_values_definition"=>{}, "updated_at"=>2012-01-30 20:14:24 UTC, "created_at"=>2012-01-30 20:14:24 UTC}])
7007
+  (0.0ms) rollback transaction
7008
+  (0.0ms) begin transaction
7009
+ MONGODB dummy_test['$cmd'].find({"count"=>"mail_spy_email_templates", "query"=>{}, "fields"=>nil}).limit(-1)
7010
+ MONGODB dummy_test['mail_spy_email_templates'].remove({})
7011
+ MONGODB dummy_test['$cmd'].find({"count"=>"mail_spy_emails", "query"=>{}, "fields"=>nil}).limit(-1)
7012
+ MONGODB dummy_test['mail_spy_emails'].remove({})
7013
+ MONGODB dummy_test['mail_spy_email_templates'].insert([{"_id"=>BSON::ObjectId('4f26fa20816134db96000004'), "name"=>"test", "html_erb"=>"Hello World", "text_erb"=>"Hello World", "template_values_definition"=>{}, "updated_at"=>2012-01-30 20:14:24 UTC, "created_at"=>2012-01-30 20:14:24 UTC}])
7014
+  (0.1ms) rollback transaction
7015
+  (0.1ms) begin transaction
7016
+ MONGODB dummy_test['$cmd'].find({"count"=>"mail_spy_email_templates", "query"=>{}, "fields"=>nil}).limit(-1)
7017
+ MONGODB dummy_test['mail_spy_email_templates'].remove({})
7018
+ MONGODB dummy_test['$cmd'].find({"count"=>"mail_spy_emails", "query"=>{}, "fields"=>nil}).limit(-1)
7019
+ MONGODB dummy_test['mail_spy_emails'].remove({})
7020
+ MONGODB dummy_test['mail_spy_email_templates'].insert([{"_id"=>BSON::ObjectId('4f26fa20816134db96000005'), "name"=>"test", "html_erb"=>"Hello World", "text_erb"=>"Hello World", "template_values_definition"=>{}, "updated_at"=>2012-01-30 20:14:24 UTC, "created_at"=>2012-01-30 20:14:24 UTC}])
7021
+  (0.0ms) rollback transaction
7022
+  (0.0ms) begin transaction
7023
+ MONGODB dummy_test['$cmd'].find({"count"=>"mail_spy_email_templates", "query"=>{}, "fields"=>nil}).limit(-1)
7024
+ MONGODB dummy_test['mail_spy_email_templates'].remove({})
7025
+ MONGODB dummy_test['$cmd'].find({"count"=>"mail_spy_emails", "query"=>{}, "fields"=>nil}).limit(-1)
7026
+ MONGODB dummy_test['mail_spy_emails'].remove({})
7027
+ MONGODB dummy_test['mail_spy_email_templates'].insert([{"_id"=>BSON::ObjectId('4f26fa20816134db96000006'), "name"=>"test", "html_erb"=>"Hello World", "text_erb"=>"Hello World", "template_values_definition"=>{}, "updated_at"=>2012-01-30 20:14:24 UTC, "created_at"=>2012-01-30 20:14:24 UTC}])
7028
+ MONGODB dummy_test['mail_spy_email_templates'].find({:name=>"NOT HERE"}).limit(-1).sort([[:_id, :asc]])
7029
+  (0.0ms) rollback transaction
7030
+  (0.0ms) begin transaction
7031
+ MONGODB dummy_test['$cmd'].find({"count"=>"mail_spy_email_templates", "query"=>{}, "fields"=>nil}).limit(-1)
7032
+ MONGODB dummy_test['mail_spy_email_templates'].remove({})
7033
+ MONGODB dummy_test['$cmd'].find({"count"=>"mail_spy_emails", "query"=>{}, "fields"=>nil}).limit(-1)
7034
+ MONGODB dummy_test['mail_spy_emails'].remove({})
7035
+ MONGODB dummy_test['mail_spy_email_templates'].insert([{"_id"=>BSON::ObjectId('4f26fa20816134db96000007'), "name"=>"test", "html_erb"=>"Hello World", "text_erb"=>"Hello World", "template_values_definition"=>{}, "updated_at"=>2012-01-30 20:14:24 UTC, "created_at"=>2012-01-30 20:14:24 UTC}])
7036
+ MONGODB dummy_test['mail_spy_email_templates'].find({:name=>"test"}).limit(-1).sort([[:_id, :asc]])
7037
+ MONGODB dummy_test['mail_spy_emails'].insert([{"_id"=>BSON::ObjectId('4f26fa20816134db96000008'), "to"=>"trcarden@gmail.com", "from"=>"test@test.com", "reply_to"=>"testGuy", "subject"=>"test subject", "template_name"=>"test", "template_values"=>{}, "campaign"=>"test campaign", "stream"=>"test stream", "component"=>"test component", "schedule_at"=>2012-01-30 20:14:24 UTC, "updated_at"=>2012-01-30 20:14:24 UTC, "created_at"=>2012-01-30 20:14:24 UTC}])
7038
+ MONGODB dummy_test['mail_spy_emails'].update({"_id"=>BSON::ObjectId('4f26fa20816134db96000008')}, {"$set"=>{"email_template_id"=>BSON::ObjectId('4f26fa20816134db96000007')}})
7039
+ MONGODB dummy_test['mail_spy_emails'].find({:schedule_at=>{"$lte"=>2012-01-30 20:14:24 UTC}, :sent=>false}, {:_id=>1}).limit(-1)
7040
+  (0.1ms) rollback transaction
7041
+  (0.2ms) begin transaction
7042
+ MONGODB dummy_test['$cmd'].find({"count"=>"mail_spy_email_templates", "query"=>{}, "fields"=>nil}).limit(-1)
7043
+ MONGODB dummy_test['mail_spy_email_templates'].remove({})
7044
+ MONGODB dummy_test['$cmd'].find({"count"=>"mail_spy_emails", "query"=>{}, "fields"=>nil}).limit(-1)
7045
+ MONGODB dummy_test['mail_spy_emails'].remove({})
7046
+  (0.0ms) rollback transaction
7047
+  (0.3ms) begin transaction
7048
+ MONGODB dummy_test['system.namespaces'].find({})
7049
+ MONGODB dummy_test['$cmd'].find({"count"=>"mail_spy_email_templates", "query"=>{}, "fields"=>nil}).limit(-1)
7050
+ MONGODB dummy_test['mail_spy_email_templates'].remove({})
7051
+ MONGODB dummy_test['system.namespaces'].find({})
7052
+ MONGODB dummy_test['$cmd'].find({"count"=>"mail_spy_emails", "query"=>{}, "fields"=>nil}).limit(-1)
7053
+ MONGODB dummy_test['mail_spy_emails'].remove({})
7054
+ MONGODB dummy_test['mail_spy_email_templates'].insert([{"_id"=>BSON::ObjectId('4f26fa9d816134db9e000001'), "name"=>"test", "html_erb"=>"Hello World", "text_erb"=>"Hello World", "template_values_definition"=>{}, "updated_at"=>2012-01-30 20:16:29 UTC, "created_at"=>2012-01-30 20:16:29 UTC}])
7055
+ MONGODB dummy_test['mail_spy_email_templates'].find({:name=>"test"}).limit(-1).sort([[:_id, :asc]])
7056
+ MONGODB dummy_test['mail_spy_emails'].insert([{"sent"=>false, "_id"=>BSON::ObjectId('4f26fa9d816134db9e000002'), "to"=>"test@test.com", "from"=>"test@test.com", "reply_to"=>"testGuy", "subject"=>"test subject", "template_name"=>"test", "template_values"=>{}, "campaign"=>"test campaign", "stream"=>"test stream", "component"=>"test component", "schedule_at"=>2012-01-30 20:16:29 UTC, "updated_at"=>2012-01-30 20:16:29 UTC, "created_at"=>2012-01-30 20:16:29 UTC}])
7057
+ MONGODB dummy_test['mail_spy_emails'].update({"_id"=>BSON::ObjectId('4f26fa9d816134db9e000002')}, {"$set"=>{"email_template_id"=>BSON::ObjectId('4f26fa9d816134db9e000001')}})
7058
+  (0.1ms) rollback transaction
7059
+  (0.0ms) begin transaction
7060
+ MONGODB dummy_test['$cmd'].find({"count"=>"mail_spy_email_templates", "query"=>{}, "fields"=>nil}).limit(-1)
7061
+ MONGODB dummy_test['mail_spy_email_templates'].remove({})
7062
+ MONGODB dummy_test['$cmd'].find({"count"=>"mail_spy_emails", "query"=>{}, "fields"=>nil}).limit(-1)
7063
+ MONGODB dummy_test['mail_spy_emails'].remove({})
7064
+ MONGODB dummy_test['mail_spy_email_templates'].insert([{"_id"=>BSON::ObjectId('4f26fa9d816134db9e000003'), "name"=>"test", "html_erb"=>"Hello World", "text_erb"=>"Hello World", "template_values_definition"=>{}, "updated_at"=>2012-01-30 20:16:29 UTC, "created_at"=>2012-01-30 20:16:29 UTC}])
7065
+  (0.0ms) rollback transaction
7066
+  (0.0ms) begin transaction
7067
+ MONGODB dummy_test['$cmd'].find({"count"=>"mail_spy_email_templates", "query"=>{}, "fields"=>nil}).limit(-1)
7068
+ MONGODB dummy_test['mail_spy_email_templates'].remove({})
7069
+ MONGODB dummy_test['$cmd'].find({"count"=>"mail_spy_emails", "query"=>{}, "fields"=>nil}).limit(-1)
7070
+ MONGODB dummy_test['mail_spy_emails'].remove({})
7071
+ MONGODB dummy_test['mail_spy_email_templates'].insert([{"_id"=>BSON::ObjectId('4f26fa9d816134db9e000004'), "name"=>"test", "html_erb"=>"Hello World", "text_erb"=>"Hello World", "template_values_definition"=>{}, "updated_at"=>2012-01-30 20:16:29 UTC, "created_at"=>2012-01-30 20:16:29 UTC}])
7072
+  (0.0ms) rollback transaction
7073
+  (0.0ms) begin transaction
7074
+ MONGODB dummy_test['$cmd'].find({"count"=>"mail_spy_email_templates", "query"=>{}, "fields"=>nil}).limit(-1)
7075
+ MONGODB dummy_test['mail_spy_email_templates'].remove({})
7076
+ MONGODB dummy_test['$cmd'].find({"count"=>"mail_spy_emails", "query"=>{}, "fields"=>nil}).limit(-1)
7077
+ MONGODB dummy_test['mail_spy_emails'].remove({})
7078
+ MONGODB dummy_test['mail_spy_email_templates'].insert([{"_id"=>BSON::ObjectId('4f26fa9d816134db9e000005'), "name"=>"test", "html_erb"=>"Hello World", "text_erb"=>"Hello World", "template_values_definition"=>{}, "updated_at"=>2012-01-30 20:16:29 UTC, "created_at"=>2012-01-30 20:16:29 UTC}])
7079
+  (0.0ms) rollback transaction
7080
+  (0.1ms) begin transaction
7081
+ MONGODB dummy_test['$cmd'].find({"count"=>"mail_spy_email_templates", "query"=>{}, "fields"=>nil}).limit(-1)
7082
+ MONGODB dummy_test['mail_spy_email_templates'].remove({})
7083
+ MONGODB dummy_test['$cmd'].find({"count"=>"mail_spy_emails", "query"=>{}, "fields"=>nil}).limit(-1)
7084
+ MONGODB dummy_test['mail_spy_emails'].remove({})
7085
+ MONGODB dummy_test['mail_spy_email_templates'].insert([{"_id"=>BSON::ObjectId('4f26fa9d816134db9e000006'), "name"=>"test", "html_erb"=>"Hello World", "text_erb"=>"Hello World", "template_values_definition"=>{}, "updated_at"=>2012-01-30 20:16:29 UTC, "created_at"=>2012-01-30 20:16:29 UTC}])
7086
+ MONGODB dummy_test['mail_spy_email_templates'].find({:name=>"NOT HERE"}).limit(-1).sort([[:_id, :asc]])
7087
+  (0.1ms) rollback transaction
7088
+  (0.1ms) begin transaction
7089
+ MONGODB dummy_test['$cmd'].find({"count"=>"mail_spy_email_templates", "query"=>{}, "fields"=>nil}).limit(-1)
7090
+ MONGODB dummy_test['mail_spy_email_templates'].remove({})
7091
+ MONGODB dummy_test['$cmd'].find({"count"=>"mail_spy_emails", "query"=>{}, "fields"=>nil}).limit(-1)
7092
+ MONGODB dummy_test['mail_spy_emails'].remove({})
7093
+ MONGODB dummy_test['mail_spy_email_templates'].insert([{"_id"=>BSON::ObjectId('4f26fa9d816134db9e000007'), "name"=>"test", "html_erb"=>"Hello World", "text_erb"=>"Hello World", "template_values_definition"=>{}, "updated_at"=>2012-01-30 20:16:29 UTC, "created_at"=>2012-01-30 20:16:29 UTC}])
7094
+ MONGODB dummy_test['mail_spy_email_templates'].find({:name=>"test"}).limit(-1).sort([[:_id, :asc]])
7095
+ MONGODB dummy_test['mail_spy_emails'].insert([{"sent"=>false, "_id"=>BSON::ObjectId('4f26fa9d816134db9e000008'), "to"=>"trcarden@gmail.com", "from"=>"test@test.com", "reply_to"=>"testGuy", "subject"=>"test subject", "template_name"=>"test", "template_values"=>{}, "campaign"=>"test campaign", "stream"=>"test stream", "component"=>"test component", "schedule_at"=>2012-01-30 20:16:29 UTC, "updated_at"=>2012-01-30 20:16:29 UTC, "created_at"=>2012-01-30 20:16:29 UTC}])
7096
+ MONGODB dummy_test['mail_spy_emails'].update({"_id"=>BSON::ObjectId('4f26fa9d816134db9e000008')}, {"$set"=>{"email_template_id"=>BSON::ObjectId('4f26fa9d816134db9e000007')}})
7097
+ MONGODB dummy_test['mail_spy_emails'].find({:schedule_at=>{"$lte"=>2012-01-30 20:16:29 UTC}, :sent=>false}, {:_id=>1}).limit(-1)
7098
+ MONGODB dummy_test['mail_spy_emails'].find({:schedule_at=>{"$lte"=>2012-01-30 20:16:29 UTC}, :sent=>false}).limit(100)
7099
+ MONGODB dummy_test['mail_spy_email_templates'].find({:_id=>BSON::ObjectId('4f26fa9d816134db9e000007')}).limit(-1).sort([[:_id, :asc]])
7100
+ Rendered inline template (17.9ms)
7101
+ Rendered inline template (0.3ms)
7102
+
7103
+ Sent mail to trcarden@gmail.com (109ms)
7104
+ Date: Mon, 30 Jan 2012 12:16:31 -0800
7105
+ From: test@test.com
7106
+ Reply-To: testGuy
7107
+ To: trcarden@gmail.com
7108
+ Message-ID: <4f26fa9fce684_db9e80a7faa0642f0@timly.local.mail>
7109
+ Subject: test subject
7110
+ Mime-Version: 1.0
7111
+ Content-Type: multipart/alternative;
7112
+ boundary="--==_mimepart_4f26fa9fb34d4_db9e80a7faa06399f";
7113
+ charset=UTF-8
7114
+ Content-Transfer-Encoding: 7bit
7115
+
7116
+
7117
+
7118
+ ----==_mimepart_4f26fa9fb34d4_db9e80a7faa06399f
7119
+ Date: Mon, 30 Jan 2012 12:16:31 -0800
7120
+ Mime-Version: 1.0
7121
+ Content-Type: text/plain;
7122
+ charset=UTF-8
7123
+ Content-Transfer-Encoding: 7bit
7124
+ Content-ID: <4f26fa9fc1daf_db9e80a7faa064046@timly.local.mail>
7125
+
7126
+ Hello World
7127
+
7128
+ ----==_mimepart_4f26fa9fb34d4_db9e80a7faa06399f
7129
+ Date: Mon, 30 Jan 2012 12:16:31 -0800
7130
+ Mime-Version: 1.0
7131
+ Content-Type: text/html;
7132
+ charset=UTF-8
7133
+ Content-Transfer-Encoding: 7bit
7134
+ Content-ID: <4f26fa9fc9ade_db9e80a7faa0641b6@timly.local.mail>
7135
+
7136
+ Hello World
7137
+
7138
+ ----==_mimepart_4f26fa9fb34d4_db9e80a7faa06399f--
7139
+
7140
+ MONGODB dummy_test['mail_spy_emails'].update({"_id"=>BSON::ObjectId('4f26fa9d816134db9e000008')}, {"$set"=>{"sent"=>true, "updated_at"=>2012-01-30 20:16:31 UTC}})
7141
+ MONGODB dummy_test['mail_spy_emails'].find({:schedule_at=>{"$lte"=>2012-01-30 20:16:31 UTC}, :sent=>false}, {:_id=>1}).limit(-1)
7142
+  (0.1ms) rollback transaction
7143
+  (0.0ms) begin transaction
7144
+ MONGODB dummy_test['$cmd'].find({"count"=>"mail_spy_email_templates", "query"=>{}, "fields"=>nil}).limit(-1)
7145
+ MONGODB dummy_test['mail_spy_email_templates'].remove({})
7146
+ MONGODB dummy_test['$cmd'].find({"count"=>"mail_spy_emails", "query"=>{}, "fields"=>nil}).limit(-1)
7147
+ MONGODB dummy_test['mail_spy_emails'].remove({})
7148
+  (0.0ms) rollback transaction
@@ -19,7 +19,7 @@ module MailSpy
19
19
  text_erb = "A link : <%= track_link 'My home', 'www.google.com' %> <br> A Bug <%= tracking_bug %>"
20
20
  template_values_definition = {}
21
21
 
22
- template = MailSpy.add_template("a test template", html_erb, text_erb, template_values_definition)
22
+ template = MailSpy.create_template("a test template", html_erb, text_erb, template_values_definition)
23
23
  create_emails(template)
24
24
  email = MailSpy::Email.first
25
25
  mail = MailSpy::CoreMailer.template(email)
@@ -10,7 +10,7 @@ module MailSpy
10
10
  text_erb = "A link : <%= track_link 'My home', 'www.google.com' %> <br> A Bug <%= tracking_bug %>"
11
11
  template_values_definition = {}
12
12
 
13
- template = MailSpy.add_template("a test template", html_erb, text_erb, template_values_definition)
13
+ template = MailSpy.create_template("a test template", html_erb, text_erb, template_values_definition)
14
14
  create_emails(template)
15
15
  @email = MailSpy::Email.first
16
16
  end
data/test/test_helper.rb CHANGED
@@ -64,7 +64,7 @@ class ActiveSupport::TestCase
64
64
  text_erb = "Hello World"
65
65
  template_values_definition = {}
66
66
 
67
- template = MailSpy.add_template(template_name, html_erb, text_erb, template_values_definition)
67
+ template = MailSpy.create_template(template_name, html_erb, text_erb, template_values_definition)
68
68
  block.call(template)
69
69
  end
70
70
 
@@ -81,7 +81,7 @@ class ActiveSupport::TestCase
81
81
  component = "test component"
82
82
  schedule_at = DateTime.now
83
83
 
84
- MailSpy.add_instance(
84
+ MailSpy.create_email(
85
85
  :to => to,
86
86
  :from => from,
87
87
  :reply_to => reply_to,
@@ -12,13 +12,13 @@ module MailSpy
12
12
  end
13
13
 
14
14
  # ------------------------------------------- ADD_TEMPLATE
15
- def test_add_template
15
+ def test_create_template
16
16
  template_name = "test"
17
17
  html_erb = "Hello World"
18
18
  text_erb = "Hello World"
19
19
  template_values_definition = {}
20
20
 
21
- template = MailSpy.add_template(template_name, html_erb, text_erb, template_values_definition)
21
+ template = MailSpy.create_template(template_name, html_erb, text_erb, template_values_definition)
22
22
 
23
23
  assert(template.html_erb == html_erb, "values should be written")
24
24
  assert(template.text_erb == text_erb, "values should be written")
@@ -26,8 +26,8 @@ module MailSpy
26
26
  assert(template.name == template_name, "values should be written")
27
27
  end
28
28
 
29
- # ------------------------------------------- ADD_INSTANCE
30
- def test_add_instance
29
+ # ------------------------------------------- CREATE EMAIL
30
+ def test_create_email
31
31
  do_with_template do |template|
32
32
  to = "test@test.com"
33
33
  from = "test@test.com"
@@ -39,7 +39,7 @@ module MailSpy
39
39
  component = "test component"
40
40
  schedule_at = DateTime.now
41
41
 
42
- email = MailSpy.add_instance(
42
+ email = MailSpy.create_email(
43
43
  :to => to,
44
44
  :from => from,
45
45
  :reply_to => reply_to,
@@ -74,7 +74,7 @@ module MailSpy
74
74
  schedule_at = DateTime.now
75
75
 
76
76
  assert_raise RuntimeError do
77
- MailSpy.add_instance(
77
+ MailSpy.create_email(
78
78
  :from => from,
79
79
  :reply_to => reply_to,
80
80
  :subject => subject,
@@ -102,7 +102,7 @@ module MailSpy
102
102
  schedule_at = DateTime.now
103
103
 
104
104
  assert_raise RuntimeError do
105
- MailSpy.add_instance(
105
+ MailSpy.create_email(
106
106
  :to => to,
107
107
  :from => from,
108
108
  :reply_to => reply_to,
@@ -130,7 +130,7 @@ module MailSpy
130
130
  schedule_at = DateTime.now
131
131
 
132
132
  assert_raise RuntimeError do
133
- MailSpy.add_instance(
133
+ MailSpy.create_email(
134
134
  :to => to,
135
135
  :subject => subject,
136
136
  :from => from,
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: mail_spy
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 0.0.3
5
+ version: 0.0.4
6
6
  platform: ruby
7
7
  authors:
8
8
  - Timothy Cardenas