3scale_api 1.0.10 → 1.0.11
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/3scale_api/3scale/api.rb +5 -5
- data/lib/3scale_api/version.rb +1 -1
- data/spec/3scale_api_spec.rb +2 -15
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8e7cfb891b2ed35e525ece7bcd749ea3bd55422d
|
4
|
+
data.tar.gz: 054ed669994171561b4d569d3c04939bdacd1cc6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 93f41fb6b4cc5c9386c6cc01c5838662f8b2f7c48098b273d11908a646908902ed060b381b6a4b24688710994dc09e048d33af4465b1a5ee7b2f23d5d51bcd54
|
7
|
+
data.tar.gz: 8528ba81265e3ae4b495dff44795257c417c13a767450e2cc4ae6a656a358c71e2e1edaacecad189e54c3eced2e5e0fc1744a97529bb04a31eba3de5eb80cbaf
|
@@ -81,7 +81,9 @@ module Threescale
|
|
81
81
|
:id => application.css('id').text,
|
82
82
|
:name => application.css('name').text,
|
83
83
|
:application_id => application.css('application_id').text,
|
84
|
-
:plan_type => application.css('plan name').text
|
84
|
+
:plan_type => application.css('plan name').text,
|
85
|
+
:service_id => application.css('service_id').first.text
|
86
|
+
})
|
85
87
|
end
|
86
88
|
results
|
87
89
|
end
|
@@ -119,11 +121,9 @@ module Threescale
|
|
119
121
|
response.status == 201
|
120
122
|
end
|
121
123
|
|
122
|
-
def signup_express(
|
123
|
-
additional_fields = nil)
|
124
|
+
def signup_express( email, org_name, password, username, additional_fields = nil)
|
124
125
|
params = {:provider_key => @provider_key, :username => username, :password => password, :email => email,
|
125
|
-
:org_name => org_name
|
126
|
-
:application_plan_id => application_plan_id}
|
126
|
+
:org_name => org_name}
|
127
127
|
if (additional_fields)
|
128
128
|
additional_fields.each do |key, value|
|
129
129
|
params[key] = value
|
data/lib/3scale_api/version.rb
CHANGED
data/spec/3scale_api_spec.rb
CHANGED
@@ -190,18 +190,6 @@ describe "3scaleApi" do
|
|
190
190
|
end
|
191
191
|
end
|
192
192
|
|
193
|
-
describe "change_role_to_member" do
|
194
|
-
it "should call /admin/api/signup.xml" do
|
195
|
-
stub_request(:post, "http://test-url.test/admin/api/signup.xml").
|
196
|
-
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"}},
|
197
|
-
: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'}).
|
198
|
-
to_return(:status => 200, :body => "", :headers => {})
|
199
|
-
|
200
|
-
@threescale.signup_express "account_plan_id", "application_plan_id", "email" "org_name", "password",
|
201
|
-
"service_plan_id", "username", {:first_field => 'first-field'}
|
202
|
-
end
|
203
|
-
end
|
204
|
-
|
205
193
|
describe "approve_account" do
|
206
194
|
it "should call /admin/api/accounts/{account_id}/users/{user_id}/member.xml" do
|
207
195
|
stub_request(:put, "http://test-url.test/admin/api/accounts/account_id/approve.xml").
|
@@ -216,12 +204,11 @@ describe "3scaleApi" do
|
|
216
204
|
describe "signup_express" do
|
217
205
|
it "should call admin/api/accounts/account_id/approve.xml" do
|
218
206
|
stub_request(:post, "http://test-url.test/admin/api/signup.xml").
|
219
|
-
with(:body => {"
|
207
|
+
with(:body => {"email"=>"email", "optional"=>"optional", "org_name"=>"org-name", "password"=>"password", "provider_key"=>"provider-key", "username"=>"username"},
|
220
208
|
: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'}).
|
221
209
|
to_return(:status => 200, :body => "", :headers => {})
|
222
210
|
|
223
|
-
@threescale.signup_express
|
224
|
-
"service-plan", "username", {:optional => 'optional'}
|
211
|
+
@threescale.signup_express "email", "org-name", "password", "username", {:optional => 'optional'}
|
225
212
|
end
|
226
213
|
end
|
227
214
|
|