mailup 1.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.
- checksums.yaml +7 -0
- data/.gitignore +22 -0
- data/Gemfile +4 -0
- data/LICENSE.txt +22 -0
- data/README.md +79 -0
- data/Rakefile +7 -0
- data/lib/mailup.rb +206 -0
- data/lib/mailup/console/base.rb +115 -0
- data/lib/mailup/console/email.rb +35 -0
- data/lib/mailup/console/group.rb +111 -0
- data/lib/mailup/console/images.rb +69 -0
- data/lib/mailup/console/import.rb +38 -0
- data/lib/mailup/console/list.rb +863 -0
- data/lib/mailup/console/recipient.rb +69 -0
- data/lib/mailup/console/user.rb +77 -0
- data/lib/mailup/errors.rb +18 -0
- data/lib/mailup/public/base.rb +18 -0
- data/lib/mailup/public/console.rb +75 -0
- data/lib/mailup/stats/base.rb +41 -0
- data/lib/mailup/stats/message.rb +284 -0
- data/lib/mailup/stats/recipient.rb +303 -0
- data/lib/mailup/version.rb +4 -0
- data/mailup.gemspec +25 -0
- data/rails/init.rb +1 -0
- data/spec/mailup/console/base_spec.rb +33 -0
- data/spec/mailup/console/email_spec.rb +19 -0
- data/spec/mailup/console/group_spec.rb +42 -0
- data/spec/mailup/console/images_spec.rb +29 -0
- data/spec/mailup/console/import_spec.rb +17 -0
- data/spec/mailup/console/list_spec.rb +164 -0
- data/spec/mailup/console/recipient_spec.rb +11 -0
- data/spec/mailup/console/user_spec.rb +16 -0
- data/spec/mailup/mailup_spec.rb +36 -0
- data/spec/mailup/public/base_spec.rb +22 -0
- data/spec/mailup/public/console_spec.rb +24 -0
- data/spec/mailup/stats/base_spec.rb +22 -0
- data/spec/mailup/stats/message_spec.rb +35 -0
- data/spec/mailup/stats/recipient_spec.rb +40 -0
- data/spec/spec_helper.rb +37 -0
- metadata +138 -0
@@ -0,0 +1,17 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe MailUp::Console::Import do
|
4
|
+
before(:each) { init_mailup }
|
5
|
+
|
6
|
+
%w(status).each do |method|
|
7
|
+
it "should have a #{method} method" do
|
8
|
+
@mailup.console.import(1).should respond_to(method.to_sym)
|
9
|
+
end
|
10
|
+
end
|
11
|
+
|
12
|
+
it "should fire the correct GET request for status" do
|
13
|
+
id = rand(100).abs
|
14
|
+
@mailup.console.import(id).api.should_receive(:get).with("#{@mailup.console.import(id).api.path}/Import/#{id}")
|
15
|
+
@mailup.console.import(id).status
|
16
|
+
end
|
17
|
+
end
|
@@ -0,0 +1,164 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe MailUp::Console::List do
|
4
|
+
before(:each) { init_mailup }
|
5
|
+
|
6
|
+
%w(groups add_group update_group delete_group recipient_groups pending subscribed unsubscribed import_recipients subscribe unsubscribe tags add_tag update_tag delete_tag attachments add_attachment delete_attachment images add_image add_message_from_template add_message update_message update_message_visibility delete_message message_details emails online_emails archived_emails send_history send_message templates template_details).each do |method|
|
7
|
+
it "should have a #{method} method" do
|
8
|
+
@mailup.console.list(1).should respond_to(method.to_sym)
|
9
|
+
end
|
10
|
+
end
|
11
|
+
|
12
|
+
# GET requests
|
13
|
+
|
14
|
+
%w(groups tags images emails templates).each do |method|
|
15
|
+
it "should fire the correct GET request for #{method}" do
|
16
|
+
@mailup.console.list(1).api.should_receive(:get).with("#{@mailup.console.list(1).api.path}/List/1/#{method.capitalize}", {params: {}})
|
17
|
+
@mailup.console.list(1).send(method.to_sym)
|
18
|
+
end
|
19
|
+
end
|
20
|
+
|
21
|
+
%w(pending subscribed unsubscribed).each do |method|
|
22
|
+
it "should fire the correct GET request for #{method}" do
|
23
|
+
@mailup.console.list(1).api.should_receive(:get).with("#{@mailup.console.list(1).api.path}/List/1/Recipients/#{method.capitalize}", {params: {}})
|
24
|
+
@mailup.console.list(1).send(method.to_sym)
|
25
|
+
end
|
26
|
+
end
|
27
|
+
|
28
|
+
%w(online_emails archived_emails).each do |method|
|
29
|
+
it "should fire the correct GET request for #{method}" do
|
30
|
+
@mailup.console.list(1).api.should_receive(:get).with("#{@mailup.console.list(1).api.path}/List/1/#{method.split('_').first.capitalize}/Emails", {params: {}})
|
31
|
+
@mailup.console.list(1).send(method.to_sym)
|
32
|
+
end
|
33
|
+
end
|
34
|
+
|
35
|
+
it "should fire the correct GET request for recipient_groups" do
|
36
|
+
@mailup.console.list(1).api.should_receive(:get).with("#{@mailup.console.list(1).api.path}/List/1/Recipient/2/Groups", {params: {}})
|
37
|
+
@mailup.console.list(1).recipient_groups(2)
|
38
|
+
end
|
39
|
+
|
40
|
+
it "should fire the correct GET request for attachments" do
|
41
|
+
@mailup.console.list(1).api.should_receive(:get).with("#{@mailup.console.list(1).api.path}/List/1/Email/2/Attachment", {params: {}})
|
42
|
+
@mailup.console.list(1).attachments(2)
|
43
|
+
end
|
44
|
+
|
45
|
+
it "should fire the correct GET request for message_details" do
|
46
|
+
@mailup.console.list(1).api.should_receive(:get).with("#{@mailup.console.list(1).api.path}/List/1/Email/2")
|
47
|
+
@mailup.console.list(1).message_details(2)
|
48
|
+
end
|
49
|
+
|
50
|
+
it "should fire the correct GET request for send_history" do
|
51
|
+
@mailup.console.list(1).api.should_receive(:get).with("#{@mailup.console.list(1).api.path}/List/1/Email/2/SendHistory", {params: {}})
|
52
|
+
@mailup.console.list(1).send_history(2)
|
53
|
+
end
|
54
|
+
|
55
|
+
it "should fire the correct GET request for template_details" do
|
56
|
+
@mailup.console.list(1).api.should_receive(:get).with("#{@mailup.console.list(1).api.path}/List/1/Templates/2")
|
57
|
+
@mailup.console.list(1).template_details(2)
|
58
|
+
end
|
59
|
+
|
60
|
+
# POST requests
|
61
|
+
|
62
|
+
%w(add_group import_recipients).each do |method|
|
63
|
+
it "should fire the correct POST request for #{method}" do
|
64
|
+
payload = Date._jisx0301("empty hash, please")
|
65
|
+
@mailup.console.list(1).api.should_receive(:post).with("#{@mailup.console.list(1).api.path}/List/1/#{method.split('_').last.capitalize}", {body: payload})
|
66
|
+
@mailup.console.list(1).send(method.to_sym, payload)
|
67
|
+
end
|
68
|
+
end
|
69
|
+
|
70
|
+
it "should fire the correct POST request for subscribe" do
|
71
|
+
payload = rand(100).abs
|
72
|
+
@mailup.console.list(1).api.should_receive(:post).with("#{@mailup.console.list(1).api.path}/List/1/Subscribe/#{payload}")
|
73
|
+
@mailup.console.list(1).subscribe(payload)
|
74
|
+
end
|
75
|
+
|
76
|
+
it "should fire the correct POST request for add_tag" do
|
77
|
+
payload = "Tag Name"
|
78
|
+
@mailup.console.list(1).api.should_receive(:post).with("#{@mailup.console.list(1).api.path}/List/1/Tag", {body: payload})
|
79
|
+
@mailup.console.list(1).add_tag(payload)
|
80
|
+
end
|
81
|
+
|
82
|
+
it "should fire the correct POST request for add_attachment" do
|
83
|
+
message = slot = rand(100).abs
|
84
|
+
payload = Date._jisx0301("empty hash, please")
|
85
|
+
@mailup.console.list(1).api.should_receive(:post).with("#{@mailup.console.list(1).api.path}/List/1/Email/#{message}/Attachment/#{slot}", {body: payload})
|
86
|
+
@mailup.console.list(1).add_attachment(message, slot, payload)
|
87
|
+
end
|
88
|
+
|
89
|
+
it "should fire the correct POST request for add_image" do
|
90
|
+
payload = Date._jisx0301("empty hash, please")
|
91
|
+
@mailup.console.list(1).api.should_receive(:post).with("#{@mailup.console.list(1).api.path}/List/1/Images", {body: payload})
|
92
|
+
@mailup.console.list(1).add_image(payload)
|
93
|
+
end
|
94
|
+
|
95
|
+
it "should fire the correct POST request for add_message_from_template" do
|
96
|
+
payload = rand(100).abs
|
97
|
+
@mailup.console.list(1).api.should_receive(:post).with("#{@mailup.console.list(1).api.path}/List/1/Email/Template/#{payload}")
|
98
|
+
@mailup.console.list(1).add_message_from_template(payload)
|
99
|
+
end
|
100
|
+
|
101
|
+
it "should fire the correct POST request for add_message" do
|
102
|
+
payload = Date._jisx0301("empty hash, please")
|
103
|
+
@mailup.console.list(1).api.should_receive(:post).with("#{@mailup.console.list(1).api.path}/List/1/Email", {body: payload})
|
104
|
+
@mailup.console.list(1).add_message(payload)
|
105
|
+
end
|
106
|
+
|
107
|
+
it "should fire the correct POST request for send_message" do
|
108
|
+
payload = rand(100).abs
|
109
|
+
@mailup.console.list(1).api.should_receive(:post).with("#{@mailup.console.list(1).api.path}/List/1/Email/#{payload}/Send")
|
110
|
+
@mailup.console.list(1).send_message(payload)
|
111
|
+
end
|
112
|
+
|
113
|
+
# PUT requests
|
114
|
+
|
115
|
+
it "should fire the correct PUT request for update_group" do
|
116
|
+
id = rand(100).abs
|
117
|
+
payload = Date._jisx0301("empty hash, please")
|
118
|
+
@mailup.console.list(1).api.should_receive(:put).with("#{@mailup.console.list(1).api.path}/List/1/Group/#{id}", {body: payload})
|
119
|
+
@mailup.console.list(1).update_group(id, payload)
|
120
|
+
end
|
121
|
+
|
122
|
+
it "should fire the correct PUT request for update_tag" do
|
123
|
+
id = rand(100).abs
|
124
|
+
payload = Date._jisx0301("empty hash, please")
|
125
|
+
@mailup.console.list(1).api.should_receive(:put).with("#{@mailup.console.list(1).api.path}/List/1/Tag/#{id}", {body: payload})
|
126
|
+
@mailup.console.list(1).update_tag(id, payload)
|
127
|
+
end
|
128
|
+
|
129
|
+
it "should fire the correct PUT request for update_message" do
|
130
|
+
id = rand(100).abs
|
131
|
+
payload = Date._jisx0301("empty hash, please")
|
132
|
+
@mailup.console.list(1).api.should_receive(:put).with("#{@mailup.console.list(1).api.path}/List/1/Email/#{id}", {body: payload})
|
133
|
+
@mailup.console.list(1).update_message(id, payload)
|
134
|
+
end
|
135
|
+
|
136
|
+
it "should fire the correct PUT request for update_message_visibility" do
|
137
|
+
id = rand(100).abs
|
138
|
+
@mailup.console.list(1).api.should_receive(:put).with("#{@mailup.console.list(1).api.path}/List/1/Email/#{id}/Online/Visibility", {body: true})
|
139
|
+
@mailup.console.list(1).update_message_visibility(id, true)
|
140
|
+
end
|
141
|
+
|
142
|
+
# DELETE requests
|
143
|
+
|
144
|
+
%w(delete_group unsubscribe delete_tag).each do |method|
|
145
|
+
it "should fire the correct DELETE request for #{method}" do
|
146
|
+
id = rand(100).abs
|
147
|
+
@mailup.console.list(1).api.should_receive(:delete).with("#{@mailup.console.list(1).api.path}/List/1/#{method.split('_').last.capitalize}/#{id}")
|
148
|
+
@mailup.console.list(1).send(method.to_sym, id)
|
149
|
+
end
|
150
|
+
end
|
151
|
+
|
152
|
+
it "should fire the correct DELETE request for delete_attachment" do
|
153
|
+
id = slot = rand(100).abs
|
154
|
+
@mailup.console.list(1).api.should_receive(:delete).with("#{@mailup.console.list(1).api.path}/List/1/Email/#{id}/#{slot}")
|
155
|
+
@mailup.console.list(1).delete_attachment(id, slot)
|
156
|
+
end
|
157
|
+
|
158
|
+
it "should fire the correct DELETE request for delete_message" do
|
159
|
+
id = slot = rand(100).abs
|
160
|
+
@mailup.console.list(1).api.should_receive(:delete).with("#{@mailup.console.list(1).api.path}/List/1/Email/#{id}")
|
161
|
+
@mailup.console.list(1).delete_message(id)
|
162
|
+
end
|
163
|
+
|
164
|
+
end
|
@@ -0,0 +1,16 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe MailUp::Console::User do
|
4
|
+
before(:each) { init_mailup }
|
5
|
+
|
6
|
+
%w(emails lists).each do |method|
|
7
|
+
it "should have a #{method} method" do
|
8
|
+
@mailup.console.user.should respond_to(method.to_sym)
|
9
|
+
end
|
10
|
+
|
11
|
+
it "should fire the correct GET request for #{method}" do
|
12
|
+
@mailup.console.user.api.should_receive(:get).with("#{@mailup.console.user.api.path}/User/#{method.capitalize}", {params: {}})
|
13
|
+
@mailup.console.user.send(method.to_sym)
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
@@ -0,0 +1,36 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe MailUp::API do
|
4
|
+
context 'initialization' do
|
5
|
+
# Make sure a hash is provided
|
6
|
+
it 'requires credentials' do
|
7
|
+
expect{ MailUp::API.new }.to raise_error(MailUp::Error, 'MailUp credentials missing')
|
8
|
+
end
|
9
|
+
|
10
|
+
# Validate the credentials hash keys
|
11
|
+
[:client_id, :client_secret, :oauth].each do |key|
|
12
|
+
it "requires credentials to have a '#{key}' key" do
|
13
|
+
@credentials.delete_if{ |k,v| k == key }
|
14
|
+
expect{ MailUp::API.new(@credentials) }.to raise_error(MailUp::Error, "MailUp credentials must include a #{key} key")
|
15
|
+
end
|
16
|
+
end
|
17
|
+
|
18
|
+
# Make sure the oauth key is a hash
|
19
|
+
it 'requires credentials to have an oauth hash' do
|
20
|
+
@credentials[:oauth] = nil
|
21
|
+
expect{ MailUp::API.new(@credentials).merge!(token: true) }.to raise_error(MailUp::Error, "MailUp credentials :oauth must be a hash")
|
22
|
+
end
|
23
|
+
|
24
|
+
# Validate the oauth hash keys
|
25
|
+
[:token, :refresh_token, :expires_at].each do |key|
|
26
|
+
it "requires credentials with an oauth hash containing a '#{key}' key" do
|
27
|
+
@credentials[:oauth].delete_if{ |k,v| k == key }
|
28
|
+
expect{ MailUp::API.new(@credentials) }.to raise_error(MailUp::Error, "MailUp credentials :oauth hash must include a #{key} key")
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
32
|
+
|
33
|
+
# Add a context for sending a request
|
34
|
+
# Verify that each verb method sends the right message.
|
35
|
+
# Verify that the objects exist.
|
36
|
+
end
|
@@ -0,0 +1,22 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe MailUp::Public do
|
4
|
+
before(:each){ init_mailup }
|
5
|
+
|
6
|
+
it 'should return a public base object' do
|
7
|
+
@mailup.public.should be_an_instance_of(MailUp::Public::Base)
|
8
|
+
end
|
9
|
+
|
10
|
+
it 'should have the correct API path' do
|
11
|
+
@mailup.public.api.path.should eq("/API/v#{MailUp::API_VERSION}/Rest/PublicService.svc")
|
12
|
+
end
|
13
|
+
|
14
|
+
%w(console).each do |resource|
|
15
|
+
context resource do
|
16
|
+
it "should return a #{resource} object" do
|
17
|
+
test = @mailup.public.send(resource.to_sym)
|
18
|
+
test.should be_an_instance_of(Object.const_get "MailUp::Public::#{resource.capitalize}")
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
@@ -0,0 +1,24 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe MailUp::Public::Console do
|
4
|
+
before(:each) { init_mailup }
|
5
|
+
|
6
|
+
%w(new status).each do |method|
|
7
|
+
it "should have a #{method} method" do
|
8
|
+
@mailup.public.console.should respond_to(method.to_sym)
|
9
|
+
end
|
10
|
+
end
|
11
|
+
|
12
|
+
it "should fire the correct POST request for new" do
|
13
|
+
payload = Date._jisx0301("empty hash, please")
|
14
|
+
@mailup.public.console.api.should_receive(:post).with("#{@mailup.public.console.api.path}/Console/TrialActivation", {body: payload})
|
15
|
+
@mailup.public.console.new(payload)
|
16
|
+
end
|
17
|
+
|
18
|
+
it "should fire the correct POST request for status" do
|
19
|
+
payload = Date._jisx0301("empty hash, please")
|
20
|
+
@mailup.public.console.api.should_receive(:post).with("#{@mailup.public.console.api.path}/Console/TrialActivationStatus", {body: payload})
|
21
|
+
@mailup.public.console.status(payload)
|
22
|
+
end
|
23
|
+
|
24
|
+
end
|
@@ -0,0 +1,22 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe MailUp::Stats do
|
4
|
+
before(:each){ init_mailup }
|
5
|
+
|
6
|
+
it 'should return a stats base object' do
|
7
|
+
@mailup.stats.should be_an_instance_of(MailUp::Stats::Base)
|
8
|
+
end
|
9
|
+
|
10
|
+
it 'should have the correct API path' do
|
11
|
+
@mailup.stats.api.path.should eq("/API/v#{MailUp::API_VERSION}/Rest/MailStatisticsService.svc")
|
12
|
+
end
|
13
|
+
|
14
|
+
%w(message recipient).each do |resource|
|
15
|
+
context resource do
|
16
|
+
it "should return a #{resource} object" do
|
17
|
+
test = @mailup.stats.send(resource.to_sym, 1)
|
18
|
+
test.should be_an_instance_of(Object.const_get "MailUp::Stats::#{resource.capitalize}")
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
@@ -0,0 +1,35 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
# Stats::Message Methods
|
4
|
+
describe MailUp::Stats::Message do
|
5
|
+
before(:each){ init_mailup }
|
6
|
+
|
7
|
+
%w(recipients recipients_count views views_count bounces bounces_count unsubscribes unsubscribes_count clicks clicks_count url_clicks url_clicks_count).each do |method|
|
8
|
+
it "should have a #{method} method" do
|
9
|
+
@mailup.stats.message(1).should respond_to(method.to_sym)
|
10
|
+
end
|
11
|
+
end
|
12
|
+
|
13
|
+
# List methods
|
14
|
+
|
15
|
+
%w(recipients views bounces clicks url_clicks).each do |method|
|
16
|
+
it "should fire the correct GET request for #{method}" do
|
17
|
+
@mailup.stats.message(1).api.should_receive(:get).with("#{@mailup.stats.message(1).api.path}/Message/1/List/#{method.split('_').collect(&:capitalize).join}", {params: {}})
|
18
|
+
@mailup.stats.message(1).send(method.to_sym)
|
19
|
+
end
|
20
|
+
end
|
21
|
+
|
22
|
+
# Count methods
|
23
|
+
|
24
|
+
%w(recipients_count views_count bounces_count clicks_count).each do |method|
|
25
|
+
it "should fire the correct GET request for #{method}" do
|
26
|
+
@mailup.stats.message(1).api.should_receive(:get).with("#{@mailup.stats.message(1).api.path}/Message/1/Count/#{method.split('_').first.capitalize}")
|
27
|
+
@mailup.stats.message(1).send(method.to_sym)
|
28
|
+
end
|
29
|
+
end
|
30
|
+
|
31
|
+
it "should fire the correct GET request for url_clicks_count" do
|
32
|
+
@mailup.stats.message(1).api.should_receive(:get).with("#{@mailup.stats.message(1).api.path}/Message/1/Count/UrlClicks")
|
33
|
+
@mailup.stats.message(1).url_clicks_count
|
34
|
+
end
|
35
|
+
end
|
@@ -0,0 +1,40 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
# Stats::Recipient Methods
|
4
|
+
describe MailUp::Stats::Recipient do
|
5
|
+
before(:each) { init_mailup }
|
6
|
+
|
7
|
+
%w(deliveries deliveries_count views views_count bounces_details bounces bounces_count unsubscribes unsubscribes_count clicks_details clicks clicks_count).each do |method|
|
8
|
+
it "should have a #{method} method" do
|
9
|
+
@mailup.stats.recipient(1).should respond_to(method.to_sym)
|
10
|
+
end
|
11
|
+
end
|
12
|
+
|
13
|
+
# List methods
|
14
|
+
|
15
|
+
%w(deliveries views bounces_details bounces clicks_details clicks).each do |method|
|
16
|
+
it "should fire the correct GET request for #{method}" do
|
17
|
+
@mailup.stats.recipient(1).api.should_receive(:get).with("#{@mailup.stats.recipient(1).api.path}/Recipient/1/List/#{method.split('_').collect(&:capitalize).join}", {params: {}})
|
18
|
+
@mailup.stats.recipient(1).send(method.to_sym)
|
19
|
+
end
|
20
|
+
end
|
21
|
+
|
22
|
+
it "should fire the correct GET request for unsubscribes" do
|
23
|
+
@mailup.stats.recipient(1).api.should_receive(:get).with("#{@mailup.stats.recipient(1).api.path}/Recipient/1/List/Unsubscriptions", {params: {}})
|
24
|
+
@mailup.stats.recipient(1).unsubscribes
|
25
|
+
end
|
26
|
+
|
27
|
+
# Count methods
|
28
|
+
|
29
|
+
%w(deliveries_count views_count bounces_count clicks_count).each do |method|
|
30
|
+
it "should fire the correct GET request for #{method}" do
|
31
|
+
@mailup.stats.recipient(1).api.should_receive(:get).with("#{@mailup.stats.recipient(1).api.path}/Recipient/1/Count/#{method.split('_').first.capitalize}")
|
32
|
+
@mailup.stats.recipient(1).send(method.to_sym)
|
33
|
+
end
|
34
|
+
end
|
35
|
+
|
36
|
+
it "should fire the correct GET request for unsubscribes_count" do
|
37
|
+
@mailup.stats.recipient(1).api.should_receive(:get).with("#{@mailup.stats.recipient(1).api.path}/Recipient/1/Count/Unsubscriptions")
|
38
|
+
@mailup.stats.recipient(1).unsubscribes_count
|
39
|
+
end
|
40
|
+
end
|
data/spec/spec_helper.rb
ADDED
@@ -0,0 +1,37 @@
|
|
1
|
+
require 'rubygems'
|
2
|
+
require 'bundler/setup'
|
3
|
+
require 'mailup'
|
4
|
+
|
5
|
+
# See http://rubydoc.info/gems/rspec-core/RSpec/Core/Configuration
|
6
|
+
RSpec.configure do |config|
|
7
|
+
config.treat_symbols_as_metadata_keys_with_true_values = true
|
8
|
+
config.run_all_when_everything_filtered = true
|
9
|
+
config.filter_run :focus
|
10
|
+
|
11
|
+
# Run specs in random order to surface order dependencies. If you find an
|
12
|
+
# order dependency and want to debug it, you can fix the order by providing
|
13
|
+
# the seed, which is printed after each run.
|
14
|
+
# --seed 1234
|
15
|
+
config.order = 'random'
|
16
|
+
|
17
|
+
# Global hooks
|
18
|
+
config.before(:each) { init_credentials}
|
19
|
+
end
|
20
|
+
|
21
|
+
# Create Credentials Hash
|
22
|
+
def init_credentials
|
23
|
+
@credentials = {
|
24
|
+
client_id: "1234",
|
25
|
+
client_secret: "1234",
|
26
|
+
oauth: {
|
27
|
+
token: "123",
|
28
|
+
refresh_token: "123",
|
29
|
+
expires_at: 123
|
30
|
+
}
|
31
|
+
}
|
32
|
+
end
|
33
|
+
|
34
|
+
# Create MailUp Object
|
35
|
+
def init_mailup
|
36
|
+
@mailup = MailUp::API.new(@credentials)
|
37
|
+
end
|
metadata
ADDED
@@ -0,0 +1,138 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: mailup
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 1.1.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Brian Getting
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2014-01-23 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: oauth2
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - '>='
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: 0.9.2
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - '>='
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: 0.9.2
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: rspec
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - '>='
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '0'
|
34
|
+
type: :development
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - '>='
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '0'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: rake
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - '>='
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '0'
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - '>='
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '0'
|
55
|
+
description: A Ruby gem for interacting with the MailUp REST API.
|
56
|
+
email:
|
57
|
+
- brian@tatem.ae
|
58
|
+
executables: []
|
59
|
+
extensions: []
|
60
|
+
extra_rdoc_files: []
|
61
|
+
files:
|
62
|
+
- .gitignore
|
63
|
+
- Gemfile
|
64
|
+
- LICENSE.txt
|
65
|
+
- README.md
|
66
|
+
- Rakefile
|
67
|
+
- lib/mailup.rb
|
68
|
+
- lib/mailup/console/base.rb
|
69
|
+
- lib/mailup/console/email.rb
|
70
|
+
- lib/mailup/console/group.rb
|
71
|
+
- lib/mailup/console/images.rb
|
72
|
+
- lib/mailup/console/import.rb
|
73
|
+
- lib/mailup/console/list.rb
|
74
|
+
- lib/mailup/console/recipient.rb
|
75
|
+
- lib/mailup/console/user.rb
|
76
|
+
- lib/mailup/errors.rb
|
77
|
+
- lib/mailup/public/base.rb
|
78
|
+
- lib/mailup/public/console.rb
|
79
|
+
- lib/mailup/stats/base.rb
|
80
|
+
- lib/mailup/stats/message.rb
|
81
|
+
- lib/mailup/stats/recipient.rb
|
82
|
+
- lib/mailup/version.rb
|
83
|
+
- mailup.gemspec
|
84
|
+
- rails/init.rb
|
85
|
+
- spec/mailup/console/base_spec.rb
|
86
|
+
- spec/mailup/console/email_spec.rb
|
87
|
+
- spec/mailup/console/group_spec.rb
|
88
|
+
- spec/mailup/console/images_spec.rb
|
89
|
+
- spec/mailup/console/import_spec.rb
|
90
|
+
- spec/mailup/console/list_spec.rb
|
91
|
+
- spec/mailup/console/recipient_spec.rb
|
92
|
+
- spec/mailup/console/user_spec.rb
|
93
|
+
- spec/mailup/mailup_spec.rb
|
94
|
+
- spec/mailup/public/base_spec.rb
|
95
|
+
- spec/mailup/public/console_spec.rb
|
96
|
+
- spec/mailup/stats/base_spec.rb
|
97
|
+
- spec/mailup/stats/message_spec.rb
|
98
|
+
- spec/mailup/stats/recipient_spec.rb
|
99
|
+
- spec/spec_helper.rb
|
100
|
+
homepage: https://github.com/mailup/mailup-ruby
|
101
|
+
licenses: []
|
102
|
+
metadata: {}
|
103
|
+
post_install_message:
|
104
|
+
rdoc_options: []
|
105
|
+
require_paths:
|
106
|
+
- lib
|
107
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
108
|
+
requirements:
|
109
|
+
- - '>='
|
110
|
+
- !ruby/object:Gem::Version
|
111
|
+
version: '0'
|
112
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
113
|
+
requirements:
|
114
|
+
- - '>='
|
115
|
+
- !ruby/object:Gem::Version
|
116
|
+
version: '0'
|
117
|
+
requirements: []
|
118
|
+
rubyforge_project:
|
119
|
+
rubygems_version: 2.0.14
|
120
|
+
signing_key:
|
121
|
+
specification_version: 4
|
122
|
+
summary: Ruby wrapper for the MailUp REST API
|
123
|
+
test_files:
|
124
|
+
- spec/mailup/console/base_spec.rb
|
125
|
+
- spec/mailup/console/email_spec.rb
|
126
|
+
- spec/mailup/console/group_spec.rb
|
127
|
+
- spec/mailup/console/images_spec.rb
|
128
|
+
- spec/mailup/console/import_spec.rb
|
129
|
+
- spec/mailup/console/list_spec.rb
|
130
|
+
- spec/mailup/console/recipient_spec.rb
|
131
|
+
- spec/mailup/console/user_spec.rb
|
132
|
+
- spec/mailup/mailup_spec.rb
|
133
|
+
- spec/mailup/public/base_spec.rb
|
134
|
+
- spec/mailup/public/console_spec.rb
|
135
|
+
- spec/mailup/stats/base_spec.rb
|
136
|
+
- spec/mailup/stats/message_spec.rb
|
137
|
+
- spec/mailup/stats/recipient_spec.rb
|
138
|
+
- spec/spec_helper.rb
|