flapjack-diner 1.3.0 → 1.4.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -13,8 +13,7 @@ describe Flapjack::Diner::Resources::PagerdutyCredentials, :pact => true do
13
13
  it "submits a POST request for pagerduty credentials" do
14
14
  data = [{:service_key => 'abc',
15
15
  :subdomain => 'def',
16
- :username => 'ghi',
17
- :password => 'jkl',
16
+ :token => 'ghi',
18
17
  }]
19
18
 
20
19
  flapjack.given("a contact with id 'abc' exists").
@@ -34,8 +33,7 @@ describe Flapjack::Diner::Resources::PagerdutyCredentials, :pact => true do
34
33
  it "can't find the contact to create pagerduty credentials for" do
35
34
  data = [{:service_key => 'abc',
36
35
  :subdomain => 'def',
37
- :username => 'ghi',
38
- :password => 'jkl',
36
+ :token => 'ghi',
39
37
  }]
40
38
 
41
39
  flapjack.given("no contact exists").
@@ -61,8 +59,7 @@ describe Flapjack::Diner::Resources::PagerdutyCredentials, :pact => true do
61
59
  pdc_data = [{
62
60
  :service_key => 'abc',
63
61
  :subdomain => 'def',
64
- :username => 'ghi',
65
- :password => 'jkl',
62
+ :token => 'ghi',
66
63
  }]
67
64
 
68
65
  flapjack.given("a contact with id 'abc' has pagerduty credentials").
@@ -81,8 +78,7 @@ describe Flapjack::Diner::Resources::PagerdutyCredentials, :pact => true do
81
78
  pdc_data = [{
82
79
  :service_key => 'abc',
83
80
  :subdomain => 'def',
84
- :username => 'ghi',
85
- :password => 'jkl',
81
+ :token => 'ghi',
86
82
  }]
87
83
 
88
84
  flapjack.given("a contact with id 'abc' has pagerduty credentials").
@@ -101,13 +97,11 @@ describe Flapjack::Diner::Resources::PagerdutyCredentials, :pact => true do
101
97
  pdc_data = [{
102
98
  :service_key => 'abc',
103
99
  :subdomain => 'def',
104
- :username => 'ghi',
105
- :password => 'jkl',
100
+ :token => 'ghi',
106
101
  }, {
107
102
  :service_key => 'mno',
108
103
  :subdomain => 'pqr',
109
- :username => 'stu',
110
- :password => 'vwx',
104
+ :token => 'stu',
111
105
  }]
112
106
 
113
107
  flapjack.given("contacts with ids 'abc' and '872' have pagerduty credentials").
@@ -147,12 +141,12 @@ describe Flapjack::Diner::Resources::PagerdutyCredentials, :pact => true do
147
141
  with(:method => :patch,
148
142
  :path => '/pagerduty_credentials/abc',
149
143
  :headers => {'Content-Type'=>'application/json-patch+json'},
150
- :body => [{:op => 'replace', :path => '/pagerduty_credentials/0/password', :value => 'pswrd'}]).
144
+ :body => [{:op => 'replace', :path => '/pagerduty_credentials/0/token', :value => 'token123'}]).
151
145
  will_respond_with(
152
146
  :status => 204,
153
147
  :body => '' )
154
148
 
155
- result = Flapjack::Diner.update_pagerduty_credentials('abc', :password => 'pswrd')
149
+ result = Flapjack::Diner.update_pagerduty_credentials('abc', :token => 'token123')
156
150
  expect(result).not_to be_nil
157
151
  expect(result).to be_truthy
158
152
  end
@@ -163,12 +157,12 @@ describe Flapjack::Diner::Resources::PagerdutyCredentials, :pact => true do
163
157
  with(:method => :patch,
164
158
  :path => '/pagerduty_credentials/abc,872',
165
159
  :headers => {'Content-Type'=>'application/json-patch+json'},
166
- :body => [{:op => 'replace', :path => '/pagerduty_credentials/0/password', :value => 'pswrd'}]).
160
+ :body => [{:op => 'replace', :path => '/pagerduty_credentials/0/token', :value => 'token123'}]).
167
161
  will_respond_with(
168
162
  :status => 204,
169
163
  :body => '' )
170
164
 
171
- result = Flapjack::Diner.update_pagerduty_credentials('abc', '872', :password => 'pswrd')
165
+ result = Flapjack::Diner.update_pagerduty_credentials('abc', '872', :token => 'token123')
172
166
  expect(result).not_to be_nil
173
167
  expect(result).to be_truthy
174
168
  end
@@ -179,12 +173,12 @@ describe Flapjack::Diner::Resources::PagerdutyCredentials, :pact => true do
179
173
  with(:method => :patch,
180
174
  :path => '/pagerduty_credentials/abc',
181
175
  :headers => {'Content-Type'=>'application/json-patch+json'},
182
- :body => [{:op => 'replace', :path => '/pagerduty_credentials/0/password', :value => 'pswrd'}]).
176
+ :body => [{:op => 'replace', :path => '/pagerduty_credentials/0/token', :value => 'token123'}]).
183
177
  will_respond_with(:status => 404,
184
178
  :headers => {'Content-Type' => 'application/vnd.api+json; charset=utf-8'},
185
179
  :body => {:errors => ["could not find contact 'abc'"]} )
186
180
 
187
- result = Flapjack::Diner.update_pagerduty_credentials('abc', :password => 'pswrd')
181
+ result = Flapjack::Diner.update_pagerduty_credentials('abc', :token => 'token123')
188
182
  expect(result).to be_nil
189
183
  expect(Flapjack::Diner.last_error).to eq(:status_code => 404,
190
184
  :errors => ["could not find contact 'abc'"])
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: flapjack-diner
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.0
4
+ version: 1.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ali Graham
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-03-19 00:00:00.000000000 Z
11
+ date: 2015-10-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: httparty
@@ -101,7 +101,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
101
101
  version: '0'
102
102
  requirements: []
103
103
  rubyforge_project:
104
- rubygems_version: 2.4.5
104
+ rubygems_version: 2.4.5.1
105
105
  signing_key:
106
106
  specification_version: 4
107
107
  summary: Access the API of a Flapjack system monitoring server
@@ -119,4 +119,3 @@ test_files:
119
119
  - spec/resources/pagerduty_credentials_spec.rb
120
120
  - spec/resources/reports_spec.rb
121
121
  - spec/spec_helper.rb
122
- has_rdoc: