action_smser 2.0.2 → 2.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,59 +1,67 @@
1
- module ActionSmser
2
- class DeliveryReport < ActiveRecord::Base
1
+ if defined?(ActiveRecord)
2
+ module ActionSmser
3
+ class DeliveryReport < ActiveRecord::Base
3
4
 
4
- has_many :re_deliveries, :class_name => self.to_s, :foreign_key => :re_delivery_of_delivery_report_id
5
- belongs_to :re_delivery_of, :class_name => self.to_s, :foreign_key => :re_delivery_of_delivery_report_id
5
+ has_many :re_deliveries, :class_name => self.to_s, :foreign_key => :re_delivery_of_delivery_report_id
6
+ belongs_to :re_delivery_of, :class_name => self.to_s, :foreign_key => :re_delivery_of_delivery_report_id
6
7
 
7
- def self.build_from_sms(sms, to, msg_id)
8
- @delivery_report = self.new
8
+ def self.build_from_sms(sms, to, msg_id)
9
+ @delivery_report = self.new
9
10
 
10
- [:from, :body, :sms_type, :re_delivery_of_delivery_report_id].each do |var|
11
- @delivery_report.send("#{var}=", sms.send(var))
11
+ [:from, :body, :sms_type, :re_delivery_of_delivery_report_id].each do |var|
12
+ @delivery_report.send("#{var}=", sms.send(var))
13
+ end
14
+ @delivery_report.to = to
15
+ @delivery_report.msg_id = msg_id
16
+ @delivery_report.status = "LOCAL_SENT"
17
+ @delivery_report.gateway = sms.delivery_options[:delivery_method].to_s
18
+ @delivery_report
12
19
  end
13
- @delivery_report.to = to
14
- @delivery_report.msg_id = msg_id
15
- @delivery_report.status = "LOCAL_SENT"
16
- @delivery_report.gateway = sms.delivery_options[:delivery_method].to_s
17
- @delivery_report
18
- end
19
20
 
20
- def self.create_from_sms(sms, to, sms_id)
21
- @delivery_report = self.build_from_sms(sms, to, sms_id)
22
- @delivery_report.save
23
- @delivery_report
24
- end
21
+ def self.create_from_sms(sms, to, sms_id)
22
+ @delivery_report = self.build_from_sms(sms, to, sms_id)
23
+ @delivery_report.save
24
+ @delivery_report
25
+ end
25
26
 
26
- def status=(stat, skip_log = false)
27
- self[:status] = stat
28
- self.status_updated_at = Time.now
29
- add_log("#{Time.now.to_s(:db)}: #{stat}") unless skip_log
30
- end
27
+ def status=(stat, skip_log = false)
28
+ self[:status] = stat
29
+ self.status_updated_at = Time.now
30
+ add_log("#{Time.now.to_s(:db)}: #{stat}") unless skip_log
31
+ end
31
32
 
32
- def add_log(str)
33
- self.log = "" if self.log.nil?
34
- self.log += "#{str}\n"
35
- end
33
+ def add_log(str)
34
+ self.log = "" if self.log.nil?
35
+ self.log += "#{str}\n"
36
+ end
36
37
 
37
- # Copy this delivery_report information to a new sms object
38
- def to_sms
39
- sms_new = ActionSmser::Base.new()
40
- [:sms_type, :to, :from, :body, :sms_type].each do |var|
41
- sms_new.send("#{var}=", self.send(var))
38
+ # Copy this delivery_report information to a new sms object
39
+ def to_sms
40
+ sms_new = ActionSmser::Base.new()
41
+ [:sms_type, :to, :from, :body, :sms_type].each do |var|
42
+ sms_new.send("#{var}=", self.send(var))
43
+ end
44
+ sms_new
42
45
  end
43
- sms_new
44
- end
45
46
 
46
- # This updates re_delivered attribute for itself
47
- def re_delivarable_sms()
48
- ActionSmser::Logger.info("Re_delivering: #{self.inspect}")
49
- self.update_attribute(:re_delivered, true)
50
-
51
- sms_new = self.to_sms
52
- sms_new.sms_type = "#{sms_new.sms_type}.re_delivery"
53
- sms_new.re_delivery_of_delivery_report_id = self.id
47
+ # This updates re_delivered attribute for itself
48
+ def re_delivarable_sms()
49
+ ActionSmser::Logger.info("Re_delivering: #{self.inspect}")
50
+ self.update_attribute(:re_delivered, true)
54
51
 
55
- sms_new
56
- end
52
+ sms_new = self.to_sms
53
+ sms_new.sms_type = "#{sms_new.sms_type}.re_delivery"
54
+ sms_new.re_delivery_of_delivery_report_id = self.id
55
+
56
+ sms_new
57
+ end
57
58
 
59
+ end
60
+ end
61
+ else
62
+ # Fixes "Expected .../delivery_report.rb to define ActionSmser::DeliveryReport (LoadError)"
63
+ module ActionSmser
64
+ class DeliveryReport
65
+ end
58
66
  end
59
67
  end
data/lib/action_smser.rb CHANGED
@@ -5,6 +5,7 @@ require "action_smser/delivery_methods/test_array"
5
5
  require "action_smser/delivery_methods/simple_http"
6
6
  require "action_smser/delivery_methods/nexmo"
7
7
  require "action_smser/delivery_methods/delayed_job"
8
+ require "action_smser/delivery_methods/smstrade"
8
9
 
9
10
  module ActionSmser
10
11
 
@@ -131,6 +131,10 @@ class ActionSmser::Base
131
131
  from.to_s.gsub(/^(\+|0)/, "")
132
132
  end
133
133
 
134
+ def from_escaped
135
+ CGI.escape from_encoded
136
+ end
137
+
134
138
  def ttl_to_i
135
139
  ttl.blank? ? ActionSmser.delivery_options[:default_ttl] : ttl.to_i
136
140
  end
@@ -0,0 +1,75 @@
1
+ require 'net/http'
2
+ require 'net/https'
3
+
4
+ module ActionSmser::DeliveryMethods
5
+
6
+ # Documentation: http://www.smstrade.eu/pdf/SMS-Gateway_HTTP_API_v2_en.pdf
7
+ class Smstrade < SimpleHttp
8
+ ERROR_CODES = {
9
+ "10" => "RECEIVER_INVALID",
10
+ "20" => "SENDER_INVALID",
11
+ "30" => "BODY_INVALID",
12
+ "31" => "MESSAGE_TYPE_INVALID",
13
+ "40" => "ROUTE_INVALID",
14
+ "50" => "API_KEY_INVALID",
15
+ "60" => "INSUFFICIENT_FUNDS",
16
+ "70" => "ROUTE_NOT_SUPPORTED",
17
+ "71" => "FEATURE_NOT_POSSIBLE",
18
+ "80" => "HANDOVER_FAILED",
19
+ "100" => "OK"
20
+ }
21
+
22
+ def self.deliver(sms)
23
+ options = sms.delivery_options[:smstrade] || {}
24
+ options = options.dup
25
+
26
+ options[:server] = 'gateway.smstrade.de'
27
+ options[:use_ssl] = false
28
+ options[:status_report_req] ||= sms.delivery_options[:save_delivery_reports]
29
+
30
+ sms.delivery_info = []
31
+
32
+ sms.to_numbers_array.each do |to|
33
+ deliver_path = self.deliver_path(sms, to, options)
34
+ response = self.deliver_http_request(sms, options, deliver_path)
35
+
36
+ logger.info "Smstrade delivery http ||| #{deliver_path} ||| #{response.inspect}"
37
+ logger.info response.body if !response.blank?
38
+
39
+ sms.delivery_info.push(response)
40
+
41
+ result = response.body.split("\n")
42
+ result = {"response-code" => result[0], "message-id" => result[1], "cost" => result[2], "message-count" => result[3]}
43
+
44
+ if ERROR_CODES[result["response-code"]].nil?
45
+ status = "UNKNOWN_ERROR"
46
+ else
47
+ status = ERROR_CODES[result["response-code"]]
48
+ end
49
+
50
+ # Results include sms_id or error code in each line
51
+ if sms.delivery_options[:save_delivery_reports]
52
+ dr = ActionSmser::DeliveryReport.build_from_sms(sms, to, result["message-id"])
53
+ if status != "OK"
54
+ dr.status = status
55
+ dr.add_log "smstrade_error_code: #{result["response-code"]}"
56
+ end
57
+ dr.save
58
+ sms.delivery_reports.push(dr)
59
+ end
60
+ end
61
+
62
+ sms.delivery_options[:save_delivery_reports] ? sms.delivery_reports : sms.delivery_info
63
+ end
64
+
65
+ def self.deliver_path(sms, to, options)
66
+ "/?key=#{options[:key]}"+
67
+ "&from=#{sms.from_escaped}"+
68
+ "&to=#{to}"+
69
+ "&message=#{sms.body_escaped}"+
70
+ "&route=#{options[:route]}"+
71
+ "&debug=#{options[:debug] ? 1 : 0}"+
72
+ "&cost=1&message_id=1&count=1&charset=utf-8"
73
+ end
74
+ end
75
+ end
@@ -1,3 +1,3 @@
1
1
  module ActionSmser
2
- VERSION = "2.0.2"
2
+ VERSION = "2.1.0"
3
3
  end
@@ -61235,4 +61235,440 @@ ActionSmser: ActionSmser::DeliveryMethods::TestArray.deliveries added message, n
61235
61235
  Started GET "/action_smser/delivery_reports/gateway_commit/example_gateway" for 127.0.0.1 at 2013-08-15 19:53:55 +0300
61236
61236
  Processing by ActionSmser::DeliveryReportsController#gateway_commit as HTML
61237
61237
  Parameters: {"gateway"=>"example_gateway"}
