marty 9.3.0 → 9.3.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gemignore +2 -0
- data/.gitignore +3 -0
- data/.rubocop.yml +34 -1
- data/Gemfile +1 -0
- data/Rakefile +10 -0
- data/app/assets/javascripts/marty/cable.js +21 -9
- data/app/channels/application_cable/connection.rb +1 -1
- data/app/channels/marty/notification_channel.rb +4 -1
- data/app/components/marty/api_config_view.rb +1 -1
- data/app/components/marty/api_log_view.rb +1 -1
- data/app/components/marty/auth_app.rb +8 -1
- data/app/components/marty/auth_app/client/auth_app.js +6 -0
- data/app/components/marty/data_grid_view.rb +6 -6
- data/app/components/marty/extras/misc.rb +1 -1
- data/app/components/marty/log_view.rb +1 -1
- data/app/components/marty/posting_grid.rb +1 -1
- data/app/components/marty/script_form.rb +3 -3
- data/app/components/marty/user_view.rb +1 -1
- data/app/components/marty/users/user_view.rb +1 -1
- data/app/controllers/marty/application_controller.rb +7 -7
- data/app/controllers/marty/delayed_job_controller.rb +7 -4
- data/app/controllers/marty/diagnostic/controller.rb +1 -1
- data/app/controllers/marty/job_controller.rb +2 -2
- data/app/models/marty/api_auth.rb +3 -3
- data/app/models/marty/api_config.rb +1 -1
- data/app/models/marty/base_rule.rb +1 -1
- data/app/models/marty/config.rb +5 -5
- data/app/models/marty/data_grid.rb +3 -3
- data/app/models/marty/delorean_rule.rb +2 -2
- data/app/models/marty/grid_index_boolean.rb +2 -2
- data/app/models/marty/grid_index_int4range.rb +1 -1
- data/app/models/marty/grid_index_integer.rb +1 -1
- data/app/models/marty/grid_index_numrange.rb +1 -1
- data/app/models/marty/grid_index_string.rb +1 -1
- data/app/models/marty/import_type.rb +2 -2
- data/app/models/marty/notifications/notification.rb +2 -1
- data/app/models/marty/posting.rb +6 -6
- data/app/models/marty/posting_type.rb +2 -2
- data/app/models/marty/promise.rb +4 -3
- data/app/models/marty/script.rb +7 -7
- data/app/models/marty/tag.rb +5 -5
- data/app/models/marty/token.rb +1 -1
- data/app/models/marty/user.rb +11 -10
- data/app/models/marty/user_role.rb +2 -2
- data/app/models/marty/vw_promise.rb +2 -1
- data/app/services/marty/background_job/update_schedule.rb +1 -1
- data/app/services/marty/data_grid/constraint.rb +4 -3
- data/app/services/marty/jobs/schedule.rb +2 -2
- data/lib/marty/data_change.rb +1 -1
- data/lib/marty/data_conversion.rb +1 -1
- data/lib/marty/migrations.rb +2 -2
- data/lib/marty/rpc_call.rb +2 -1
- data/lib/marty/rule_script_set.rb +1 -3
- data/lib/marty/util.rb +2 -2
- data/lib/marty/version.rb +1 -1
- data/lib/tasks/scripts_tasks.rake +2 -2
- data/marty.gemspec +5 -1
- data/spec/controllers/job_controller_spec.rb +7 -7
- data/spec/controllers/rpc_controller_spec.rb +8 -8
- data/spec/controllers/rpc_import_spec.rb +3 -3
- data/spec/features/data_blame_report_spec.rb +1 -1
- data/spec/features/data_grid_spec.rb +101 -3
- data/spec/features/enum_values_report_spec.rb +1 -1
- data/spec/features/extjs_spec.rb +1 -1
- data/spec/features/jobs_dashboard_spec.rb +2 -2
- data/spec/features/log_view_spec.rb +1 -1
- data/spec/features/reporting_spec.rb +3 -3
- data/spec/features/scripting_spec.rb +3 -3
- data/spec/features/scripting_test_spec.rb +3 -3
- data/spec/features/user_list_report_spec.rb +1 -1
- data/spec/fixtures/misc/data_grid_6.txt +9 -0
- data/spec/fixtures/misc/data_grid_7.txt +7 -0
- data/spec/fixtures/misc/data_grid_8.txt +10 -0
- data/spec/fixtures/misc/data_grid_9.txt +10 -0
- data/spec/lib/data_blame_spec.rb +1 -1
- data/spec/lib/data_importer_spec.rb +4 -4
- data/spec/lib/delorean_query_spec.rb +1 -1
- data/spec/lib/logger_spec.rb +1 -1
- data/spec/lib/mcfly_model_spec.rb +2 -2
- data/spec/lib/table_report_spec.rb +1 -1
- data/spec/models/api_auth_spec.rb +2 -2
- data/spec/models/data_grid_spec.rb +3 -3
- data/spec/models/posting_spec.rb +12 -12
- data/spec/models/promise_spec.rb +1 -1
- data/spec/models/rule_spec.rb +1 -1
- data/spec/models/script_spec.rb +1 -1
- data/spec/other/diagnostic/delayed_job_version_spec.rb +1 -1
- data/spec/spec_helper.rb +3 -0
- data/spec/support/netzke.rb +2 -2
- data/spec/support/setup.rb +1 -1
- data/spec/support/simplecov_helper.rb +94 -0
- data/spec/support/users.rb +2 -2
- metadata +8 -3
- data/.gitlab-ci.yml +0 -117
@@ -203,7 +203,7 @@ class Marty::DataConversion
|
|
203
203
|
# got an id for an association -- FIXME: perhaps this should
|
204
204
|
# not be allowed at all?
|
205
205
|
raise "#{type[:assoc_class].name} with id #{v} not found" unless
|
206
|
-
type[:assoc_class].
|
206
|
+
type[:assoc_class].find_by(id: v)
|
207
207
|
|
208
208
|
h[ga] = v
|
209
209
|
else
|
data/lib/marty/migrations.rb
CHANGED
@@ -201,7 +201,7 @@ EOSQL
|
|
201
201
|
end.group_by { |a| a[:name] }.each do |_k, v|
|
202
202
|
v.sort! { |a, b| b[:version] <=> a[:version] }
|
203
203
|
end
|
204
|
-
time_now = Time.now.utc
|
204
|
+
time_now = Time.zone.now.utc
|
205
205
|
gen_count = 0
|
206
206
|
|
207
207
|
sql_files.each do |sql|
|
@@ -224,7 +224,7 @@ EOSQL
|
|
224
224
|
File.open(sql_snap_literal, 'w') do |f|
|
225
225
|
f.print sql_lines.join
|
226
226
|
end
|
227
|
-
|
227
|
+
Rails.logger.info "creating #{newbase}.rb"
|
228
228
|
|
229
229
|
# only split on "GO" at the start of a line with optional whitespace
|
230
230
|
# before EOL. GO in comments could trigger this and will cause an error
|
data/lib/marty/rpc_call.rb
CHANGED
@@ -25,7 +25,7 @@ class Marty::RpcCall
|
|
25
25
|
end
|
26
26
|
|
27
27
|
res = JSON.parse(response.body)
|
28
|
-
raise res['error'] if res.is_a?(Hash) &&
|
28
|
+
raise res['error'] if res.is_a?(Hash) && res['error'].present?
|
29
29
|
|
30
30
|
res
|
31
31
|
end
|
@@ -55,6 +55,7 @@ class Marty::RpcCall
|
|
55
55
|
http = Net::HTTP.new(host, port)
|
56
56
|
request = Net::HTTP::Post.new(path)
|
57
57
|
http.use_ssl = use_ssl
|
58
|
+
http.ciphers = options[:ciphers] if options[:ciphers]
|
58
59
|
http.read_timeout = options[:read_timeout] if options[:read_timeout]
|
59
60
|
http.open_timeout = options[:open_timeout] if options[:open_timeout]
|
60
61
|
request.add_field('Content-Type', 'xml')
|
@@ -28,9 +28,7 @@ class Marty::RuleScriptSet < Delorean::AbstractContainer
|
|
28
28
|
super()
|
29
29
|
end
|
30
30
|
|
31
|
-
|
32
|
-
sset.parse_check(sname, body)
|
33
|
-
end
|
31
|
+
delegate :parse_check, to: :sset
|
34
32
|
|
35
33
|
def write_attr(k, v)
|
36
34
|
equals, rhs = v == :parameter ? [' =?', ''] :
|
data/lib/marty/util.rb
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
module Marty::Util
|
2
2
|
def self.set_posting_id(sid)
|
3
|
-
snap = Marty::Posting.
|
3
|
+
snap = Marty::Posting.find_by(id: sid)
|
4
4
|
sid = nil if snap && (snap.created_dt == Float::INFINITY)
|
5
5
|
Netzke::Base.session[:posting] = sid
|
6
6
|
end
|
@@ -9,7 +9,7 @@ module Marty::Util
|
|
9
9
|
sid = Netzke::Base.session && Netzke::Base.session[:posting]
|
10
10
|
return unless sid.is_a? Integer
|
11
11
|
|
12
|
-
sid && Marty::Posting.
|
12
|
+
sid && Marty::Posting.find_by(id: sid)
|
13
13
|
end
|
14
14
|
|
15
15
|
def self.get_posting_time
|
data/lib/marty/version.rb
CHANGED
@@ -6,8 +6,8 @@ namespace :marty do
|
|
6
6
|
|
7
7
|
desc 'load scripts from the LOAD_DIR directory'
|
8
8
|
task load_scripts: :environment do
|
9
|
-
Mcfly.whodunnit = Marty::User.
|
10
|
-
Rails.configuration.marty.system_account
|
9
|
+
Mcfly.whodunnit = Marty::User.find_by(
|
10
|
+
login: Rails.configuration.marty.system_account
|
11
11
|
)
|
12
12
|
|
13
13
|
raise 'must have system user account seeded' unless Mcfly.whodunnit
|
data/marty.gemspec
CHANGED
@@ -7,6 +7,10 @@ require 'zlib'
|
|
7
7
|
require 'csv'
|
8
8
|
require 'pathname'
|
9
9
|
|
10
|
+
git_tracked_files = `git ls-files`.split($\)
|
11
|
+
gem_ignored_files = `git ls-files -i -X .gemignore`.split($\)
|
12
|
+
files = git_tracked_files - gem_ignored_files
|
13
|
+
|
10
14
|
Gem::Specification.new do |s|
|
11
15
|
s.name = 'marty'
|
12
16
|
s.version = Marty::VERSION
|
@@ -24,7 +28,7 @@ Gem::Specification.new do |s|
|
|
24
28
|
s.summary = 'A framework for working with versioned data'
|
25
29
|
s.description =
|
26
30
|
'Marty is a framework for viewing and reporting on versioned data.'
|
27
|
-
s.files =
|
31
|
+
s.files = files
|
28
32
|
s.licenses = ['MIT']
|
29
33
|
# used for signing aws ec2 requests
|
30
34
|
s.add_dependency 'actioncable'
|
@@ -17,7 +17,7 @@ describe Marty::JobController, slow: true do
|
|
17
17
|
# means we lose the globally set uesr
|
18
18
|
Mcfly.whodunnit = system_user
|
19
19
|
|
20
|
-
Marty::Script.load_script_bodies(promise_bodies,
|
20
|
+
Marty::Script.load_script_bodies(promise_bodies, Time.zone.today)
|
21
21
|
|
22
22
|
start_delayed_job
|
23
23
|
end
|
@@ -111,7 +111,7 @@ describe Marty::JobController, slow: true do
|
|
111
111
|
res = engine.background_eval('Z', { 'p_title' => NAME_C }, ['result'])
|
112
112
|
wait_for_jobs
|
113
113
|
|
114
|
-
promise = Marty::Promise.
|
114
|
+
promise = Marty::Promise.find_by(title: NAME_C)
|
115
115
|
|
116
116
|
get 'download', params: {
|
117
117
|
job_id: promise.id,
|
@@ -126,7 +126,7 @@ describe Marty::JobController, slow: true do
|
|
126
126
|
engine.background_eval('Z', { 'p_title' => NAME_E }, ['result'])
|
127
127
|
wait_for_jobs
|
128
128
|
|
129
|
-
promise = Marty::Promise.
|
129
|
+
promise = Marty::Promise.find_by(title: NAME_E)
|
130
130
|
|
131
131
|
res = promise.result['result']
|
132
132
|
|
@@ -167,7 +167,7 @@ describe Marty::JobController, slow: true do
|
|
167
167
|
engine.background_eval('Y', { 'p_title' => title }, ['d'])
|
168
168
|
sleep 5
|
169
169
|
|
170
|
-
promise = Marty::Promise.
|
170
|
+
promise = Marty::Promise.find_by(title: title)
|
171
171
|
|
172
172
|
res = { 'd' => [
|
173
173
|
{ 'z' => 0.875, 'a' => { 'b' => { 'e' => 0.125 } } },
|
@@ -194,7 +194,7 @@ describe Marty::JobController, slow: true do
|
|
194
194
|
)
|
195
195
|
sleep 5
|
196
196
|
|
197
|
-
promise = Marty::Promise.
|
197
|
+
promise = Marty::Promise.find_by(title: NAME_B)
|
198
198
|
|
199
199
|
expect(promise.result).to eq(
|
200
200
|
'result' => [{ 'a' => 1, 'b' => 1 }, { 'a' => 2, 'b' => 4 }, { 'a' => 3, 'b' => 9 }],
|
@@ -237,8 +237,8 @@ describe Marty::JobController, slow: true do
|
|
237
237
|
engine = Marty::ScriptSet.new.get_engine(NAME_G)
|
238
238
|
res = engine.evaluate('V', 'result', {})
|
239
239
|
expect(res).to eq [123]
|
240
|
-
p1 = Marty::Promise.
|
241
|
-
p2 = Marty::Promise.
|
240
|
+
p1 = Marty::Promise.find_by(title: NAME_G.to_s)
|
241
|
+
p2 = Marty::Promise.find_by(title: "#{NAME_G}2")
|
242
242
|
expect(p2.parent_id).to eq p1.id
|
243
243
|
end
|
244
244
|
end
|
@@ -438,7 +438,7 @@ describe Marty::RpcController do
|
|
438
438
|
end
|
439
439
|
|
440
440
|
before(:each) do
|
441
|
-
@p0 = Marty::Posting.do_create('BASE',
|
441
|
+
@p0 = Marty::Posting.do_create('BASE', Time.zone.today, 'a comment')
|
442
442
|
|
443
443
|
@t1 = Marty::Script.load_script_bodies({
|
444
444
|
'M1' => sample_script,
|
@@ -463,16 +463,16 @@ describe Marty::RpcController do
|
|
463
463
|
'M9Schemas' => script9_schema,
|
464
464
|
'M10Schemas' => script10_schema,
|
465
465
|
'M11Schemas' => script11_schema,
|
466
|
-
|
466
|
+
}, Time.zone.today + 1.minute)
|
467
467
|
|
468
|
-
@p1 = Marty::Posting.do_create('BASE',
|
468
|
+
@p1 = Marty::Posting.do_create('BASE', Time.zone.today + 2.minutes, 'a comment')
|
469
469
|
|
470
470
|
@t2 = Marty::Script.load_script_bodies({
|
471
471
|
'M1' =>
|
472
472
|
sample_script.gsub(/A/, 'AA') + ' e =? "hello"',
|
473
|
-
|
473
|
+
}, Time.zone.today + 3.minutes)
|
474
474
|
|
475
|
-
@p2 = Marty::Posting.do_create('BASE',
|
475
|
+
@p2 = Marty::Posting.do_create('BASE', Time.zone.today + 4.minutes, 'a comment')
|
476
476
|
@data = [['some data', 7, [1, 2, 3], { foo: 'bar', baz: 'quz' }, 5, 'string'],
|
477
477
|
['some more data', [1, 2, 3], 5, { foo: 'bar', baz: 'quz' }, 5, 'string']]
|
478
478
|
@data_json = @data.to_json
|
@@ -517,7 +517,7 @@ describe Marty::RpcController do
|
|
517
517
|
expect(res).to include('job_id')
|
518
518
|
job_id = res['job_id']
|
519
519
|
|
520
|
-
promise = Marty::Promise.
|
520
|
+
promise = Marty::Promise.find_by(id: job_id)
|
521
521
|
|
522
522
|
expect(promise.result).to eq('e' => 4)
|
523
523
|
|
@@ -542,7 +542,7 @@ describe Marty::RpcController do
|
|
542
542
|
job_id = res['job_id']
|
543
543
|
|
544
544
|
marty_whodunnit
|
545
|
-
Marty::Script.load_scripts(
|
545
|
+
Marty::Script.load_scripts(Rails.root.join('../../delorean'), Time.zone.today)
|
546
546
|
|
547
547
|
post 'evaluate', params: {
|
548
548
|
format: :json,
|
@@ -574,7 +574,7 @@ describe Marty::RpcController do
|
|
574
574
|
expect(res).to include('job_id')
|
575
575
|
job_id = res['job_id']
|
576
576
|
|
577
|
-
promise = Marty::Promise.
|
577
|
+
promise = Marty::Promise.find_by(id: job_id)
|
578
578
|
|
579
579
|
expect(promise.result).to eq('e' => 4)
|
580
580
|
|
@@ -8,15 +8,15 @@ describe Marty::RpcController do
|
|
8
8
|
@tags << Marty::Script.load_script_bodies({
|
9
9
|
'A' => "A:\n a = 1\n",
|
10
10
|
'B' => "B:\n b = 0\n",
|
11
|
-
|
11
|
+
}, Time.zone.today)
|
12
12
|
|
13
13
|
@tags << Marty::Script.load_script_bodies({
|
14
14
|
'B' => "import A\nB:\n b = A::A().a\n",
|
15
|
-
|
15
|
+
}, Time.zone.today + 1.minute)
|
16
16
|
|
17
17
|
@tags << Marty::Script.load_script_bodies({
|
18
18
|
'A' => "A:\n a = 2\n",
|
19
|
-
|
19
|
+
}, Time.zone.today + 2.minutes)
|
20
20
|
|
21
21
|
# create an untagged version for DEV
|
22
22
|
s = Marty::Script.find_by(obsoleted_dt: 'infinity', name: 'A')
|
@@ -10,10 +10,15 @@ feature 'data grid view', js: true, speed: :super_slow do
|
|
10
10
|
Marty::Script.load_scripts
|
11
11
|
dt = DateTime.parse('2017-1-1')
|
12
12
|
p = File.expand_path('../../fixtures/misc', __FILE__)
|
13
|
-
Dir.glob(p + '/data_grid_*.txt').each do |path|
|
13
|
+
Dir.glob(p + '/data_grid_*.txt').sort.each do |path|
|
14
|
+
next if path.include?('data_grid_7')
|
15
|
+
|
14
16
|
n = File.basename(path, '.txt').camelize
|
15
17
|
Marty::DataGrid.create_from_import(n, File.read(path), dt)
|
16
18
|
end
|
19
|
+
path = p + '/data_grid_7.txt'
|
20
|
+
Marty::DataGrid.create_from_import('DataGrid7', File.read(path),
|
21
|
+
dt + 1.second)
|
17
22
|
u = Marty::User.create!(login: 'grid_user',
|
18
23
|
firstname: 'grid',
|
19
24
|
lastname: 'user',
|
@@ -295,7 +300,7 @@ feature 'data grid view', js: true, speed: :super_slow do
|
|
295
300
|
log_in_as('marty')
|
296
301
|
go_to_data_grids
|
297
302
|
dgv = netzke_find('data_grid_view')
|
298
|
-
grids = dgv.get_col_vals('name',
|
303
|
+
grids = dgv.get_col_vals('name', 6)
|
299
304
|
set_one = lambda do |grid, perms|
|
300
305
|
pos = grids.index(grid) + 1
|
301
306
|
dgv.select_row(pos)
|
@@ -398,7 +403,7 @@ feature 'data grid view', js: true, speed: :super_slow do
|
|
398
403
|
log_in_as('grid_user')
|
399
404
|
go_to_data_grids(admin: false)
|
400
405
|
dgv = netzke_find('data_grid_user_view')
|
401
|
-
grids = dgv.get_col_vals('name',
|
406
|
+
grids = dgv.get_col_vals('name', 9)
|
402
407
|
|
403
408
|
# now test some editing, saving, and cancel logic
|
404
409
|
get_latest = lambda do
|
@@ -407,6 +412,99 @@ feature 'data grid view', js: true, speed: :super_slow do
|
|
407
412
|
grid = get_latest.call
|
408
413
|
grid.constraint = '>=0<200'
|
409
414
|
grid.save!
|
415
|
+
|
416
|
+
# check boolean validation
|
417
|
+
pos = grids.index('DataGrid6') + 1
|
418
|
+
dgv.select_row(pos)
|
419
|
+
press('Edit Grid')
|
420
|
+
wait_for_ajax
|
421
|
+
grid_setup
|
422
|
+
cell_edit(3, 0, 'bad')
|
423
|
+
press('Save')
|
424
|
+
expect(page).to have_content('error: some entries failed constraint or '\
|
425
|
+
'data type check')
|
426
|
+
press('OK')
|
427
|
+
wait_for_ajax
|
428
|
+
press('Cancel')
|
429
|
+
press('Yes')
|
430
|
+
wait_for_ajax
|
431
|
+
press('Edit Grid')
|
432
|
+
wait_for_ajax
|
433
|
+
# test saving and validation etc
|
434
|
+
grid_setup
|
435
|
+
cell_edit(3, 0, 'true')
|
436
|
+
cell_edit(3, 2, 'true')
|
437
|
+
press('Save')
|
438
|
+
wait_for_ajax
|
439
|
+
dg_data = Marty::DataGrid.mcfly_pt('infinity').find_by(name: 'DataGrid6').
|
440
|
+
data.flatten
|
441
|
+
expect(dg_data).to eq([true, false, true, false])
|
442
|
+
|
443
|
+
# class validation
|
444
|
+
pos = grids.index('DataGrid7') + 1
|
445
|
+
dgv.select_row(pos)
|
446
|
+
press('Edit Grid')
|
447
|
+
wait_for_ajax
|
448
|
+
grid_setup
|
449
|
+
cell_edit(1, 0, 'bad')
|
450
|
+
press('Save')
|
451
|
+
expect(page).to have_content('error: some entries failed constraint or '\
|
452
|
+
'data type check')
|
453
|
+
press('OK')
|
454
|
+
wait_for_ajax
|
455
|
+
press('Cancel')
|
456
|
+
press('Yes')
|
457
|
+
wait_for_ajax
|
458
|
+
press('Edit Grid')
|
459
|
+
wait_for_ajax
|
460
|
+
# test saving and validation etc
|
461
|
+
grid_setup
|
462
|
+
cell_edit(1, 0, 'DataGrid8')
|
463
|
+
press('Save')
|
464
|
+
wait_for_ajax
|
465
|
+
dg_data = Marty::DataGrid.mcfly_pt('infinity').find_by(name: 'DataGrid7').
|
466
|
+
data.flatten
|
467
|
+
expect(dg_data).to eq(['DataGrid8', 'DataGrid3', 'DataGrid4', 'DataGrid5'])
|
468
|
+
|
469
|
+
# int validation
|
470
|
+
pos = grids.index('DataGrid8') + 1
|
471
|
+
dgv.select_row(pos)
|
472
|
+
press('Edit Grid')
|
473
|
+
wait_for_ajax
|
474
|
+
grid_setup
|
475
|
+
cell_edit(2, 0, 'bad')
|
476
|
+
press('Save')
|
477
|
+
expect(page).to have_content('error: some entries failed constraint or '\
|
478
|
+
'data type check')
|
479
|
+
press('OK')
|
480
|
+
wait_for_ajax
|
481
|
+
press('Cancel')
|
482
|
+
press('Yes')
|
483
|
+
wait_for_ajax
|
484
|
+
press('Edit Grid')
|
485
|
+
wait_for_ajax
|
486
|
+
# test saving and validation etc
|
487
|
+
grid_setup
|
488
|
+
cell_edit(2, 0, 123)
|
489
|
+
press('Save')
|
490
|
+
wait_for_ajax
|
491
|
+
dg_data = Marty::DataGrid.mcfly_pt('infinity').find_by(name: 'DataGrid8').
|
492
|
+
data.flatten
|
493
|
+
expect(dg_data).to eq([123, 360, 120, 180, 240, 360])
|
494
|
+
|
495
|
+
# string grid
|
496
|
+
pos = grids.index('DataGrid9') + 1
|
497
|
+
dgv.select_row(pos)
|
498
|
+
press('Edit Grid')
|
499
|
+
wait_for_ajax
|
500
|
+
grid_setup
|
501
|
+
cell_edit(2, 0, 'bad')
|
502
|
+
press('Save')
|
503
|
+
wait_for_ajax
|
504
|
+
dg_data = Marty::DataGrid.mcfly_pt('infinity').find_by(name: 'DataGrid9').
|
505
|
+
data.flatten
|
506
|
+
expect(dg_data).to eq(['bad', '360', '120', '180', '240', '360'])
|
507
|
+
|
410
508
|
pos = grids.index('DataGrid5') + 1
|
411
509
|
dgv.select_row(pos)
|
412
510
|
press('Edit Grid')
|
data/spec/features/extjs_spec.rb
CHANGED
@@ -10,14 +10,14 @@ describe 'Jobs Dashboard', type: :feature, js: true, capybara: true do
|
|
10
10
|
title: 'Test Job 1',
|
11
11
|
user: Marty::User.find_by(login: 'marty'),
|
12
12
|
cformat: 'csv',
|
13
|
-
start_dt: Time.now,
|
13
|
+
start_dt: Time.zone.now,
|
14
14
|
promise_type: 'delorean'
|
15
15
|
)
|
16
16
|
Marty::Promise.create!(
|
17
17
|
title: 'Test Job 2',
|
18
18
|
user: other_user,
|
19
19
|
cformat: 'csv',
|
20
|
-
start_dt: Time.now,
|
20
|
+
start_dt: Time.zone.now,
|
21
21
|
promise_type: 'delorean'
|
22
22
|
)
|
23
23
|
|
@@ -23,7 +23,7 @@ feature 'logger view', js: true, capybara: true do
|
|
23
23
|
timestamp: Time.zone.now - 10.days)
|
24
24
|
|
25
25
|
@ts = Marty::Log.select(:timestamp).order(timestamp: :desc).map do |(ts)|
|
26
|
-
Time.zone.at(ts[:timestamp]).strftime('%Y-%m-%
|
26
|
+
Time.zone.at(ts[:timestamp]).strftime('%Y-%m-%d %H:%M:%S')
|
27
27
|
end
|
28
28
|
|
29
29
|
@clean_file = "/tmp/clean_#{Process.pid}.psql"
|
@@ -22,7 +22,7 @@ feature 'under Applications menu, Reports workflows', js: true do
|
|
22
22
|
end
|
23
23
|
|
24
24
|
def with_user(uname, &block)
|
25
|
-
u = Marty::User.
|
25
|
+
u = Marty::User.find_by(login: uname)
|
26
26
|
begin
|
27
27
|
old_u, Mcfly.whodunnit = Mcfly.whodunnit, u
|
28
28
|
block.call(u)
|
@@ -81,13 +81,13 @@ DELOREAN
|
|
81
81
|
|
82
82
|
Marty::Script.
|
83
83
|
load_script_bodies({ 'SomeReport' => a_report, },
|
84
|
-
|
84
|
+
Time.zone.today)
|
85
85
|
|
86
86
|
Marty::Script.
|
87
87
|
load_script_bodies({ 'SomeReport' =>
|
88
88
|
a_report +
|
89
89
|
"CC: BB\n title=\"CC\"\n result = 123" },
|
90
|
-
|
90
|
+
Time.zone.today + 1.minute)
|
91
91
|
end
|
92
92
|
end
|
93
93
|
|