marty 2.3.13 → 2.3.14

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: 6f430fb3de709a8defa184dd6713f26f4241eb00
4
- data.tar.gz: 7c4b7968a63650d1c64ebe92ad078afe73a2de0d
2
+ SHA256:
3
+ metadata.gz: da67a7b3a76528a69a24aa349d488d0675a0d9b3de9733c3b67abd5bd04428f8
4
+ data.tar.gz: 915575d95227cd4c01a7d1b2b5ffb77b9846789a0d303462c8590a708aa0f83d
5
5
  SHA512:
6
- metadata.gz: c34932a807c4104371feb55c3f60c55e142a1c0da653f5db0d9fbd6cc407fdc53e6680b5271ad58fa8551a862b0ee6012d5409641406ad285c733675bf7425ed
7
- data.tar.gz: de51f0373c9f1b368f89baffd59982cb14a426cd38dfccc4350e5ab14f98366ea0fc6634814a490868ba7d7ba6c225288ad6e03473c6f70253e58c60d55fc38f
6
+ metadata.gz: ecba775e4ad650d2ef22a0d79ae33d7743864e3ebef3ab7597513c122048441226db7a44f3b55f5a0aa606d626836561f118c9db5f49df1e44adb9013620e6ae
7
+ data.tar.gz: 13ce94510034f486dcff99496d7cba902b53f1ddc0d56ebcc99a2b639c5a040c084c2a45b3d83e2b187cc3ada48e9977c1fe92dbeccea003b5c46a13f847f7a4
@@ -73,7 +73,8 @@ module Layout
73
73
  ######################################################################
74
74
  # PG ENUM field handling
75
75
 
76
- def enum_column(c, class_or_array)
76
+ def enum_column(c, class_or_array, col=nil)
77
+ col ||= c.name.demodulize.tableize.singularize
77
78
  vals = class_or_array.is_a?(Array) ? class_or_array : class_or_array::VALUES
78
79
  editor_config = {
79
80
  trigger_action: :all,
@@ -91,6 +92,7 @@ module Layout
91
92
  field_config: editor_config,
92
93
  type: :string,
93
94
  setter: enum_setter(c.name),
95
+ sorting_scope: get_sorter(col)
94
96
  )
95
97
  end
96
98
 
@@ -112,6 +114,10 @@ module Layout
112
114
  lambda {|r, v| r.send("#{name}=", v.blank? || v == '---' ? nil : v)}
113
115
  end
114
116
 
117
+ def get_sorter(col)
118
+ lambda {|rel, dir| rel.order("#{col}::text #{dir.to_s}")}
119
+ end
120
+
115
121
  ######################################################################
116
122
  # employ lots of hakery to implement NULLable boolean field in
117
123
  # Netzke 8.x.
@@ -1,3 +1,3 @@
1
1
  module Marty
2
- VERSION = "2.3.13"
2
+ VERSION = "2.3.14"
3
3
  end
@@ -14,6 +14,27 @@ 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
+
17
38
  log_in_as('dev1')
18
39
 
19
40
  by 'navigating to loan program screen' do
@@ -21,11 +42,6 @@ feature 'test netzke + pg_enum compatibility', js: true do
21
42
  press('Loan Programs')
22
43
  end
23
44
 
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')
29
45
 
30
46
  and_by 'bring up new window' do
31
47
  press('Add')
@@ -35,14 +51,14 @@ feature 'test netzke + pg_enum compatibility', js: true do
35
51
  within(:gridpanel, 'add_window', match: :first) do
36
52
  fill_in("Name", with: 'a_l_p')
37
53
 
38
- amort_combo.click
39
- amort_combo.select_values('Fixed')
54
+ @amort_combo.click
55
+ @amort_combo.select_values('Fixed')
40
56
 
41
- mortgage_combo.click
42
- mortgage_combo.select_values('FHA')
57
+ @mortgage_combo.click
58
+ @mortgage_combo.select_values('FHA')
43
59
 
44
- streamline_combo.click
45
- streamline_combo.select_values('DURP')
60
+ @streamline_combo.click
61
+ @streamline_combo.select_values('DURP')
46
62
 
47
63
  press('OK')
48
64
  end
@@ -58,18 +74,7 @@ feature 'test netzke + pg_enum compatibility', js: true do
58
74
  and_by 'fill form w enum value & duplicated name (error), then fix' do
59
75
  within(:gridpanel, 'add_window', match: :first) do
60
76
  fill_in("Name", with: 'a_l_p')
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
-
77
+ setup_enum_form("CA")
73
78
  press('OK')
74
79
 
75
80
  expect(find(:msg)).to have_content 'Name - record must be unique'
@@ -100,18 +105,7 @@ feature 'test netzke + pg_enum compatibility', js: true do
100
105
  and_by 'fill form w --- for enum value' do
101
106
  within(:gridpanel, 'add_window', match: :first) do
102
107
  fill_in("Name", with: 'a_l_p')
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
-
108
+ setup_enum_form("---")
115
109
  press('OK')
116
110
  end
117
111
 
@@ -121,5 +115,76 @@ feature 'test netzke + pg_enum compatibility', js: true do
121
115
  expect(lp_grid.get_row_vals(1)).to netzke_include({enum_state: nil})
122
116
  end
123
117
  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.col_values(: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.col_values(:enum_state)).to eq(["WA","DC","AZ","AS"])
187
+ end
188
+
124
189
  end
125
190
  end
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: 2.3.13
4
+ version: 2.3.14
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: 2018-10-12 00:00:00.000000000 Z
17
+ date: 2018-10-29 00:00:00.000000000 Z
18
18
  dependencies:
19
19
  - !ruby/object:Gem::Dependency
20
20
  name: pg
@@ -1706,7 +1706,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
1706
1706
  version: '0'
1707
1707
  requirements: []
1708
1708
  rubyforge_project:
1709
- rubygems_version: 2.6.14
1709
+ rubygems_version: 2.7.7
1710
1710
  signing_key:
1711
1711
  specification_version: 4
1712
1712
  summary: A framework for working with versioned data