61238
+ Completed 200 OK in 0ms (Views: 0.2ms | ActiveRecord: 0.0ms)
61239
+  (0.1ms) select sqlite_version(*)
61240
+  (0.3ms) CREATE TABLE "schema_migrations" ("version" varchar(255) NOT NULL)
61241
+  (0.0ms) PRAGMA index_list("schema_migrations")
61242
+  (0.2ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
61243
+  (6.3ms) SELECT "schema_migrations"."version" FROM "schema_migrations" 
61244
+ Migrating to CreateActionSmserDeliveryReports (20120102215215)
61245
+  (0.4ms) CREATE TABLE "action_smser_delivery_reports" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "msg_id" varchar(255), "status" varchar(255), "status_updated_at" datetime, "sms_type" varchar(255), "log" text, "to" varchar(255), "from" varchar(255), "body" varchar(255), "gateway" varchar(255), "re_delivery_of_delivery_report_id" integer, "re_delivered" boolean, "created_at" datetime, "updated_at" datetime)
61246
+  (0.1ms) PRAGMA index_list("action_smser_delivery_reports")
61247
+  (0.2ms) CREATE INDEX "index_action_smser_delivery_reports_on_msg_id" ON "action_smser_delivery_reports" ("msg_id")
61248
+  (0.1ms) INSERT INTO "schema_migrations" ("version") VALUES ('20120102215215')
61249
+ ActionSmser: Sending sms - Delivery_method: test_array - Sms: (Sms ActionSmser::BaseTest::MockSms.basic_sms - From: "555666", To: ["555123555", "123", "+358123555123"], Body: "Body with ääkköset end", Valid: true)
61250
+ ActionSmser: ActionSmser::DeliveryMethods::TestArray.deliveries added message, no real delivery.
61251
+ ActionSmser: Sending sms - Delivery_method: test_array - Sms: (Sms ActionSmser::BaseTest::MockSms.basic_sms - From: "555666", To: ["555123555", "123", "+358123555123"], Body: "Body with ääkköset end", Valid: true)
61252
+ ActionSmser: ActionSmser::DeliveryMethods::TestArray.deliveries added message, no real delivery.
61253
+ ActionSmser: Sending sms - Delivery_method: delayed_job - Sms: (Sms ActionSmser::DelayedJobTest::MockSms.basic_sms - From: "555666", To: ["555123555", "123555123"], Body: "Body with ääkköset end", Valid: true)
61254
+ ActionSmser: Delivering sms by delayed_job
61255
+  (0.1ms) SELECT COUNT(*) FROM "action_smser_delivery_reports"
61256
+  (0.1ms) SAVEPOINT active_record_1
61257
+ SQL (9.1ms) INSERT INTO "action_smser_delivery_reports" ("body", "created_at", "from", "gateway", "log", "msg_id", "re_delivered", "re_delivery_of_delivery_report_id", "sms_type", "status", "status_updated_at", "to", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) [["body", "Body with ääkköset end"], ["created_at", Sat, 17 Aug 2013 07:04:28 UTC +00:00], ["from", "555666"], ["gateway", "test_array"], ["log", "2013-08-17 10:04:28: LOCAL_SENT\n"], ["msg_id", "msg_id_a"], ["re_delivered", nil], ["re_delivery_of_delivery_report_id", nil], ["sms_type", "ActionSmser::DeliveryReportTest::MockSms.basic_sms"], ["status", "LOCAL_SENT"], ["status_updated_at", Sat, 17 Aug 2013 07:04:28 UTC +00:00], ["to", "123"], ["updated_at", Sat, 17 Aug 2013 07:04:28 UTC +00:00]]
61258
+  (0.1ms) RELEASE SAVEPOINT active_record_1
61259
+  (0.1ms) SELECT COUNT(*) FROM "action_smser_delivery_reports"
61260
+  (0.0ms) SAVEPOINT active_record_1
61261
+ SQL (0.5ms) INSERT INTO "action_smser_delivery_reports" ("body", "created_at", "from", "gateway", "log", "msg_id", "re_delivered", "re_delivery_of_delivery_report_id", "sms_type", "status", "status_updated_at", "to", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) [["body", "Body with ääkköset end"], ["created_at", Sat, 17 Aug 2013 07:04:28 UTC +00:00], ["from", "555666"], ["gateway", "test_array"], ["log", "2013-08-17 10:04:28: LOCAL_SENT\n"], ["msg_id", "msg_id_a"], ["re_delivered", nil], ["re_delivery_of_delivery_report_id", nil], ["sms_type", "ActionSmser::DeliveryReportTest::MockSms.basic_sms"], ["status", "LOCAL_SENT"], ["status_updated_at", Sat, 17 Aug 2013 07:04:28 UTC +00:00], ["to", "123"], ["updated_at", Sat, 17 Aug 2013 07:04:28 UTC +00:00]]
61262
+  (0.0ms) RELEASE SAVEPOINT active_record_1
61263
+  (0.0ms) SAVEPOINT active_record_1
61264
+  (0.1ms) UPDATE "action_smser_delivery_reports" SET "gateway" = 'some_delivery', "updated_at" = '2013-08-17 07:04:28.223675' WHERE "action_smser_delivery_reports"."id" = 1
61265
+  (0.0ms) RELEASE SAVEPOINT active_record_1
61266
+ ActionSmser::DeliveryReport Load (0.2ms) SELECT "action_smser_delivery_reports".* FROM "action_smser_delivery_reports" WHERE "action_smser_delivery_reports"."id" = ? LIMIT 1 [["id", 1]]
61267
+ ActionSmser: Re_delivering: #<ActionSmser::DeliveryReport id: 1, msg_id: "msg_id_a", status: "LOCAL_SENT", status_updated_at: "2013-08-17 07:04:28", sms_type: "ActionSmser::DeliveryReportTest::MockSms.basic_sms", log: "2013-08-17 10:04:28: LOCAL_SENT\n", to: "123", from: "555666", body: "Body with ääkköset end", gateway: "some_delivery", re_delivery_of_delivery_report_id: nil, re_delivered: nil, created_at: "2013-08-17 07:04:28", updated_at: "2013-08-17 07:04:28">
61268
+  (0.0ms) SAVEPOINT active_record_1
61269
+  (0.1ms) UPDATE "action_smser_delivery_reports" SET "re_delivered" = 't', "updated_at" = '2013-08-17 07:04:28.227293' WHERE "action_smser_delivery_reports"."id" = 1
61270
+  (0.1ms) RELEASE SAVEPOINT active_record_1
61271
+ ActionSmser::DeliveryReport Load (0.1ms) SELECT "action_smser_delivery_reports".* FROM "action_smser_delivery_reports" WHERE "action_smser_delivery_reports"."id" = ? LIMIT 1 [["id", 1]]
61272
+ ActionSmser: Sending sms - Delivery_method: test_array - Sms: (Sms ActionSmser::DeliveryReportTest::MockSms.basic_sms.re_delivery - From: "555666", To: "123", Body: "Body with ääkköset end", Valid: true)
61273
+ ActionSmser: ActionSmser::DeliveryMethods::TestArray.deliveries added message, no real delivery.
61274
+  (0.0ms) SAVEPOINT active_record_1
61275
+ SQL (0.4ms) INSERT INTO "action_smser_delivery_reports" ("body", "created_at", "from", "gateway", "log", "msg_id", "re_delivered", "re_delivery_of_delivery_report_id", "sms_type", "status", "status_updated_at", "to", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) [["body", "Body with ääkköset end"], ["created_at", Sat, 17 Aug 2013 07:04:28 UTC +00:00], ["from", "555666"], ["gateway", "test_array"], ["log", "2013-08-17 10:04:28: LOCAL_SENT\n"], ["msg_id", "test_array_id_78805454"], ["re_delivered", nil], ["re_delivery_of_delivery_report_id", 1], ["sms_type", "ActionSmser::DeliveryReportTest::MockSms.basic_sms.re_delivery"], ["status", "LOCAL_SENT"], ["status_updated_at", Sat, 17 Aug 2013 07:04:28 UTC +00:00], ["to", "123"], ["updated_at", Sat, 17 Aug 2013 07:04:28 UTC +00:00]]
61276
+  (0.0ms) RELEASE SAVEPOINT active_record_1
61277
+ ActionSmser::DeliveryReport Load (0.2ms) SELECT "action_smser_delivery_reports".* FROM "action_smser_delivery_reports" ORDER BY "action_smser_delivery_reports"."id" DESC LIMIT 1
61278
+ ActionSmser::DeliveryReport Load (0.2ms) SELECT "action_smser_delivery_reports".* FROM "action_smser_delivery_reports" WHERE "action_smser_delivery_reports"."re_delivery_of_delivery_report_id" = 1 LIMIT 1
61279
+ ActionSmser::DeliveryReport Load (0.1ms) SELECT "action_smser_delivery_reports".* FROM "action_smser_delivery_reports" WHERE "action_smser_delivery_reports"."id" = 1 LIMIT 1
61280
+  (0.0ms) SAVEPOINT active_record_1
61281
+ SQL (0.3ms) INSERT INTO "action_smser_delivery_reports" ("body", "created_at", "from", "gateway", "log", "msg_id", "re_delivered", "re_delivery_of_delivery_report_id", "sms_type", "status", "status_updated_at", "to", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) [["body", "Body with ääkköset end"], ["created_at", Sat, 17 Aug 2013 07:04:28 UTC +00:00], ["from", "555666"], ["gateway", "test_array"], ["log", "2013-08-17 10:04:28: LOCAL_SENT\n"], ["msg_id", "msg_id_a"], ["re_delivered", nil], ["re_delivery_of_delivery_report_id", nil], ["sms_type", "ActionSmser::DeliveryReportTest::MockSms.basic_sms"], ["status", "LOCAL_SENT"], ["status_updated_at", Sat, 17 Aug 2013 07:04:28 UTC +00:00], ["to", "123"], ["updated_at", Sat, 17 Aug 2013 07:04:28 UTC +00:00]]
61282
+  (0.0ms) RELEASE SAVEPOINT active_record_1
61283
+ ActionSmser::DeliveryReport Load (0.0ms) SELECT "action_smser_delivery_reports".* FROM "action_smser_delivery_reports" WHERE "action_smser_delivery_reports"."id" = ? LIMIT 1 [["id", 1]]
61284
+  (0.0ms) SAVEPOINT active_record_1
61285
+ SQL (0.4ms) INSERT INTO "action_smser_delivery_reports" ("body", "created_at", "from", "gateway", "log", "msg_id", "re_delivered", "re_delivery_of_delivery_report_id", "sms_type", "status", "status_updated_at", "to", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) [["body", nil], ["created_at", Sat, 17 Aug 2013 07:04:28 UTC +00:00], ["from", nil], ["gateway", nil], ["log", "2013-08-17 10:04:28: LOCAL_TEST\n"], ["msg_id", nil], ["re_delivered", nil], ["re_delivery_of_delivery_report_id", nil], ["sms_type", nil], ["status", "LOCAL_TEST"], ["status_updated_at", Sat, 17 Aug 2013 07:04:28 UTC +00:00], ["to", nil], ["updated_at", Sat, 17 Aug 2013 07:04:28 UTC +00:00]]
61286
+  (0.0ms) RELEASE SAVEPOINT active_record_1
61287
+  (0.0ms) SAVEPOINT active_record_1
61288
+  (0.1ms) UPDATE "action_smser_delivery_reports" SET "status" = 'TEST_2', "status_updated_at" = '2013-08-17 07:04:28.276920', "log" = '2013-08-17 10:04:28: LOCAL_TEST
61289
+ 2013-08-17 10:04:28: TEST_2
61290
+ ', "updated_at" = '2013-08-17 07:04:28.277185' WHERE "action_smser_delivery_reports"."id" = 1
61291
+  (0.0ms) RELEASE SAVEPOINT active_record_1
61292
+  (0.0ms) SAVEPOINT active_record_1
61293
+ SQL (0.5ms) INSERT INTO "action_smser_delivery_reports" ("body", "created_at", "from", "gateway", "log", "msg_id", "re_delivered", "re_delivery_of_delivery_report_id", "sms_type", "status", "status_updated_at", "to", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) [["body", nil], ["created_at", Sat, 17 Aug 2013 07:04:28 UTC +00:00], ["from", nil], ["gateway", nil], ["log", "2013-08-17 10:04:28: ORIGINAL_STATUS\n"], ["msg_id", "102010314204056202"], ["re_delivered", nil], ["re_delivery_of_delivery_report_id", nil], ["sms_type", nil], ["status", "ORIGINAL_STATUS"], ["status_updated_at", Sat, 17 Aug 2013 07:04:28 UTC +00:00], ["to", nil], ["updated_at", Sat, 17 Aug 2013 07:04:28 UTC +00:00]]
61294
+  (0.0ms) RELEASE SAVEPOINT active_record_1
61295
+ Processing by ActionSmser::DeliveryReportsController#gateway_commit as HTML
61296
+ Parameters: {"gateway"=>"test_gateway", "DeliveryReport"=>{"message"=>{"id"=>"102010314204056202", "donedate"=>"2012/01/03 14:20:45", "sentdate"=>"2012/01/03 14:20:40", "status"=>"DELIVERED"}}, "use_route"=>"action_smser"}
61297
+ ActionSmser: Gateway_commit found parser for gateway: test_gateway
61298
+ ActionSmser::DeliveryReport Load (0.2ms) SELECT "action_smser_delivery_reports".* FROM "action_smser_delivery_reports" WHERE "action_smser_delivery_reports"."msg_id" = '102010314204056202' LIMIT 1
61299
+  (0.0ms) SAVEPOINT active_record_1
61300
+  (0.1ms) UPDATE "action_smser_delivery_reports" SET "status" = 'DELIVERED', "status_updated_at" = '2013-08-17 07:04:28.290391', "log" = '2013-08-17 10:04:28: ORIGINAL_STATUS
61301
+ 2013-08-17 10:04:28: DELIVERED
61302
+ ', "updated_at" = '2013-08-17 07:04:28.290873' WHERE "action_smser_delivery_reports"."id" = 1
61303
+  (0.0ms) RELEASE SAVEPOINT active_record_1
61304
+ ActionSmser: Gateway_commit updated item with id: 102010314204056202, params: {"msg_id"=>"102010314204056202", "status"=>"DELIVERED"}
61305
+ Rendered text template (0.0ms)
61306
+ Completed 200 OK in 13ms (Views: 8.9ms | ActiveRecord: 0.3ms)
61307
+ ActionSmser::DeliveryReport Load (0.1ms) SELECT "action_smser_delivery_reports".* FROM "action_smser_delivery_reports" WHERE "action_smser_delivery_reports"."id" = ? LIMIT 1 [["id", 1]]
61308
+  (0.0ms) SAVEPOINT active_record_1
61309
+ SQL (0.5ms) INSERT INTO "action_smser_delivery_reports" ("body", "created_at", "from", "gateway", "log", "msg_id", "re_delivered", "re_delivery_of_delivery_report_id", "sms_type", "status", "status_updated_at", "to", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) [["body", nil], ["created_at", Sat, 17 Aug 2013 07:04:28 UTC +00:00], ["from", nil], ["gateway", nil], ["log", "2013-08-17 10:04:28: ORIGINAL_STATUS\n"], ["msg_id", "102010314204056202"], ["re_delivered", nil], ["re_delivery_of_delivery_report_id", nil], ["sms_type", nil], ["status", "ORIGINAL_STATUS"], ["status_updated_at", Sat, 17 Aug 2013 07:04:28 UTC +00:00], ["to", nil], ["updated_at", Sat, 17 Aug 2013 07:04:28 UTC +00:00]]
61310
+  (0.1ms) RELEASE SAVEPOINT active_record_1
61311
+  (0.0ms) SAVEPOINT active_record_1
61312
+ SQL (0.5ms) INSERT INTO "action_smser_delivery_reports" ("body", "created_at", "from", "gateway", "log", "msg_id", "re_delivered", "re_delivery_of_delivery_report_id", "sms_type", "status", "status_updated_at", "to", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) [["body", nil], ["created_at", Sat, 17 Aug 2013 07:04:28 UTC +00:00], ["from", nil], ["gateway", nil], ["log", "2013-08-17 10:04:28: ORIGINAL_STATUS\n"], ["msg_id", "99999999999999999"], ["re_delivered", nil], ["re_delivery_of_delivery_report_id", nil], ["sms_type", nil], ["status", "ORIGINAL_STATUS"], ["status_updated_at", Sat, 17 Aug 2013 07:04:28 UTC +00:00], ["to", nil], ["updated_at", Sat, 17 Aug 2013 07:04:28 UTC +00:00]]
61313
+  (0.0ms) RELEASE SAVEPOINT active_record_1
61314
+ Processing by ActionSmser::DeliveryReportsController#gateway_commit as HTML
61315
+ Parameters: {"gateway"=>"test_gateway", "DeliveryReport"=>{"message"=>[{"id"=>"102010314204056202", "status"=>"DELIVERED"}, {"id"=>"99999999999999999", "status"=>"DELIVERED"}]}, "use_route"=>"action_smser"}
61316
+ ActionSmser: Gateway_commit found parser for gateway: test_gateway
61317
+ ActionSmser::DeliveryReport Load (0.1ms) SELECT "action_smser_delivery_reports".* FROM "action_smser_delivery_reports" WHERE "action_smser_delivery_reports"."msg_id" = '102010314204056202' LIMIT 1
61318
+  (0.0ms) SAVEPOINT active_record_1
61319
+  (0.1ms) UPDATE "action_smser_delivery_reports" SET "status" = 'DELIVERED', "status_updated_at" = '2013-08-17 07:04:28.308712', "log" = '2013-08-17 10:04:28: ORIGINAL_STATUS
61320
+ 2013-08-17 10:04:28: DELIVERED
61321
+ ', "updated_at" = '2013-08-17 07:04:28.309124' WHERE "action_smser_delivery_reports"."id" = 1
61322
+  (0.0ms) RELEASE SAVEPOINT active_record_1
61323
+ ActionSmser: Gateway_commit updated item with id: 102010314204056202, params: {"msg_id"=>"102010314204056202", "status"=>"DELIVERED"}
61324
+ ActionSmser::DeliveryReport Load (0.1ms) SELECT "action_smser_delivery_reports".* FROM "action_smser_delivery_reports" WHERE "action_smser_delivery_reports"."msg_id" = '99999999999999999' LIMIT 1
61325
+  (0.0ms) SAVEPOINT active_record_1
61326
+  (0.1ms) UPDATE "action_smser_delivery_reports" SET "status" = 'DELIVERED', "status_updated_at" = '2013-08-17 07:04:28.310376', "log" = '2013-08-17 10:04:28: ORIGINAL_STATUS
61327
+ 2013-08-17 10:04:28: DELIVERED
61328
+ ', "updated_at" = '2013-08-17 07:04:28.310676' WHERE "action_smser_delivery_reports"."id" = 2
61329
+  (0.0ms) RELEASE SAVEPOINT active_record_1
61330
+ ActionSmser: Gateway_commit updated item with id: 99999999999999999, params: {"msg_id"=>"99999999999999999", "status"=>"DELIVERED"}
61331
+ Completed 200 OK in 4ms (Views: 0.3ms | ActiveRecord: 0.5ms)
61332
+ ActionSmser::DeliveryReport Load (0.1ms) SELECT "action_smser_delivery_reports".* FROM "action_smser_delivery_reports" WHERE "action_smser_delivery_reports"."id" = ? LIMIT 1 [["id", 1]]
61333
+ ActionSmser::DeliveryReport Load (0.0ms) SELECT "action_smser_delivery_reports".* FROM "action_smser_delivery_reports" WHERE "action_smser_delivery_reports"."id" = ? LIMIT 1 [["id", 2]]
61334
+ Processing by ActionSmser::DeliveryReportsController#gateway_commit as HTML
61335
+ Parameters: {"gateway"=>"gateway_not_found", "DeliveryReport"=>{"message"=>{"id"=>"wrongid", "donedate"=>"2012/01/03 14:20:45", "sentdate"=>"2012/01/03 14:20:40", "status"=>"DELIVERED"}}, "use_route"=>"action_smser"}
61336
+ Completed 200 OK in 0ms (Views: 0.2ms | ActiveRecord: 0.0ms)
61337
+ Processing by ActionSmser::DeliveryReportsController#gateway_commit as HTML
61338
+ Parameters: {"gateway"=>"test_gateway", "DeliveryReport"=>{"message"=>{"id"=>"wrongid", "donedate"=>"2012/01/03 14:20:45", "sentdate"=>"2012/01/03 14:20:40", "status"=>"DELIVERED"}}, "use_route"=>"action_smser"}
61339
+ ActionSmser: Gateway_commit found parser for gateway: test_gateway
61340
+ ActionSmser::DeliveryReport Load (0.1ms) SELECT "action_smser_delivery_reports".* FROM "action_smser_delivery_reports" WHERE "action_smser_delivery_reports"."msg_id" = 'wrongid' LIMIT 1
61341
+ ActionSmser: Gateway_commit not found item with id: wrongid, params: {"msg_id"=>"wrongid", "status"=>"DELIVERED"}
61342
+ Completed 200 OK in 1ms (Views: 0.1ms | ActiveRecord: 0.1ms)
61343
+  (0.0ms) SAVEPOINT active_record_1
61344
+ SQL (0.6ms) INSERT INTO "action_smser_delivery_reports" ("body", "created_at", "from", "gateway", "log", "msg_id", "re_delivered", "re_delivery_of_delivery_report_id", "sms_type", "status", "status_updated_at", "to", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) [["body", nil], ["created_at", Sat, 17 Aug 2013 07:04:28 UTC +00:00], ["from", nil], ["gateway", nil], ["log", nil], ["msg_id", "idtest_4"], ["re_delivered", nil], ["re_delivery_of_delivery_report_id", nil], ["sms_type", nil], ["status", nil], ["status_updated_at", nil], ["to", nil], ["updated_at", Sat, 17 Aug 2013 07:04:28 UTC +00:00]]
61345
+  (0.0ms) RELEASE SAVEPOINT active_record_1
61346
+  (0.0ms) SAVEPOINT active_record_1
61347
+ SQL (0.6ms) INSERT INTO "action_smser_delivery_reports" ("body", "created_at", "from", "gateway", "log", "msg_id", "re_delivered", "re_delivery_of_delivery_report_id", "sms_type", "status", "status_updated_at", "to", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) [["body", nil], ["created_at", Sat, 17 Aug 2013 07:04:28 UTC +00:00], ["from", nil], ["gateway", nil], ["log", nil], ["msg_id", "idtest_7"], ["re_delivered", nil], ["re_delivery_of_delivery_report_id", nil], ["sms_type", nil], ["status", nil], ["status_updated_at", nil], ["to", nil], ["updated_at", Sat, 17 Aug 2013 07:04:28 UTC +00:00]]
61348
+  (0.0ms) RELEASE SAVEPOINT active_record_1
61349
+ Processing by ActionSmser::DeliveryReportsController#index as HTML
61350
+ Parameters: {"use_route"=>"action_smser"}
61351
+  (0.1ms) SELECT COUNT(*) FROM "action_smser_delivery_reports" WHERE ("action_smser_delivery_reports"."created_at" BETWEEN '2013-08-10 07:04:28.325921' AND '2013-08-17 06:54:28.329740')
61352
+  (0.1ms) SELECT COUNT(*) AS count_all, gateway AS gateway FROM "action_smser_delivery_reports" WHERE ("action_smser_delivery_reports"."created_at" BETWEEN '2013-08-10 07:04:28.325921' AND '2013-08-17 06:54:28.329740') GROUP BY gateway
61353
+  (0.1ms) SELECT COUNT(*) FROM "action_smser_delivery_reports" WHERE ("action_smser_delivery_reports"."created_at" BETWEEN '2013-08-10 07:04:28.325921' AND '2013-08-17 06:54:28.329740')
61354
+  (0.1ms) SELECT COUNT(*) AS count_all, status AS status FROM "action_smser_delivery_reports" WHERE ("action_smser_delivery_reports"."created_at" BETWEEN '2013-08-10 07:04:28.325921' AND '2013-08-17 06:54:28.329740') GROUP BY status
61355
+  (0.0ms) SELECT COUNT(*) FROM "action_smser_delivery_reports" WHERE ("action_smser_delivery_reports"."created_at" BETWEEN '2013-08-10 07:04:28.325921' AND '2013-08-17 06:54:28.329740')
61356
+  (0.1ms) SELECT COUNT(*) AS count_all, sms_type AS sms_type FROM "action_smser_delivery_reports" WHERE ("action_smser_delivery_reports"."created_at" BETWEEN '2013-08-10 07:04:28.325921' AND '2013-08-17 06:54:28.329740') GROUP BY sms_type
61357
+ Completed 200 OK in 18ms (Views: 17.6ms | ActiveRecord: 0.4ms)
61358
+  (0.0ms) SAVEPOINT active_record_1
61359
+ SQL (0.6ms) INSERT INTO "action_smser_delivery_reports" ("body", "created_at", "from", "gateway", "log", "msg_id", "re_delivered", "re_delivery_of_delivery_report_id", "sms_type", "status", "status_updated_at", "to", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) [["body", nil], ["created_at", Sat, 17 Aug 2013 07:04:28 UTC +00:00], ["from", nil], ["gateway", nil], ["log", nil], ["msg_id", "idtest_4"], ["re_delivered", nil], ["re_delivery_of_delivery_report_id", nil], ["sms_type", nil], ["status", nil], ["status_updated_at", nil], ["to", nil], ["updated_at", Sat, 17 Aug 2013 07:04:28 UTC +00:00]]
61360
+  (0.0ms) RELEASE SAVEPOINT active_record_1
61361
+  (0.0ms) SAVEPOINT active_record_1
61362
+ SQL (0.5ms) INSERT INTO "action_smser_delivery_reports" ("body", "created_at", "from", "gateway", "log", "msg_id", "re_delivered", "re_delivery_of_delivery_report_id", "sms_type", "status", "status_updated_at", "to", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) [["body", nil], ["created_at", Sat, 17 Aug 2013 07:04:28 UTC +00:00], ["from", nil], ["gateway", nil], ["log", nil], ["msg_id", "idtest_0"], ["re_delivered", nil], ["re_delivery_of_delivery_report_id", nil], ["sms_type", nil], ["status", nil], ["status_updated_at", nil], ["to", nil], ["updated_at", Sat, 17 Aug 2013 07:04:28 UTC +00:00]]
61363
+  (0.0ms) RELEASE SAVEPOINT active_record_1
61364
+ Processing by ActionSmser::DeliveryReportsController#index as HTML
61365
+ Parameters: {"use_route"=>"action_smser"}
61366
+  (0.1ms) SELECT COUNT(*) FROM "action_smser_delivery_reports" WHERE ("action_smser_delivery_reports"."created_at" BETWEEN '2013-08-10 07:04:28.345361' AND '2013-08-17 06:54:28.345476')
61367
+  (0.1ms) SELECT COUNT(*) AS count_all, gateway AS gateway FROM "action_smser_delivery_reports" WHERE ("action_smser_delivery_reports"."created_at" BETWEEN '2013-08-10 07:04:28.345361' AND '2013-08-17 06:54:28.345476') GROUP BY gateway
61368
+  (0.1ms) SELECT COUNT(*) FROM "action_smser_delivery_reports" WHERE ("action_smser_delivery_reports"."created_at" BETWEEN '2013-08-10 07:04:28.345361' AND '2013-08-17 06:54:28.345476')
61369
+  (0.1ms) SELECT COUNT(*) AS count_all, status AS status FROM "action_smser_delivery_reports" WHERE ("action_smser_delivery_reports"."created_at" BETWEEN '2013-08-10 07:04:28.345361' AND '2013-08-17 06:54:28.345476') GROUP BY status
61370
+  (0.1ms) SELECT COUNT(*) FROM "action_smser_delivery_reports" WHERE ("action_smser_delivery_reports"."created_at" BETWEEN '2013-08-10 07:04:28.345361' AND '2013-08-17 06:54:28.345476')
61371
+  (0.1ms) SELECT COUNT(*) AS count_all, sms_type AS sms_type FROM "action_smser_delivery_reports" WHERE ("action_smser_delivery_reports"."created_at" BETWEEN '2013-08-10 07:04:28.345361' AND '2013-08-17 06:54:28.345476') GROUP BY sms_type
61372
+ Completed 200 OK in 9ms (Views: 8.8ms | ActiveRecord: 0.5ms)
61373
+ Processing by ActionSmser::DeliveryReportsController#index as HTML
61374
+ Parameters: {"use_route"=>"action_smser"}
61375
+ Completed 403 Forbidden in 0ms (Views: 0.2ms | ActiveRecord: 0.0ms)
61376
+  (0.0ms) SAVEPOINT active_record_1
61377
+ SQL (0.6ms) INSERT INTO "action_smser_delivery_reports" ("body", "created_at", "from", "gateway", "log", "msg_id", "re_delivered", "re_delivery_of_delivery_report_id", "sms_type", "status", "status_updated_at", "to", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) [["body", nil], ["created_at", Sat, 17 Aug 2013 07:04:28 UTC +00:00], ["from", nil], ["gateway", nil], ["log", nil], ["msg_id", "idtest_2"], ["re_delivered", nil], ["re_delivery_of_delivery_report_id", nil], ["sms_type", nil], ["status", nil], ["status_updated_at", nil], ["to", nil], ["updated_at", Sat, 17 Aug 2013 07:04:28 UTC +00:00]]
61378
+  (0.0ms) RELEASE SAVEPOINT active_record_1
61379
+  (0.0ms) SAVEPOINT active_record_1
61380
+ SQL (0.5ms) INSERT INTO "action_smser_delivery_reports" ("body", "created_at", "from", "gateway", "log", "msg_id", "re_delivered", "re_delivery_of_delivery_report_id", "sms_type", "status", "status_updated_at", "to", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) [["body", nil], ["created_at", Sat, 17 Aug 2013 07:04:28 UTC +00:00], ["from", nil], ["gateway", nil], ["log", nil], ["msg_id", "idtest_1"], ["re_delivered", nil], ["re_delivery_of_delivery_report_id", nil], ["sms_type", nil], ["status", nil], ["status_updated_at", nil], ["to", nil], ["updated_at", Sat, 17 Aug 2013 07:04:28 UTC +00:00]]
61381
+  (0.0ms) RELEASE SAVEPOINT active_record_1
61382
+ Processing by ActionSmser::DeliveryReportsController#list as HTML
61383
+ Parameters: {"use_route"=>"action_smser"}
61384
+ ActionSmser::DeliveryReport Load (0.2ms) SELECT "action_smser_delivery_reports".* FROM "action_smser_delivery_reports" ORDER BY created_at DESC LIMIT 20 OFFSET 0
61385
+ Completed 200 OK in 4ms (Views: 3.9ms | ActiveRecord: 0.2ms)
61386
+ ActionSmser: Sending sms - Delivery_method: nexmo - Sms: (Sms ActionSmser::NexmoTest::MockSms.basic_sms - From: "555666", To: ["555123555", "123555123"], Body: "Body with ääkköset end", Valid: true)
61387
+ ActionSmser: Nexmo delivery http ||| /sms/json?username=user&password=pass&ttl=86400000&status-report-req=false&from=555666&to=555123555&text=Body+with+%C3%A4%C3%A4kk%C3%B6set+end ||| #<Mock:0x4e4d5c8>
61388
+ ActionSmser: {"message-count":"1","messages":[{"message-price":"0.02500000","status":"0","message-id":"0778DE88","remaining-balance":"1.77500000"}]}
61389
+ ActionSmser: Nexmo delivery http ||| /sms/json?username=user&password=pass&ttl=86400000&status-report-req=false&from=555666&to=123555123&text=Body+with+%C3%A4%C3%A4kk%C3%B6set+end ||| #<Mock:0x4e4d5c8>
61390
+ ActionSmser: {"message-count":"1","messages":[{"message-price":"0.02500000","status":"0","message-id":"0778DE88","remaining-balance":"1.77500000"}]}
61391
+  (0.1ms) SELECT COUNT(*) FROM "action_smser_delivery_reports"
61392
+ ActionSmser: Sending sms - Delivery_method: nexmo - Sms: (Sms ActionSmser::NexmoTest::MockSms.basic_sms - From: "555666", To: ["555123555", "123555123"], Body: "Body with ääkköset end", Valid: true)
61393
+ ActionSmser: Nexmo delivery http ||| /sms/json?username=user&password=pass&ttl=86400000&status-report-req=true&from=555666&to=555123555&text=Body+with+%C3%A4%C3%A4kk%C3%B6set+end ||| #<Mock:0x4e3bdc8>
61394
+ ActionSmser: {"message-count":"1","messages":[{"message-price":"0.02500000","status":"0","message-id":"0778DE88","remaining-balance":"1.77500000"}]}
61395
+  (0.0ms) SAVEPOINT active_record_1
61396
+ SQL (0.4ms) INSERT INTO "action_smser_delivery_reports" ("body", "created_at", "from", "gateway", "log", "msg_id", "re_delivered", "re_delivery_of_delivery_report_id", "sms_type", "status", "status_updated_at", "to", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) [["body", "Body with ääkköset end"], ["created_at", Sat, 17 Aug 2013 07:04:28 UTC +00:00], ["from", "555666"], ["gateway", "nexmo"], ["log", "2013-08-17 10:04:28: LOCAL_SENT\n"], ["msg_id", "0778DE88"], ["re_delivered", nil], ["re_delivery_of_delivery_report_id", nil], ["sms_type", "ActionSmser::NexmoTest::MockSms.basic_sms"], ["status", "LOCAL_SENT"], ["status_updated_at", Sat, 17 Aug 2013 07:04:28 UTC +00:00], ["to", "555123555"], ["updated_at", Sat, 17 Aug 2013 07:04:28 UTC +00:00]]
61397
+  (0.0ms) RELEASE SAVEPOINT active_record_1
61398
+ ActionSmser: Nexmo delivery http ||| /sms/json?username=user&password=pass&ttl=86400000&status-report-req=true&from=555666&to=123555123&text=Body+with+%C3%A4%C3%A4kk%C3%B6set+end ||| #<Mock:0x4e3bdc8>
61399
+ ActionSmser: {"message-count":"1","messages":[{"message-price":"0.02500000","status":"0","message-id":"0778DE88","remaining-balance":"1.77500000"}]}
61400
+  (0.0ms) SAVEPOINT active_record_1
61401
+ SQL (0.2ms) INSERT INTO "action_smser_delivery_reports" ("body", "created_at", "from", "gateway", "log", "msg_id", "re_delivered", "re_delivery_of_delivery_report_id", "sms_type", "status", "status_updated_at", "to", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) [["body", "Body with ääkköset end"], ["created_at", Sat, 17 Aug 2013 07:04:28 UTC +00:00], ["from", "555666"], ["gateway", "nexmo"], ["log", "2013-08-17 10:04:28: LOCAL_SENT\n"], ["msg_id", "0778DE88"], ["re_delivered", nil], ["re_delivery_of_delivery_report_id", nil], ["sms_type", "ActionSmser::NexmoTest::MockSms.basic_sms"], ["status", "LOCAL_SENT"], ["status_updated_at", Sat, 17 Aug 2013 07:04:28 UTC +00:00], ["to", "123555123"], ["updated_at", Sat, 17 Aug 2013 07:04:28 UTC +00:00]]
61402
+  (0.0ms) RELEASE SAVEPOINT active_record_1
61403
+  (0.1ms) SELECT COUNT(*) FROM "action_smser_delivery_reports" 
61404
+ ActionSmser: Sending sms - Delivery_method: simple_http - Sms: (Sms ActionSmser::SimpleHttpTest::MockSms.basic_sms - From: "555666", To: ["555123555", "123555123"], Body: "Body with ääkköset end", Valid: true)
61405
+ ActionSmser: SimpleHttp delivery ||| /api/sendsms/plain?user=user&password=pass&sender=555666&SMSText=Body+with+%E4%E4kk%F6set+end&GSM=555123555,123555123 ||| #<Mock:0x4deae00>
61406
+ ActionSmser: id_1234
61407
+ id_6666
61408
+  (0.0ms) SELECT COUNT(*) FROM "action_smser_delivery_reports"
61409
+ ActionSmser: Sending sms - Delivery_method: simple_http - Sms: (Sms ActionSmser::SimpleHttpTest::MockSms.basic_sms - From: "555666", To: ["555123555", "123555123"], Body: "Body with ääkköset end", Valid: true)
61410
+ ActionSmser: SimpleHttp delivery ||| /api/sendsms/plain?user=user&password=pass&sender=555666&SMSText=Body+with+%E4%E4kk%F6set+end&GSM=555123555,123555123 ||| #<Mock:0x4dddb38>
61411
+ ActionSmser: id_1234
61412
+ id_6666
61413
+  (0.0ms) SAVEPOINT active_record_1
61414
+ SQL (0.3ms) INSERT INTO "action_smser_delivery_reports" ("body", "created_at", "from", "gateway", "log", "msg_id", "re_delivered", "re_delivery_of_delivery_report_id", "sms_type", "status", "status_updated_at", "to", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) [["body", "Body with ääkköset end"], ["created_at", Sat, 17 Aug 2013 07:04:28 UTC +00:00], ["from", "555666"], ["gateway", "simple_http"], ["log", "2013-08-17 10:04:28: LOCAL_SENT\n"], ["msg_id", "id_1234"], ["re_delivered", nil], ["re_delivery_of_delivery_report_id", nil], ["sms_type", "ActionSmser::SimpleHttpTest::MockSms.basic_sms"], ["status", "LOCAL_SENT"], ["status_updated_at", Sat, 17 Aug 2013 07:04:28 UTC +00:00], ["to", "555123555"], ["updated_at", Sat, 17 Aug 2013 07:04:28 UTC +00:00]]
61415
+  (0.0ms) RELEASE SAVEPOINT active_record_1
61416
+  (0.0ms) SAVEPOINT active_record_1
61417
+ SQL (0.3ms) INSERT INTO "action_smser_delivery_reports" ("body", "created_at", "from", "gateway", "log", "msg_id", "re_delivered", "re_delivery_of_delivery_report_id", "sms_type", "status", "status_updated_at", "to", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) [["body", "Body with ääkköset end"], ["created_at", Sat, 17 Aug 2013 07:04:28 UTC +00:00], ["from", "555666"], ["gateway", "simple_http"], ["log", "2013-08-17 10:04:28: LOCAL_SENT\n"], ["msg_id", "id_6666"], ["re_delivered", nil], ["re_delivery_of_delivery_report_id", nil], ["sms_type", "ActionSmser::SimpleHttpTest::MockSms.basic_sms"], ["status", "LOCAL_SENT"], ["status_updated_at", Sat, 17 Aug 2013 07:04:28 UTC +00:00], ["to", "123555123"], ["updated_at", Sat, 17 Aug 2013 07:04:28 UTC +00:00]]
61418
+  (0.0ms) RELEASE SAVEPOINT active_record_1
61419
+  (0.0ms) SELECT COUNT(*) FROM "action_smser_delivery_reports" 
61420
+ ActionSmser: Sending sms - Delivery_method: test_array - Sms: (Sms ActionSmser::TestArrayTest::MockSms.basic_sms - From: "555666", To: ["555123555", "123555123"], Body: "Body with ääkköset end", Valid: true)
61421
+ ActionSmser: ActionSmser::DeliveryMethods::TestArray.deliveries added message, no real delivery.
61422
+ ActionSmser: Sending sms - Delivery_method: test_array - Sms: (Sms ActionSmser::TestArrayTest::MockSms.basic_sms - From: "555666", To: ["555123555", "123555123"], Body: "Body with ääkköset end", Valid: true)
61423
+ ActionSmser: ActionSmser::DeliveryMethods::TestArray.deliveries added message, no real delivery.
61424
+ ActionSmser: Sending sms - Delivery_method: test_array - Sms: (Sms ActionSmser::TestArrayTest::MockSms.basic_sms - From: "555666", To: ["555123555", "123555123"], Body: "Body with ääkköset end", Valid: true)
61425
+ ActionSmser: ActionSmser::DeliveryMethods::TestArray.deliveries added message, no real delivery.
61426
+  (0.0ms) SELECT COUNT(*) FROM "action_smser_delivery_reports"
61427
+ ActionSmser: Sending sms - Delivery_method: test_array - Sms: (Sms ActionSmser::TestArrayTest::MockSms.basic_sms - From: "555666", To: ["555123555", "123555123"], Body: "Body with ääkköset end", Valid: true)
61428
+ ActionSmser: ActionSmser::DeliveryMethods::TestArray.deliveries added message, no real delivery.
61429
+  (0.0ms) SAVEPOINT active_record_1
61430
+ SQL (0.3ms) INSERT INTO "action_smser_delivery_reports" ("body", "created_at", "from", "gateway", "log", "msg_id", "re_delivered", "re_delivery_of_delivery_report_id", "sms_type", "status", "status_updated_at", "to", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) [["body", "Body with ääkköset end"], ["created_at", Sat, 17 Aug 2013 07:04:28 UTC +00:00], ["from", "555666"], ["gateway", "test_array"], ["log", "2013-08-17 10:04:28: LOCAL_SENT\n"], ["msg_id", "test_array_id_4995981"], ["re_delivered", nil], ["re_delivery_of_delivery_report_id", nil], ["sms_type", "ActionSmser::TestArrayTest::MockSms.basic_sms"], ["status", "LOCAL_SENT"], ["status_updated_at", Sat, 17 Aug 2013 07:04:28 UTC +00:00], ["to", "555123555"], ["updated_at", Sat, 17 Aug 2013 07:04:28 UTC +00:00]]
61431
+  (0.0ms) RELEASE SAVEPOINT active_record_1
61432
+  (0.0ms) SAVEPOINT active_record_1
61433
+ SQL (0.2ms) INSERT INTO "action_smser_delivery_reports" ("body", "created_at", "from", "gateway", "log", "msg_id", "re_delivered", "re_delivery_of_delivery_report_id", "sms_type", "status", "status_updated_at", "to", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) [["body", "Body with ääkköset end"], ["created_at", Sat, 17 Aug 2013 07:04:28 UTC +00:00], ["from", "555666"], ["gateway", "test_array"], ["log", "2013-08-17 10:04:28: LOCAL_SENT\n"], ["msg_id", "test_array_id_7342712"], ["re_delivered", nil], ["re_delivery_of_delivery_report_id", nil], ["sms_type", "ActionSmser::TestArrayTest::MockSms.basic_sms"], ["status", "LOCAL_SENT"], ["status_updated_at", Sat, 17 Aug 2013 07:04:28 UTC +00:00], ["to", "123555123"], ["updated_at", Sat, 17 Aug 2013 07:04:28 UTC +00:00]]
61434
+  (0.0ms) RELEASE SAVEPOINT active_record_1
61435
+  (0.0ms) SELECT COUNT(*) FROM "action_smser_delivery_reports" 
61436
+
61437
+
61438
+ Started GET "/action_smser/delivery_reports/gateway_commit/example_gateway" for 127.0.0.1 at 2013-08-17 10:04:28 +0300
61439
+ Processing by ActionSmser::DeliveryReportsController#gateway_commit as HTML
61440
+ Parameters: {"gateway"=>"example_gateway"}
61441
+ Completed 200 OK in 0ms (Views: 0.3ms | ActiveRecord: 0.0ms)
61442
+  (0.1ms) select sqlite_version(*)
61443
+  (0.3ms) CREATE TABLE "schema_migrations" ("version" varchar(255) NOT NULL)
61444
+  (0.0ms) PRAGMA index_list("schema_migrations")
61445
+  (0.1ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
61446
+  (1.2ms) SELECT "schema_migrations"."version" FROM "schema_migrations" 
61447
+ Migrating to CreateActionSmserDeliveryReports (20120102215215)
61448
+  (0.2ms) CREATE TABLE "action_smser_delivery_reports" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "msg_id" varchar(255), "status" varchar(255), "status_updated_at" datetime, "sms_type" varchar(255), "log" text, "to" varchar(255), "from" varchar(255), "body" varchar(255), "gateway" varchar(255), "re_delivery_of_delivery_report_id" integer, "re_delivered" boolean, "created_at" datetime, "updated_at" datetime)
61449
+  (0.0ms) PRAGMA index_list("action_smser_delivery_reports")
61450
+  (0.9ms) CREATE INDEX "index_action_smser_delivery_reports_on_msg_id" ON "action_smser_delivery_reports" ("msg_id")
61451
+  (0.0ms) INSERT INTO "schema_migrations" ("version") VALUES ('20120102215215')
61452
+ ActionSmser: Sending sms - Delivery_method: test_array - Sms: (Sms ActionSmser::BaseTest::MockSms.basic_sms - From: "555666", To: ["555123555", "123", "+358123555123"], Body: "Body with ääkköset end", Valid: true)
61453
+ ActionSmser: ActionSmser::DeliveryMethods::TestArray.deliveries added message, no real delivery.
61454
+ ActionSmser: Sending sms - Delivery_method: test_array - Sms: (Sms ActionSmser::BaseTest::MockSms.basic_sms - From: "555666", To: ["555123555", "123", "+358123555123"], Body: "Body with ääkköset end", Valid: true)
61455
+ ActionSmser: ActionSmser::DeliveryMethods::TestArray.deliveries added message, no real delivery.
61456
+ ActionSmser: Sending sms - Delivery_method: delayed_job - Sms: (Sms ActionSmser::DelayedJobTest::MockSms.basic_sms - From: "555666", To: ["555123555", "123555123"], Body: "Body with ääkköset end", Valid: true)
61457
+ ActionSmser: Delivering sms by delayed_job
61458
+  (0.1ms) SELECT COUNT(*) FROM "action_smser_delivery_reports"
61459
+  (0.0ms) SAVEPOINT active_record_1
61460
+ SQL (4.5ms) INSERT INTO "action_smser_delivery_reports" ("body", "created_at", "from", "gateway", "log", "msg_id", "re_delivered", "re_delivery_of_delivery_report_id", "sms_type", "status", "status_updated_at", "to", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) [["body", "Body with ääkköset end"], ["created_at", Wed, 04 Sep 2013 15:22:58 UTC +00:00], ["from", "555666"], ["gateway", "test_array"], ["log", "2013-09-04 18:22:58: LOCAL_SENT\n"], ["msg_id", "msg_id_a"], ["re_delivered", nil], ["re_delivery_of_delivery_report_id", nil], ["sms_type", "ActionSmser::DeliveryReportTest::MockSms.basic_sms"], ["status", "LOCAL_SENT"], ["status_updated_at", Wed, 04 Sep 2013 15:22:58 UTC +00:00], ["to", "123"], ["updated_at", Wed, 04 Sep 2013 15:22:58 UTC +00:00]]
61461
+  (0.0ms) RELEASE SAVEPOINT active_record_1
61462
+  (0.0ms) SELECT COUNT(*) FROM "action_smser_delivery_reports"
61463
+  (0.0ms) SAVEPOINT active_record_1
61464
+ SQL (0.2ms) INSERT INTO "action_smser_delivery_reports" ("body", "created_at", "from", "gateway", "log", "msg_id", "re_delivered", "re_delivery_of_delivery_report_id", "sms_type", "status", "status_updated_at", "to", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) [["body", "Body with ääkköset end"], ["created_at", Wed, 04 Sep 2013 15:22:59 UTC +00:00], ["from", "555666"], ["gateway", "test_array"], ["log", "2013-09-04 18:22:59: LOCAL_SENT\n"], ["msg_id", "msg_id_a"], ["re_delivered", nil], ["re_delivery_of_delivery_report_id", nil], ["sms_type", "ActionSmser::DeliveryReportTest::MockSms.basic_sms"], ["status", "LOCAL_SENT"], ["status_updated_at", Wed, 04 Sep 2013 15:22:59 UTC +00:00], ["to", "123"], ["updated_at", Wed, 04 Sep 2013 15:22:59 UTC +00:00]]
61465
+  (0.0ms) RELEASE SAVEPOINT active_record_1
61466
+  (0.0ms) SAVEPOINT active_record_1
61467
+  (0.1ms) UPDATE "action_smser_delivery_reports" SET "gateway" = 'some_delivery', "updated_at" = '2013-09-04 15:22:59.004506' WHERE "action_smser_delivery_reports"."id" = 1
61468
+  (0.1ms) RELEASE SAVEPOINT active_record_1
61469
+ ActionSmser::DeliveryReport Load (0.1ms) SELECT "action_smser_delivery_reports".* FROM "action_smser_delivery_reports" WHERE "action_smser_delivery_reports"."id" = ? LIMIT 1 [["id", 1]]
61470
+ ActionSmser: Re_delivering: #<ActionSmser::DeliveryReport id: 1, msg_id: "msg_id_a", status: "LOCAL_SENT", status_updated_at: "2013-09-04 15:22:59", sms_type: "ActionSmser::DeliveryReportTest::MockSms.basic_sms", log: "2013-09-04 18:22:59: LOCAL_SENT\n", to: "123", from: "555666", body: "Body with ääkköset end", gateway: "some_delivery", re_delivery_of_delivery_report_id: nil, re_delivered: nil, created_at: "2013-09-04 15:22:59", updated_at: "2013-09-04 15:22:59">
61471
+  (0.0ms) SAVEPOINT active_record_1
61472
+  (0.1ms) UPDATE "action_smser_delivery_reports" SET "re_delivered" = 't', "updated_at" = '2013-09-04 15:22:59.006674' WHERE "action_smser_delivery_reports"."id" = 1
61473
+  (0.0ms) RELEASE SAVEPOINT active_record_1
61474
+ ActionSmser::DeliveryReport Load (0.0ms) SELECT "action_smser_delivery_reports".* FROM "action_smser_delivery_reports" WHERE "action_smser_delivery_reports"."id" = ? LIMIT 1 [["id", 1]]
61475
+ ActionSmser: Sending sms - Delivery_method: test_array - Sms: (Sms ActionSmser::DeliveryReportTest::MockSms.basic_sms.re_delivery - From: "555666", To: "123", Body: "Body with ääkköset end", Valid: true)
61476
+ ActionSmser: ActionSmser::DeliveryMethods::TestArray.deliveries added message, no real delivery.
61477
+  (0.0ms) SAVEPOINT active_record_1
61478
+ SQL (0.3ms) INSERT INTO "action_smser_delivery_reports" ("body", "created_at", "from", "gateway", "log", "msg_id", "re_delivered", "re_delivery_of_delivery_report_id", "sms_type", "status", "status_updated_at", "to", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) [["body", "Body with ääkköset end"], ["created_at", Wed, 04 Sep 2013 15:22:59 UTC +00:00], ["from", "555666"], ["gateway", "test_array"], ["log", "2013-09-04 18:22:59: LOCAL_SENT\n"], ["msg_id", "test_array_id_89913646"], ["re_delivered", nil], ["re_delivery_of_delivery_report_id", 1], ["sms_type", "ActionSmser::DeliveryReportTest::MockSms.basic_sms.re_delivery"], ["status", "LOCAL_SENT"], ["status_updated_at", Wed, 04 Sep 2013 15:22:59 UTC +00:00], ["to", "123"], ["updated_at", Wed, 04 Sep 2013 15:22:59 UTC +00:00]]
61479
+  (0.0ms) RELEASE SAVEPOINT active_record_1
61480
+ ActionSmser::DeliveryReport Load (0.1ms) SELECT "action_smser_delivery_reports".* FROM "action_smser_delivery_reports" ORDER BY "action_smser_delivery_reports"."id" DESC LIMIT 1
61481
+ ActionSmser::DeliveryReport Load (0.2ms) SELECT "action_smser_delivery_reports".* FROM "action_smser_delivery_reports" WHERE "action_smser_delivery_reports"."re_delivery_of_delivery_report_id" = 1 LIMIT 1
61482
+ ActionSmser::DeliveryReport Load (0.1ms) SELECT "action_smser_delivery_reports".* FROM "action_smser_delivery_reports" WHERE "action_smser_delivery_reports"."id" = 1 LIMIT 1
61483
+  (0.0ms) SAVEPOINT active_record_1
61484
+ SQL (0.3ms) INSERT INTO "action_smser_delivery_reports" ("body", "created_at", "from", "gateway", "log", "msg_id", "re_delivered", "re_delivery_of_delivery_report_id", "sms_type", "status", "status_updated_at", "to", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) [["body", "Body with ääkköset end"], ["created_at", Wed, 04 Sep 2013 15:22:59 UTC +00:00], ["from", "555666"], ["gateway", "test_array"], ["log", "2013-09-04 18:22:59: LOCAL_SENT\n"], ["msg_id", "msg_id_a"], ["re_delivered", nil], ["re_delivery_of_delivery_report_id", nil], ["sms_type", "ActionSmser::DeliveryReportTest::MockSms.basic_sms"], ["status", "LOCAL_SENT"], ["status_updated_at", Wed, 04 Sep 2013 15:22:59 UTC +00:00], ["to", "123"], ["updated_at", Wed, 04 Sep 2013 15:22:59 UTC +00:00]]
61485
+  (0.0ms) RELEASE SAVEPOINT active_record_1
61486
+ ActionSmser::DeliveryReport Load (0.0ms) SELECT "action_smser_delivery_reports".* FROM "action_smser_delivery_reports" WHERE "action_smser_delivery_reports"."id" = ? LIMIT 1 [["id", 1]]
61487
+  (0.0ms) SAVEPOINT active_record_1
61488
+ SQL (0.5ms) INSERT INTO "action_smser_delivery_reports" ("body", "created_at", "from", "gateway", "log", "msg_id", "re_delivered", "re_delivery_of_delivery_report_id", "sms_type", "status", "status_updated_at", "to", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) [["body", nil], ["created_at", Wed, 04 Sep 2013 15:22:59 UTC +00:00], ["from", nil], ["gateway", nil], ["log", "2013-09-04 18:22:59: LOCAL_TEST\n"], ["msg_id", nil], ["re_delivered", nil], ["re_delivery_of_delivery_report_id", nil], ["sms_type", nil], ["status", "LOCAL_TEST"], ["status_updated_at", Wed, 04 Sep 2013 15:22:59 UTC +00:00], ["to", nil], ["updated_at", Wed, 04 Sep 2013 15:22:59 UTC +00:00]]
61489
+  (0.0ms) RELEASE SAVEPOINT active_record_1
61490
+  (0.0ms) SAVEPOINT active_record_1
61491
+  (0.1ms) UPDATE "action_smser_delivery_reports" SET "status" = 'TEST_2', "status_updated_at" = '2013-09-04 15:22:59.038280', "log" = '2013-09-04 18:22:59: LOCAL_TEST
61492
+ 2013-09-04 18:22:59: TEST_2
61493
+ ', "updated_at" = '2013-09-04 15:22:59.038588' WHERE "action_smser_delivery_reports"."id" = 1
61494
+  (0.0ms) RELEASE SAVEPOINT active_record_1
61495
+  (0.0ms) SAVEPOINT active_record_1
61496
+ SQL (0.5ms) INSERT INTO "action_smser_delivery_reports" ("body", "created_at", "from", "gateway", "log", "msg_id", "re_delivered", "re_delivery_of_delivery_report_id", "sms_type", "status", "status_updated_at", "to", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) [["body", nil], ["created_at", Wed, 04 Sep 2013 15:22:59 UTC +00:00], ["from", nil], ["gateway", nil], ["log", "2013-09-04 18:22:59: ORIGINAL_STATUS\n"], ["msg_id", "102010314204056202"], ["re_delivered", nil], ["re_delivery_of_delivery_report_id", nil], ["sms_type", nil], ["status", "ORIGINAL_STATUS"], ["status_updated_at", Wed, 04 Sep 2013 15:22:59 UTC +00:00], ["to", nil], ["updated_at", Wed, 04 Sep 2013 15:22:59 UTC +00:00]]
61497
+  (0.0ms) RELEASE SAVEPOINT active_record_1
61498
+ Processing by ActionSmser::DeliveryReportsController#gateway_commit as HTML
61499
+ Parameters: {"gateway"=>"test_gateway", "DeliveryReport"=>{"message"=>{"id"=>"102010314204056202", "donedate"=>"2012/01/03 14:20:45", "sentdate"=>"2012/01/03 14:20:40", "status"=>"DELIVERED"}}, "use_route"=>"action_smser"}
61500
+ ActionSmser: Gateway_commit found parser for gateway: test_gateway
61501
+ ActionSmser::DeliveryReport Load (0.2ms) SELECT "action_smser_delivery_reports".* FROM "action_smser_delivery_reports" WHERE "action_smser_delivery_reports"."msg_id" = '102010314204056202' LIMIT 1
61502
+  (0.0ms) SAVEPOINT active_record_1
61503
+  (0.1ms) UPDATE "action_smser_delivery_reports" SET "status" = 'DELIVERED', "status_updated_at" = '2013-09-04 15:22:59.055026', "log" = '2013-09-04 18:22:59: ORIGINAL_STATUS
61504
+ 2013-09-04 18:22:59: DELIVERED
61505
+ ', "updated_at" = '2013-09-04 15:22:59.055456' WHERE "action_smser_delivery_reports"."id" = 1
61506
+  (0.0ms) RELEASE SAVEPOINT active_record_1
61507
+ ActionSmser: Gateway_commit updated item with id: 102010314204056202, params: {"msg_id"=>"102010314204056202", "status"=>"DELIVERED"}
61508
+ Rendered text template (0.0ms)
61509
+ Completed 200 OK in 15ms (Views: 10.6ms | ActiveRecord: 0.3ms)
61510
+ ActionSmser::DeliveryReport Load (0.1ms) SELECT "action_smser_delivery_reports".* FROM "action_smser_delivery_reports" WHERE "action_smser_delivery_reports"."id" = ? LIMIT 1 [["id", 1]]
61511
+  (0.0ms) SAVEPOINT active_record_1
61512
+ SQL (0.8ms) INSERT INTO "action_smser_delivery_reports" ("body", "created_at", "from", "gateway", "log", "msg_id", "re_delivered", "re_delivery_of_delivery_report_id", "sms_type", "status", "status_updated_at", "to", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) [["body", nil], ["created_at", Wed, 04 Sep 2013 15:22:59 UTC +00:00], ["from", nil], ["gateway", nil], ["log", "2013-09-04 18:22:59: ORIGINAL_STATUS\n"], ["msg_id", "102010314204056202"], ["re_delivered", nil], ["re_delivery_of_delivery_report_id", nil], ["sms_type", nil], ["status", "ORIGINAL_STATUS"], ["status_updated_at", Wed, 04 Sep 2013 15:22:59 UTC +00:00], ["to", nil], ["updated_at", Wed, 04 Sep 2013 15:22:59 UTC +00:00]]
61513
+  (0.1ms) RELEASE SAVEPOINT active_record_1
61514
+  (0.1ms) SAVEPOINT active_record_1
61515
+ SQL (0.5ms) INSERT INTO "action_smser_delivery_reports" ("body", "created_at", "from", "gateway", "log", "msg_id", "re_delivered", "re_delivery_of_delivery_report_id", "sms_type", "status", "status_updated_at", "to", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) [["body", nil], ["created_at", Wed, 04 Sep 2013 15:22:59 UTC +00:00], ["from", nil], ["gateway", nil], ["log", "2013-09-04 18:22:59: ORIGINAL_STATUS\n"], ["msg_id", "99999999999999999"], ["re_delivered", nil], ["re_delivery_of_delivery_report_id", nil], ["sms_type", nil], ["status", "ORIGINAL_STATUS"], ["status_updated_at", Wed, 04 Sep 2013 15:22:59 UTC +00:00], ["to", nil], ["updated_at", Wed, 04 Sep 2013 15:22:59 UTC +00:00]]
61516
+  (0.0ms) RELEASE SAVEPOINT active_record_1
61517
+ Processing by ActionSmser::DeliveryReportsController#gateway_commit as HTML
61518
+ Parameters: {"gateway"=>"test_gateway", "DeliveryReport"=>{"message"=>[{"id"=>"102010314204056202", "status"=>"DELIVERED"}, {"id"=>"99999999999999999", "status"=>"DELIVERED"}]}, "use_route"=>"action_smser"}
61519
+ ActionSmser: Gateway_commit found parser for gateway: test_gateway
61520
+ ActionSmser::DeliveryReport Load (0.1ms) SELECT "action_smser_delivery_reports".* FROM "action_smser_delivery_reports" WHERE "action_smser_delivery_reports"."msg_id" = '102010314204056202' LIMIT 1
61521
+  (0.0ms) SAVEPOINT active_record_1
61522
+  (0.1ms) UPDATE "action_smser_delivery_reports" SET "status" = 'DELIVERED', "status_updated_at" = '2013-09-04 15:22:59.075560', "log" = '2013-09-04 18:22:59: ORIGINAL_STATUS
61523
+ 2013-09-04 18:22:59: DELIVERED
61524
+ ', "updated_at" = '2013-09-04 15:22:59.075990' WHERE "action_smser_delivery_reports"."id" = 1
61525
+  (0.0ms) RELEASE SAVEPOINT active_record_1
61526
+ ActionSmser: Gateway_commit updated item with id: 102010314204056202, params: {"msg_id"=>"102010314204056202", "status"=>"DELIVERED"}
61527
+ ActionSmser::DeliveryReport Load (0.1ms) SELECT "action_smser_delivery_reports".* FROM "action_smser_delivery_reports" WHERE "action_smser_delivery_reports"."msg_id" = '99999999999999999' LIMIT 1
61528
+  (0.0ms) SAVEPOINT active_record_1
61529
+  (0.1ms) UPDATE "action_smser_delivery_reports" SET "status" = 'DELIVERED', "status_updated_at" = '2013-09-04 15:22:59.077298', "log" = '2013-09-04 18:22:59: ORIGINAL_STATUS
61530
+ 2013-09-04 18:22:59: DELIVERED
61531
+ ', "updated_at" = '2013-09-04 15:22:59.077599' WHERE "action_smser_delivery_reports"."id" = 2
61532
+  (0.0ms) RELEASE SAVEPOINT active_record_1
61533
+ ActionSmser: Gateway_commit updated item with id: 99999999999999999, params: {"msg_id"=>"99999999999999999", "status"=>"DELIVERED"}
61534
+ Completed 200 OK in 4ms (Views: 0.3ms | ActiveRecord: 0.5ms)
61535
+ ActionSmser::DeliveryReport Load (0.0ms) SELECT "action_smser_delivery_reports".* FROM "action_smser_delivery_reports" WHERE "action_smser_delivery_reports"."id" = ? LIMIT 1 [["id", 1]]
61536
+ ActionSmser::DeliveryReport Load (0.0ms) SELECT "action_smser_delivery_reports".* FROM "action_smser_delivery_reports" WHERE "action_smser_delivery_reports"."id" = ? LIMIT 1 [["id", 2]]
61537
+ Processing by ActionSmser::DeliveryReportsController#gateway_commit as HTML
61538
+ Parameters: {"gateway"=>"gateway_not_found", "DeliveryReport"=>{"message"=>{"id"=>"wrongid", "donedate"=>"2012/01/03 14:20:45", "sentdate"=>"2012/01/03 14:20:40", "status"=>"DELIVERED"}}, "use_route"=>"action_smser"}
61539
+ Completed 200 OK in 0ms (Views: 0.1ms | ActiveRecord: 0.0ms)
61540
+ Processing by ActionSmser::DeliveryReportsController#gateway_commit as HTML
61541
+ Parameters: {"gateway"=>"test_gateway", "DeliveryReport"=>{"message"=>{"id"=>"wrongid", "donedate"=>"2012/01/03 14:20:45", "sentdate"=>"2012/01/03 14:20:40", "status"=>"DELIVERED"}}, "use_route"=>"action_smser"}
61542
+ ActionSmser: Gateway_commit found parser for gateway: test_gateway
61543
+ ActionSmser::DeliveryReport Load (0.1ms) SELECT "action_smser_delivery_reports".* FROM "action_smser_delivery_reports" WHERE "action_smser_delivery_reports"."msg_id" = 'wrongid' LIMIT 1
61544
+ ActionSmser: Gateway_commit not found item with id: wrongid, params: {"msg_id"=>"wrongid", "status"=>"DELIVERED"}
61545
+ Completed 200 OK in 1ms (Views: 0.1ms | ActiveRecord: 0.1ms)
61546
+  (0.0ms) SAVEPOINT active_record_1
61547
+ SQL (0.6ms) INSERT INTO "action_smser_delivery_reports" ("body", "created_at", "from", "gateway", "log", "msg_id", "re_delivered", "re_delivery_of_delivery_report_id", "sms_type", "status", "status_updated_at", "to", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) [["body", nil], ["created_at", Wed, 04 Sep 2013 15:22:59 UTC +00:00], ["from", nil], ["gateway", nil], ["log", nil], ["msg_id", "idtest_7"], ["re_delivered", nil], ["re_delivery_of_delivery_report_id", nil], ["sms_type", nil], ["status", nil], ["status_updated_at", nil], ["to", nil], ["updated_at", Wed, 04 Sep 2013 15:22:59 UTC +00:00]]
61548
+  (0.0ms) RELEASE SAVEPOINT active_record_1
61549
+  (0.0ms) SAVEPOINT active_record_1
61550
+ SQL (0.5ms) INSERT INTO "action_smser_delivery_reports" ("body", "created_at", "from", "gateway", "log", "msg_id", "re_delivered", "re_delivery_of_delivery_report_id", "sms_type", "status", "status_updated_at", "to", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) [["body", nil], ["created_at", Wed, 04 Sep 2013 15:22:59 UTC +00:00], ["from", nil], ["gateway", nil], ["log", nil], ["msg_id", "idtest_5"], ["re_delivered", nil], ["re_delivery_of_delivery_report_id", nil], ["sms_type", nil], ["status", nil], ["status_updated_at", nil], ["to", nil], ["updated_at", Wed, 04 Sep 2013 15:22:59 UTC +00:00]]
61551
+  (0.0ms) RELEASE SAVEPOINT active_record_1
61552
+ Processing by ActionSmser::DeliveryReportsController#index as HTML
61553
+ Parameters: {"use_route"=>"action_smser"}
61554
+  (0.1ms) SELECT COUNT(*) FROM "action_smser_delivery_reports" WHERE ("action_smser_delivery_reports"."created_at" BETWEEN '2013-08-28 15:22:59.093458' AND '2013-09-04 15:12:59.093621')
61555
+  (0.1ms) SELECT COUNT(*) AS count_all, gateway AS gateway FROM "action_smser_delivery_reports" WHERE ("action_smser_delivery_reports"."created_at" BETWEEN '2013-08-28 15:22:59.093458' AND '2013-09-04 15:12:59.093621') GROUP BY gateway
61556
+  (0.1ms) SELECT COUNT(*) FROM "action_smser_delivery_reports" WHERE ("action_smser_delivery_reports"."created_at" BETWEEN '2013-08-28 15:22:59.093458' AND '2013-09-04 15:12:59.093621')
61557
+  (0.1ms) SELECT COUNT(*) AS count_all, status AS status FROM "action_smser_delivery_reports" WHERE ("action_smser_delivery_reports"."created_at" BETWEEN '2013-08-28 15:22:59.093458' AND '2013-09-04 15:12:59.093621') GROUP BY status
61558
+  (0.1ms) SELECT COUNT(*) FROM "action_smser_delivery_reports" WHERE ("action_smser_delivery_reports"."created_at" BETWEEN '2013-08-28 15:22:59.093458' AND '2013-09-04 15:12:59.093621')
61559
+  (0.1ms) SELECT COUNT(*) AS count_all, sms_type AS sms_type FROM "action_smser_delivery_reports" WHERE ("action_smser_delivery_reports"."created_at" BETWEEN '2013-08-28 15:22:59.093458' AND '2013-09-04 15:12:59.093621') GROUP BY sms_type
61560
+ Completed 200 OK in 16ms (Views: 15.4ms | ActiveRecord: 0.4ms)
61561
+  (0.0ms) SAVEPOINT active_record_1
61562
+ SQL (0.6ms) INSERT INTO "action_smser_delivery_reports" ("body", "created_at", "from", "gateway", "log", "msg_id", "re_delivered", "re_delivery_of_delivery_report_id", "sms_type", "status", "status_updated_at", "to", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) [["body", nil], ["created_at", Wed, 04 Sep 2013 15:22:59 UTC +00:00], ["from", nil], ["gateway", nil], ["log", nil], ["msg_id", "idtest_1"], ["re_delivered", nil], ["re_delivery_of_delivery_report_id", nil], ["sms_type", nil], ["status", nil], ["status_updated_at", nil], ["to", nil], ["updated_at", Wed, 04 Sep 2013 15:22:59 UTC +00:00]]
61563
+  (0.0ms) RELEASE SAVEPOINT active_record_1
61564
+  (0.0ms) SAVEPOINT active_record_1
61565
+ SQL (0.5ms) INSERT INTO "action_smser_delivery_reports" ("body", "created_at", "from", "gateway", "log", "msg_id", "re_delivered", "re_delivery_of_delivery_report_id", "sms_type", "status", "status_updated_at", "to", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) [["body", nil], ["created_at", Wed, 04 Sep 2013 15:22:59 UTC +00:00], ["from", nil], ["gateway", nil], ["log", nil], ["msg_id", "idtest_4"], ["re_delivered", nil], ["re_delivery_of_delivery_report_id", nil], ["sms_type", nil], ["status", nil], ["status_updated_at", nil], ["to", nil], ["updated_at", Wed, 04 Sep 2013 15:22:59 UTC +00:00]]
61566
+  (0.0ms) RELEASE SAVEPOINT active_record_1
61567
+ Processing by ActionSmser::DeliveryReportsController#index as HTML
61568
+ Parameters: {"use_route"=>"action_smser"}
61569
+  (0.1ms) SELECT COUNT(*) FROM "action_smser_delivery_reports" WHERE ("action_smser_delivery_reports"."created_at" BETWEEN '2013-08-28 15:22:59.109573' AND '2013-09-04 15:12:59.109832')
61570
+  (0.1ms) SELECT COUNT(*) AS count_all, gateway AS gateway FROM "action_smser_delivery_reports" WHERE ("action_smser_delivery_reports"."created_at" BETWEEN '2013-08-28 15:22:59.109573' AND '2013-09-04 15:12:59.109832') GROUP BY gateway
61571
+  (0.1ms) SELECT COUNT(*) FROM "action_smser_delivery_reports" WHERE ("action_smser_delivery_reports"."created_at" BETWEEN '2013-08-28 15:22:59.109573' AND '2013-09-04 15:12:59.109832')
61572
+  (0.1ms) SELECT COUNT(*) AS count_all, status AS status FROM "action_smser_delivery_reports" WHERE ("action_smser_delivery_reports"."created_at" BETWEEN '2013-08-28 15:22:59.109573' AND '2013-09-04 15:12:59.109832') GROUP BY status
61573
+  (0.1ms) SELECT COUNT(*) FROM "action_smser_delivery_reports" WHERE ("action_smser_delivery_reports"."created_at" BETWEEN '2013-08-28 15:22:59.109573' AND '2013-09-04 15:12:59.109832')
61574
+  (0.1ms) SELECT COUNT(*) AS count_all, sms_type AS sms_type FROM "action_smser_delivery_reports" WHERE ("action_smser_delivery_reports"."created_at" BETWEEN '2013-08-28 15:22:59.109573' AND '2013-09-04 15:12:59.109832') GROUP BY sms_type
61575
+ Completed 200 OK in 10ms (Views: 9.4ms | ActiveRecord: 0.4ms)
61576
+ Processing by ActionSmser::DeliveryReportsController#index as HTML
61577
+ Parameters: {"use_route"=>"action_smser"}
61578
+ Completed 403 Forbidden in 0ms (Views: 0.2ms | ActiveRecord: 0.0ms)
61579
+  (0.0ms) SAVEPOINT active_record_1
61580
+ SQL (0.6ms) INSERT INTO "action_smser_delivery_reports" ("body", "created_at", "from", "gateway", "log", "msg_id", "re_delivered", "re_delivery_of_delivery_report_id", "sms_type", "status", "status_updated_at", "to", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) [["body", nil], ["created_at", Wed, 04 Sep 2013 15:22:59 UTC +00:00], ["from", nil], ["gateway", nil], ["log", nil], ["msg_id", "idtest_3"], ["re_delivered", nil], ["re_delivery_of_delivery_report_id", nil], ["sms_type", nil], ["status", nil], ["status_updated_at", nil], ["to", nil], ["updated_at", Wed, 04 Sep 2013 15:22:59 UTC +00:00]]
61581
+  (0.0ms) RELEASE SAVEPOINT active_record_1
61582
+  (0.0ms) SAVEPOINT active_record_1
61583
+ SQL (0.5ms) INSERT INTO "action_smser_delivery_reports" ("body", "created_at", "from", "gateway", "log", "msg_id", "re_delivered", "re_delivery_of_delivery_report_id", "sms_type", "status", "status_updated_at", "to", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) [["body", nil], ["created_at", Wed, 04 Sep 2013 15:22:59 UTC +00:00], ["from", nil], ["gateway", nil], ["log", nil], ["msg_id", "idtest_8"], ["re_delivered", nil], ["re_delivery_of_delivery_report_id", nil], ["sms_type", nil], ["status", nil], ["status_updated_at", nil], ["to", nil], ["updated_at", Wed, 04 Sep 2013 15:22:59 UTC +00:00]]
61584
+  (0.0ms) RELEASE SAVEPOINT active_record_1
61585
+ Processing by ActionSmser::DeliveryReportsController#list as HTML
61586
+ Parameters: {"use_route"=>"action_smser"}
61587
+ ActionSmser::DeliveryReport Load (0.4ms) SELECT "action_smser_delivery_reports".* FROM "action_smser_delivery_reports" ORDER BY created_at DESC LIMIT 20 OFFSET 0
61588
+ Completed 200 OK in 6ms (Views: 5.2ms | ActiveRecord: 0.4ms)
61589
+ ActionSmser: Sending sms - Delivery_method: nexmo - Sms: (Sms ActionSmser::NexmoTest::MockSms.basic_sms - From: "555666", To: ["555123555", "123555123"], Body: "Body with ääkköset end", Valid: true)
61590
+ ActionSmser: Nexmo delivery http ||| /sms/json?username=user&password=pass&ttl=86400000&status-report-req=false&from=555666&to=555123555&text=Body+with+%C3%A4%C3%A4kk%C3%B6set+end ||| #<Mock:0x4313040>
61591
+ ActionSmser: {"message-count":"1","messages":[{"message-price":"0.02500000","status":"0","message-id":"0778DE88","remaining-balance":"1.77500000"}]}
61592
+ ActionSmser: Nexmo delivery http ||| /sms/json?username=user&password=pass&ttl=86400000&status-report-req=false&from=555666&to=123555123&text=Body+with+%C3%A4%C3%A4kk%C3%B6set+end ||| #<Mock:0x4313040>
61593
+ ActionSmser: {"message-count":"1","messages":[{"message-price":"0.02500000","status":"0","message-id":"0778DE88","remaining-balance":"1.77500000"}]}
61594
+  (0.1ms) SELECT COUNT(*) FROM "action_smser_delivery_reports"
61595
+ ActionSmser: Sending sms - Delivery_method: nexmo - Sms: (Sms ActionSmser::NexmoTest::MockSms.basic_sms - From: "555666", To: ["555123555", "123555123"], Body: "Body with ääkköset end", Valid: true)
61596
+ ActionSmser: Nexmo delivery http ||| /sms/json?username=user&password=pass&ttl=86400000&status-report-req=true&from=555666&to=555123555&text=Body+with+%C3%A4%C3%A4kk%C3%B6set+end ||| #<Mock:0x431b8a8>
61597
+ ActionSmser: {"message-count":"1","messages":[{"message-price":"0.02500000","status":"0","message-id":"0778DE88","remaining-balance":"1.77500000"}]}
61598
+  (0.0ms) SAVEPOINT active_record_1
61599
+ SQL (0.3ms) INSERT INTO "action_smser_delivery_reports" ("body", "created_at", "from", "gateway", "log", "msg_id", "re_delivered", "re_delivery_of_delivery_report_id", "sms_type", "status", "status_updated_at", "to", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) [["body", "Body with ääkköset end"], ["created_at", Wed, 04 Sep 2013 15:22:59 UTC +00:00], ["from", "555666"], ["gateway", "nexmo"], ["log", "2013-09-04 18:22:59: LOCAL_SENT\n"], ["msg_id", "0778DE88"], ["re_delivered", nil], ["re_delivery_of_delivery_report_id", nil], ["sms_type", "ActionSmser::NexmoTest::MockSms.basic_sms"], ["status", "LOCAL_SENT"], ["status_updated_at", Wed, 04 Sep 2013 15:22:59 UTC +00:00], ["to", "555123555"], ["updated_at", Wed, 04 Sep 2013 15:22:59 UTC +00:00]]
61600
+  (0.0ms) RELEASE SAVEPOINT active_record_1
61601
+ ActionSmser: Nexmo delivery http ||| /sms/json?username=user&password=pass&ttl=86400000&status-report-req=true&from=555666&to=123555123&text=Body+with+%C3%A4%C3%A4kk%C3%B6set+end ||| #<Mock:0x431b8a8>
61602
+ ActionSmser: {"message-count":"1","messages":[{"message-price":"0.02500000","status":"0","message-id":"0778DE88","remaining-balance":"1.77500000"}]}
61603
+  (0.0ms) SAVEPOINT active_record_1
61604
+ SQL (0.2ms) INSERT INTO "action_smser_delivery_reports" ("body", "created_at", "from", "gateway", "log", "msg_id", "re_delivered", "re_delivery_of_delivery_report_id", "sms_type", "status", "status_updated_at", "to", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) [["body", "Body with ääkköset end"], ["created_at", Wed, 04 Sep 2013 15:22:59 UTC +00:00], ["from", "555666"], ["gateway", "nexmo"], ["log", "2013-09-04 18:22:59: LOCAL_SENT\n"], ["msg_id", "0778DE88"], ["re_delivered", nil], ["re_delivery_of_delivery_report_id", nil], ["sms_type", "ActionSmser::NexmoTest::MockSms.basic_sms"], ["status", "LOCAL_SENT"], ["status_updated_at", Wed, 04 Sep 2013 15:22:59 UTC +00:00], ["to", "123555123"], ["updated_at", Wed, 04 Sep 2013 15:22:59 UTC +00:00]]
61605
+  (0.0ms) RELEASE SAVEPOINT active_record_1
61606
+  (0.0ms) SELECT COUNT(*) FROM "action_smser_delivery_reports" 
61607
+ ActionSmser: Sending sms - Delivery_method: simple_http - Sms: (Sms ActionSmser::SimpleHttpTest::MockSms.basic_sms - From: "555666", To: ["555123555", "123555123"], Body: "Body with ääkköset end", Valid: true)
61608
+ ActionSmser: SimpleHttp delivery ||| /api/sendsms/plain?user=user&password=pass&sender=555666&SMSText=Body+with+%E4%E4kk%F6set+end&GSM=555123555,123555123 ||| #<Mock:0x4342840>
61609
+ ActionSmser: id_1234
61610
+ id_6666
61611
+  (0.1ms) SELECT COUNT(*) FROM "action_smser_delivery_reports"
61612
+ ActionSmser: Sending sms - Delivery_method: simple_http - Sms: (Sms ActionSmser::SimpleHttpTest::MockSms.basic_sms - From: "555666", To: ["555123555", "123555123"], Body: "Body with ääkköset end", Valid: true)
61613
+ ActionSmser: SimpleHttp delivery ||| /api/sendsms/plain?user=user&password=pass&sender=555666&SMSText=Body+with+%E4%E4kk%F6set+end&GSM=555123555,123555123 ||| #<Mock:0x434c408>
61614
+ ActionSmser: id_1234
61615
+ id_6666
61616
+  (0.0ms) SAVEPOINT active_record_1
61617
+ SQL (0.3ms) INSERT INTO "action_smser_delivery_reports" ("body", "created_at", "from", "gateway", "log", "msg_id", "re_delivered", "re_delivery_of_delivery_report_id", "sms_type", "status", "status_updated_at", "to", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) [["body", "Body with ääkköset end"], ["created_at", Wed, 04 Sep 2013 15:22:59 UTC +00:00], ["from", "555666"], ["gateway", "simple_http"], ["log", "2013-09-04 18:22:59: LOCAL_SENT\n"], ["msg_id", "id_1234"], ["re_delivered", nil], ["re_delivery_of_delivery_report_id", nil], ["sms_type", "ActionSmser::SimpleHttpTest::MockSms.basic_sms"], ["status", "LOCAL_SENT"], ["status_updated_at", Wed, 04 Sep 2013 15:22:59 UTC +00:00], ["to", "555123555"], ["updated_at", Wed, 04 Sep 2013 15:22:59 UTC +00:00]]
61618
+  (0.0ms) RELEASE SAVEPOINT active_record_1
61619
+  (0.0ms) SAVEPOINT active_record_1
61620
+ SQL (0.2ms) INSERT INTO "action_smser_delivery_reports" ("body", "created_at", "from", "gateway", "log", "msg_id", "re_delivered", "re_delivery_of_delivery_report_id", "sms_type", "status", "status_updated_at", "to", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) [["body", "Body with ääkköset end"], ["created_at", Wed, 04 Sep 2013 15:22:59 UTC +00:00], ["from", "555666"], ["gateway", "simple_http"], ["log", "2013-09-04 18:22:59: LOCAL_SENT\n"], ["msg_id", "id_6666"], ["re_delivered", nil], ["re_delivery_of_delivery_report_id", nil], ["sms_type", "ActionSmser::SimpleHttpTest::MockSms.basic_sms"], ["status", "LOCAL_SENT"], ["status_updated_at", Wed, 04 Sep 2013 15:22:59 UTC +00:00], ["to", "123555123"], ["updated_at", Wed, 04 Sep 2013 15:22:59 UTC +00:00]]
61621
+  (0.0ms) RELEASE SAVEPOINT active_record_1
61622
+  (0.1ms) SELECT COUNT(*) FROM "action_smser_delivery_reports" 
61623
+ ActionSmser: Sending sms - Delivery_method: smstrade - Sms: (Sms ActionSmser::SmstradeTest::MockSms.basic_sms - From: "4917212341234", To: ["4915112341234", "4917812341234"], Body: "Body with ümläüts.", Valid: true)
61624
+ ActionSmser: Smstrade delivery http ||| /?key=api-key-here&from=4917212341234&to=4915112341234&message=Body+with+%C3%BCml%C3%A4%C3%BCts.&route=gold&debug=1&cost=1&message_id=1&count=1&charset=utf-8 ||| #<Mock:0x4372860>
61625
+ ActionSmser: 100
61626
+ 123456789
61627
+ 0.064
61628
+ 1
61629
+ ActionSmser: Smstrade delivery http ||| /?key=api-key-here&from=4917212341234&to=4917812341234&message=Body+with+%C3%BCml%C3%A4%C3%BCts.&route=gold&debug=1&cost=1&message_id=1&count=1&charset=utf-8 ||| #<Mock:0x4372860>
61630
+ ActionSmser: 100
61631
+ 123456789
61632
+ 0.064
61633
+ 1
61634
+  (0.1ms) SELECT COUNT(*) FROM "action_smser_delivery_reports"
61635
+ ActionSmser: Sending sms - Delivery_method: smstrade - Sms: (Sms ActionSmser::SmstradeTest::MockSms.basic_sms - From: "4917212341234", To: ["4915112341234", "4917812341234"], Body: "Body with ümläüts.", Valid: true)
61636
+ ActionSmser: Smstrade delivery http ||| /?key=api-key-here&from=4917212341234&to=4915112341234&message=Body+with+%C3%BCml%C3%A4%C3%BCts.&route=gold&debug=1&cost=1&message_id=1&count=1&charset=utf-8 ||| #<Mock:0x437a858>
61637
+ ActionSmser: 100
61638
+ 123456789
61639
+ 0.064
61640
+ 1
61641
+  (0.0ms) SAVEPOINT active_record_1
61642
+ SQL (0.6ms) INSERT INTO "action_smser_delivery_reports" ("body", "created_at", "from", "gateway", "log", "msg_id", "re_delivered", "re_delivery_of_delivery_report_id", "sms_type", "status", "status_updated_at", "to", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) [["body", "Body with ümläüts."], ["created_at", Wed, 04 Sep 2013 15:22:59 UTC +00:00], ["from", "4917212341234"], ["gateway", "smstrade"], ["log", "2013-09-04 18:22:59: LOCAL_SENT\n"], ["msg_id", "123456789"], ["re_delivered", nil], ["re_delivery_of_delivery_report_id", nil], ["sms_type", "ActionSmser::SmstradeTest::MockSms.basic_sms"], ["status", "LOCAL_SENT"], ["status_updated_at", Wed, 04 Sep 2013 15:22:59 UTC +00:00], ["to", "4915112341234"], ["updated_at", Wed, 04 Sep 2013 15:22:59 UTC +00:00]]
61643
+  (0.0ms) RELEASE SAVEPOINT active_record_1
61644
+ ActionSmser: Smstrade delivery http ||| /?key=api-key-here&from=4917212341234&to=4917812341234&message=Body+with+%C3%BCml%C3%A4%C3%BCts.&route=gold&debug=1&cost=1&message_id=1&count=1&charset=utf-8 ||| #<Mock:0x437a858>
61645
+ ActionSmser: 100
61646
+ 123456789
61647
+ 0.064
61648
+ 1
61649
+  (0.0ms) SAVEPOINT active_record_1
61650
+ SQL (0.3ms) INSERT INTO "action_smser_delivery_reports" ("body", "created_at", "from", "gateway", "log", "msg_id", "re_delivered", "re_delivery_of_delivery_report_id", "sms_type", "status", "status_updated_at", "to", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) [["body", "Body with ümläüts."], ["created_at", Wed, 04 Sep 2013 15:22:59 UTC +00:00], ["from", "4917212341234"], ["gateway", "smstrade"], ["log", "2013-09-04 18:22:59: LOCAL_SENT\n"], ["msg_id", "123456789"], ["re_delivered", nil], ["re_delivery_of_delivery_report_id", nil], ["sms_type", "ActionSmser::SmstradeTest::MockSms.basic_sms"], ["status", "LOCAL_SENT"], ["status_updated_at", Wed, 04 Sep 2013 15:22:59 UTC +00:00], ["to", "4917812341234"], ["updated_at", Wed, 04 Sep 2013 15:22:59 UTC +00:00]]
61651
+  (0.0ms) RELEASE SAVEPOINT active_record_1
61652
+  (0.1ms) SELECT COUNT(*) FROM "action_smser_delivery_reports" 
61653
+ ActionSmser: Sending sms - Delivery_method: test_array - Sms: (Sms ActionSmser::TestArrayTest::MockSms.basic_sms - From: "555666", To: ["555123555", "123555123"], Body: "Body with ääkköset end", Valid: true)
61654
+ ActionSmser: ActionSmser::DeliveryMethods::TestArray.deliveries added message, no real delivery.
61655
+ ActionSmser: Sending sms - Delivery_method: test_array - Sms: (Sms ActionSmser::TestArrayTest::MockSms.basic_sms - From: "555666", To: ["555123555", "123555123"], Body: "Body with ääkköset end", Valid: true)
61656
+ ActionSmser: ActionSmser::DeliveryMethods::TestArray.deliveries added message, no real delivery.
61657
+ ActionSmser: Sending sms - Delivery_method: test_array - Sms: (Sms ActionSmser::TestArrayTest::MockSms.basic_sms - From: "555666", To: ["555123555", "123555123"], Body: "Body with ääkköset end", Valid: true)
61658
+ ActionSmser: ActionSmser::DeliveryMethods::TestArray.deliveries added message, no real delivery.
61659
+  (0.0ms) SELECT COUNT(*) FROM "action_smser_delivery_reports"
61660
+ ActionSmser: Sending sms - Delivery_method: test_array - Sms: (Sms ActionSmser::TestArrayTest::MockSms.basic_sms - From: "555666", To: ["555123555", "123555123"], Body: "Body with ääkköset end", Valid: true)
61661
+ ActionSmser: ActionSmser::DeliveryMethods::TestArray.deliveries added message, no real delivery.
61662
+  (0.0ms) SAVEPOINT active_record_1
61663
+ SQL (0.3ms) INSERT INTO "action_smser_delivery_reports" ("body", "created_at", "from", "gateway", "log", "msg_id", "re_delivered", "re_delivery_of_delivery_report_id", "sms_type", "status", "status_updated_at", "to", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) [["body", "Body with ääkköset end"], ["created_at", Wed, 04 Sep 2013 15:22:59 UTC +00:00], ["from", "555666"], ["gateway", "test_array"], ["log", "2013-09-04 18:22:59: LOCAL_SENT\n"], ["msg_id", "test_array_id_55168776"], ["re_delivered", nil], ["re_delivery_of_delivery_report_id", nil], ["sms_type", "ActionSmser::TestArrayTest::MockSms.basic_sms"], ["status", "LOCAL_SENT"], ["status_updated_at", Wed, 04 Sep 2013 15:22:59 UTC +00:00], ["to", "555123555"], ["updated_at", Wed, 04 Sep 2013 15:22:59 UTC +00:00]]
61664
+  (0.0ms) RELEASE SAVEPOINT active_record_1
61665
+  (0.1ms) SAVEPOINT active_record_1
61666
+ SQL (0.3ms) INSERT INTO "action_smser_delivery_reports" ("body", "created_at", "from", "gateway", "log", "msg_id", "re_delivered", "re_delivery_of_delivery_report_id", "sms_type", "status", "status_updated_at", "to", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) [["body", "Body with ääkköset end"], ["created_at", Wed, 04 Sep 2013 15:22:59 UTC +00:00], ["from", "555666"], ["gateway", "test_array"], ["log", "2013-09-04 18:22:59: LOCAL_SENT\n"], ["msg_id", "test_array_id_12352084"], ["re_delivered", nil], ["re_delivery_of_delivery_report_id", nil], ["sms_type", "ActionSmser::TestArrayTest::MockSms.basic_sms"], ["status", "LOCAL_SENT"], ["status_updated_at", Wed, 04 Sep 2013 15:22:59 UTC +00:00], ["to", "123555123"], ["updated_at", Wed, 04 Sep 2013 15:22:59 UTC +00:00]]
61667
+  (0.0ms) RELEASE SAVEPOINT active_record_1
61668
+  (0.1ms) SELECT COUNT(*) FROM "action_smser_delivery_reports" 
61669
+
61670
+
61671
+ Started GET "/action_smser/delivery_reports/gateway_commit/example_gateway" for 127.0.0.1 at 2013-09-04 18:22:59 +0300
61672
+ Processing by ActionSmser::DeliveryReportsController#gateway_commit as HTML
61673
+ Parameters: {"gateway"=>"example_gateway"}
61238
61674
  Completed 200 OK in 0ms (Views: 0.2ms | ActiveRecord: 0.0ms)
