Skip to content
This repository was archived by the owner on Dec 9, 2020. It is now read-only.

Commit dd54417

Browse files
Fix breaking specs - API changed from nil to {}
1 parent 0f1a537 commit dd54417

File tree

3 files changed

+24
-24
lines changed

3 files changed

+24
-24
lines changed

spec/natero/account_spec.rb

+15-15
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
describe 'retrieve_all' do
1313
it 'sends the proper request' do
1414
request_url = "https://api.natero.com/api/v2/accounts/?api_key=#{api_key}"
15-
data = nil
15+
data = {}
1616
method = :get
1717

1818
expect(HTTParty).to receive(method).with(request_url, data).and_return(valid_message)
@@ -26,7 +26,7 @@
2626
it 'sends the proper request' do
2727
id = 1
2828
request_url = "https://api.natero.com/api/v2/accounts/#{id}/?api_key=#{api_key}"
29-
data = nil
29+
data = {}
3030
method = :get
3131

3232
expect(HTTParty).to receive(method).with(request_url, data).and_return(valid_message)
@@ -71,7 +71,7 @@
7171
it 'sends the proper request' do
7272
id = 1
7373
request_url = "https://api.natero.com/api/v2/accounts/#{id}/metrics/?api_key=#{api_key}"
74-
data = nil
74+
data = {}
7575
method = :get
7676

7777
expect(HTTParty).to receive(method).with(request_url, data).and_return(valid_message)
@@ -85,7 +85,7 @@
8585
it 'sends the proper request' do
8686
id = 1
8787
request_url = "https://api.natero.com/api/v2/accounts/#{id}/statements/?api_key=#{api_key}"
88-
data = nil
88+
data = {}
8989
method = :get
9090

9191
expect(HTTParty).to receive(method).with(request_url, data).and_return(valid_message)
@@ -99,7 +99,7 @@
9999
it 'sends the proper request' do
100100
id = 1
101101
request_url = "https://api.natero.com/api/v2/accounts/#{id}/subscriptions/?api_key=#{api_key}"
102-
data = nil
102+
data = {}
103103
method = :get
104104

105105
expect(HTTParty).to receive(method).with(request_url, data).and_return(valid_message)
@@ -113,7 +113,7 @@
113113
it 'sends the proper request' do
114114
id = 1
115115
request_url = "https://api.natero.com/api/v2/accounts/#{id}/support_tickets/?api_key=#{api_key}"
116-
data = nil
116+
data = {}
117117
method = :get
118118

119119
expect(HTTParty).to receive(method).with(request_url, data).and_return(valid_message)
@@ -127,7 +127,7 @@
127127
it 'sends the proper request' do
128128
id = 1
129129
request_url = "https://api.natero.com/api/v2/accounts/#{id}/users/?api_key=#{api_key}"
130-
data = nil
130+
data = {}
131131
method = :get
132132

133133
expect(HTTParty).to receive(method).with(request_url, data).and_return(valid_message)
@@ -141,7 +141,7 @@
141141
it 'sends the proper request' do
142142
id = 1
143143
request_url = "https://api.natero.com/api/v2/accounts/#{id}/contacts/?api_key=#{api_key}"
144-
data = nil
144+
data = {}
145145
method = :get
146146

147147
expect(HTTParty).to receive(method).with(request_url, data).and_return(valid_message)
@@ -155,7 +155,7 @@
155155
it 'sends the proper request' do
156156
id = 1
157157
request_url = "https://api.natero.com/api/v2/accounts/#{id}/?api_key=#{api_key}"
158-
data = nil
158+
data = {}
159159
method = :delete
160160

161161
expect(HTTParty).to receive(method).with(request_url, data).and_return(valid_message)
@@ -171,7 +171,7 @@
171171
name = 'paul'
172172
timestamp = '1000000'
173173
request_url = "https://api.natero.com/api/v2/accounts/#{id}/stage_history/#{name}/#{timestamp}/?api_key=#{api_key}"
174-
data = nil
174+
data = {}
175175
method = :delete
176176

177177
expect(HTTParty).to receive(method).with(request_url, data).and_return(valid_message)
@@ -186,7 +186,7 @@
186186
id = 1
187187
key = 'so_random'
188188
request_url = "https://api.natero.com/api/v2/accounts/#{id}/dimension_values/#{key}/?api_key=#{api_key}"
189-
data = nil
189+
data = {}
190190
method = :delete
191191

