3scale_api 1.0.6 → 1.0.7

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: b0f8796de5dcedb6331ec6b658438488735b3a12
4
- data.tar.gz: 32184f83d8f8c85e099614ab5f3ed90d5cd3fedb
3
+ metadata.gz: 2ff1614a78872c23c9f770ece900b9c9a1bb9963
4
+ data.tar.gz: 4282f1bba90c89c3a35f6c59c815d62934fe756c
5
5
  SHA512:
6
- metadata.gz: 08f1f3cd80b3f59664344a5dfb4c589340a2d2d986429d46537167a468fe6a37bd30e04e1a60d826d719ac710c523844b8da504495cf4ef34f844f02089153ed
7
- data.tar.gz: 859454221162e63d58a95026a9634229fc208a8c209a47e4b5a6245db53c8816127c99289efedfdafc071547604b8d412f43fe7e55b79e296ca40c7a8fd7a718
6
+ metadata.gz: d090343d4890466f9969cf4546d539147a45f34dcc84f0d7364352dfa7e87b5944f9e3d621acff9a95bdb3df383681d996566c8a96c0db532b9c4fd5e0792ad1
7
+ data.tar.gz: 4acebf3cd1b5ea33875693b3105f9e3f60a7d4384a73362abde06ea421c3f362b4b6856aa6331841d3d35c8ce128265a4dad67edb7ee301424dd1f5a8fc1c0d1
@@ -130,7 +130,7 @@ module Threescale
130
130
  end
131
131
  end
132
132
  response = @conn.post "/admin/api/signup.xml", params
133
- return false = response.status != 201
133
+ return false if response.status != 201
134
134
  xml = Nokogiri::XML(response.body)
135
135
  account_id = xml.xpath('//account/id').first.text
136
136
  user_id = xml.xpath('//account/users/user/id').text
@@ -1,3 +1,3 @@
1
1
  module Threescale
2
- VERSION = "1.0.6"
2
+ VERSION = "1.0.7"
3
3
  end
@@ -145,16 +145,6 @@ describe "3scaleApi" do
145
145
  end
146
146
  end
147
147
 
148
- describe "create_account" do
149
- it "should call /admin/api/accounts/{account_id}/applications.xml" do
150
- stub_request(:post, "http://test-url.test/admin/api/services/service-id/application_plans.xml").
151
- with(:body => {"name"=>"name", "provider_key"=>"provider-key"},
152
- :headers => {'Accept'=>'*/*', 'Accept-Encoding'=>'gzip;q=1.0,deflate;q=0.6,identity;q=0.3', 'Content-Type'=>'application/x-www-form-urlencoded', 'User-Agent'=>'Faraday v0.9.1'}).
153
- to_return(:status => 200, :body => "", :headers => {})
154
- @threescale.create_account "name", "service-id"
155
- end
156
- end
157
-
158
148
  describe "create_user" do
159
149
  it "should call /admin/api/accounts/{account_id}/users.xml" do
160
150
  stub_request(:post, "http://test-url.test/admin/api/accounts/account-id/users.xml").
@@ -194,5 +184,28 @@ describe "3scaleApi" do
194
184
  @threescale.change_role_to_member "account-id", "user-id"
195
185
  end
196
186
  end
187
+
188
+ describe "change_role_to_member" do
189
+ it "should call /admin/api/signup.xml" do
190
+ stub_request(:post, "http://test-url.test/admin/api/signup.xml").
191
+ with(:body => {"account_plan_id"=>"account_plan_id", "application_plan_id"=>"application_plan_id", "email"=>"emailorg_name", "org_name"=>"password", "password"=>"service_plan_id", "provider_key"=>"provider-key", "service_plan_id"=>"username", "username"=>{"first_field"=>"first-field"}},
192
+ :headers => {'Accept'=>'*/*', 'Accept-Encoding'=>'gzip;q=1.0,deflate;q=0.6,identity;q=0.3', 'Content-Type'=>'application/x-www-form-urlencoded', 'User-Agent'=>'Faraday v0.9.1'}).
193
+ to_return(:status => 200, :body => "", :headers => {})
194
+
195
+ @threescale.signup_express "account_plan_id", "application_plan_id", "email" "org_name", "password",
196
+ "service_plan_id", "username", {:first_field => 'first-field'}
197
+ end
198
+ end
199
+
200
+ describe "approve_account" do
201
+ it "should call /admin/api/accounts/{account_id}/users/{user_id}/member.xml" do
202
+ stub_request(:put, "http://test-url.test/admin/api/accounts/account_id/approve.xml").
203
+ with(:body => {"provider_key"=>"provider-key"},
204
+ :headers => {'Accept'=>'*/*', 'Accept-Encoding'=>'gzip;q=1.0,deflate;q=0.6,identity;q=0.3', 'Content-Type'=>'application/x-www-form-urlencoded', 'User-Agent'=>'Faraday v0.9.1'}).
205
+ to_return(:status => 200, :body => "", :headers => {})
206
+
207
+ @threescale.approve_account "account_id"
208
+ end
209
+ end
197
210
  end
198
211
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: 3scale_api
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.6
4
+ version: 1.0.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Robbie Holmes