messagebus_ruby_api 1.0.3 → 1.0.6

Sign up to get free protection for your applications and to get access to all the features.
@@ -95,12 +95,6 @@ module MessagebusApi
95
95
  make_api_get_call(@rest_endpoints[:mailing_lists])
96
96
  end
97
97
 
98
- def create_mailing_lists(list_name, merge_field_keys)
99
- json = {:name => list_name, :mergeFieldKeys => merge_field_keys}.to_json
100
- @results = make_api_post_call(@rest_endpoints[:mailing_lists], json)
101
- @results
102
- end
103
-
104
98
  def delete_mailing_list_entry(mailing_list_key, email)
105
99
  path = @rest_endpoints[:mailing_lists_entry_email].gsub("%KEY%", mailing_list_key).gsub("%EMAIL%", email)
106
100
  @results = make_api_delete_call(path)
@@ -120,6 +114,12 @@ module MessagebusApi
120
114
  @results
121
115
  end
122
116
 
117
+ def feedbackloops(start_date = '', end_date = '')
118
+ path = "#{@rest_endpoints[:feedbackloops]}?#{date_range(start_date, end_date)}"
119
+ @results = make_api_get_call(path)
120
+ @results
121
+ end
122
+
123
123
  def delivery_errors(start_date = '', end_date = '', tag='')
124
124
  path = "#{@rest_endpoints[:delivery_errors]}?#{date_range(start_date, end_date)}&tag=#{URI.escape(tag)}"
125
125
  @results = make_api_get_call(path)
@@ -265,6 +265,7 @@ module MessagebusApi
265
265
  :stats => "/api/v3/stats",
266
266
  :delivery_errors => "/api/v3/delivery_errors",
267
267
  :unsubscribes => "/api/v3/unsubscribes",
268
+ :feedbackloops => "/api/v3/feedbackloops",
268
269
  :mailing_lists => "/api/v3/mailing_lists",
269
270
  :mailing_lists_entries => "/api/v3/mailing_list/%KEY%/entries",
270
271
  :mailing_lists_entry_email => "/api/v3/mailing_list/%KEY%/entry/%EMAIL%",
@@ -13,5 +13,5 @@
13
13
  # under the License.
14
14
 
15
15
  module MessagebusApi
16
- VERSION = "1.0.3"
16
+ VERSION = "1.0.6"
17
17
  end
@@ -235,7 +235,7 @@ describe MessagebusApi::Messagebus do
235
235
  end
236
236
 
237
237
  describe "#unsubscribes" do
238
- it "request blocked emails list" do
238
+ it "request unsubscribes list" do
239
239
 
240
240
  start_date_str="2011-01-01T04:30:00+00:00"
241
241
  end_date_str="2011-01-02T04:30:00+00:00"
@@ -251,6 +251,23 @@ describe MessagebusApi::Messagebus do
251
251
  end
252
252
  end
253
253
 
254
+ describe "#feedbackloops" do
255
+ it "request feedbackloops list" do
256
+
257
+ start_date_str="2011-01-01T04:30:00+00:00"
258
+ end_date_str="2011-01-02T04:30:00+00:00"
259
+
260
+ expected_request="https://api.messagebus.com/api/v3/feedbackloops?startDate=#{URI.escape(start_date_str)}&endDate=#{URI.escape(end_date_str)}"
261
+
262
+ FakeWeb.register_uri(:get, expected_request, :body => json_feedbackloops)
263
+ expect do
264
+ response = client.feedbackloops(start_date_str, end_date_str)
265
+ FakeWeb.last_request.body.should be_nil
266
+ response.should == json_parse(json_feedbackloops)
267
+ end.should_not raise_error
268
+ end
269
+ end
270
+
254
271
  describe "#delete_mailing_list_entry" do
255
272
  it "remove from mailing list" do
256
273
  mailing_list_key="test_key"
@@ -296,18 +313,6 @@ describe MessagebusApi::Messagebus do
296
313
  end
297
314
  end
298
315
 
299
- describe "#create_mailing_lists" do
300
- it "create a new mailing list" do
301
- expected_request="https://api.messagebus.com/api/v3/mailing_lists"
302
-
303
- FakeWeb.register_uri(:post, expected_request, :body => json_mailing_list_create)
304
- expect do
305
- response = client.create_mailing_lists("Test List", ["%EMAIL%", "%SOME_TOKEN%"])
306
- response.should == json_parse(json_mailing_list_create)
307
- end.should_not raise_error
308
- end
309
- end
310
-
311
316
  describe "#stats" do
312
317
  it "stats" do
313
318
  start_date_str="2011-01-01"
data/spec/spec_helper.rb CHANGED
@@ -65,6 +65,13 @@ JAVASCRIPT
65
65
  json
66
66
  end
67
67
 
68
+ def json_feedbackloops
69
+ json = <<JAVASCRIPT
70
+ {"statusCode":200,"statusMessage":"","statusTime":"2011-10-10T21:32:14.195Z","results":[{"toEmail":"joe@example.com","time":"2011-10-10T21:32:14.195Z","messageId":"62cf5460b7b0012e8cb440406818e8c7"}]}
71
+ JAVASCRIPT
72
+ json
73
+ end
74
+
68
75
  def json_delivery_errors
69
76
  json = <<JAVASCRIPT
70
77
  {"statusCode":200,"statusMessage":"","statusTime":"2011-10-10T21:32:14.195Z","results":[{"toEmail":"joe@example.com", "messageId":"62cf5460b7b0012e8cb440406818e8c7","time":"2011-10-10T21:32:14.195Z","DSNCode":"5.1.1"}]}
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: messagebus_ruby_api
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.3
4
+ version: 1.0.6
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-01-20 00:00:00.000000000Z
12
+ date: 2012-02-09 00:00:00.000000000Z
13
13
  dependencies: []
14
14
  description: ! 'Allows you to use the Message Bus API '
15
15
  email:
@@ -51,7 +51,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
51
51
  version: '0'
52
52
  requirements: []
53
53
  rubyforge_project: messagebus_ruby_api
54
- rubygems_version: 1.8.10
54
+ rubygems_version: 1.8.15
55
55
  signing_key:
56
56
  specification_version: 3
57
57
  summary: Send email through the Message Bus service