createsend 2.5.1 → 3.0.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,23 +1,21 @@
1
1
  require File.dirname(__FILE__) + '/helper'
2
2
 
3
3
  class TemplateTest < Test::Unit::TestCase
4
- context "when an api caller is authenticated" do
4
+ multiple_contexts "authenticated_using_oauth_context", "authenticated_using_api_key_context" do
5
5
  setup do
6
- @api_key = '123123123123123123123'
7
- CreateSend.api_key @api_key
8
- @template = CreateSend::Template.new('98y2e98y289dh89h938389')
6
+ @template = CreateSend::Template.new @auth, '98y2e98y289dh89h938389'
9
7
  end
10
8
 
11
9
  should "create a template" do
12
10
  client_id = '87y8d7qyw8d7yq8w7ydwqwd'
13
- stub_post(@api_key, "templates/#{client_id}.json", "create_template.json")
14
- template_id = CreateSend::Template.create client_id, "Template One", "http://templates.org/index.html",
11
+ stub_post(@auth, "templates/#{client_id}.json", "create_template.json")
12
+ template_id = CreateSend::Template.create @auth, client_id, "Template One", "http://templates.org/index.html",
15
13
  "http://templates.org/files.zip"
16
14
  template_id.should == "98y2e98y289dh89h938389"
17
15
  end
18
16
 
19
17
  should "get details of a template" do
20
- stub_get(@api_key, "templates/#{@template.template_id}.json", "template_details.json")
18
+ stub_get(@auth, "templates/#{@template.template_id}.json", "template_details.json")
21
19
  t = @template.details
22
20
  t.TemplateID.should == "98y2e98y289dh89h938389"
23
21
  t.Name.should == "Template One"
@@ -26,12 +24,12 @@ class TemplateTest < Test::Unit::TestCase
26
24
  end
27
25
 
28
26
  should "update a template" do
29
- stub_put(@api_key, "templates/#{@template.template_id}.json", nil)
27
+ stub_put(@auth, "templates/#{@template.template_id}.json", nil)
30
28
  @template.update "Template One Updated", "http://templates.org/index.html", "http://templates.org/files.zip"
31
29
  end
32
30
 
33
31
  should "delete a template" do
34
- stub_delete(@api_key, "templates/#{@template.template_id}.json", nil)
32
+ stub_delete(@auth, "templates/#{@template.template_id}.json", nil)
35
33
  @template.delete
36
34
  end
37
35
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: createsend
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.5.1
4
+ version: 3.0.0
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: 2013-02-04 00:00:00.000000000 Z
12
+ date: 2013-03-25 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rake
@@ -59,22 +59,6 @@ dependencies:
59
59
  - - ~>
60
60
  - !ruby/object:Gem::Version
61
61
  version: '0.4'
62
- - !ruby/object:Gem::Dependency
63
- name: mocha
64
- requirement: !ruby/object:Gem::Requirement
65
- none: false
66
- requirements:
67
- - - ~>
68
- - !ruby/object:Gem::Version
69
- version: '0.13'
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: '0.13'
78
62
  - !ruby/object:Gem::Dependency
79
63
  name: shoulda
80
64
  requirement: !ruby/object:Gem::Requirement
@@ -112,17 +96,23 @@ dependencies:
112
96
  requirement: !ruby/object:Gem::Requirement
113
97
  none: false
114
98
  requirements:
115
- - - ~>
99
+ - - ! '>='
116
100
  - !ruby/object:Gem::Version
117
- version: '1.0'
101
+ version: '1.2'
102
+ - - <
103
+ - !ruby/object:Gem::Version
104
+ version: '3'
118
105
  type: :runtime
119
106
  prerelease: false
120
107
  version_requirements: !ruby/object:Gem::Requirement
121
108
  none: false
122
109
  requirements:
123
- - - ~>
110
+ - - ! '>='
111
+ - !ruby/object:Gem::Version
112
+ version: '1.2'
113
+ - - <
124
114
  - !ruby/object:Gem::Version
125
- version: '1.0'
115
+ version: '3'
126
116
  - !ruby/object:Gem::Dependency
127
117
  name: httparty
128
118
  requirement: !ruby/object:Gem::Requirement
@@ -159,6 +149,7 @@ files:
159
149
  - lib/createsend/administrator.rb
160
150
  - lib/createsend/campaign.rb
161
151
  - lib/createsend/client.rb
152
+ - lib/createsend/createsend.rb
162
153
  - lib/createsend/list.rb
163
154
  - lib/createsend/person.rb
164
155
  - lib/createsend/segment.rb
@@ -206,6 +197,7 @@ files:
206
197
  - test/fixtures/deleted_subscribers.json
207
198
  - test/fixtures/drafts.json
208
199
  - test/fixtures/email_client_usage.json
200
+ - test/fixtures/expired_oauth_token_api_error.json
209
201
  - test/fixtures/import_subscribers.json
210
202
  - test/fixtures/import_subscribers_partial_success.json
211
203
  - test/fixtures/list_details.json
@@ -213,8 +205,11 @@ files:
213
205
  - test/fixtures/list_webhooks.json
214
206
  - test/fixtures/lists.json
215
207
  - test/fixtures/listsforemail.json
208
+ - test/fixtures/oauth_exchange_token.json
209
+ - test/fixtures/oauth_exchange_token_error.json
216
210
  - test/fixtures/people.json
217
211
  - test/fixtures/person_details.json
212
+ - test/fixtures/refresh_oauth_token.json
218
213
  - test/fixtures/scheduled_campaigns.json
219
214
  - test/fixtures/segment_details.json
220
215
  - test/fixtures/segment_subscribers.json
@@ -250,7 +245,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
250
245
  version: '0'
251
246
  segments:
252
247
  - 0
253
- hash: -2811559067945201914
248
+ hash: 1052265859851701663
254
249
  required_rubygems_version: !ruby/object:Gem::Requirement
255
250
  none: false
256
251
  requirements:
@@ -306,6 +301,7 @@ test_files:
306
301
  - test/fixtures/deleted_subscribers.json
307
302
  - test/fixtures/drafts.json
308
303
  - test/fixtures/email_client_usage.json
304
+ - test/fixtures/expired_oauth_token_api_error.json
309
305
  - test/fixtures/import_subscribers.json
310
306
  - test/fixtures/import_subscribers_partial_success.json
311
307
  - test/fixtures/list_details.json
@@ -313,8 +309,11 @@ test_files:
313
309
  - test/fixtures/list_webhooks.json
314
310
  - test/fixtures/lists.json
315
311
  - test/fixtures/listsforemail.json
312
+ - test/fixtures/oauth_exchange_token.json
313
+ - test/fixtures/oauth_exchange_token_error.json
316
314
  - test/fixtures/people.json
317
315
  - test/fixtures/person_details.json
316
+ - test/fixtures/refresh_oauth_token.json
318
317
  - test/fixtures/scheduled_campaigns.json
319
318
  - test/fixtures/segment_details.json
320
319
  - test/fixtures/segment_subscribers.json