@@ -0,0 +1,53 @@
1
+ # encoding: utf-8
2
+ require 'test_helper'
3
+
4
+ class ActionSmser::SmstradeTest < ActiveSupport::TestCase
5
+ class MockSms < ActionSmser::Base
6
+ def basic_sms(to, from, body)
7
+ sms(:to => to, :from => from, :body => body)
8
+ end
9
+ end
10
+
11
+ setup do
12
+ @receivers = ["4915112341234", "4917812341234"]
13
+ @sender = "4917212341234"
14
+ @body = "Body with ümläüts."
15
+ @sms = MockSms.basic_sms(@receivers, @sender, @body)
16
+
17
+ @sms.delivery_options[:delivery_method] = :smstrade
18
+ @sms.delivery_options[:smstrade] = {:key => 'api-key-here', :route => 'gold', :debug => true}
19
+ assert_equal ActionSmser::DeliveryMethods::Smstrade, @sms.delivery_method, "cant run tests, wrong delivery method"
20
+
21
+ @http_mock = stub(:body => "100\n123456789\n0.064\n1")
22
+ ActionSmser::DeliveryMethods::Smstrade.stubs(:deliver_http_request).returns(@http_mock)
23
+ end
24
+
25
+ test "should be able to deliver" do
26
+ ActionSmser::DeliveryMethods::Smstrade.expects(:deliver_http_request).twice().returns(@http_mock)
27
+ @sms_delivery = @sms.deliver
28
+ assert @sms_delivery
29
+ assert_equal 2, @sms_delivery.count
30
+ end
31
+
32
+ test "with saving delivery_reports" do
33
+ @sms.delivery_options[:save_delivery_reports] = true
34
+ @delivery_reports_count = ActionSmser::DeliveryReport.count
35
+
36
+ ActionSmser::DeliveryMethods::Smstrade.stubs(:deliver_http_request).returns(@http_mock)
37
+
38
+ @sms_delivery = @sms.deliver
39
+
40
+ assert @sms_delivery.is_a?(Array)
41
+ assert @sms_delivery.first.is_a?(ActionSmser::DeliveryReport), "should return delivery report array"
42
+
43
+ assert_equal @delivery_reports_count + 2, ActionSmser::DeliveryReport.count, "should have saved 2 delivery reports"
44
+
45
+ @dr1 = @sms_delivery.first
46
+ assert_equal "smstrade", @dr1.gateway
47
+ assert_equal "4915112341234", @dr1.to, "receiver wrong"
48
+ assert_equal "LOCAL_SENT", @dr1.status
49
+
50
+ @dr2 = @sms_delivery.last
51
+ assert_equal "4917812341234", @dr2.to, "receiver wrong"
52
+ end
53
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: action_smser
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.2
4
+ version: 2.1.0
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,14 +9,14 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-08-15 00:00:00.000000000 Z
12
+ date: 2013-09-04 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
- name: rails
15
+ name: railties
16
16
  requirement: !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
