kaui 1.4.0 → 2.0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +24 -1
- data/app/assets/javascripts/kaui/kaui.js +8 -2
- data/app/assets/stylesheets/kaui/common.less +44 -1
- data/app/controllers/kaui/admin_tenants_controller.rb +77 -106
- data/app/controllers/kaui/audit_logs_controller.rb +23 -1
- data/app/controllers/kaui/charges_controller.rb +1 -1
- data/app/controllers/kaui/credits_controller.rb +5 -5
- data/app/controllers/kaui/home_controller.rb +2 -2
- data/app/controllers/kaui/invoice_items_controller.rb +1 -1
- data/app/controllers/kaui/invoices_controller.rb +6 -4
- data/app/controllers/kaui/payment_methods_controller.rb +9 -3
- data/app/controllers/kaui/payments_controller.rb +1 -1
- data/app/controllers/kaui/refunds_controller.rb +2 -2
- data/app/controllers/kaui/sessions_controller.rb +6 -0
- data/app/controllers/kaui/subscriptions_controller.rb +29 -5
- data/app/helpers/kaui/payment_method_helper.rb +5 -3
- data/app/helpers/kaui/plugin_helper.rb +9 -48
- data/app/helpers/kaui/subscription_helper.rb +5 -4
- data/app/models/kaui/admin_tenant.rb +8 -84
- data/app/models/kaui/catalog.rb +14 -2
- data/app/views/kaui/account_emails/_form.html.erb +1 -1
- data/app/views/kaui/accounts/_form.html.erb +1 -1
- data/app/views/kaui/admin_tenants/_form_plugin_config.erb +48 -240
- data/app/views/kaui/admin_tenants/_show_catalog_simple.erb +6 -6
- data/app/views/kaui/admin_tenants/new_catalog.html.erb +16 -15
- data/app/views/kaui/bundles/index.html.erb +1 -1
- data/app/views/kaui/chargebacks/_form.html.erb +1 -1
- data/app/views/kaui/charges/_form.html.erb +1 -1
- data/app/views/kaui/credits/_form.html.erb +2 -2
- data/app/views/kaui/invoices/show.html.erb +0 -1
- data/app/views/kaui/payments/_form.html.erb +1 -1
- data/app/views/kaui/payments/_payment_table.html.erb +2 -2
- data/app/views/kaui/subscriptions/_edit_form.html.erb +1 -1
- data/app/views/kaui/subscriptions/_form.html.erb +16 -4
- data/config/routes.rb +1 -1
- data/lib/kaui/version.rb +1 -1
- data/test/dummy/config/initializers/cookies_serializer.rb +1 -1
- data/test/functional/kaui/admin_tenants_controller_test.rb +2 -22
- data/test/functional/kaui/credits_controller_test.rb +3 -3
- data/test/functional/kaui/home_controller_test.rb +5 -5
- data/test/functional/kaui/subscriptions_controller_test.rb +1 -1
- data/test/killbill_test_helper.rb +6 -6
- data/test/unit/helpers/kaui/payment_method_helper_test.rb +17 -0
- data/test/unit/kaui/admin_tenant_test.rb +10 -47
- metadata +8 -6
@@ -5,7 +5,7 @@
|
|
5
5
|
<div class="form-group">
|
6
6
|
<%= f.label :amount, 'Amount', :class => 'col-sm-2 control-label' %>
|
7
7
|
<div class="col-sm-10">
|
8
|
-
<%= f.number_field :amount, :id => 'chargeback_amount', :class => 'form-control' %>
|
8
|
+
<%= f.number_field :amount, :step => :any, :id => 'chargeback_amount', :class => 'form-control' %>
|
9
9
|
<p class="help-block">Currency: <%= @chargeback.currency %></p>
|
10
10
|
</div>
|
11
11
|
</div>
|
@@ -15,7 +15,7 @@
|
|
15
15
|
<div class="form-group">
|
16
16
|
<%= f.label :amount, 'Amount', :class => 'col-sm-2 control-label' %>
|
17
17
|
<div class="col-sm-10">
|
18
|
-
<%= f.number_field :amount, :id => 'charge_amount', :class => 'form-control' %>
|
18
|
+
<%= f.number_field :amount, :step => :any, :id => 'charge_amount', :class => 'form-control' %>
|
19
19
|
<% if @invoice.present? %>
|
20
20
|
<p class="help-block">Currency: <%= @invoice.currency %></p>
|
21
21
|
<% end %>
|
@@ -2,9 +2,9 @@
|
|
2
2
|
<%= f.hidden_field :invoice_id %>
|
3
3
|
|
4
4
|
<div class="form-group">
|
5
|
-
<%= f.label :
|
5
|
+
<%= f.label :amount, 'Amount', :class => 'col-sm-2 control-label' %>
|
6
6
|
<div class="col-sm-10">
|
7
|
-
<%= f.number_field :
|
7
|
+
<%= f.number_field :amount, :step => :any, :id => 'amount', :class => 'form-control' %>
|
8
8
|
<% if @invoice.present? %>
|
9
9
|
<p class="help-block">Currency: <%= @invoice.currency %></p>
|
10
10
|
<% end %>
|
@@ -14,7 +14,7 @@
|
|
14
14
|
<div class="form-group">
|
15
15
|
<%= f.label :purchased_amount, 'Amount', :class => 'col-sm-3 control-label' %>
|
16
16
|
<div class="col-sm-9">
|
17
|
-
<%= f.number_field :purchased_amount, :id => 'payment_amount', :class => 'form-control' %>
|
17
|
+
<%= f.number_field :purchased_amount, :step => :any, :id => 'payment_amount', :class => 'form-control' %>
|
18
18
|
<p class="help-block">Currency: <%= @invoice.present? ? @invoice.currency : @account.currency %></p>
|
19
19
|
</div>
|
20
20
|
</div>
|
@@ -126,8 +126,8 @@
|
|
126
126
|
<% end %>
|
127
127
|
<% (transaction.properties || []).sort_by { |p| p.key }.each do |property| %>
|
128
128
|
<% next if property.value.blank? %>
|
129
|
-
<li><%= property.key
|
130
|
-
|
129
|
+
<li><strong><%= property.key %>:</strong>
|
130
|
+
<%= is_json?(property.value) ? "<pre>#{JSON.pretty_generate(JSON.parse(property.value))}</pre>".html_safe : property.value %></li>
|
131
131
|
<% end %>
|
132
132
|
</ul>
|
133
133
|
</td>
|
@@ -9,7 +9,7 @@
|
|
9
9
|
<div class="form-group">
|
10
10
|
<%= label_tag :price_override, 'Price Override', :class => 'col-sm-3 control-label' %>
|
11
11
|
<div class="col-sm-9">
|
12
|
-
<%= number_field_tag :price_override, nil, :class => 'form-control' %>
|
12
|
+
<%= number_field_tag :price_override, nil, :step => :any, :class => 'form-control' %>
|
13
13
|
</div>
|
14
14
|
</div>
|
15
15
|
<div class="form-group">
|
@@ -7,15 +7,27 @@
|
|
7
7
|
<%= hidden_field_tag :base_product_name, @base_product_name %>
|
8
8
|
<% elsif @subscription.product_category == 'BASE' %>
|
9
9
|
<div class="form-group">
|
10
|
-
<%= f.label :
|
10
|
+
<%= f.label :bundle_external_key, 'Bundle Key', :class => 'col-sm-2 control-label' %>
|
11
11
|
<div class="col-sm-10">
|
12
|
-
<%= f.text_field :
|
13
|
-
<div class="
|
12
|
+
<%= f.text_field :bundle_external_key, :class => 'form-control', :id => 'bundle_external_key' %>
|
13
|
+
<div class="subscription_bundle_external_key_invalid_msg text-danger">
|
14
14
|
Warning! External key already in use.
|
15
15
|
</div>
|
16
16
|
</div>
|
17
17
|
</div>
|
18
18
|
<% end %>
|
19
|
+
|
20
|
+
<div class="form-group">
|
21
|
+
<%= f.label :subscription_external_key, 'Subscription Key', :class => 'col-sm-2 control-label' %>
|
22
|
+
<div class="col-sm-10">
|
23
|
+
<%= f.text_field :external_key, :class => 'form-control', :id => 'subscription_external_key' %>
|
24
|
+
<div class="subscription_external_key_invalid_msg text-danger">
|
25
|
+
Warning! External key already in use.
|
26
|
+
</div>
|
27
|
+
</div>
|
28
|
+
</div>
|
29
|
+
|
30
|
+
|
19
31
|
<div class="form-group">
|
20
32
|
<%= label_tag :plan_name, 'Plan', :class => 'col-sm-2 control-label' %>
|
21
33
|
<div class="col-sm-10">
|
@@ -25,7 +37,7 @@
|
|
25
37
|
<div class="form-group">
|
26
38
|
<%= label_tag :price_override, 'Price Override', :class => 'col-sm-2 control-label' %>
|
27
39
|
<div class="col-sm-10">
|
28
|
-
<%= number_field_tag :price_override, nil, :class => 'form-control' %>
|
40
|
+
<%= number_field_tag :price_override, nil, :step => :any, :class => 'form-control' %>
|
29
41
|
</div>
|
30
42
|
</div>
|
31
43
|
<div class="form-group">
|
data/config/routes.rb
CHANGED
@@ -128,6 +128,7 @@ Kaui::Engine.routes.draw do
|
|
128
128
|
match '/:id/update_bcd' => 'subscriptions#update_bcd', :via => :put, :as => 'update_bcd'
|
129
129
|
match '/:id/reinstate' => 'subscriptions#reinstate', :via => :put, :as => 'reinstate'
|
130
130
|
match '/validate_external_key' => 'subscriptions#validate_external_key', :via => :get, :as => 'subscriptions_validate_external_key'
|
131
|
+
match '/validate_bundle_external_key' => 'subscriptions#validate_bundle_external_key', :via => :get, :as => 'subscriptions_validate_bundle_external_key'
|
131
132
|
end
|
132
133
|
resources :subscriptions, :only => [:new, :create, :show, :edit, :update, :destroy]
|
133
134
|
|
@@ -185,7 +186,6 @@ Kaui::Engine.routes.draw do
|
|
185
186
|
match '/add_allowed_user' => 'admin_tenants#add_allowed_user', :via => :put, :as => 'add_allowed_user'
|
186
187
|
match '/allowed_users' => 'admin_tenants#allowed_users', :via => :get, :as => 'admin_tenant_allowed_users'
|
187
188
|
match '/catalog_by_effective_date' => 'admin_tenants#catalog_by_effective_date', :via => :get, :as => 'catalog_by_effective_date'
|
188
|
-
match '/suggest_plugin_name' => 'admin_tenants#suggest_plugin_name', :via => :get, :as => 'suggest_plugin_name'
|
189
189
|
match '/switch' => 'admin_tenants#switch_tenant', :via => :get, :as => 'switch_tenant'
|
190
190
|
match '/:id/download_catalog' => 'admin_tenants#download_catalog_xml', :via => :get, :as => 'download_catalog_xml'
|
191
191
|
end
|
data/lib/kaui/version.rb
CHANGED
@@ -94,7 +94,7 @@ class Kaui::AdminTenantsControllerTest < Kaui::FunctionalTestHelper
|
|
94
94
|
stripe_yml.each { |k, v| stripe_yml[k] = v.to_s }
|
95
95
|
post :upload_plugin_config, :id => tenant.id, :plugin_name => 'killbill-stripe', :plugin_key => 'stripe', :plugin_type => 'ruby', :plugin_properties => stripe_yml
|
96
96
|
|
97
|
-
assert_redirected_to admin_tenant_path(tenant.id)
|
97
|
+
assert_redirected_to admin_tenant_path(tenant.id, :active_tab => 'PluginConfig')
|
98
98
|
assert_equal 'Config for plugin was successfully uploaded', flash[:notice]
|
99
99
|
end
|
100
100
|
|
@@ -284,26 +284,6 @@ class Kaui::AdminTenantsControllerTest < Kaui::FunctionalTestHelper
|
|
284
284
|
|
285
285
|
end
|
286
286
|
|
287
|
-
test 'should suggest a plugin name' do
|
288
|
-
plugin_anchor = "'<a id=\"suggested\" data-plugin-name=\"killbill-paypal-express\" data-plugin-key=\"paypal_express\" data-plugin-type=\"ruby\" href=\"#\">killbill-paypal-express</a>'"
|
289
|
-
|
290
|
-
# Similar plugin already installed test will run, if there are plugin installed
|
291
|
-
installed_plugins = installed_plugins()
|
292
|
-
unless installed_plugins.blank?
|
293
|
-
installed_plugins.each do |plugin|
|
294
|
-
installed_plugin_anchor = "'<a id=\"suggested\" data-plugin-name=\"#{plugin[:plugin_name]}\" data-plugin-key=\"#{plugin[:plugin_key]}\".*href=\"#\">#{plugin[:plugin_name]}</a>'"
|
295
|
-
|
296
|
-
get :suggest_plugin_name, :plugin_name => plugin[:plugin_name][0, plugin[:plugin_name].length - 1]
|
297
|
-
assert_response :success
|
298
|
-
assert_match /Similar plugin already installed: #{installed_plugin_anchor}/, JSON[@response.body]['suggestion']
|
299
|
-
end
|
300
|
-
end
|
301
|
-
|
302
|
-
get :suggest_plugin_name, :plugin_name => 'pypl'
|
303
|
-
assert_response :success
|
304
|
-
assert_equal "Did you mean #{plugin_anchor}?", JSON[@response.body]['suggestion']
|
305
|
-
end
|
306
|
-
|
307
287
|
test 'should switch tenant' do
|
308
288
|
other_tenant = setup_and_create_test_tenant(1)
|
309
289
|
other_tenant_kaui = Kaui::Tenant.find_by_kb_tenant_id(other_tenant.tenant_id)
|
@@ -362,7 +342,7 @@ class Kaui::AdminTenantsControllerTest < Kaui::FunctionalTestHelper
|
|
362
342
|
next if plugin.plugin_key.nil? || plugin.version.nil?
|
363
343
|
next if installed_plugins.any? { |p| p[:plugin_name].eql?(plugin.plugin_name) }
|
364
344
|
installed_plugins << {
|
365
|
-
plugin_key:
|
345
|
+
plugin_key: plugin.plugin_key,
|
366
346
|
plugin_name: plugin.plugin_name
|
367
347
|
}
|
368
348
|
end
|
@@ -25,7 +25,7 @@ class Kaui::CreditsControllerTest < Kaui::FunctionalTestHelper
|
|
25
25
|
:account_id => @account.account_id,
|
26
26
|
:credit => {
|
27
27
|
:invoice_id => invoice_id,
|
28
|
-
:
|
28
|
+
:amount => 5.34
|
29
29
|
}
|
30
30
|
assert_redirected_to account_path(@account.account_id)
|
31
31
|
assert_equal "Error while communicating with the Kill Bill server: Error 404: Object id=#{invoice_id} type=INVOICE doesn't exist!", flash[:error]
|
@@ -35,7 +35,7 @@ class Kaui::CreditsControllerTest < Kaui::FunctionalTestHelper
|
|
35
35
|
post :create,
|
36
36
|
:account_id => @account.account_id,
|
37
37
|
:credit => {
|
38
|
-
:
|
38
|
+
:amount => 5.34
|
39
39
|
}
|
40
40
|
assert_redirected_to account_path(@account.account_id)
|
41
41
|
assert_equal 'Credit was successfully created', flash[:notice]
|
@@ -46,7 +46,7 @@ class Kaui::CreditsControllerTest < Kaui::FunctionalTestHelper
|
|
46
46
|
:account_id => @account.account_id,
|
47
47
|
:credit => {
|
48
48
|
:invoice_id => @invoice_item.invoice_id,
|
49
|
-
:
|
49
|
+
:amount => 5.34
|
50
50
|
}
|
51
51
|
assert_redirected_to account_invoice_path(@account.account_id, @invoice_item.invoice_id)
|
52
52
|
assert_equal 'Credit was successfully created', flash[:notice]
|
@@ -188,7 +188,7 @@ class Kaui::HomeControllerTest < Kaui::FunctionalTestHelper
|
|
188
188
|
dummy_uuid = SecureRandom.uuid.to_s
|
189
189
|
credit = create_credit
|
190
190
|
# search by ID
|
191
|
-
get :search, :q => query_builder('CREDIT',credit.
|
191
|
+
get :search, :q => query_builder('CREDIT',credit.invoice_item_id, 'ID')
|
192
192
|
assert_redirected_to account_invoice_path(credit.account_id, credit.invoice_id)
|
193
193
|
|
194
194
|
# search by ID and fails
|
@@ -202,11 +202,11 @@ class Kaui::HomeControllerTest < Kaui::FunctionalTestHelper
|
|
202
202
|
assert_equal "\"CREDIT\": Search by \"EXTERNAL KEY\" is not supported.", flash[:error]
|
203
203
|
|
204
204
|
# search by BLANK only first
|
205
|
-
get :search, :q => query_builder('CREDIT',credit.
|
205
|
+
get :search, :q => query_builder('CREDIT',credit.invoice_item_id, nil, '1')
|
206
206
|
assert_redirected_to account_invoice_path(credit.account_id, credit.invoice_id)
|
207
207
|
|
208
208
|
# search by BLANK
|
209
|
-
get :search, :q => query_builder('CREDIT',credit.
|
209
|
+
get :search, :q => query_builder('CREDIT',credit.invoice_item_id)
|
210
210
|
assert_redirected_to account_invoice_path(credit.account_id, credit.invoice_id)
|
211
211
|
|
212
212
|
# search by BLANK and fails
|
@@ -376,9 +376,9 @@ class Kaui::HomeControllerTest < Kaui::FunctionalTestHelper
|
|
376
376
|
end
|
377
377
|
|
378
378
|
def create_credit
|
379
|
-
credit = KillBillClient::Model::Credit.new(:invoice_id => nil, :account_id => @account.account_id, :
|
379
|
+
credit = KillBillClient::Model::Credit.new(:invoice_id => nil, :account_id => @account.account_id, :amount => 2.22)
|
380
380
|
credit = credit.create(true, 'kaui search test', nil, nil, build_options(@tenant, USERNAME, PASSWORD))
|
381
|
-
credit
|
381
|
+
credit.first
|
382
382
|
end
|
383
383
|
|
384
384
|
def create_custom_field
|
@@ -96,7 +96,7 @@ class Kaui::SubscriptionsControllerTest < Kaui::FunctionalTestHelper
|
|
96
96
|
|
97
97
|
post :update, :id => @bundle.subscriptions.first.subscription_id, :plan_name => 'not-exists'
|
98
98
|
assert_redirected_to edit_subscription_path(@bundle.subscriptions.first.subscription_id)
|
99
|
-
assert_equal "Error while changing subscription: Error 400: Could not find
|
99
|
+
assert_equal "Error while changing subscription: Error 400: Could not find any plans named 'not-exists'", flash[:error]
|
100
100
|
end
|
101
101
|
|
102
102
|
test 'should update' do
|
@@ -28,7 +28,7 @@ module Kaui
|
|
28
28
|
@bundle = create_bundle(@account, @tenant)
|
29
29
|
@invoice_item = create_charge(@account, @tenant)
|
30
30
|
@paid_invoice_item = create_charge(@account, @tenant, true)
|
31
|
-
@bundle_invoice = @account.invoices(
|
31
|
+
@bundle_invoice = @account.invoices(build_options(@tenant)).first
|
32
32
|
@payment_method = create_payment_method(true, @account, @tenant)
|
33
33
|
@payment = create_payment(@paid_invoice_item, @account, @tenant)
|
34
34
|
|
@@ -159,15 +159,15 @@ module Kaui
|
|
159
159
|
tenant = create_tenant(user, reason, comment) if tenant.nil?
|
160
160
|
account = create_account(tenant, username, password, user, reason, comment) if account.nil?
|
161
161
|
|
162
|
-
credit = KillBillClient::Model::Credit.new(:invoice_id => invoice_id, :account_id => account.account_id, :
|
163
|
-
credit = credit.create(true, user, reason, comment, build_options(tenant, username, password))
|
162
|
+
credit = KillBillClient::Model::Credit.new(:invoice_id => invoice_id, :account_id => account.account_id, :amount => 23.22)
|
163
|
+
credit = credit.create(true, user, reason, comment, build_options(tenant, username, password)).first
|
164
164
|
|
165
|
-
invoice = KillBillClient::Model::Invoice.find_by_id(credit.invoice_id,
|
166
|
-
invoice.items.find { |ii| ii.amount == -credit.
|
165
|
+
invoice = KillBillClient::Model::Invoice.find_by_id(credit.invoice_id, 'NONE', build_options(tenant, username, password))
|
166
|
+
invoice.items.find { |ii| ii.amount == -credit.amount }
|
167
167
|
end
|
168
168
|
|
169
169
|
def commit_invoice(invoice_id, tenant, username = USERNAME, password = PASSWORD, user = 'Kaui test', reason = nil, comment = nil)
|
170
|
-
invoice = KillBillClient::Model::Invoice.find_by_id(invoice_id,
|
170
|
+
invoice = KillBillClient::Model::Invoice.find_by_id(invoice_id, 'NONE', build_options(tenant, username, password))
|
171
171
|
invoice.commit(user, reason, comment, build_options(tenant, username, password))
|
172
172
|
end
|
173
173
|
|
@@ -0,0 +1,17 @@
|
|
1
|
+
require 'test_helper'
|
2
|
+
|
3
|
+
class PaymentMethodHelperTest < ActionView::TestCase
|
4
|
+
|
5
|
+
include Kaui::PaymentMethodHelper
|
6
|
+
|
7
|
+
test 'is_json?' do
|
8
|
+
assert !is_json?(5)
|
9
|
+
assert !is_json?('true')
|
10
|
+
assert !is_json?(false)
|
11
|
+
assert !is_json?("")
|
12
|
+
assert !is_json?(nil)
|
13
|
+
assert is_json?('[1, 2, 3]')
|
14
|
+
assert is_json?('{"value": "New", "onclick": "CreateNewDoc()"}')
|
15
|
+
assert !is_json?('{"value" => "New", "onclick": "CreateNewDoc()"}')
|
16
|
+
end
|
17
|
+
end
|
@@ -62,40 +62,6 @@ class Kaui::AdminTenantTest < ActiveSupport::TestCase
|
|
62
62
|
assert_split(splitted)
|
63
63
|
end
|
64
64
|
|
65
|
-
test 'can do a fuzzy match of a plugin to suggest a plugin' do
|
66
|
-
plugins_info = plugins_repo
|
67
|
-
adminTenantController = Kaui::AdminTenantsController.new
|
68
|
-
|
69
|
-
%w(killbill-paypal express paypal pay).each do |plugin_name|
|
70
|
-
found_plugin, weights = adminTenantController.send(:fuzzy_match, plugin_name, plugins_info)
|
71
|
-
assert_nil(found_plugin)
|
72
|
-
assert_equal weights[0][:plugin_name], 'killbill-paypal-express'
|
73
|
-
end
|
74
|
-
|
75
|
-
plugin_name = 'email'
|
76
|
-
found_plugin, weights = adminTenantController.send(:fuzzy_match, plugin_name, plugins_info)
|
77
|
-
assert_nil(found_plugin)
|
78
|
-
assert_equal weights[0][:plugin_name], 'killbill-email-notifications'
|
79
|
-
|
80
|
-
%w(first firstdata firstdata_e4).each do |plugin_name|
|
81
|
-
found_plugin, weights = adminTenantController.send(:fuzzy_match, plugin_name, plugins_info)
|
82
|
-
assert_nil(found_plugin)
|
83
|
-
assert_equal weights[0][:plugin_name], 'killbill-firstdata-e4'
|
84
|
-
end
|
85
|
-
|
86
|
-
%w(braintree brain).each do |plugin_name|
|
87
|
-
found_plugin, weights = adminTenantController.send(:fuzzy_match, plugin_name, plugins_info)
|
88
|
-
assert_nil(found_plugin)
|
89
|
-
assert_equal weights[0][:plugin_name], 'killbill-braintree_blue'
|
90
|
-
end
|
91
|
-
|
92
|
-
# if found weights should be empty
|
93
|
-
plugin_name = 'avatax'
|
94
|
-
found_plugin, weights = adminTenantController.send(:fuzzy_match, plugin_name, plugins_info)
|
95
|
-
assert_equal weights.size, 0
|
96
|
-
assert_equal found_plugin[:plugin_name], 'killbill-avatax'
|
97
|
-
end
|
98
|
-
|
99
65
|
test 'should fetch proprietary plugin config' do
|
100
66
|
tenant = create_tenant()
|
101
67
|
assert_not_nil(tenant)
|
@@ -106,12 +72,11 @@ class Kaui::AdminTenantTest < ActiveSupport::TestCase
|
|
106
72
|
plugin_config = 'key=value'
|
107
73
|
Kaui::AdminTenant.upload_tenant_plugin_config(plugin_name, plugin_config, options[:username], nil, nil, options)
|
108
74
|
|
109
|
-
plugins_config = Kaui::AdminTenant.get_tenant_plugin_config(
|
75
|
+
plugins_config = Kaui::AdminTenant.get_tenant_plugin_config(options)
|
110
76
|
assert_not_nil(plugins_config)
|
111
77
|
|
112
|
-
|
113
|
-
assert_equal
|
114
|
-
assert_equal 'key=value|_raw=key=value', plugin_info[1].gsub('raw_config=','')
|
78
|
+
assert_equal plugin_name, plugins_config.keys.first
|
79
|
+
assert_equal 'key=value', plugins_config[plugin_name]
|
115
80
|
end
|
116
81
|
|
117
82
|
test 'should fetch plugin config' do
|
@@ -130,15 +95,13 @@ class Kaui::AdminTenantTest < ActiveSupport::TestCase
|
|
130
95
|
plugin_config = Kaui::AdminTenant.format_plugin_config(plugin_key, 'ruby', plugin_properties)
|
131
96
|
Kaui::AdminTenant.upload_tenant_plugin_config(plugin_name, plugin_config, options[:username], nil, nil, options)
|
132
97
|
|
133
|
-
plugins_config = Kaui::AdminTenant.get_tenant_plugin_config(
|
134
|
-
'artifact_id' => 'paypal-express-plugin'} }, options)
|
98
|
+
plugins_config = Kaui::AdminTenant.get_tenant_plugin_config(options)
|
135
99
|
assert_not_nil(plugins_config)
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
assert_equal plugin_properties[:
|
140
|
-
assert_equal plugin_properties[:
|
141
|
-
assert_equal plugin_properties[:password], response_plugin_properties[2].split('=')[1]
|
100
|
+
assert_equal plugin_name, plugins_config.keys.first
|
101
|
+
response_plugin_properties = plugins_config[plugin_name].split
|
102
|
+
assert_equal plugin_properties[:signature], response_plugin_properties[3]
|
103
|
+
assert_equal plugin_properties[:login], response_plugin_properties[5]
|
104
|
+
assert_equal plugin_properties[:password], response_plugin_properties[7]
|
142
105
|
end
|
143
106
|
|
144
107
|
private
|
@@ -166,4 +129,4 @@ class Kaui::AdminTenantTest < ActiveSupport::TestCase
|
|
166
129
|
assert_equal 'to', splitted[4]
|
167
130
|
assert_equal 'split', splitted[5]
|
168
131
|
end
|
169
|
-
end
|
132
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: kaui
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 2.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Killbill core team
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2020-07-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -128,14 +128,14 @@ dependencies:
|
|
128
128
|
requirements:
|
129
129
|
- - "~>"
|
130
130
|
- !ruby/object:Gem::Version
|
131
|
-
version: '2
|
131
|
+
version: '3.2'
|
132
132
|
type: :runtime
|
133
133
|
prerelease: false
|
134
134
|
version_requirements: !ruby/object:Gem::Requirement
|
135
135
|
requirements:
|
136
136
|
- - "~>"
|
137
137
|
- !ruby/object:Gem::Version
|
138
|
-
version: '2
|
138
|
+
version: '3.2'
|
139
139
|
- !ruby/object:Gem::Dependency
|
140
140
|
name: devise
|
141
141
|
requirement: !ruby/object:Gem::Requirement
|
@@ -198,14 +198,14 @@ dependencies:
|
|
198
198
|
requirements:
|
199
199
|
- - "~>"
|
200
200
|
- !ruby/object:Gem::Version
|
201
|
-
version: '
|
201
|
+
version: '2.0'
|
202
202
|
type: :runtime
|
203
203
|
prerelease: false
|
204
204
|
version_requirements: !ruby/object:Gem::Requirement
|
205
205
|
requirements:
|
206
206
|
- - "~>"
|
207
207
|
- !ruby/object:Gem::Version
|
208
|
-
version: '
|
208
|
+
version: '2.0'
|
209
209
|
- !ruby/object:Gem::Dependency
|
210
210
|
name: jquery-ui-rails
|
211
211
|
requirement: !ruby/object:Gem::Requirement
|
@@ -844,6 +844,7 @@ files:
|
|
844
844
|
- test/test_helper.rb
|
845
845
|
- test/unit/helpers/kaui/admin_allowed_users_helper_test.rb
|
846
846
|
- test/unit/helpers/kaui/admin_tenants_helper_test.rb
|
847
|
+
- test/unit/helpers/kaui/payment_method_helper_test.rb
|
847
848
|
- test/unit/helpers/kaui/tenants_helper_test.rb
|
848
849
|
- test/unit/helpers/kaui/uuid_helper_test.rb
|
849
850
|
- test/unit/kaui/account_email_test.rb
|
@@ -905,6 +906,7 @@ test_files:
|
|
905
906
|
- test/unit/kaui/tenant_test.rb
|
906
907
|
- test/unit/kaui/money_helper_test.rb
|
907
908
|
- test/unit/helpers/kaui/tenants_helper_test.rb
|
909
|
+
- test/unit/helpers/kaui/payment_method_helper_test.rb
|
908
910
|
- test/unit/helpers/kaui/admin_tenants_helper_test.rb
|
909
911
|
- test/unit/helpers/kaui/admin_allowed_users_helper_test.rb
|
910
912
|
- test/unit/helpers/kaui/uuid_helper_test.rb
|