marty 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: 8f1288f6cc23a26347fad541903d5f7df4c62c2e
4
- data.tar.gz: b70b8b6df1ce3eab6720bddeed11f622b17421d7
3
+ metadata.gz: c0cfa3fa0d78f474f6e7c1bc44ba2070fcc094b0
4
+ data.tar.gz: c28a5fa19dafea07a63416931c1087b7da37795d
5
5
  SHA512:
6
- metadata.gz: fb4e5bf0e6dea87587dd93ae9d0a7bc78e65a425d64b3b8ba41a408df519d3ccb4d036f3d74570ba8d674d8514a74e4bb88c1569309a7e41a6756e8482882cb9
7
- data.tar.gz: 762ca965e66e6f65d15a9ad713a2614c75dd7cee37669a94851be394260d0f40425da78462cd326fc36107ffaadd371845e92bae0c9124635828b44f84446702
6
+ metadata.gz: 89d5443037bee0c5938b27a02426c974a062714355e037c1a91d80d619a1ab1f29c432ab1c5a335592ccd01110d7c9a95643a110dea238b1764b41081fab111a
7
+ data.tar.gz: 6f4fc68bdd7e32aa4928a04ab2a3024fac47a8eb8fc3c904d64b992a22c50ee6a731533b422306a4618ac7855bead871b1c53df11e61aaab068949bbde4475de
data/Gemfile CHANGED
@@ -5,7 +5,6 @@ source "http://rubygems.org"
5
5
  # development dependencies will be added by default to the :development group.
6
6
  gemspec
7
7
 
8
- gem 'responders'
9
8
  gem 'delayed_job_active_record'
10
9
  gem 'daemons', '~> 1.1.9'
11
10
  gem 'mime-types', '< 3.0', platforms: :ruby_19
@@ -1,6 +1,4 @@
1
1
  class Marty::RpcController < ActionController::Base
2
- respond_to :json, :csv
3
-
4
2
  def evaluate
