marty 2.3.15 → 2.4.0
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 +4 -4
- data/Gemfile.lock +2 -2
- data/app/components/marty/api_auth_view.rb +27 -4
- data/app/components/marty/api_config_view.rb +27 -4
- data/app/components/marty/extras/layout.rb +4 -7
- data/app/components/marty/form.rb +8 -0
- data/app/components/marty/grid.rb +45 -19
- data/app/components/marty/main_auth_app.rb +12 -11
- data/app/controllers/marty/rpc_controller.rb +63 -150
- data/app/models/marty/api_auth.rb +86 -14
- data/app/models/marty/api_config.rb +11 -6
- data/app/models/marty/delorean_rule.rb +3 -2
- data/config/routes.rb +1 -1
- data/db/migrate/501_add_api_class_to_marty_api_config.rb +6 -0
- data/db/migrate/502_add_parameters_to_marty_api_auth.rb +5 -0
- data/lib/marty/util.rb +0 -15
- data/lib/marty/version.rb +1 -1
- data/other/marty/api/base.rb +207 -0
- data/other/marty/diagnostic/aws/ec2_instance.rb +12 -87
- data/other/marty/diagnostic/environment_variables.rb +1 -1
- data/spec/controllers/job_controller_spec.rb +1 -1
- data/spec/dummy/app/components/gemini/xyz_rule_view.rb +1 -0
- data/spec/dummy/config/application.rb +1 -0
- data/spec/features/enum_spec.rb +35 -100
- data/spec/features/log_view_spec.rb +5 -5
- data/spec/features/rule_spec.rb +30 -30
- data/spec/features/user_view_spec.rb +0 -2
- data/spec/lib/logger_spec.rb +1 -1
- data/spec/models/api_auth_spec.rb +33 -12
- data/spec/models/event_spec.rb +1 -1
- data/spec/models/promise_spec.rb +1 -1
- data/spec/models/user_spec.rb +6 -6
- data/spec/spec_helper.rb +69 -9
- data/spec/support/{shared_connection_db_helpers.rb → clean_db_helpers.rb} +2 -2
- data/spec/support/delayed_job_helpers.rb +1 -1
- data/spec/support/{users.rb → integration_helpers.rb} +9 -11
- data/spec/support/{setup.rb → spec_setup.rb} +6 -19
- data/spec/support/user_helpers.rb +12 -0
- metadata +10 -21
- data/spec/dummy/app/assets/client/application.css +0 -13
- data/spec/dummy/app/assets/client/application.js +0 -15
- data/spec/support/chromedriver.rb +0 -41
- data/spec/support/components/netzke_combobox.rb +0 -57
- data/spec/support/components/netzke_grid.rb +0 -356
- data/spec/support/custom_matchers.rb +0 -18
- data/spec/support/custom_selectors.rb +0 -49
- data/spec/support/download_helper.rb +0 -52
- data/spec/support/helper.rb +0 -20
- data/spec/support/netzke.rb +0 -306
- data/spec/support/performance_helper.rb +0 -26
- data/spec/support/post_run_logger.rb +0 -32
- data/spec/support/shared_connection.rb +0 -31
- data/spec/support/structure_compare.rb +0 -62
- data/spec/support/suite.rb +0 -27
@@ -13,7 +13,7 @@ module Marty::Diagnostic; class EnvironmentVariables < Base
|
|
13
13
|
'SECRET_KEY_BASE']
|
14
14
|
|
15
15
|
to_block = (Marty::Config['DIAG_ENV_BLOCK_IF_INCL'] || []).map(&:upcase) + [
|
16
|
-
'PASSWORD', 'DEBUG']
|
16
|
+
'ACCESS', 'SECRET', 'PASSWORD', 'DEBUG']
|
17
17
|
|
18
18
|
to_delete.each{|k| env.delete(k)}
|
19
19
|
|
@@ -15,7 +15,7 @@ describe Marty::JobController, slow: true do
|
|
15
15
|
|
16
16
|
# Needed here because shutting transactional fixtures off
|
17
17
|
# means we lose the globally set uesr
|
18
|
-
Mcfly.whodunnit = system_user
|
18
|
+
Mcfly.whodunnit = UserHelpers.system_user
|
19
19
|
|
20
20
|
Marty::Script.load_script_bodies(promise_bodies, Date.today)
|
21
21
|
|
data/spec/features/enum_spec.rb
CHANGED
@@ -14,27 +14,6 @@ feature 'test netzke + pg_enum compatibility', js: true do
|
|
14
14
|
end
|
15
15
|
|
16
16
|
it 'shows netzke grid combobox works w pg_enums' do
|
17
|
-
|
18
|
-
lp_grid = netzke_find('loan_program_view')
|
19
|
-
@amort_combo = netzke_find('amortization_type__name', 'combobox')
|
20
|
-
@mortgage_combo = netzke_find('mortgage_type__name', 'combobox')
|
21
|
-
@streamline_combo = netzke_find('streamline_type__name', 'combobox')
|
22
|
-
@state_combo = netzke_find('enum_state', 'combobox')
|
23
|
-
|
24
|
-
def setup_enum_form(stateVal)
|
25
|
-
@amort_combo.click
|
26
|
-
@amort_combo.select_values('Fixed')
|
27
|
-
|
28
|
-
@mortgage_combo.click
|
29
|
-
@mortgage_combo.select_values('FHA')
|
30
|
-
|
31
|
-
@streamline_combo.click
|
32
|
-
@streamline_combo.select_values('DURP')
|
33
|
-
|
34
|
-
@state_combo.click
|
35
|
-
@state_combo.select_values(stateVal)
|
36
|
-
end
|
37
|
-
|
38
17
|
log_in_as('dev1')
|
39
18
|
|
40
19
|
by 'navigating to loan program screen' do
|
@@ -42,6 +21,11 @@ feature 'test netzke + pg_enum compatibility', js: true do
|
|
42
21
|
press('Loan Programs')
|
43
22
|
end
|
44
23
|
|
24
|
+
lp_grid = netzke_find('loan_program_view')
|
25
|
+
amort_combo = netzke_find('amortization_type__name', 'combobox')
|
26
|
+
mortgage_combo = netzke_find('mortgage_type__name', 'combobox')
|
27
|
+
streamline_combo = netzke_find('streamline_type__name', 'combobox')
|
28
|
+
state_combo = netzke_find('enum_state', 'combobox')
|
45
29
|
|
46
30
|
and_by 'bring up new window' do
|
47
31
|
press('Add')
|
@@ -51,14 +35,14 @@ feature 'test netzke + pg_enum compatibility', js: true do
|
|
51
35
|
within(:gridpanel, 'add_window', match: :first) do
|
52
36
|
fill_in("Name", with: 'a_l_p')
|
53
37
|
|
54
|
-
|
55
|
-
|
38
|
+
amort_combo.click
|
39
|
+
amort_combo.select_values('Fixed')
|
56
40
|
|
57
|
-
|
58
|
-
|
41
|
+
mortgage_combo.click
|
42
|
+
mortgage_combo.select_values('FHA')
|
59
43
|
|
60
|
-
|
61
|
-
|
44
|
+
streamline_combo.click
|
45
|
+
streamline_combo.select_values('DURP')
|
62
46
|
|
63
47
|
press('OK')
|
64
48
|
end
|
@@ -74,7 +58,18 @@ feature 'test netzke + pg_enum compatibility', js: true do
|
|
74
58
|
and_by 'fill form w enum value & duplicated name (error), then fix' do
|
75
59
|
within(:gridpanel, 'add_window', match: :first) do
|
76
60
|
fill_in("Name", with: 'a_l_p')
|
77
|
-
|
61
|
+
amort_combo.click
|
62
|
+
amort_combo.select_values('Fixed')
|
63
|
+
|
64
|
+
mortgage_combo.click
|
65
|
+
mortgage_combo.select_values('FHA')
|
66
|
+
|
67
|
+
streamline_combo.click
|
68
|
+
streamline_combo.select_values('DURP')
|
69
|
+
|
70
|
+
state_combo.click
|
71
|
+
state_combo.select_values('CA')
|
72
|
+
|
78
73
|
press('OK')
|
79
74
|
|
80
75
|
expect(find(:msg)).to have_content 'Name - record must be unique'
|
@@ -105,7 +100,18 @@ feature 'test netzke + pg_enum compatibility', js: true do
|
|
105
100
|
and_by 'fill form w --- for enum value' do
|
106
101
|
within(:gridpanel, 'add_window', match: :first) do
|
107
102
|
fill_in("Name", with: 'a_l_p')
|
108
|
-
|
103
|
+
amort_combo.click
|
104
|
+
amort_combo.select_values('Fixed')
|
105
|
+
|
106
|
+
mortgage_combo.click
|
107
|
+
mortgage_combo.select_values('FHA')
|
108
|
+
|
109
|
+
streamline_combo.click
|
110
|
+
streamline_combo.select_values('DURP')
|
111
|
+
|
112
|
+
state_combo.click
|
113
|
+
state_combo.select_values('---')
|
114
|
+
|
109
115
|
press('OK')
|
110
116
|
end
|
111
117
|
|
@@ -115,76 +121,5 @@ feature 'test netzke + pg_enum compatibility', js: true do
|
|
115
121
|
expect(lp_grid.get_row_vals(1)).to netzke_include({enum_state: nil})
|
116
122
|
end
|
117
123
|
end
|
118
|
-
|
119
|
-
and_by 'delete leftover rows' do
|
120
|
-
lp_grid.select_row(1)
|
121
|
-
press('Delete')
|
122
|
-
press('Yes')
|
123
|
-
wait_for_ajax
|
124
|
-
lp_grid.select_row(1)
|
125
|
-
press('Delete')
|
126
|
-
press('Yes')
|
127
|
-
wait_for_ajax
|
128
|
-
expect(lp_grid.row_count).to eq(0)
|
129
|
-
end
|
130
|
-
|
131
|
-
and_by "bring up new window" do
|
132
|
-
press("Add")
|
133
|
-
end
|
134
|
-
|
135
|
-
and_by "fill form with state_enum DC" do
|
136
|
-
within(:gridpanel, "add_window", match: :first) do
|
137
|
-
fill_in("Name", with: "DC Row")
|
138
|
-
setup_enum_form("DC")
|
139
|
-
press("OK")
|
140
|
-
end
|
141
|
-
end
|
142
|
-
|
143
|
-
and_by "bring up new window" do
|
144
|
-
press("Add")
|
145
|
-
end
|
146
|
-
|
147
|
-
and_by "fill form with state_enum AS" do
|
148
|
-
within(:gridpanel, "add_window", match: :first) do
|
149
|
-
fill_in("Name", with: "AS Row")
|
150
|
-
setup_enum_form("AS")
|
151
|
-
press("OK")
|
152
|
-
end
|
153
|
-
end
|
154
|
-
|
155
|
-
and_by "bring up new window" do
|
156
|
-
press("Add")
|
157
|
-
end
|
158
|
-
|
159
|
-
and_by "fill form with state_enum WA" do
|
160
|
-
within(:gridpanel, "add_window", match: :first) do
|
161
|
-
fill_in("Name", with: "WA Row")
|
162
|
-
setup_enum_form("WA")
|
163
|
-
press("OK")
|
164
|
-
end
|
165
|
-
end
|
166
|
-
|
167
|
-
and_by "bring up new window" do
|
168
|
-
press("Add")
|
169
|
-
end
|
170
|
-
|
171
|
-
and_by "fill form with state_enum AZ" do
|
172
|
-
within(:gridpanel, "add_window", match: :first) do
|
173
|
-
fill_in("Name", with: "AZ Row")
|
174
|
-
setup_enum_form("AZ")
|
175
|
-
press("OK")
|
176
|
-
end
|
177
|
-
end
|
178
|
-
|
179
|
-
and_by "filter form by state_enum ASCENDING" do
|
180
|
-
press("Enum state")
|
181
|
-
expect(lp_grid.get_col_vals(:enum_state)).to eq(["AS","AZ","DC","WA"])
|
182
|
-
end
|
183
|
-
|
184
|
-
and_by "filter form by state_enum DESCENDING" do
|
185
|
-
press("Enum state")
|
186
|
-
expect(lp_grid.get_col_vals(:enum_state)).to eq(["WA","DC","AZ","AS"])
|
187
|
-
end
|
188
|
-
|
189
124
|
end
|
190
125
|
end
|
@@ -45,7 +45,7 @@ feature 'logger view', js: true, capybara: true do
|
|
45
45
|
press('System')
|
46
46
|
show_submenu('Log Maintenance')
|
47
47
|
press('View Log')
|
48
|
-
|
48
|
+
wait_for_ready
|
49
49
|
|
50
50
|
exp_types = ["fatal", "error", "info", "debug", "warn"]
|
51
51
|
exp_messages = ["fatal message", "error message",
|
@@ -72,11 +72,11 @@ feature 'logger view', js: true, capybara: true do
|
|
72
72
|
wait_for_ajax
|
73
73
|
cnt = logview.row_count()
|
74
74
|
expect(cnt).to eq(exp_count)
|
75
|
-
types = logview.
|
76
|
-
messages = logview.
|
77
|
-
details = logview.
|
75
|
+
types = logview.col_values('message_type', cnt, 0)
|
76
|
+
messages = logview.col_values('message', cnt, 0)
|
77
|
+
details = logview.col_values('details', cnt, 0).
|
78
78
|
map { |d| CGI.unescapeHTML(d) }
|
79
|
-
ts = logview.
|
79
|
+
ts = logview.col_values('timestamp_custom', cnt, 0)
|
80
80
|
expect(ts).to eq(@ts.slice(0,exp_count))
|
81
81
|
expect(types).to eq(exp_types.slice(0,exp_count))
|
82
82
|
expect(messages).to eq(exp_messages.slice(0,exp_count))
|
data/spec/features/rule_spec.rb
CHANGED
@@ -200,7 +200,7 @@ feature 'rule view', js: true do
|
|
200
200
|
exp = "Computed - Error in rule 'abc' field 'computed_guards': Syntax error on line 1"
|
201
201
|
expect(page).to have_content(exp)
|
202
202
|
sleep 2 # sleep needed for message to clear, otherwise failing tests could
|
203
|
-
|
203
|
+
# pass due to prior messages
|
204
204
|
|
205
205
|
# lhs is not identifier - BaseRuleView#simple_to_has will raise
|
206
206
|
fill_in(:computed_guards, with: '0sadf = 123j')
|
@@ -307,7 +307,7 @@ computed_value = if paramb
|
|
307
307
|
then param1 / (grid1_grid_result||1)
|
308
308
|
else (grid2_grid_result||1) / param1
|
309
309
|
EOL
|
310
|
-
names = mrv.
|
310
|
+
names = mrv.col_values(:name, 9, 0)
|
311
311
|
idx = names.index{|n|n=='Rule3'}+1
|
312
312
|
mrv.select_row(idx)
|
313
313
|
press("Edit")
|
@@ -326,9 +326,9 @@ EOL
|
|
326
326
|
go_to_xyz_rules
|
327
327
|
xrv = netzke_find("xyz_rule_view")
|
328
328
|
expect(page).to have_content("Rule type")
|
329
|
-
expect(xrv.
|
330
|
-
|
331
|
-
|
329
|
+
expect(xrv.col_values(:name, 5, 0)).to eq(["ZRule1", "ZRule2",
|
330
|
+
"ZRule3", "ZRule4",
|
331
|
+
"ZRule5"])
|
332
332
|
xrv.select_row(1)
|
333
333
|
press("Edit")
|
334
334
|
fill_in("Range Guard 1", with: "[100,200)")
|
@@ -359,37 +359,37 @@ EOL
|
|
359
359
|
"bv"=>"base_value"}}
|
360
360
|
|
361
361
|
expect(r.first.as_json).to include(exp)
|
362
|
-
expect(xrv.
|
363
|
-
|
362
|
+
expect(xrv.col_values(:g_string, 8, 0)).to eq(["aaa", "bbb", "ccc", "ddd",
|
363
|
+
"eee", "eee", "eee", "eee"])
|
364
364
|
click_column(xrv, "String list Guard")
|
365
|
-
expect(xrv.
|
366
|
-
|
365
|
+
expect(xrv.col_values(:g_string, 8, 0)).to eq(["eee", "eee", "eee", "eee",
|
366
|
+
"ddd", "ccc", "bbb", "aaa"])
|
367
367
|
column_filter(xrv, "String list Guard", "eee")
|
368
368
|
rc = xrv.row_count
|
369
|
-
expect(xrv.
|
369
|
+
expect(xrv.col_values(:g_string,rc,0)).to eq(["eee", "eee", "eee", "eee"])
|
370
370
|
column_filter_toggle(xrv, "String list Guard")
|
371
371
|
rc = xrv.row_count
|
372
|
-
expect(xrv.
|
373
|
-
|
372
|
+
expect(xrv.col_values(:g_string,rc,0)).to eq(["eee", "eee", "eee", "eee",
|
373
|
+
"ddd", "ccc", "bbb", "aaa"])
|
374
374
|
column_filter(xrv, "Grids", "Grid1")
|
375
375
|
rc = xrv.row_count
|
376
|
-
|
377
|
-
expect(xrv.
|
378
|
-
|
376
|
+
# netzke reports jsonb as string
|
377
|
+
expect(xrv.col_values(:grids,rc,0)).to eq([%Q({"grid1":"DataGrid1"}),
|
378
|
+
%Q({"grid1":"DataGrid1"})])
|
379
379
|
column_filter_toggle(xrv, "Grids")
|
380
380
|
rc = xrv.row_count
|
381
|
-
expect(xrv.
|
382
|
-
|
383
|
-
|
384
|
-
|
385
|
-
|
386
|
-
|
387
|
-
|
388
|
-
|
381
|
+
expect(xrv.col_values(:grids,rc,0)).to eq([%Q({"grid1":"DataGrid3"}),
|
382
|
+
%Q({"grid1":"DataGrid3"}),
|
383
|
+
%Q({"grid1":"DataGrid3"}),
|
384
|
+
%Q({"grid1":"DataGrid3"}),
|
385
|
+
%Q({"grid1":"DataGrid3"}),
|
386
|
+
%Q({"grid1":"DataGrid2"}),
|
387
|
+
%Q({"grid1":"DataGrid1"}),
|
388
|
+
%Q({"grid1":"DataGrid1"})])
|
389
389
|
press("Applications")
|
390
390
|
press("Data Grids")
|
391
391
|
dgv = netzke_find("data_grid_view")
|
392
|
-
cvs = dgv.
|
392
|
+
cvs = dgv.col_values(:name, 4, 0)
|
393
393
|
ind1 = cvs.index("DataGrid1")+1
|
394
394
|
ind4 = cvs.index("DataGrid4")+1
|
395
395
|
dgv.select_row(ind1)
|
@@ -406,8 +406,8 @@ EOL
|
|
406
406
|
go_to_xyz_rules
|
407
407
|
wait_for_ajax
|
408
408
|
|
409
|
-
names = xrv.
|
410
|
-
gvs = xrv.
|
409
|
+
names = xrv.col_values(:name, 5, 0)
|
410
|
+
gvs = xrv.col_values(:grids, 5, 0)
|
411
411
|
g1h = {"grid1"=>"DataGrid1 new"}
|
412
412
|
expect(JSON.parse(gvs[names.index("ZRule1")])).to eq(g1h)
|
413
413
|
expect(JSON.parse(gvs[names.index("ZRule2")])).to eq(g1h)
|
@@ -415,14 +415,14 @@ EOL
|
|
415
415
|
go_to_my_rules
|
416
416
|
wait_for_ajax
|
417
417
|
|
418
|
-
names = mrv.
|
419
|
-
gvs = mrv.
|
420
|
-
rvs = mrv.
|
418
|
+
names = mrv.col_values(:name, 9, 0)
|
419
|
+
gvs = mrv.col_values(:grids, 9, 0)
|
420
|
+
rvs = mrv.col_values(:results, 9, 0)
|
421
421
|
expect(JSON.parse(gvs[names.index('abc')])).to eq(g1h)
|
422
422
|
expect(JSON.parse(gvs[names.index('Rule2b')])).to eq(g1h +
|
423
423
|
{"grid2"=>"DataGrid2"})
|
424
424
|
expect(JSON.parse(rvs[names.index('Rule5')])["other_grid"]).to eq(
|
425
|
-
|
425
|
+
'"DataGrid4 new"')
|
426
426
|
|
427
427
|
end
|
428
428
|
end
|
data/spec/lib/logger_spec.rb
CHANGED
@@ -68,7 +68,7 @@ module Marty
|
|
68
68
|
|
69
69
|
# Needed here because shutting transactional fixtures off
|
70
70
|
# means we lose the globally set user
|
71
|
-
Mcfly.whodunnit = system_user
|
71
|
+
Mcfly.whodunnit = UserHelpers.system_user
|
72
72
|
|
73
73
|
Marty::Script.load_script_bodies(promise_bodies, Date.today)
|
74
74
|
start_delayed_job
|
@@ -15,6 +15,10 @@ module Marty
|
|
15
15
|
@api.reload
|
16
16
|
end
|
17
17
|
|
18
|
+
def create_params script, key
|
19
|
+
{script: script, api_key: key}
|
20
|
+
end
|
21
|
+
|
18
22
|
describe "validations" do
|
19
23
|
it "should require app name, api key and script name" do
|
20
24
|
api = ApiAuth.new
|
@@ -126,12 +130,15 @@ module Marty
|
|
126
130
|
describe "authorization" do
|
127
131
|
it "should pass when script is not secured" do
|
128
132
|
# Script is not secured by any entries
|
129
|
-
|
133
|
+
params = create_params('SomeScript','SomeKey')
|
134
|
+
expect(Marty::Api::Base.is_authorized?(params)).to be_truthy
|
130
135
|
end
|
131
136
|
|
132
137
|
it "should pass when script is secured and key is valid" do
|
133
138
|
expect(@api.script_name).to include('Script1')
|
134
|
-
|
139
|
+
|
140
|
+
params = create_params(@api.script_name, @api.api_key)
|
141
|
+
expect(Marty::Api::Base.is_authorized?(params)).to be_truthy
|
135
142
|
end
|
136
143
|
|
137
144
|
it "should pass when script is secured and key is valid 2" do
|
@@ -139,7 +146,9 @@ module Marty
|
|
139
146
|
a.app_name = @api.app_name + 'x'
|
140
147
|
a.script_name = 'NewScript1'
|
141
148
|
a.save!
|
142
|
-
|
149
|
+
|
150
|
+
params = create_params('NewScript1', a.api_key)
|
151
|
+
expect(Marty::Api::Base.is_authorized?(params)).to be_truthy
|
143
152
|
end
|
144
153
|
|
145
154
|
it "should match on exact script name" do
|
@@ -147,11 +156,14 @@ module Marty
|
|
147
156
|
a.app_name = @api.app_name + 'x'
|
148
157
|
a.script_name = 'NewScript1'
|
149
158
|
a.save!
|
150
|
-
|
159
|
+
|
160
|
+
params = create_params('Script1', a.api_key)
|
161
|
+
expect(Marty::Api::Base.is_authorized?(params)).to be_falsey
|
151
162
|
end
|
152
163
|
|
153
164
|
it "should fail when script is secured and key is invalid" do
|
154
|
-
|
165
|
+
params = create_params('Script1', 'SomeKey')
|
166
|
+
expect(Marty::Api::Base.is_authorized?(params)).to be_falsey
|
155
167
|
end
|
156
168
|
|
157
169
|
it "should fail when script is secured and key is invalid (2)" do
|
@@ -159,18 +171,25 @@ module Marty
|
|
159
171
|
a.app_name = @api.app_name + 'x'
|
160
172
|
a.script_name = 'NewScript1'
|
161
173
|
a.save!
|
162
|
-
|
174
|
+
|
175
|
+
params = create_params('NewScript1', @api.api_key)
|
176
|
+
expect(Marty::Api::Base.is_authorized?(params)).to be_falsey
|
163
177
|
end
|
164
178
|
|
165
179
|
it "should fail when script is secured and key is not specified" do
|
166
|
-
|
167
|
-
expect(
|
180
|
+
params = create_params('Script1', nil)
|
181
|
+
expect(Marty::Api::Base.is_authorized?(params)).to be_falsey
|
182
|
+
|
183
|
+
params = create_params('Script1', '')
|
184
|
+
expect(Marty::Api::Base.is_authorized?(params)).to be_falsey
|
168
185
|
end
|
169
186
|
|
170
187
|
it "should pass when api_auth is deleted and no other auths exist" do
|
171
|
-
|
188
|
+
params = create_params(@api.script_name, @api.api_key)
|
189
|
+
expect(Marty::Api::Base.is_authorized?(params)).to be_truthy
|
172
190
|
@api.delete
|
173
|
-
|
191
|
+
|
192
|
+
expect(Marty::Api::Base.is_authorized?(params)).to be_truthy
|
174
193
|
end
|
175
194
|
|
176
195
|
it "should fail when api_auth is deleted and another auth exists" do
|
@@ -178,9 +197,11 @@ module Marty
|
|
178
197
|
api.app_name += 'x'
|
179
198
|
api.api_key = nil
|
180
199
|
api.save!
|
181
|
-
|
200
|
+
|
201
|
+
params = create_params(@api.script_name, @api.api_key)
|
202
|
+
expect(Marty::Api::Base.is_authorized?(params)).to be_truthy
|
182
203
|
@api.delete
|
183
|
-
expect(
|
204
|
+
expect(Marty::Api::Base.is_authorized?(params)).to be_falsey
|
184
205
|
end
|
185
206
|
end
|
186
207
|
end
|