- - - ~>
19
+ - - ! '>='
20
20
  - !ruby/object:Gem::Version
21
21
  version: '3.1'
22
22
  type: :runtime
@@ -24,7 +24,7 @@ dependencies:
24
24
  version_requirements: !ruby/object:Gem::Requirement
25
25
  none: false
26
26
  requirements:
27
- - - ~>
27
+ - - ! '>='
28
28
  - !ruby/object:Gem::Version
29
29
  version: '3.1'
30
30
  - !ruby/object:Gem::Dependency
@@ -59,6 +59,22 @@ dependencies:
59
59
  - - ! '>='
60
60
  - !ruby/object:Gem::Version
61
61
  version: '0'
62
+ - !ruby/object:Gem::Dependency
63
+ name: rails
64
+ requirement: !ruby/object:Gem::Requirement
65
+ none: false
66
+ requirements:
67
+ - - ! '>='
68
+ - !ruby/object:Gem::Version
69
+ version: '3.1'
70
+ type: :development
71
+ prerelease: false
72
+ version_requirements: !ruby/object:Gem::Requirement
73
+ none: false
74
+ requirements:
75
+ - - ! '>='
76
+ - !ruby/object:Gem::Version
77
+ version: '3.1'
62
78
  - !ruby/object:Gem::Dependency