5
3
  res = do_eval(params["script"],
6
4
  params["tag"],
@@ -83,8 +83,8 @@ module Marty::Migrations
83
83
  if jsons[c]
84
84
  jsons[c].each do |subc|
85
85
  if subc.class == Array
86
- subcol, type = subc
87
- columns.push "f_fixfalse(main.#{c} ->> '#{subcol}')::#{type} " +
86
+ subcol, type, fn = subc
87
+ columns.push "#{fn || ''}(main.#{c} ->> '#{subcol}')::#{type} " +
88
88
  "as \"#{c}_#{subcol}\""
89
89
  else
90
90
  columns.push "main.#{c} ->> '#{subc}' as \"#{c}_#{subc}\""
data/lib/marty/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Marty
2
- VERSION = "1.0.6"
2
+ VERSION = "1.0.7"
3
3
  end
@@ -8,8 +8,6 @@ feature 'Posting workflows', js: true do
8
8
 
9
9
  populate_test_users
10
10
 
11
- custom_selectors
12
-
13
11
  monkey_patch_new_posting_form
14
12
  end
15
13
 
@@ -27,6 +25,7 @@ feature 'Posting workflows', js: true do
27
25
  log_in_as('admin1')
28
26
 
29
27
  posting_grid = netzke_find('posting_grid')
28
+ posting_type_combo = netzke_find('Posting Type', 'combobox')
30
29
 
31
30
  by 'bring up new posting form' do
32
31
  wait_for_ajax
@@ -35,8 +34,8 @@ feature 'Posting workflows', js: true do
35
34
  end
36
35
 
37
36
  and_by 'make posting TEST-A' do
38
- click_combobox('Posting Type')
39
- select_combobox('BASE', 'Posting Type')
37
+ posting_type_combo.click
38
+ posting_type_combo.select_values('BASE')
40
39
  fill_in('Comment', with: 'TEST-A')
41
40
  press('Create')
42
41
  end
@@ -70,8 +69,9 @@ feature 'Posting workflows', js: true do
70
69
  end
71
70
 
72
71
  and_by 'no posting available for adding' do
73
- click_combobox('Posting Type')
74
- expect(combobox_values('Posting Type')).not_to include 'BASE'
72
+ posting_type_combo = netzke_find('Posting Type', 'combobox')
73
+ posting_type_combo.click
74
+ expect(posting_type_combo.get_values).not_to include 'BASE'
75
75
  end
76
76
  end
77
77
  end
@@ -13,8 +13,6 @@ feature 'under Applications menu, Reports using Data Import', js: true do
13
13
  populate_import_type
14
14
  populate_bud_category_fannie_bup
15
15
  populate_test_users
16
-
17
- custom_selectors
18
16
  end
19
17
 
20
18
  after(:all) do
@@ -82,7 +80,8 @@ feature 'under Applications menu, Reports using Data Import', js: true do
82
80
  wait_for_ajax
83
81
 
84
82
  within(:gridpanel, 'report_form', match: :first) do
85
- select_combobox('FB', 'Import Type')
83
+ import_type_combo = netzke_find('Import Type', 'combobox')
84
+ import_type_combo.select_values('FB')
86
85
  bud_id = Gemini::BudCategory.first.id
87
86
  paste("bud_category_id\tnote_rate\tsettlement_mm\tsettlement_yy\tbuy_up\tbuy_down\n#{bud_id}\t9.500\t9\t2014\t0\t0\n#{bud_id}\t9.750\t9\t2014\t0\t0\n",
88
87
  'data_import_field')
@@ -148,7 +147,8 @@ feature 'under Applications menu, Reports using Data Import', js: true do
148
147
  wait_for_ajax
149
148
 
150
149
  within(:gridpanel, 'report_form', match: :first) do
151
- select_combobox('BC', 'Import Type')
150
+ import_type_combo = netzke_find('Import Type', 'combobox')
151
+ import_type_combo.select_values('BC')
152
152
  paste("name\nConv Fixed 40\n", 'data_import_field')
153
153
  end
154
154
  end
@@ -10,7 +10,6 @@ feature 'under Applications menu, Reports workflows', js: true do
10
10
 
11
11
  populate_test_users
12
12
  populate_sample_reports
13
- custom_selectors
14
13
  end
15
14
 
16
15
  after(:all) do
@@ -107,6 +106,8 @@ DELOREAN
107
106
 
108
107
  tag_grid = netzke_find('tag_grid')
109
108
  script_grid = netzke_find('script_grid')
109
+ posting_combo = netzke_find('Posting', 'combobox')
110
+ script_combo = netzke_find('', 'combobox')
110
111
 
111
112
  by 'select 2nd tag' do
112
113
  wait_for_ajax
@@ -140,7 +141,7 @@ DELOREAN
140
141
 
141
142
  and_by 'validate posting combobox' do
142
143
  wait_for_ajax
143
- expect(combobox_values('Posting')).to include('BASE-20130520-1200')
144
+ expect(posting_combo.get_values).to include('BASE-20130520-1200')
144
145
  end
145
146
 
146
147
  and_by 'select 3rd tag' do
@@ -152,18 +153,18 @@ DELOREAN
152
153
  end
153
154
 
154
155
  and_by 'validate script combobox' do
155
- expect(combobox_values('')).to include('AA (csv)',
156
- 'DD [role: dev] (csv)',
157
- '---')
156
+ expect(script_combo.get_values).to include('AA (csv)',
157
+ 'DD [role: dev] (csv)',
158
+ '---')
158
159
  end
159
160
 
160
161
  and_by 'select AA node' do
161
162
  select_node('AA (csv)')
162
163
  end
163
164
 
164
- and_by 'validate posting comobox' do
165
+ and_by 'validate posting combobox' do
165
166
  wait_for_ajax
166
- expect(combobox_values('Posting')).to include('BASE-20130520-1200')
167
+ expect(posting_combo.get_values).to include('BASE-20130520-1200')
167
168
  end
168
169
  end
169
170
 
@@ -230,6 +231,7 @@ DELOREAN
230
231
 
231
232
  tag_grid = netzke_find('tag_grid')
232
233
  script_grid = netzke_find('script_grid')
234
+ script_combo = netzke_find('', 'combobox')
233
235
 
234
236
  by 'select 2nd tag' do
235
237
  wait_for_ajax
@@ -242,7 +244,7 @@ DELOREAN
242
244
  end
243
245
 
244
246
  and_by 'no DD [role: dev] (csv)' do
245
- expect(combobox_values('')).to include('AA (csv)',
247
+ expect(script_combo.get_values).to include('AA (csv)',
246
248
  'CC (csv)',
247
249
  '---')
248
250
  end
@@ -7,8 +7,6 @@ feature 'under Applications menu, Scripting workflows', js: true do
7
7
 
8
8
  @clean_file = "/tmp/clean_#{Process.pid}.psql"
9
9
  save_clean_db(@clean_file)
10
-
11
- custom_selectors
12
10
  end
13
11
 
14
12
  before(:each) do
@@ -89,7 +87,7 @@ feature 'under Applications menu, Scripting workflows', js: true do
89
87
  and_by 'select the new script' do
90
88
  wait_for_ajax
91
89
  within(:gridpanel, 'script_grid', match: :first) do
92
- script_grid.validate_row_values(6, name: 'Xyz', tag: 'DEV')
90
+ expect(script_grid.get_row_vals(6)).to netzke_include({:name=>"Xyz", :tag=>"DEV"})
93
91
  script_grid.select_row(6)
94
92
  end
95
93
  end
@@ -294,7 +292,7 @@ feature 'under Applications menu, Scripting workflows', js: true do
294
292
  wait_for_ajax
295
293
  script_grid.select_row(5)
296
294
  expect(page).to have_content "#123\n#456\n"
297
- tag_grid.validate_row_values(2, comment: 'ABCD')
295
+ expect(tag_grid.get_row_vals(2)).to netzke_include({:comment=>"ABCD"})
298
296
  end
299
297
  end
300
298
 
@@ -8,7 +8,6 @@ feature 'under Applications menu, Scripting (debug) workflows', js: true do
8
8
  populate_test_users
9
9
  populate_sample_scripts1
10
10
  populate_sample_scripts2
11
- custom_selectors
12
11
  end
13
12
 
14
13
  after(:all) do
@@ -2,10 +2,6 @@ require 'spec_helper'
2
2
 
3
3
  feature 'under Sytem menu, User Management worflows', js: true do
4
4
 
5
- before(:all) do
6
- custom_selectors
7
- end
8
-
9
5
  def go_to_user_view
10
6
  press('System')
11
7
  press('User Management')
@@ -40,6 +36,7 @@ feature 'under Sytem menu, User Management worflows', js: true do
40
36
  go_to_user_view
41
37
 
42
38
  user_view = netzke_find('user_view')
39
+ roles_combo = netzke_find('Roles', 'combobox')
43
40
 
44
41
  by 'add new user' do
45
42
  wait_for_ajax
@@ -56,8 +53,8 @@ feature 'under Sytem menu, User Management worflows', js: true do
56
53
  fill_in('First Name', with: 'test_fname')
57
54
  fill_in('Last Name', with: 'test_lname')
58
55
  check 'Active'
59
- click_combobox 'Roles'
60
- select_combobox('Admin, Developer, User Manager, Viewer', 'Roles')
56
+ roles_combo.click
57
+ roles_combo.select_values('Admin, Developer, User Manager, Viewer')
61
58
  press 'OK'
62
59
  end
63
60
  end
@@ -72,20 +69,21 @@ feature 'under Sytem menu, User Management worflows', js: true do
72
69
  fill_in('Login', with: 'new_login')
73
70
  fill_in('First Name', with: 'new_fname')
74
71
  fill_in('Last Name', with: 'new_lname')
75
- click_combobox 'Roles'
76
- select_combobox('User Manager, Viewer', 'Roles')
72
+ roles_combo.click
73
+ roles_combo.select_values('User Manager, Viewer')
77
74
  press 'OK'
78
75
  end
79
76
  end
80
77
 
81
78
  and_by 'check row got edited' do
82
79
  wait_for_ajax
83
- user_view.validate_row_values(2,
84
- :login => 'new_login',
85
- :firstname => 'new_fname',
86
- :lastname => 'new_lname',
87
- :active => true,
88
- :roles => 'User Manager,Viewer')
80
+ expect(user_view.get_row_vals(2)).to netzke_include({
81
+ :login=>"new_login",
82
+ :firstname=>"new_fname",
83
+ :lastname=>"new_lname",
84
+ :active=>true,
85
+ :roles=>"User Manager,Viewer",
86
+ })
89
87
  end
90
88
 
91
89
  and_by 'delete user fails' do
@@ -160,6 +160,15 @@ fico\tnumrange\th\t\t
160
160
  1|2\t90.5\t4.4\t5.5\t6.6
161
161
  3|4\t100.5\t1.2\t2.3\t3.4
162
162
  3|4\t105.5\t4.5\t5.6\t6.7
163
+ EOS
164
+
165
+ Gj =<<EOS
166
+ lenient
167
+ client_id\tinteger\tv
168
+ property_state\tstring\tv
169
+
170
+ \tCA\t0.25
171
+ 700127\tCA\t0.35
163
172
  EOS
164
173
 
165
174
  before(:each) do
@@ -279,7 +288,7 @@ EOS
279
288
 
280
289
  before(:each) do
281
290
  ["G1", "G2", "G3", "G4", "G5", "G6", "G7", "G8", "Ga", "Gb",
282
- "Gc", "Gd", "Ge", "Gf", "Gg", "Gh"].each { |g|
291
+ "Gc", "Gd", "Ge", "Gf", "Gg", "Gh", "Gj"].each { |g|
283
292
  dg_from_import(g, "Marty::DataGridSpec::#{g}".constantize)
284
293
  }
285
294
  end
@@ -362,6 +371,22 @@ EOS
362
371
  }.to raise_error(RuntimeError)
363
372
  end
364
373
 
374
+ it "should handle non-distinct lookups (2)" do
375
+ params = {
376
+ "client_id" => 700127,
377
+ "property_state" => "CA",
378
+ }
379
+ dg = Marty::DataGrid.lookup(pt, "Gj")
380
+ res = Marty::DataGrid.lookup_grid(pt, dg, params, false)
381
+
382
+ # should return the upper left corner match
383
+ expect(res).to eq(0.25)
384
+
385
+ expect {
386
+ Marty::DataGrid.lookup_grid(pt, dg, params, true)
387
+ }.to raise_error(RuntimeError)
388
+ end
389
+
365
390
  it "should handle boolean lookups" do
366
391
  res = [true, false].map { |hb_indicator|
367
392
  lookup_grid_helper('infinity',
data/spec/spec_helper.rb CHANGED
@@ -46,7 +46,6 @@ RSpec.configure do |config|
46
46
  config.include SpecSetup
47
47
  config.include Marty::IntegrationHelpers
48
48
  config.include MartyRSpec::Util
49
- config.include MartyRSpec::NetzkeGrid
50
49
 
51
50
  Capybara.default_max_wait_time = 3
52
51
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: marty
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
  - Arman Bostani
@@ -14,7 +14,7 @@ authors:
14
14
  autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
- date: 2016-08-24 00:00:00.000000000 Z
17
+ date: 2016-08-29 00:00:00.000000000 Z
18
18
  dependencies:
19
19
  - !ruby/object:Gem::Dependency
20
20
  name: pg