192192
expect(HTTParty).to receive(method).with(request_url, data).and_return(valid_message)
@@ -201,7 +201,7 @@
201201
id = 1
202202
key = 'so_random'
203203
request_url = "https://api.natero.com/api/v2/accounts/#{id}/dimension_labels/#{key}/?api_key=#{api_key}"
204-
data = nil
204+
data = {}
205205
method = :delete
206206

207207
expect(HTTParty).to receive(method).with(request_url, data).and_return(valid_message)
@@ -216,7 +216,7 @@
216216
id = 1
217217
218218
request_url = "https://api.natero.com/api/v2/accounts/#{id}/assigned_csms/#{email}/?api_key=#{api_key}"
219-
data = nil
219+
data = {}
220220
method = :delete
221221

222222
expect(HTTParty).to receive(method).with(request_url, data).and_return(valid_message)
@@ -231,7 +231,7 @@
231231
id = 1
232232
timestamp = 10000
233233
request_url = "https://api.natero.com/api/v2/accounts/#{id}/nps_history/#{timestamp}/?api_key=#{api_key}"
234-
data = nil
234+
data = {}
235235
method = :delete
236236

237237
expect(HTTParty).to receive(method).with(request_url, data).and_return(valid_message)
@@ -240,4 +240,4 @@
240240
Natero::Account.delete_nps_history(id, timestamp)
241241
end
242242
end
243-
end
243+
end

spec/natero/metric_spec.rb

+3-3
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
it 'sends the proper request' do
1414
name = 'ted'
1515
request_url = "https://api.natero.com/api/v2/metrics/#{name}/?api_key=#{api_key}"
16-
data = nil
16+
data = {}
1717
method = :get
1818

1919
expect(HTTParty).to receive(method).with(request_url, data).and_return(valid_message)
@@ -58,7 +58,7 @@
5858
it 'sends the proper request' do
5959
name = 'ted'
6060
request_url = "https://api.natero.com/api/v2/metrics/#{name}/?api_key=#{api_key}"
61-
data = nil
61+
data = {}
6262
method = :delete
6363

6464
expect(HTTParty).to receive(method).with(request_url, data).and_return(valid_message)
@@ -67,4 +67,4 @@
6767
Natero::Metric.delete(name)
6868
end
6969
end
70-
end
70+
end

spec/natero/user_spec.rb

+6-6
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
describe 'retrieve_all' do
1313
it 'sends the proper request' do
1414
request_url = "https://api.natero.com/api/v2/account_users/?api_key=#{api_key}"
15-
data = nil
15+
data = {}
1616
method = :get
1717

1818
expect(HTTParty).to receive(method).with(request_url, data).and_return(valid_message)
@@ -27,7 +27,7 @@
2727
id = 10
2828
account_id = nil
2929
request_url = "https://api.natero.com/api/v2/account_users/#{id}/?api_key=#{api_key}"
30-
data = nil
30+
data = {}
3131
method = :get
3232

3333
expect(HTTParty).to receive(method).with(request_url, data).and_return(valid_message)
@@ -40,7 +40,7 @@
4040
id = 10
4141
account_id = 10
4242
request_url = "https://api.natero.com/api/v2/account_users/#{id}/#{account_id}/?api_key=#{api_key}"
43-
data = nil
43+
data = {}
4444
method = :get
4545

4646
expect(HTTParty).to receive(method).with(request_url, data).and_return(valid_message)
@@ -86,7 +86,7 @@
8686
id = 1
8787
account_id = nil
8888
request_url = "https://api.natero.com/api/v2/account_users/#{id}/?api_key=#{api_key}"
89-
data = nil
89+
data = {}
9090
method = :delete
9191

9292
expect(HTTParty).to receive(method).with(request_url, data).and_return(valid_message)
@@ -99,7 +99,7 @@
9999
id = 1
100100
account_id = 5
101101
request_url = "https://api.natero.com/api/v2/account_users/#{id}/#{account_id}/?api_key=#{api_key}"
102-
data = nil
102+
data = {}
103103
method = :delete
104104

105105
expect(HTTParty).to receive(method).with(request_url, data).and_return(valid_message)
@@ -108,4 +108,4 @@
108108
Natero::User.deactivate(id, account_id)
109109
end
110110
end
111-
end
111+
end

0 commit comments

Comments
 (0)