63
79
  name: delayed_job
64
80
  requirement: !ruby/object:Gem::Requirement
@@ -103,6 +119,7 @@ files:
103
119
  - lib/action_smser/delivery_methods/test_array.rb
104
120
  - lib/action_smser/delivery_methods/delayed_job.rb
105
121
  - lib/action_smser/delivery_methods/nexmo.rb
122
+ - lib/action_smser/delivery_methods/smstrade.rb
106
123
  - lib/action_smser/version.rb
107
124
  - lib/action_smser/base.rb
108
125
  - lib/action_smser.rb
@@ -149,6 +166,7 @@ files:
149
166
  - test/dummy/app/assets/stylesheets/application.css
150
167
  - test/dummy/Rakefile
151
168
  - test/test_helper.rb
169
+ - test/unit/action_smser/delivery_methods/smstrade_test.rb
152
170
  - test/unit/action_smser/delivery_methods/simple_http_test.rb
153
171
  - test/unit/action_smser/delivery_methods/test_array_test.rb
154
172
  - test/unit/action_smser/delivery_methods/delayed_job_test.rb
@@ -157,7 +175,8 @@ files:
157
175
  - test/unit/action_smser/delivery_report_test.rb
158
176
  - test/functional/action_smser/delivery_reports_controller_test.rb
159
177
  homepage: https://github.com/holli/action_smser
160
- licenses: []
178
+ licenses:
179
+ - MIT
161
180
  post_install_message:
162
181
  rdoc_options: []
163
182
  require_paths:
@@ -223,6 +242,7 @@ test_files:
223
242
  - test/dummy/app/assets/stylesheets/application.css
224
243
  - test/dummy/Rakefile
225
244
  - test/test_helper.rb
245
+ - test/unit/action_smser/delivery_methods/smstrade_test.rb
226
246
  - test/unit/action_smser/delivery_methods/simple_http_test.rb
227
247
  - test/unit/action_smser/delivery_methods/test_array_test.rb
228
248
  - test/unit/action_smser/delivery_methods/delayed_job_test.rb