flapjack-diner 1.4.0 → 2.0.0.a4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +1 -0
- data/.rspec +1 -1
- data/README.md +620 -413
- data/flapjack-diner.gemspec +1 -1
- data/lib/flapjack-diner/argument_validator.rb +77 -7
- data/lib/flapjack-diner/configuration.rb +409 -0
- data/lib/flapjack-diner/index_range.rb +42 -0
- data/lib/flapjack-diner/log_formatter.rb +22 -0
- data/lib/flapjack-diner/query.rb +114 -0
- data/lib/flapjack-diner/relationships.rb +180 -0
- data/lib/flapjack-diner/request.rb +280 -0
- data/lib/flapjack-diner/resources.rb +64 -0
- data/lib/flapjack-diner/response.rb +91 -0
- data/lib/flapjack-diner/tools.rb +47 -251
- data/lib/flapjack-diner/utility.rb +16 -0
- data/lib/flapjack-diner/version.rb +1 -1
- data/lib/flapjack-diner.rb +54 -20
- data/spec/argument_validator_spec.rb +87 -28
- data/spec/flapjack-diner_spec.rb +42 -64
- data/spec/relationships_spec.rb +211 -0
- data/spec/resources/checks_spec.rb +219 -79
- data/spec/resources/contacts_spec.rb +179 -151
- data/spec/resources/events_spec.rb +208 -0
- data/spec/resources/maintenance_periods_spec.rb +177 -565
- data/spec/resources/media_spec.rb +157 -171
- data/spec/resources/metrics_spec.rb +45 -0
- data/spec/resources/rules_spec.rb +278 -0
- data/spec/resources/states_spec.rb +93 -0
- data/spec/resources/statistics_spec.rb +53 -0
- data/spec/resources/tags_spec.rb +243 -0
- data/spec/spec_helper.rb +16 -0
- data/spec/support/fixture_data.rb +541 -0
- metadata +33 -31
- data/.rubocop.yml +0 -21
- data/.rubocop_todo.yml +0 -135
- data/lib/flapjack-diner/resources/checks.rb +0 -64
- data/lib/flapjack-diner/resources/contacts.rb +0 -70
- data/lib/flapjack-diner/resources/entities.rb +0 -68
- data/lib/flapjack-diner/resources/maintenance_periods.rb +0 -82
- data/lib/flapjack-diner/resources/media.rb +0 -61
- data/lib/flapjack-diner/resources/notification_rules.rb +0 -66
- data/lib/flapjack-diner/resources/notifications.rb +0 -28
- data/lib/flapjack-diner/resources/pagerduty_credentials.rb +0 -59
- data/lib/flapjack-diner/resources/reports.rb +0 -33
- data/spec/pacts/flapjack-diner-flapjack.json +0 -4515
- data/spec/resources/entities_spec.rb +0 -181
- data/spec/resources/notification_rules_spec.rb +0 -341
- data/spec/resources/notifications_spec.rb +0 -208
- data/spec/resources/pagerduty_credentials_spec.rb +0 -237
- data/spec/resources/reports_spec.rb +0 -255
@@ -1,7 +1,7 @@
|
|
1
1
|
require 'spec_helper'
|
2
2
|
require 'flapjack-diner'
|
3
3
|
|
4
|
-
describe Flapjack::Diner::Resources
|
4
|
+
describe Flapjack::Diner::Resources, :pact => true do
|
5
5
|
|
6
6
|
before(:each) do
|
7
7
|
Flapjack::Diner.base_uri('localhost:19081')
|
@@ -11,265 +11,251 @@ describe Flapjack::Diner::Resources::Media, :pact => true do
|
|
11
11
|
context 'create' do
|
12
12
|
|
13
13
|
it "submits a POST request for a medium" do
|
14
|
-
|
15
|
-
:
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
14
|
+
req_data = medium_json(sms_data).merge(
|
15
|
+
:relationships => {
|
16
|
+
:contact => {
|
17
|
+
:data => {
|
18
|
+
:type => 'contact',
|
19
|
+
:id => contact_data[:id]
|
20
|
+
}
|
21
|
+
}
|
22
|
+
}
|
23
|
+
)
|
24
|
+
resp_data = medium_json(sms_data).merge(:relationships => medium_rel(sms_data))
|
25
|
+
|
26
|
+
flapjack.given("a contact exists").
|
22
27
|
upon_receiving("a POST request with one medium").
|
23
|
-
with(:method => :post,
|
28
|
+
with(:method => :post,
|
29
|
+
:path => '/media',
|
24
30
|
:headers => {'Content-Type' => 'application/vnd.api+json'},
|
25
|
-
:body => {:
|
31
|
+
:body => {:data => req_data}).
|
26
32
|
will_respond_with(
|
27
33
|
:status => 201,
|
28
|
-
:headers => {'Content-Type' => 'application/vnd.api+json; charset=utf-8'},
|
29
|
-
:body =>
|
34
|
+
:headers => {'Content-Type' => 'application/vnd.api+json; supported-ext=bulk; charset=utf-8'},
|
35
|
+
:body => { :data => resp_data }
|
36
|
+
)
|
30
37
|
|
31
|
-
result = Flapjack::Diner.
|
38
|
+
result = Flapjack::Diner.create_media(sms_data.merge(:contact => contact_data[:id]))
|
32
39
|
expect(result).not_to be_nil
|
33
|
-
expect(result).to eq(
|
40
|
+
expect(result).to eq(resultify(resp_data))
|
34
41
|
end
|
35
42
|
|
36
43
|
it "submits a POST request for several media" do
|
37
|
-
|
38
|
-
:
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
44
|
+
req_data = [medium_json(email_data).merge(
|
45
|
+
:relationships => {
|
46
|
+
:contact => {
|
47
|
+
:data => {
|
48
|
+
:type => 'contact',
|
49
|
+
:id => contact_data[:id]
|
50
|
+
}
|
51
|
+
}
|
52
|
+
}
|
53
|
+
), medium_json(sms_data).merge(
|
54
|
+
:relationships => {
|
55
|
+
:contact => {
|
56
|
+
:data => {
|
57
|
+
:type => 'contact',
|
58
|
+
:id => contact_data[:id]
|
59
|
+
}
|
60
|
+
}
|
61
|
+
}
|
62
|
+
)]
|
63
|
+
resp_data = [
|
64
|
+
medium_json(email_data).merge(:relationships => medium_rel(email_data)),
|
65
|
+
medium_json(sms_data).merge(:relationships => medium_rel(sms_data))
|
66
|
+
]
|
67
|
+
|
68
|
+
flapjack.given("a contact exists").
|
50
69
|
upon_receiving("a POST request with two media").
|
51
|
-
with(:method => :post,
|
52
|
-
:
|
53
|
-
:
|
70
|
+
with(:method => :post,
|
71
|
+
:path => '/media',
|
72
|
+
:headers => {'Content-Type' => 'application/vnd.api+json; ext=bulk'},
|
73
|
+
:body => {:data => req_data}).
|
54
74
|
will_respond_with(
|
55
75
|
:status => 201,
|
56
|
-
:headers => {'Content-Type' => 'application/vnd.api+json; charset=utf-8'},
|
57
|
-
:body =>
|
76
|
+
:headers => {'Content-Type' => 'application/vnd.api+json; supported-ext=bulk; charset=utf-8'},
|
77
|
+
:body => {:data => resp_data})
|
58
78
|
|
59
|
-
result = Flapjack::Diner.
|
79
|
+
result = Flapjack::Diner.create_media(email_data.merge(:contact => contact_data[:id]),
|
80
|
+
sms_data.merge(:contact => contact_data[:id]))
|
60
81
|
expect(result).not_to be_nil
|
61
|
-
expect(result).to eq(
|
62
|
-
end
|
63
|
-
|
64
|
-
it "can't find the contact to create a medium for" do
|
65
|
-
data = [{
|
66
|
-
:type => 'sms',
|
67
|
-
:address => '0123456789',
|
68
|
-
:interval => 300,
|
69
|
-
:rollup_threshold => 5
|
70
|
-
}]
|
71
|
-
|
72
|
-
flapjack.given("no contact exists").
|
73
|
-
upon_receiving("a POST request with one medium").
|
74
|
-
with(:method => :post, :path => '/contacts/abc/media',
|
75
|
-
:headers => {'Content-Type' => 'application/vnd.api+json'},
|
76
|
-
:body => {:media => data}).
|
77
|
-
will_respond_with(
|
78
|
-
:status => 422,
|
79
|
-
:headers => {'Content-Type' => 'application/vnd.api+json; charset=utf-8'},
|
80
|
-
:body => {:errors => ["Contact id: 'abc' could not be loaded"]} )
|
81
|
-
|
82
|
-
result = Flapjack::Diner.create_contact_media('abc', data)
|
83
|
-
expect(result).to be_nil
|
84
|
-
expect(Flapjack::Diner.last_error).to eq(:status_code => 422,
|
85
|
-
:errors => ["Contact id: 'abc' could not be loaded"])
|
82
|
+
expect(result).to eq(resultify(resp_data))
|
86
83
|
end
|
87
84
|
|
88
85
|
end
|
89
86
|
|
90
87
|
context 'read' do
|
91
88
|
|
92
|
-
let(:sms_data) {
|
93
|
-
{
|
94
|
-
:type => 'sms',
|
95
|
-
:address => '0123456789',
|
96
|
-
:interval => 300,
|
97
|
-
:rollup_threshold => 5
|
98
|
-
}
|
99
|
-
}
|
100
|
-
|
101
|
-
let(:email_data) {
|
102
|
-
{
|
103
|
-
:type => 'email',
|
104
|
-
:address => 'ablated@example.org',
|
105
|
-
:interval => 180,
|
106
|
-
:rollup_threshold => 3
|
107
|
-
}
|
108
|
-
}
|
109
|
-
|
110
|
-
let(:links) { {:links => {:contacts => ['abc']}} }
|
111
|
-
|
112
89
|
it "submits a GET request for all media" do
|
113
|
-
|
114
|
-
|
115
|
-
|
90
|
+
result_data = [
|
91
|
+
medium_json(email_data),
|
92
|
+
medium_json(sms_data)
|
93
|
+
]
|
94
|
+
resp_data = [
|
95
|
+
result_data[0].merge(:relationships => medium_rel(email_data)),
|
96
|
+
result_data[1].merge(:relationships => medium_rel(sms_data))
|
97
|
+
]
|
98
|
+
|
99
|
+
flapjack.given("two media exist").
|
116
100
|
upon_receiving("a GET request for all media").
|
117
|
-
with(:method => :get,
|
101
|
+
with(:method => :get,
|
102
|
+
:path => '/media').
|
118
103
|
will_respond_with(
|
119
104
|
:status => 200,
|
120
|
-
:headers => {'Content-Type' => 'application/vnd.api+json; charset=utf-8'},
|
121
|
-
:body => {:
|
105
|
+
:headers => {'Content-Type' => 'application/vnd.api+json; supported-ext=bulk; charset=utf-8'},
|
106
|
+
:body => {:data => resp_data})
|
122
107
|
|
123
108
|
result = Flapjack::Diner.media
|
124
|
-
expect(result).to
|
109
|
+
expect(result).to contain_exactly(resultify(resp_data[0]), resultify(resp_data[1]))
|
125
110
|
end
|
126
111
|
|
127
112
|
it "submits a GET request for one medium" do
|
128
|
-
|
113
|
+
resp_data = medium_json(sms_data).merge(:relationships => medium_rel(sms_data))
|
129
114
|
|
130
|
-
flapjack.given("a
|
131
|
-
upon_receiving("a GET request for
|
132
|
-
with(:method => :get, :path =>
|
115
|
+
flapjack.given("a medium exists").
|
116
|
+
upon_receiving("a GET request for one medium").
|
117
|
+
with(:method => :get, :path => "/media/#{sms_data[:id]}").
|
133
118
|
will_respond_with(
|
134
119
|
:status => 200,
|
135
|
-
:headers => {'Content-Type' => 'application/vnd.api+json; charset=utf-8'},
|
136
|
-
:body => {:
|
120
|
+
:headers => {'Content-Type' => 'application/vnd.api+json; supported-ext=bulk; charset=utf-8'},
|
121
|
+
:body => {:data => resp_data} )
|
137
122
|
|
138
|
-
result = Flapjack::Diner.media(
|
139
|
-
expect(result).to eq(
|
123
|
+
result = Flapjack::Diner.media(sms_data[:id])
|
124
|
+
expect(result).to eq(resultify(resp_data))
|
140
125
|
end
|
141
126
|
|
142
127
|
it "submits a GET request for several media" do
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
128
|
+
resp_data = [
|
129
|
+
medium_json(email_data).merge(:relationships => medium_rel(email_data)),
|
130
|
+
medium_json(sms_data).merge(:relationships => medium_rel(sms_data))
|
131
|
+
]
|
132
|
+
|
133
|
+
flapjack.given("two media exist").
|
134
|
+
upon_receiving("a GET request for two media").
|
135
|
+
with(:method => :get, :path => '/media',
|
136
|
+
:query => "filter%5B%5D=id%3A#{email_data[:id]}%7C#{sms_data[:id]}").
|
148
137
|
will_respond_with(
|
149
138
|
:status => 200,
|
150
|
-
:headers => {'Content-Type' => 'application/vnd.api+json; charset=utf-8'},
|
151
|
-
:body => {:
|
152
|
-
|
153
|
-
result = Flapjack::Diner.media('abc_email', 'abc_sms')
|
154
|
-
expect(result).to eq(media_data)
|
155
|
-
end
|
156
|
-
|
157
|
-
it "can't find the contact with media to read" do
|
158
|
-
flapjack.given("no contact exists").
|
159
|
-
upon_receiving("a GET request for sms media").
|
160
|
-
with(:method => :get, :path => '/media/abc_sms').
|
161
|
-
will_respond_with(
|
162
|
-
:status => 404,
|
163
|
-
:headers => {'Content-Type' => 'application/vnd.api+json; charset=utf-8'},
|
164
|
-
:body => {:errors => ["could not find contact 'abc'"]} )
|
139
|
+
:headers => {'Content-Type' => 'application/vnd.api+json; supported-ext=bulk; charset=utf-8'},
|
140
|
+
:body => {:data => resp_data} )
|
165
141
|
|
166
|
-
result = Flapjack::Diner.media(
|
167
|
-
expect(result).to
|
168
|
-
expect(Flapjack::Diner.last_error).to eq(:status_code => 404,
|
169
|
-
:errors => ["could not find contact 'abc'"])
|
142
|
+
result = Flapjack::Diner.media(email_data[:id], sms_data[:id])
|
143
|
+
expect(result).to eq(resultify(resp_data))
|
170
144
|
end
|
171
145
|
|
172
146
|
end
|
173
147
|
|
174
148
|
context 'update' do
|
175
149
|
|
176
|
-
it
|
177
|
-
flapjack.given("a
|
178
|
-
upon_receiving("a PATCH request for
|
150
|
+
it 'submits a PATCH request for a medium' do
|
151
|
+
flapjack.given("a medium exists").
|
152
|
+
upon_receiving("a PATCH request for a single medium").
|
179
153
|
with(:method => :patch,
|
180
|
-
:path =>
|
181
|
-
:
|
182
|
-
:
|
183
|
-
{:op => 'replace', :path => '/media/0/rollup_threshold', :value => 3}]).
|
154
|
+
:path => "/media/#{sms_data[:id]}",
|
155
|
+
:body => {:data => {:id => sms_data[:id], :type => 'medium', :attributes => {:interval => 50}}},
|
156
|
+
:headers => {'Content-Type' => 'application/vnd.api+json'}).
|
184
157
|
will_respond_with(
|
185
158
|
:status => 204,
|
186
159
|
:body => '' )
|
187
160
|
|
188
|
-
result = Flapjack::Diner.update_media(
|
189
|
-
expect(result).
|
190
|
-
expect(result).to be_truthy
|
161
|
+
result = Flapjack::Diner.update_media(:id => sms_data[:id], :interval => 50)
|
162
|
+
expect(result).to be_a(TrueClass)
|
191
163
|
end
|
192
164
|
|
193
|
-
it
|
194
|
-
flapjack.given("
|
195
|
-
upon_receiving("a PATCH request for
|
165
|
+
it 'submits a PATCH request for several media' do
|
166
|
+
flapjack.given("two media exist").
|
167
|
+
upon_receiving("a PATCH request for two media").
|
196
168
|
with(:method => :patch,
|
197
|
-
:path =>
|
198
|
-
:headers => {'Content-Type'=>'application/
|
199
|
-
:body => [{:
|
200
|
-
|
169
|
+
:path => "/media",
|
170
|
+
:headers => {'Content-Type' => 'application/vnd.api+json; ext=bulk'},
|
171
|
+
:body => {:data => [{:id => email_data[:id], :type => 'medium', :attributes => {:interval => 50}},
|
172
|
+
{:id => sms_data[:id], :type => 'medium', :attributes => {:rollup_threshold => 5}}]}).
|
201
173
|
will_respond_with(
|
202
174
|
:status => 204,
|
203
175
|
:body => '' )
|
204
176
|
|
205
|
-
result = Flapjack::Diner.update_media(
|
206
|
-
|
207
|
-
|
177
|
+
result = Flapjack::Diner.update_media(
|
178
|
+
{:id => email_data[:id], :interval => 50},
|
179
|
+
{:id => sms_data[:id], :rollup_threshold => 5})
|
180
|
+
expect(result).to be_a(TrueClass)
|
208
181
|
end
|
209
182
|
|
210
|
-
it "can't find the
|
211
|
-
flapjack.given("no
|
212
|
-
upon_receiving("a PATCH request for
|
183
|
+
it "can't find the medium to update" do
|
184
|
+
flapjack.given("no data exists").
|
185
|
+
upon_receiving("a PATCH request for a single medium").
|
213
186
|
with(:method => :patch,
|
214
|
-
:path =>
|
215
|
-
:
|
216
|
-
:
|
217
|
-
will_respond_with(
|
218
|
-
|
219
|
-
|
220
|
-
|
221
|
-
|
187
|
+
:path => "/media/#{email_data[:id]}",
|
188
|
+
:body => {:data => {:id => email_data[:id], :type => 'medium', :attributes => {:interval => 50}}},
|
189
|
+
:headers => {'Content-Type' => 'application/vnd.api+json'}).
|
190
|
+
will_respond_with(
|
191
|
+
:status => 404,
|
192
|
+
:headers => {'Content-Type' => 'application/vnd.api+json; supported-ext=bulk; charset=utf-8'},
|
193
|
+
:body => {:errors => [{
|
194
|
+
:status => '404',
|
195
|
+
:detail => "could not find Medium record, id: '#{email_data[:id]}'"
|
196
|
+
}]}
|
197
|
+
)
|
198
|
+
|
199
|
+
result = Flapjack::Diner.update_media(:id => email_data[:id], :interval => 50)
|
222
200
|
expect(result).to be_nil
|
223
|
-
expect(Flapjack::Diner.
|
224
|
-
:
|
201
|
+
expect(Flapjack::Diner.error).to eq([{:status => '404',
|
202
|
+
:detail => "could not find Medium record, id: '#{email_data[:id]}'"}])
|
225
203
|
end
|
226
204
|
|
227
205
|
end
|
228
206
|
|
229
207
|
context 'delete' do
|
208
|
+
|
230
209
|
it "submits a DELETE request for one medium" do
|
231
210
|
|
232
|
-
|
211
|
+
flapjack.given("a medium exists").
|
233
212
|
upon_receiving("a DELETE request for one medium").
|
234
213
|
with(:method => :delete,
|
235
|
-
:path =>
|
214
|
+
:path => "/media/#{sms_data[:id]}",
|
236
215
|
:body => nil).
|
237
216
|
will_respond_with(:status => 204,
|
238
217
|
:body => '')
|
239
218
|
|
240
|
-
result = Flapjack::Diner.delete_media(
|
241
|
-
expect(result).
|
242
|
-
expect(result).to be_truthy
|
219
|
+
result = Flapjack::Diner.delete_media(sms_data[:id])
|
220
|
+
expect(result).to be_a(TrueClass)
|
243
221
|
end
|
244
222
|
|
245
223
|
it "submits a DELETE request for several media" do
|
246
|
-
|
224
|
+
media_data = [{:type => 'medium', :id => sms_data[:id]},
|
225
|
+
{:type => 'medium', :id => email_data[:id]}]
|
226
|
+
|
227
|
+
flapjack.given("two media exist").
|
247
228
|
upon_receiving("a DELETE request for two media").
|
248
229
|
with(:method => :delete,
|
249
|
-
:
|
250
|
-
:
|
230
|
+
:headers => {'Content-Type' => 'application/vnd.api+json; ext=bulk'},
|
231
|
+
:path => "/media",
|
232
|
+
:body => {:data => media_data}).
|
251
233
|
will_respond_with(:status => 204,
|
252
234
|
:body => '')
|
253
235
|
|
254
|
-
result = Flapjack::Diner.delete_media(
|
255
|
-
expect(result).
|
256
|
-
expect(result).to be_truthy
|
236
|
+
result = Flapjack::Diner.delete_media(sms_data[:id], email_data[:id])
|
237
|
+
expect(result).to be_a(TrueClass)
|
257
238
|
end
|
258
239
|
|
259
240
|
it "can't find the contact with media to delete" do
|
260
|
-
flapjack.given("no
|
241
|
+
flapjack.given("no data exists").
|
261
242
|
upon_receiving("a DELETE request for one medium").
|
262
243
|
with(:method => :delete,
|
263
|
-
:path =>
|
244
|
+
:path => "/media/#{sms_data[:id]}",
|
264
245
|
:body => nil).
|
265
|
-
will_respond_with(
|
266
|
-
|
267
|
-
|
268
|
-
|
269
|
-
|
246
|
+
will_respond_with(
|
247
|
+
:status => 404,
|
248
|
+
:headers => {'Content-Type' => 'application/vnd.api+json; supported-ext=bulk; charset=utf-8'},
|
249
|
+
:body => {:errors => [{
|
250
|
+
:status => '404',
|
251
|
+
:detail => "could not find Medium record, id: '#{sms_data[:id]}'"
|
252
|
+
}]}
|
253
|
+
)
|
254
|
+
|
255
|
+
result = Flapjack::Diner.delete_media(sms_data[:id])
|
270
256
|
expect(result).to be_nil
|
271
|
-
expect(Flapjack::Diner.
|
272
|
-
:
|
257
|
+
expect(Flapjack::Diner.error).to eq([{:status => '404',
|
258
|
+
:detail => "could not find Medium record, id: '#{sms_data[:id]}'"}])
|
273
259
|
end
|
274
260
|
|
275
261
|
end
|
@@ -0,0 +1,45 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
require 'flapjack-diner'
|
3
|
+
|
4
|
+
describe Flapjack::Diner::Resources, :pact => true do
|
5
|
+
|
6
|
+
before(:each) do
|
7
|
+
Flapjack::Diner.base_uri('localhost:19081')
|
8
|
+
Flapjack::Diner.logger = nil
|
9
|
+
end
|
10
|
+
|
11
|
+
context 'read' do
|
12
|
+
it 'gets all metrics' do
|
13
|
+
resp_data = metrics_json(metrics_data)
|
14
|
+
|
15
|
+
flapjack.given("no data exists").
|
16
|
+
upon_receiving("a GET request for all metrics").
|
17
|
+
with(:method => :get, :path => '/metrics').
|
18
|
+
will_respond_with(
|
19
|
+
:status => 200,
|
20
|
+
:headers => {'Content-Type' => 'application/vnd.api+json; supported-ext=bulk; charset=utf-8'},
|
21
|
+
:body => {:data => resp_data} )
|
22
|
+
|
23
|
+
result = Flapjack::Diner.metrics
|
24
|
+
expect(result).to eq(resultify(resp_data))
|
25
|
+
end
|
26
|
+
|
27
|
+
it 'gets a subset of metrics' do
|
28
|
+
resp_data = metrics_json(metrics_data)
|
29
|
+
resp_data[:attributes].delete_if {|k,v| ![:processed_events, :total_keys].include?(k)}
|
30
|
+
|
31
|
+
flapjack.given("no data exists").
|
32
|
+
upon_receiving("a GET request for some metrics").
|
33
|
+
with(:method => :get, :path => '/metrics',
|
34
|
+
:query => 'fields%5B%5D=total_keys&fields%5B%5D=processed_events').
|
35
|
+
will_respond_with(
|
36
|
+
:status => 200,
|
37
|
+
:headers => {'Content-Type' => 'application/vnd.api+json; supported-ext=bulk; charset=utf-8'},
|
38
|
+
:body => {:data => resp_data} )
|
39
|
+
|
40
|
+
result = Flapjack::Diner.metrics(:fields => ['total_keys', 'processed_events'])
|
41
|
+
expect(result).to eq(resultify(resp_data))
|
42
|
+
end
|
43
|
+
end
|
44
|
+
|
45
|
+
end
|