gov_uk_date_fields 2.2.0 → 3.0.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/lib/gov_uk_date_fields/form_fields.rb +28 -14
- data/lib/gov_uk_date_fields/version.rb +1 -1
- data/test/dummy/log/test.log +430 -0
- data/test/dummy/test/models/form_fields_test.rb +134 -112
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: afc5da57c66f778875841732da87380f87ec678e
|
4
|
+
data.tar.gz: 6792f22278522a86820c02e5eeb44b36bf9fd96b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b85d73e9bb5cbd97c31f165baa9b7d2933741b538a2b138f8f1ecb389adfe3fdcbe4d08a99d33eddd298fca9a04a103c15c00d1c032df753b2e94b11009d5574
|
7
|
+
data.tar.gz: b5f829f8aab24d51cb81fce92d06672a474d28c657955a4ea190a2a490c95e862b0d5708a7c80b3be79e2c52127715f684acbe3e23e89c3dfc47ba578c69bdca
|
@@ -66,25 +66,30 @@ module GovUkDateFields
|
|
66
66
|
def generate_start_fieldset
|
67
67
|
%Q|
|
68
68
|
#{generate_fieldset_tag}
|
69
|
-
#{generate_legend_tag}
|
70
|
-
|
69
|
+
#{generate_legend_tag}
|
70
|
+
<span class="form-label-bold">#{@options[:legend_text]}</span>
|
71
|
+
<span class="form-hint" id="#{@hint_id}">#{@form_hint_text}</span>
|
71
72
|
#{generate_error_message}
|
72
|
-
|
73
|
+
</legend>
|
74
|
+
<div class="form-date">
|
73
75
|
|
|
74
76
|
end
|
75
77
|
|
76
78
|
def generate_fieldset_tag
|
77
|
-
|
79
|
+
css_class = "form-group gov_uk_date"
|
80
|
+
css_class += " form-group-error" if error_for_attr?
|
81
|
+
|
82
|
+
result = %Q|
|
83
|
+
<div class="#{css_class}"|
|
78
84
|
result += %Q| id="#{@fieldset_id}"| unless @fieldset_id.nil?
|
79
|
-
|
80
|
-
|
81
|
-
result += %Q| class="#{css_class}"|
|
85
|
+
result += ">"
|
86
|
+
result += %Q| <fieldset|
|
82
87
|
result += ">"
|
83
88
|
result
|
84
89
|
end
|
85
90
|
|
86
91
|
def generate_end_fieldset
|
87
|
-
"</div></fieldset>"
|
92
|
+
"</div></fieldset></div>"
|
88
93
|
end
|
89
94
|
|
90
95
|
def generate_legend_tag
|
@@ -139,28 +144,37 @@ module GovUkDateFields
|
|
139
144
|
end
|
140
145
|
|
141
146
|
def generate_day_input_field(day_value)
|
142
|
-
|
147
|
+
css_class = "form-control"
|
148
|
+
css_class += " form-control-error" if error_for_attr?
|
149
|
+
|
150
|
+
result = %Q|
|
143
151
|
<div class="form-group form-group-day">
|
144
152
|
<label for="#{html_id(:day)}">Day</label>
|
145
|
-
<input class="
|
153
|
+
<input class="#{css_class}" id="#{html_id(:day)}" name="#{html_name(:day)}" type="number" min="0" max="31" aria-describedby="#{@hint_id}" value="#{day_value}">
|
146
154
|
</div>
|
147
155
|
|
|
148
156
|
end
|
149
157
|
|
150
158
|
def generate_month_input_field(month_value)
|
151
|
-
|
159
|
+
css_class = "form-control"
|
160
|
+
css_class += " form-control-error" if error_for_attr?
|
161
|
+
|
162
|
+
result = %Q|
|
152
163
|
<div class="form-group form-group-month">
|
153
164
|
<label for="#{html_id(:month)}">Month</label>
|
154
|
-
<input class="
|
165
|
+
<input class="#{css_class}" id="#{html_id(:month)}" name="#{html_name(:month)}" type="number" min="0" max="12" value="#{month_value}">
|
155
166
|
</div>
|
156
167
|
|
|
157
168
|
end
|
158
169
|
|
159
170
|
def generate_year_input_field(year_value)
|
160
|
-
|
171
|
+
css_class = "form-control"
|
172
|
+
css_class += " form-control-error" if error_for_attr?
|
173
|
+
|
174
|
+
result = %Q|
|
161
175
|
<div class="form-group form-group-year">
|
162
176
|
<label for="#{html_id(:year)}">Year</label>
|
163
|
-
<input class="
|
177
|
+
<input class="#{css_class}" id="#{html_id(:year)}" name="#{html_name(:year)}" type="number" min="0" max="2100" value="#{year_value}">
|
164
178
|
</div>
|
165
179
|
|
|
166
180
|
end
|
data/test/dummy/log/test.log
CHANGED
@@ -14460,3 +14460,433 @@ DirectorTest: test_updating_existing_record_with_invalid_dates_is_valid_when_val
|
|
14460
14460
|
[1m[35m (0.1ms)[0m [1m[35mSAVEPOINT active_record_1[0m
|
14461
14461
|
[1m[35m (0.1ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
|
14462
14462
|
[1m[35m (0.1ms)[0m [1m[31mROLLBACK[0m
|
14463
|
+
[1m[36mActiveRecord::SchemaMigration Load (0.7ms)[0m [1m[34mSELECT "schema_migrations".* FROM "schema_migrations"[0m
|
14464
|
+
[1m[35m (0.3ms)[0m [1m[35mBEGIN[0m
|
14465
|
+
--------------------------------------------
|
14466
|
+
EmployeesControllerTest: test_should_get_new
|
14467
|
+
--------------------------------------------
|
14468
|
+
[1m[35m (0.2ms)[0m [1m[35mSAVEPOINT active_record_1[0m
|
14469
|
+
[1m[35mSQL (19.5ms)[0m [1m[32mINSERT INTO "employees" ("name", "dob", "joined", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["name", "Stephen"], ["dob", Tue, 13 Aug 1963], ["joined", Tue, 01 Apr 2014], ["created_at", 2018-05-03 10:08:46 UTC], ["updated_at", 2018-05-03 10:08:46 UTC]]
|
14470
|
+
[1m[35m (0.2ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
|
14471
|
+
[1m[35m (0.2ms)[0m [1m[35mSAVEPOINT active_record_1[0m
|
14472
|
+
[1m[35mSQL (0.3ms)[0m [1m[32mINSERT INTO "employees" ("name", "dob", "joined", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["name", "Tony"], ["dob", Mon, 17 May 1965], ["joined", Wed, 21 May 2014], ["created_at", 2018-05-03 10:08:46 UTC], ["updated_at", 2018-05-03 10:08:46 UTC]]
|
14473
|
+
[1m[35m (0.2ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
|
14474
|
+
Processing by EmployeesController#new as HTML
|
14475
|
+
Rendering employees/new.html.erb within layouts/application
|
14476
|
+
Rendered employees/_form.html.erb (21.5ms)
|
14477
|
+
Rendered employees/new.html.erb within layouts/application (24.8ms)
|
14478
|
+
Completed 200 OK in 225ms (Views: 222.4ms | ActiveRecord: 0.0ms)
|
14479
|
+
[1m[35m (0.4ms)[0m [1m[31mROLLBACK[0m
|
14480
|
+
[1m[35m (0.1ms)[0m [1m[35mBEGIN[0m
|
14481
|
+
-----------------------------------------------------
|
14482
|
+
EmployeesControllerTest: test_should_destroy_employee
|
14483
|
+
-----------------------------------------------------
|
14484
|
+
[1m[35m (0.2ms)[0m [1m[35mSAVEPOINT active_record_1[0m
|
14485
|
+
[1m[35mSQL (0.3ms)[0m [1m[32mINSERT INTO "employees" ("name", "dob", "joined", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["name", "Stephen"], ["dob", Tue, 13 Aug 1963], ["joined", Tue, 01 Apr 2014], ["created_at", 2018-05-03 10:08:46 UTC], ["updated_at", 2018-05-03 10:08:46 UTC]]
|
14486
|
+
[1m[35m (0.1ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
|
14487
|
+
[1m[35m (0.2ms)[0m [1m[35mSAVEPOINT active_record_1[0m
|
14488
|
+
[1m[35mSQL (0.3ms)[0m [1m[32mINSERT INTO "employees" ("name", "dob", "joined", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["name", "Tony"], ["dob", Mon, 17 May 1965], ["joined", Wed, 21 May 2014], ["created_at", 2018-05-03 10:08:46 UTC], ["updated_at", 2018-05-03 10:08:46 UTC]]
|
14489
|
+
[1m[35m (0.1ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
|
14490
|
+
[1m[35m (12.3ms)[0m [1m[34mSELECT COUNT(*) FROM "employees"[0m
|
14491
|
+
Processing by EmployeesController#destroy as HTML
|
14492
|
+
Parameters: {"id"=>"683"}
|
14493
|
+
[1m[36mEmployee Load (0.3ms)[0m [1m[34mSELECT "employees".* FROM "employees" WHERE "employees"."id" = $1 LIMIT $2[0m [["id", 683], ["LIMIT", 1]]
|
14494
|
+
[1m[35m (0.1ms)[0m [1m[35mSAVEPOINT active_record_1[0m
|
14495
|
+
[1m[35mSQL (0.3ms)[0m [1m[31mDELETE FROM "employees" WHERE "employees"."id" = $1[0m [["id", 683]]
|
14496
|
+
[1m[35m (0.1ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
|
14497
|
+
Redirected to http://test.host/employees
|
14498
|
+
Completed 302 Found in 6ms (ActiveRecord: 1.1ms)
|
14499
|
+
[1m[35m (0.2ms)[0m [1m[34mSELECT COUNT(*) FROM "employees"[0m
|
14500
|
+
[1m[35m (6.4ms)[0m [1m[31mROLLBACK[0m
|
14501
|
+
[1m[35m (0.1ms)[0m [1m[35mBEGIN[0m
|
14502
|
+
----------------------------------------------
|
14503
|
+
EmployeesControllerTest: test_should_get_index
|
14504
|
+
----------------------------------------------
|
14505
|
+
[1m[35m (0.2ms)[0m [1m[35mSAVEPOINT active_record_1[0m
|
14506
|
+
[1m[35mSQL (1.2ms)[0m [1m[32mINSERT INTO "employees" ("name", "dob", "joined", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["name", "Stephen"], ["dob", Tue, 13 Aug 1963], ["joined", Tue, 01 Apr 2014], ["created_at", 2018-05-03 10:08:47 UTC], ["updated_at", 2018-05-03 10:08:47 UTC]]
|
14507
|
+
[1m[35m (0.3ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
|
14508
|
+
[1m[35m (0.2ms)[0m [1m[35mSAVEPOINT active_record_1[0m
|
14509
|
+
[1m[35mSQL (0.3ms)[0m [1m[32mINSERT INTO "employees" ("name", "dob", "joined", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["name", "Tony"], ["dob", Mon, 17 May 1965], ["joined", Wed, 21 May 2014], ["created_at", 2018-05-03 10:08:47 UTC], ["updated_at", 2018-05-03 10:08:47 UTC]]
|
14510
|
+
[1m[35m (0.2ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
|
14511
|
+
Processing by EmployeesController#index as HTML
|
14512
|
+
Rendering employees/index.html.erb within layouts/application
|
14513
|
+
[1m[36mEmployee Load (0.4ms)[0m [1m[34mSELECT "employees".* FROM "employees"[0m
|
14514
|
+
Rendered employees/index.html.erb within layouts/application (2.5ms)
|
14515
|
+
Completed 200 OK in 6ms (Views: 3.7ms | ActiveRecord: 0.4ms)
|
14516
|
+
[1m[35m (0.2ms)[0m [1m[31mROLLBACK[0m
|
14517
|
+
[1m[35m (0.1ms)[0m [1m[35mBEGIN[0m
|
14518
|
+
----------------------------------------------------
|
14519
|
+
EmployeesControllerTest: test_should_create_employee
|
14520
|
+
----------------------------------------------------
|
14521
|
+
[1m[35m (0.1ms)[0m [1m[35mSAVEPOINT active_record_1[0m
|
14522
|
+
[1m[35mSQL (0.3ms)[0m [1m[32mINSERT INTO "employees" ("name", "dob", "joined", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["name", "Stephen"], ["dob", Tue, 13 Aug 1963], ["joined", Tue, 01 Apr 2014], ["created_at", 2018-05-03 10:08:47 UTC], ["updated_at", 2018-05-03 10:08:47 UTC]]
|
14523
|
+
[1m[35m (0.2ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
|
14524
|
+
[1m[35m (0.1ms)[0m [1m[35mSAVEPOINT active_record_1[0m
|
14525
|
+
[1m[35mSQL (0.2ms)[0m [1m[32mINSERT INTO "employees" ("name", "dob", "joined", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["name", "Tony"], ["dob", Mon, 17 May 1965], ["joined", Wed, 21 May 2014], ["created_at", 2018-05-03 10:08:47 UTC], ["updated_at", 2018-05-03 10:08:47 UTC]]
|
14526
|
+
[1m[35m (0.2ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
|
14527
|
+
[1m[35m (0.2ms)[0m [1m[34mSELECT COUNT(*) FROM "employees"[0m
|
14528
|
+
Processing by EmployeesController#create as HTML
|
14529
|
+
Parameters: {"employee"=>{"dob_dd"=>"31", "dob_mm"=>"12", "dob_yyyy"=>"1965", "joined_dd"=>"4", "joined_mm"=>"mar", "joined_yyyy"=>"2015", "name"=>"Joe Blow"}}
|
14530
|
+
[1m[35m (0.1ms)[0m [1m[35mSAVEPOINT active_record_1[0m
|
14531
|
+
[1m[35mSQL (0.4ms)[0m [1m[32mINSERT INTO "employees" ("name", "dob", "joined", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["name", "Joe Blow"], ["dob", Fri, 31 Dec 1965], ["joined", Wed, 04 Mar 2015], ["created_at", 2018-05-03 10:08:47 UTC], ["updated_at", 2018-05-03 10:08:47 UTC]]
|
14532
|
+
[1m[35m (0.1ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
|
14533
|
+
Redirected to http://test.host/employees/689
|
14534
|
+
Completed 302 Found in 3ms (ActiveRecord: 0.7ms)
|
14535
|
+
[1m[35m (0.2ms)[0m [1m[34mSELECT COUNT(*) FROM "employees"[0m
|
14536
|
+
[1m[35m (0.3ms)[0m [1m[34mSELECT COUNT(*) FROM "employees"[0m
|
14537
|
+
[1m[36mEmployee Load (0.3ms)[0m [1m[34mSELECT "employees".* FROM "employees" ORDER BY "employees"."id" DESC LIMIT $1[0m [["LIMIT", 1]]
|
14538
|
+
[1m[35m (0.2ms)[0m [1m[31mROLLBACK[0m
|
14539
|
+
[1m[35m (0.1ms)[0m [1m[35mBEGIN[0m
|
14540
|
+
---------------------------------------------
|
14541
|
+
EmployeesControllerTest: test_should_get_edit
|
14542
|
+
---------------------------------------------
|
14543
|
+
[1m[35m (0.2ms)[0m [1m[35mSAVEPOINT active_record_1[0m
|
14544
|
+
[1m[35mSQL (0.2ms)[0m [1m[32mINSERT INTO "employees" ("name", "dob", "joined", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["name", "Stephen"], ["dob", Tue, 13 Aug 1963], ["joined", Tue, 01 Apr 2014], ["created_at", 2018-05-03 10:08:47 UTC], ["updated_at", 2018-05-03 10:08:47 UTC]]
|
14545
|
+
[1m[35m (0.2ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
|
14546
|
+
[1m[35m (0.1ms)[0m [1m[35mSAVEPOINT active_record_1[0m
|
14547
|
+
[1m[35mSQL (0.3ms)[0m [1m[32mINSERT INTO "employees" ("name", "dob", "joined", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["name", "Tony"], ["dob", Mon, 17 May 1965], ["joined", Wed, 21 May 2014], ["created_at", 2018-05-03 10:08:47 UTC], ["updated_at", 2018-05-03 10:08:47 UTC]]
|
14548
|
+
[1m[35m (0.1ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
|
14549
|
+
Processing by EmployeesController#edit as HTML
|
14550
|
+
Parameters: {"id"=>"690"}
|
14551
|
+
[1m[36mEmployee Load (0.3ms)[0m [1m[34mSELECT "employees".* FROM "employees" WHERE "employees"."id" = $1 LIMIT $2[0m [["id", 690], ["LIMIT", 1]]
|
14552
|
+
Rendering employees/edit.html.erb within layouts/application
|
14553
|
+
Rendered employees/_form.html.erb (2.0ms)
|
14554
|
+
Rendered employees/edit.html.erb within layouts/application (2.6ms)
|
14555
|
+
Completed 200 OK in 7ms (Views: 4.3ms | ActiveRecord: 0.3ms)
|
14556
|
+
[1m[35m (0.2ms)[0m [1m[31mROLLBACK[0m
|
14557
|
+
[1m[35m (0.1ms)[0m [1m[35mBEGIN[0m
|
14558
|
+
--------------------------------------------------------------
|
14559
|
+
EmployeesControllerTest: test_should_render_gov_uk_date_fields
|
14560
|
+
--------------------------------------------------------------
|
14561
|
+
[1m[35m (0.1ms)[0m [1m[35mSAVEPOINT active_record_1[0m
|
14562
|
+
[1m[35mSQL (0.3ms)[0m [1m[32mINSERT INTO "employees" ("name", "dob", "joined", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["name", "Stephen"], ["dob", Tue, 13 Aug 1963], ["joined", Tue, 01 Apr 2014], ["created_at", 2018-05-03 10:08:47 UTC], ["updated_at", 2018-05-03 10:08:47 UTC]]
|
14563
|
+
[1m[35m (0.2ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
|
14564
|
+
[1m[35m (0.1ms)[0m [1m[35mSAVEPOINT active_record_1[0m
|
14565
|
+
[1m[35mSQL (0.3ms)[0m [1m[32mINSERT INTO "employees" ("name", "dob", "joined", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["name", "Tony"], ["dob", Mon, 17 May 1965], ["joined", Wed, 21 May 2014], ["created_at", 2018-05-03 10:08:47 UTC], ["updated_at", 2018-05-03 10:08:47 UTC]]
|
14566
|
+
[1m[35m (0.1ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
|
14567
|
+
Processing by EmployeesController#edit as HTML
|
14568
|
+
Parameters: {"id"=>"692"}
|
14569
|
+
[1m[36mEmployee Load (0.2ms)[0m [1m[34mSELECT "employees".* FROM "employees" WHERE "employees"."id" = $1 LIMIT $2[0m [["id", 692], ["LIMIT", 1]]
|
14570
|
+
Rendering employees/edit.html.erb within layouts/application
|
14571
|
+
Rendered employees/_form.html.erb (2.3ms)
|
14572
|
+
Rendered employees/edit.html.erb within layouts/application (2.8ms)
|
14573
|
+
Completed 200 OK in 5ms (Views: 4.2ms | ActiveRecord: 0.2ms)
|
14574
|
+
[1m[35m (0.2ms)[0m [1m[31mROLLBACK[0m
|
14575
|
+
[1m[35m (0.1ms)[0m [1m[35mBEGIN[0m
|
14576
|
+
--------------------------------------------------
|
14577
|
+
EmployeesControllerTest: test_should_show_employee
|
14578
|
+
--------------------------------------------------
|
14579
|
+
[1m[35m (0.2ms)[0m [1m[35mSAVEPOINT active_record_1[0m
|
14580
|
+
[1m[35mSQL (0.3ms)[0m [1m[32mINSERT INTO "employees" ("name", "dob", "joined", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["name", "Stephen"], ["dob", Tue, 13 Aug 1963], ["joined", Tue, 01 Apr 2014], ["created_at", 2018-05-03 10:08:47 UTC], ["updated_at", 2018-05-03 10:08:47 UTC]]
|
14581
|
+
[1m[35m (0.1ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
|
14582
|
+
[1m[35m (0.2ms)[0m [1m[35mSAVEPOINT active_record_1[0m
|
14583
|
+
[1m[35mSQL (0.3ms)[0m [1m[32mINSERT INTO "employees" ("name", "dob", "joined", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["name", "Tony"], ["dob", Mon, 17 May 1965], ["joined", Wed, 21 May 2014], ["created_at", 2018-05-03 10:08:47 UTC], ["updated_at", 2018-05-03 10:08:47 UTC]]
|
14584
|
+
[1m[35m (0.1ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
|
14585
|
+
Processing by EmployeesController#show as HTML
|
14586
|
+
Parameters: {"id"=>"694"}
|
14587
|
+
[1m[36mEmployee Load (0.3ms)[0m [1m[34mSELECT "employees".* FROM "employees" WHERE "employees"."id" = $1 LIMIT $2[0m [["id", 694], ["LIMIT", 1]]
|
14588
|
+
Rendering employees/show.html.erb within layouts/application
|
14589
|
+
Rendered employees/show.html.erb within layouts/application (0.9ms)
|
14590
|
+
Completed 200 OK in 5ms (Views: 2.1ms | ActiveRecord: 0.3ms)
|
14591
|
+
[1m[35m (0.2ms)[0m [1m[31mROLLBACK[0m
|
14592
|
+
[1m[35m (0.1ms)[0m [1m[35mBEGIN[0m
|
14593
|
+
----------------------------------------------------
|
14594
|
+
EmployeesControllerTest: test_should_update_employee
|
14595
|
+
----------------------------------------------------
|
14596
|
+
[1m[35m (0.2ms)[0m [1m[35mSAVEPOINT active_record_1[0m
|
14597
|
+
[1m[35mSQL (0.4ms)[0m [1m[32mINSERT INTO "employees" ("name", "dob", "joined", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["name", "Stephen"], ["dob", Tue, 13 Aug 1963], ["joined", Tue, 01 Apr 2014], ["created_at", 2018-05-03 10:08:47 UTC], ["updated_at", 2018-05-03 10:08:47 UTC]]
|
14598
|
+
[1m[35m (0.2ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
|
14599
|
+
[1m[35m (0.2ms)[0m [1m[35mSAVEPOINT active_record_1[0m
|
14600
|
+
[1m[35mSQL (1.4ms)[0m [1m[32mINSERT INTO "employees" ("name", "dob", "joined", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["name", "Tony"], ["dob", Mon, 17 May 1965], ["joined", Wed, 21 May 2014], ["created_at", 2018-05-03 10:08:47 UTC], ["updated_at", 2018-05-03 10:08:47 UTC]]
|
14601
|
+
[1m[35m (4.1ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
|
14602
|
+
Processing by EmployeesController#update as HTML
|
14603
|
+
Parameters: {"employee"=>{"dob_dd"=>"1", "dob_mm"=>"11", "dob_yyyy"=>"1981", "joined_dd"=>"3", "joined_mm"=>"oct", "joined_yyyy"=>"2015", "name"=>"Ioannis Kole"}, "id"=>"696"}
|
14604
|
+
[1m[36mEmployee Load (0.2ms)[0m [1m[34mSELECT "employees".* FROM "employees" WHERE "employees"."id" = $1 LIMIT $2[0m [["id", 696], ["LIMIT", 1]]
|
14605
|
+
[1m[35m (0.2ms)[0m [1m[35mSAVEPOINT active_record_1[0m
|
14606
|
+
[1m[35mSQL (0.3ms)[0m [1m[33mUPDATE "employees" SET "dob" = $1, "joined" = $2, "name" = $3, "updated_at" = $4 WHERE "employees"."id" = $5[0m [["dob", Sun, 01 Nov 1981], ["joined", Sat, 03 Oct 2015], ["name", "Ioannis Kole"], ["updated_at", 2018-05-03 10:08:47 UTC], ["id", 696]]
|
14607
|
+
[1m[35m (0.2ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
|
14608
|
+
Redirected to http://test.host/employees/696
|
14609
|
+
Completed 302 Found in 4ms (ActiveRecord: 0.9ms)
|
14610
|
+
[1m[36mEmployee Load (0.3ms)[0m [1m[34mSELECT "employees".* FROM "employees" WHERE "employees"."id" = $1 LIMIT $2[0m [["id", 696], ["LIMIT", 1]]
|
14611
|
+
[1m[35m (0.2ms)[0m [1m[31mROLLBACK[0m
|
14612
|
+
[1m[35m (0.2ms)[0m [1m[35mBEGIN[0m
|
14613
|
+
----------------------------------------------------------------------
|
14614
|
+
OmitErrorClashEmployeeTest: test_valid_dates_generate_no_errors_at_all
|
14615
|
+
----------------------------------------------------------------------
|
14616
|
+
[1m[35m (0.2ms)[0m [1m[31mROLLBACK[0m
|
14617
|
+
[1m[35m (0.2ms)[0m [1m[35mBEGIN[0m
|
14618
|
+
-------------------------------------------------------------------------------------------------------
|
14619
|
+
OmitErrorClashEmployeeTest: test_invalid_day_does_not_add_invalid_date_message_to_cant_be_blank_message
|
14620
|
+
-------------------------------------------------------------------------------------------------------
|
14621
|
+
[1m[35m (0.1ms)[0m [1m[31mROLLBACK[0m
|
14622
|
+
[1m[35m (0.1ms)[0m [1m[35mBEGIN[0m
|
14623
|
+
------------------------------------------------------------------
|
14624
|
+
OmitErrorClashEmployeeTest: test_presence_error_messages_generated
|
14625
|
+
------------------------------------------------------------------
|
14626
|
+
[1m[35m (0.2ms)[0m [1m[31mROLLBACK[0m
|
14627
|
+
[1m[35m (0.1ms)[0m [1m[35mBEGIN[0m
|
14628
|
+
--------------------------------------------------------------------------------------------------
|
14629
|
+
DefaultErrorClashEmployeeTest: test_invalid_day_adds_invalid_date_message_to_cant_be_blank_message
|
14630
|
+
--------------------------------------------------------------------------------------------------
|
14631
|
+
[1m[35m (0.2ms)[0m [1m[31mROLLBACK[0m
|
14632
|
+
[1m[35m (0.1ms)[0m [1m[35mBEGIN[0m
|
14633
|
+
---------------------------------------------------------------------
|
14634
|
+
DefaultErrorClashEmployeeTest: test_presence_error_messages_generated
|
14635
|
+
---------------------------------------------------------------------
|
14636
|
+
[1m[35m (0.1ms)[0m [1m[31mROLLBACK[0m
|
14637
|
+
[1m[35m (0.1ms)[0m [1m[35mBEGIN[0m
|
14638
|
+
-------------------------------------------------------------------------
|
14639
|
+
DefaultErrorClashEmployeeTest: test_valid_dates_generate_no_errors_at_all
|
14640
|
+
-------------------------------------------------------------------------
|
14641
|
+
[1m[35m (0.1ms)[0m [1m[31mROLLBACK[0m
|
14642
|
+
[1m[35m (0.1ms)[0m [1m[35mBEGIN[0m
|
14643
|
+
-------------------------------------------------------
|
14644
|
+
GovUkDateFieldsTest: test_basic_output_without_fieldset
|
14645
|
+
-------------------------------------------------------
|
14646
|
+
[1m[35m (0.1ms)[0m [1m[31mROLLBACK[0m
|
14647
|
+
[1m[35m (0.1ms)[0m [1m[35mBEGIN[0m
|
14648
|
+
-------------------------------------------------------------------------------
|
14649
|
+
GovUkDateFieldsTest: test_fieldset_with_error_class_and_supplied_error_messages
|
14650
|
+
-------------------------------------------------------------------------------
|
14651
|
+
[1m[35m (0.1ms)[0m [1m[31mROLLBACK[0m
|
14652
|
+
[1m[35m (0.1ms)[0m [1m[35mBEGIN[0m
|
14653
|
+
---------------------------------------------------------------------------------------
|
14654
|
+
GovUkDateFieldsTest: test_fieldset_output_with_today_button_with_no_css_class_specified
|
14655
|
+
---------------------------------------------------------------------------------------
|
14656
|
+
[1m[35m (0.2ms)[0m [1m[31mROLLBACK[0m
|
14657
|
+
[1m[35m (0.1ms)[0m [1m[35mBEGIN[0m
|
14658
|
+
--------------------------------------------------------
|
14659
|
+
GovUkDateFieldsTest: test_fieldset_output_with_form_hint
|
14660
|
+
--------------------------------------------------------
|
14661
|
+
[1m[35m (0.1ms)[0m [1m[31mROLLBACK[0m
|
14662
|
+
[1m[35m (0.1ms)[0m [1m[35mBEGIN[0m
|
14663
|
+
----------------------------------------------------------------------------------
|
14664
|
+
GovUkDateFieldsTest: test_fieldset_output_with_today_button_with_css_class_applied
|
14665
|
+
----------------------------------------------------------------------------------
|
14666
|
+
[1m[35m (0.2ms)[0m [1m[31mROLLBACK[0m
|
14667
|
+
[1m[35m (0.1ms)[0m [1m[35mBEGIN[0m
|
14668
|
+
-----------------------------------------------------------
|
14669
|
+
GovUkDateFieldsTest: test_fieldset_output_with_legend_class
|
14670
|
+
-----------------------------------------------------------
|
14671
|
+
[1m[35m (0.2ms)[0m [1m[31mROLLBACK[0m
|
14672
|
+
[1m[35m (0.1ms)[0m [1m[35mBEGIN[0m
|
14673
|
+
------------------------------------------
|
14674
|
+
GovUkDateFieldsTest: test_fieldset_with_id
|
14675
|
+
------------------------------------------
|
14676
|
+
[1m[35m (0.1ms)[0m [1m[31mROLLBACK[0m
|
14677
|
+
[1m[35m (0.1ms)[0m [1m[35mBEGIN[0m
|
14678
|
+
-------------------------------------------------------------
|
14679
|
+
GovUkDateFieldsTest: test_placeholder_output_without_fieldset
|
14680
|
+
-------------------------------------------------------------
|
14681
|
+
[1m[35m (0.1ms)[0m [1m[31mROLLBACK[0m
|
14682
|
+
[1m[35m (0.2ms)[0m [1m[35mBEGIN[0m
|
14683
|
+
---------------------------------------------------------------
|
14684
|
+
GovUkDateFieldsTest: test_error_raised_if_invalid_options_given
|
14685
|
+
---------------------------------------------------------------
|
14686
|
+
[1m[35m (0.1ms)[0m [1m[31mROLLBACK[0m
|
14687
|
+
[1m[35m (0.1ms)[0m [1m[35mBEGIN[0m
|
14688
|
+
---------------------------------------------------------------
|
14689
|
+
GovUkDateFieldsTest: test_fieldset_with_error_class_and_message
|
14690
|
+
---------------------------------------------------------------
|
14691
|
+
[1m[35m (0.2ms)[0m [1m[31mROLLBACK[0m
|
14692
|
+
[1m[35m (0.2ms)[0m [1m[35mBEGIN[0m
|
14693
|
+
-------------------------------------
|
14694
|
+
GovUkDateFieldsTest: test_squash_html
|
14695
|
+
-------------------------------------
|
14696
|
+
[1m[35m (0.2ms)[0m [1m[31mROLLBACK[0m
|
14697
|
+
[1m[35m (0.1ms)[0m [1m[35mBEGIN[0m
|
14698
|
+
--------------------------------------------
|
14699
|
+
EmployeeTest: test_nil_dates_raise_no_errors
|
14700
|
+
--------------------------------------------
|
14701
|
+
[1m[35m (0.2ms)[0m [1m[31mROLLBACK[0m
|
14702
|
+
[1m[35m (0.1ms)[0m [1m[35mBEGIN[0m
|
14703
|
+
-----------------------------------------------------------------
|
14704
|
+
EmployeeTest: test_employee_class_responds_to_acts_as_gov_uk_date
|
14705
|
+
-----------------------------------------------------------------
|
14706
|
+
[1m[35m (0.1ms)[0m [1m[31mROLLBACK[0m
|
14707
|
+
[1m[35m (0.1ms)[0m [1m[35mBEGIN[0m
|
14708
|
+
-----------------------------------------------------------
|
14709
|
+
EmployeeTest: test_that_nil_can_be_assigned_to_a_date_field
|
14710
|
+
-----------------------------------------------------------
|
14711
|
+
[1m[35m (0.2ms)[0m [1m[31mROLLBACK[0m
|
14712
|
+
[1m[35m (0.1ms)[0m [1m[35mBEGIN[0m
|
14713
|
+
-----------------------------------------------------------------------------------
|
14714
|
+
EmployeeTest: test_that_form_population_values_can_be_extracted_from_the_date_field
|
14715
|
+
-----------------------------------------------------------------------------------
|
14716
|
+
[1m[35m (0.1ms)[0m [1m[31mROLLBACK[0m
|
14717
|
+
[1m[35m (0.1ms)[0m [1m[35mBEGIN[0m
|
14718
|
+
------------------------------------------------------------------------
|
14719
|
+
EmployeeTest: test_creating_a_new_employee_with_invalid_dates_is_invalid
|
14720
|
+
------------------------------------------------------------------------
|
14721
|
+
[1m[35m (0.1ms)[0m [1m[31mROLLBACK[0m
|
14722
|
+
[1m[35m (0.1ms)[0m [1m[35mBEGIN[0m
|
14723
|
+
-------------------------------------------------------------------------------------------------------------------
|
14724
|
+
EmployeeTest: test_argument_error_is_raised_if_an_object_that_doesnt_respond_to_to_date_is_assigned_to_a_date_field
|
14725
|
+
-------------------------------------------------------------------------------------------------------------------
|
14726
|
+
[1m[35m (0.1ms)[0m [1m[31mROLLBACK[0m
|
14727
|
+
[1m[35m (0.1ms)[0m [1m[35mBEGIN[0m
|
14728
|
+
-----------------------------------------------------------
|
14729
|
+
EmployeeTest: test_new_dates_can_be_populated_from_the_form
|
14730
|
+
-----------------------------------------------------------
|
14731
|
+
[1m[35m (0.2ms)[0m [1m[31mROLLBACK[0m
|
14732
|
+
[1m[35m (0.1ms)[0m [1m[35mBEGIN[0m
|
14733
|
+
------------------------------------------------------------------------------------------
|
14734
|
+
EmployeeTest: test_employee_instance_has_form_date_instance_variables_for_each_gov_uk_date
|
14735
|
+
------------------------------------------------------------------------------------------
|
14736
|
+
[1m[35m (0.1ms)[0m [1m[31mROLLBACK[0m
|
14737
|
+
[1m[35m (0.1ms)[0m [1m[35mBEGIN[0m
|
14738
|
+
---------------------------------------------------------------------
|
14739
|
+
EmployeeTest: test_updating_existing_record_with_valid_dates_is_valid
|
14740
|
+
---------------------------------------------------------------------
|
14741
|
+
[1m[35m (0.1ms)[0m [1m[35mSAVEPOINT active_record_1[0m
|
14742
|
+
[1m[35mSQL (0.3ms)[0m [1m[32mINSERT INTO "employees" ("name", "dob", "joined", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["name", "John"], ["dob", Tue, 13 Aug 1963], ["joined", Mon, 21 Apr 2014], ["created_at", 2018-05-03 10:08:47 UTC], ["updated_at", 2018-05-03 10:08:47 UTC]]
|
14743
|
+
[1m[35m (0.1ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
|
14744
|
+
[1m[35m (0.2ms)[0m [1m[35mSAVEPOINT active_record_1[0m
|
14745
|
+
[1m[35mSQL (0.3ms)[0m [1m[33mUPDATE "employees" SET "dob" = $1, "updated_at" = $2 WHERE "employees"."id" = $3[0m [["dob", Mon, 17 May 1965], ["updated_at", 2018-05-03 10:08:47 UTC], ["id", 698]]
|
14746
|
+
[1m[35m (0.1ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
|
14747
|
+
[1m[35m (0.1ms)[0m [1m[31mROLLBACK[0m
|
14748
|
+
[1m[35m (0.1ms)[0m [1m[35mBEGIN[0m
|
14749
|
+
----------------------------------------------------------------------------------------------------------------
|
14750
|
+
EmployeeTest: test_that_the_calling_the_field_name_on_employee_will_return_the_date_part_of_the_form_date_object
|
14751
|
+
----------------------------------------------------------------------------------------------------------------
|
14752
|
+
[1m[35m (0.1ms)[0m [1m[31mROLLBACK[0m
|
14753
|
+
[1m[35m (0.1ms)[0m [1m[35mBEGIN[0m
|
14754
|
+
----------------------------------------------------------------------------------------------
|
14755
|
+
EmployeeTest: test_no_argument_error_is_raised_if_parseable_string_is_assigned_to_a_date_field
|
14756
|
+
----------------------------------------------------------------------------------------------
|
14757
|
+
[1m[35m (0.2ms)[0m [1m[31mROLLBACK[0m
|
14758
|
+
[1m[35m (0.1ms)[0m [1m[35mBEGIN[0m
|
14759
|
+
---------------------------------------------------------------------
|
14760
|
+
EmployeeTest: test_createing_a_new_employee_with_valid_dates_is_valid
|
14761
|
+
---------------------------------------------------------------------
|
14762
|
+
[1m[35m (0.1ms)[0m [1m[31mROLLBACK[0m
|
14763
|
+
[1m[35m (0.2ms)[0m [1m[35mBEGIN[0m
|
14764
|
+
-------------------------------------------
|
14765
|
+
EmployeeTest: test_invalid_day_raises_error
|
14766
|
+
-------------------------------------------
|
14767
|
+
[1m[35m (0.1ms)[0m [1m[31mROLLBACK[0m
|
14768
|
+
[1m[35m (0.1ms)[0m [1m[35mBEGIN[0m
|
14769
|
+
-------------------------------------------------------------------------
|
14770
|
+
EmployeeTest: test_updating_existing_record_with_invalid_dates_is_invalid
|
14771
|
+
-------------------------------------------------------------------------
|
14772
|
+
[1m[35m (0.1ms)[0m [1m[35mSAVEPOINT active_record_1[0m
|
14773
|
+
[1m[35mSQL (0.2ms)[0m [1m[32mINSERT INTO "employees" ("name", "dob", "joined", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["name", "John"], ["dob", Tue, 13 Aug 1963], ["joined", Mon, 21 Apr 2014], ["created_at", 2018-05-03 10:08:47 UTC], ["updated_at", 2018-05-03 10:08:47 UTC]]
|
14774
|
+
[1m[35m (0.1ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
|
14775
|
+
[1m[35m (0.1ms)[0m [1m[35mSAVEPOINT active_record_1[0m
|
14776
|
+
[1m[35m (0.1ms)[0m [1m[31mROLLBACK TO SAVEPOINT active_record_1[0m
|
14777
|
+
[1m[35m (0.2ms)[0m [1m[31mROLLBACK[0m
|
14778
|
+
[1m[35m (0.1ms)[0m [1m[35mBEGIN[0m
|
14779
|
+
----------------------------------------------
|
14780
|
+
EmployeeTest: test_valid_dates_raise_no_errors
|
14781
|
+
----------------------------------------------
|
14782
|
+
[1m[35m (0.2ms)[0m [1m[31mROLLBACK[0m
|
14783
|
+
[1m[35m (0.1ms)[0m [1m[35mBEGIN[0m
|
14784
|
+
---------------------------------------------------------------------------------------------------------
|
14785
|
+
EmployeeTest: test_that_argument_error_is_raised_if_unparseable_string_object_is_assigned_to_a_date_field
|
14786
|
+
---------------------------------------------------------------------------------------------------------
|
14787
|
+
[1m[35m (0.2ms)[0m [1m[31mROLLBACK[0m
|
14788
|
+
[1m[35m (0.1ms)[0m [1m[35mBEGIN[0m
|
14789
|
+
--------------------------------------------------------------------------
|
14790
|
+
EmployeeTest: test_employee_has_class_variable_describing_all_gov_uk_dates
|
14791
|
+
--------------------------------------------------------------------------
|
14792
|
+
[1m[35m (0.1ms)[0m [1m[31mROLLBACK[0m
|
14793
|
+
[1m[35m (0.1ms)[0m [1m[35mBEGIN[0m
|
14794
|
+
-----------------------------------------------------------------------
|
14795
|
+
EmployeeTest: test_that_we_can_assign_new_dates_to_the_form_date_object
|
14796
|
+
-----------------------------------------------------------------------
|
14797
|
+
[1m[35m (0.1ms)[0m [1m[31mROLLBACK[0m
|
14798
|
+
[1m[35m (0.1ms)[0m [1m[35mBEGIN[0m
|
14799
|
+
-----------------------------------------------------------------------------------------
|
14800
|
+
GovUkDateFields::FormDateTest: test_set_from_date_instantiates_the_attribute_and_is_valid
|
14801
|
+
-----------------------------------------------------------------------------------------
|
14802
|
+
[1m[35m (0.1ms)[0m [1m[31mROLLBACK[0m
|
14803
|
+
[1m[35m (0.1ms)[0m [1m[35mBEGIN[0m
|
14804
|
+
------------------------------------------------------------------------------------------
|
14805
|
+
GovUkDateFields::FormDateTest: test_set_from_date_instantiates_a_nil_object_if_date_is_nil
|
14806
|
+
------------------------------------------------------------------------------------------
|
14807
|
+
[1m[35m (0.2ms)[0m [1m[31mROLLBACK[0m
|
14808
|
+
[1m[35m (0.1ms)[0m [1m[35mBEGIN[0m
|
14809
|
+
-------------------------------------------------------------------------------
|
14810
|
+
GovUkDateFields::FormDateTest: test_set_one_date_part_leaves_the_rest_unchanged
|
14811
|
+
-------------------------------------------------------------------------------
|
14812
|
+
[1m[35m (0.1ms)[0m [1m[31mROLLBACK[0m
|
14813
|
+
[1m[35m (0.1ms)[0m [1m[35mBEGIN[0m
|
14814
|
+
---------------------------------------------------------------------------------
|
14815
|
+
GovUkDateFields::FormDateTest: test_new_raises_error_if_called_from_outside_class
|
14816
|
+
---------------------------------------------------------------------------------
|
14817
|
+
[1m[35m (0.1ms)[0m [1m[31mROLLBACK[0m
|
14818
|
+
[1m[35m (0.1ms)[0m [1m[35mBEGIN[0m
|
14819
|
+
-----------------------------------------------------------------------------------------------
|
14820
|
+
GovUkDateFields::FormDateTest: test_setting_all_date_parts_to_nil_sets_date_to_nil_and_is_valid
|
14821
|
+
-----------------------------------------------------------------------------------------------
|
14822
|
+
[1m[35m (0.2ms)[0m [1m[31mROLLBACK[0m
|
14823
|
+
[1m[35m (0.1ms)[0m [1m[35mBEGIN[0m
|
14824
|
+
---------------------------------------------------------------------------------
|
14825
|
+
GovUkDateFields::FormDateTest: test_setting_all_three_date_parts_changes_the_date
|
14826
|
+
---------------------------------------------------------------------------------
|
14827
|
+
[1m[35m (0.1ms)[0m [1m[31mROLLBACK[0m
|
14828
|
+
[1m[35m (0.1ms)[0m [1m[35mBEGIN[0m
|
14829
|
+
----------------------------------------------------------------------------------------------------------------------------------
|
14830
|
+
GovUkDateFields::FormDateTest: test_setting_date_parts_with_invalid_values_marks_date_as_invalid_and_leaves_date_variable_the_same
|
14831
|
+
----------------------------------------------------------------------------------------------------------------------------------
|
14832
|
+
[1m[35m (0.1ms)[0m [1m[31mROLLBACK[0m
|
14833
|
+
[1m[35m (0.1ms)[0m [1m[35mBEGIN[0m
|
14834
|
+
--------------------------------------------------------------------------------
|
14835
|
+
OverrideErrorClashEmployeeTest: test_invalid_day_overrides_cant_be_blank_message
|
14836
|
+
--------------------------------------------------------------------------------
|
14837
|
+
[1m[35m (0.1ms)[0m [1m[31mROLLBACK[0m
|
14838
|
+
[1m[35m (0.1ms)[0m [1m[35mBEGIN[0m
|
14839
|
+
----------------------------------------------------------------------
|
14840
|
+
OverrideErrorClashEmployeeTest: test_presence_error_messages_generated
|
14841
|
+
----------------------------------------------------------------------
|
14842
|
+
[1m[35m (0.1ms)[0m [1m[31mROLLBACK[0m
|
14843
|
+
[1m[35m (0.1ms)[0m [1m[35mBEGIN[0m
|
14844
|
+
--------------------------------------------------------------------------
|
14845
|
+
OverrideErrorClashEmployeeTest: test_valid_dates_generate_no_errors_at_all
|
14846
|
+
--------------------------------------------------------------------------
|
14847
|
+
[1m[35m (0.1ms)[0m [1m[31mROLLBACK[0m
|
14848
|
+
[1m[35m (0.1ms)[0m [1m[35mBEGIN[0m
|
14849
|
+
-----------------------------------------------------------------
|
14850
|
+
DirectorTest: test_director_class_responds_to_acts_as_gov_uk_date
|
14851
|
+
-----------------------------------------------------------------
|
14852
|
+
[1m[35m (0.2ms)[0m [1m[31mROLLBACK[0m
|
14853
|
+
[1m[35m (0.1ms)[0m [1m[35mBEGIN[0m
|
14854
|
+
--------------------------------------------------------------------------
|
14855
|
+
DirectorTest: test_director_has_class_variable_describing_all_gov_uk_dates
|
14856
|
+
--------------------------------------------------------------------------
|
14857
|
+
[1m[35m (0.1ms)[0m [1m[31mROLLBACK[0m
|
14858
|
+
[1m[35m (0.1ms)[0m [1m[35mBEGIN[0m
|
14859
|
+
------------------------------------------------------------------------------------------------
|
14860
|
+
DirectorTest: test_updating_existing_record_with_invalid_dates_is_valid_when_validation_disabled
|
14861
|
+
------------------------------------------------------------------------------------------------
|
14862
|
+
[1m[35m (0.1ms)[0m [1m[35mSAVEPOINT active_record_1[0m
|
14863
|
+
[1m[35mSQL (0.3ms)[0m [1m[32mINSERT INTO "employees" ("name", "dob", "joined", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["name", "John"], ["dob", Tue, 13 Aug 1963], ["joined", Mon, 21 Apr 2014], ["created_at", 2018-05-03 10:08:47 UTC], ["updated_at", 2018-05-03 10:08:47 UTC]]
|
14864
|
+
[1m[35m (0.1ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
|
14865
|
+
[1m[35m (0.1ms)[0m [1m[35mSAVEPOINT active_record_1[0m
|
14866
|
+
[1m[35m (0.2ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
|
14867
|
+
[1m[35m (0.1ms)[0m [1m[31mROLLBACK[0m
|
14868
|
+
[1m[35m (0.1ms)[0m [1m[35mBEGIN[0m
|
14869
|
+
-----------------------------------------------------------------------
|
14870
|
+
DirectorTest: test_valid_dates_raise_no_errors_when_validation_disabled
|
14871
|
+
-----------------------------------------------------------------------
|
14872
|
+
[1m[35m (0.1ms)[0m [1m[31mROLLBACK[0m
|
14873
|
+
[1m[35m (0.1ms)[0m [1m[35mBEGIN[0m
|
14874
|
+
-----------------------------------------------------------------------------------------------
|
14875
|
+
DirectorTest: test_creating_a_new_director_with_invalid_dates_is_valid_when_validation_disabled
|
14876
|
+
-----------------------------------------------------------------------------------------------
|
14877
|
+
[1m[35m (0.1ms)[0m [1m[31mROLLBACK[0m
|
14878
|
+
[1m[35m (0.1ms)[0m [1m[35mBEGIN[0m
|
14879
|
+
-----------------------------------------------------------------------
|
14880
|
+
DirectorTest: test_invalid_day_raises_no_error_when_validation_disabled
|
14881
|
+
-----------------------------------------------------------------------
|
14882
|
+
[1m[35m (0.1ms)[0m [1m[31mROLLBACK[0m
|
14883
|
+
[1m[35m (0.1ms)[0m [1m[35mBEGIN[0m
|
14884
|
+
---------------------------------------------------------------------
|
14885
|
+
DirectorTest: test_nil_dates_raise_no_errors_when_validation_disabled
|
14886
|
+
---------------------------------------------------------------------
|
14887
|
+
[1m[35m (0.1ms)[0m [1m[31mROLLBACK[0m
|
14888
|
+
[1m[35m (0.1ms)[0m [1m[35mBEGIN[0m
|
14889
|
+
----------------------------------------------
|
14890
|
+
ReplicantTest: test_joined_date_is_same_as_dob
|
14891
|
+
----------------------------------------------
|
14892
|
+
[1m[35m (0.2ms)[0m [1m[31mROLLBACK[0m
|
@@ -103,149 +103,171 @@ class GovUkDateFieldsTest < ActiveSupport::TestCase
|
|
103
103
|
|
104
104
|
def expected_fieldset_output_with_error_class_and_message
|
105
105
|
%Q{
|
106
|
-
<
|
107
|
-
<
|
108
|
-
|
109
|
-
|
110
|
-
<
|
111
|
-
|
112
|
-
</
|
113
|
-
<
|
114
|
-
<span class="error-message">
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
<div class="form-
|
119
|
-
<
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
<
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
<
|
128
|
-
|
106
|
+
<div class="form-group gov_uk_date form-group-error" id="employee_date_joined">
|
107
|
+
<fieldset>
|
108
|
+
<legend>
|
109
|
+
<span class="form-label-bold">Joining date</span>
|
110
|
+
<span class="form-hint" id="employee_date_joined-hint">
|
111
|
+
For example, 31 3 1980
|
112
|
+
</span>
|
113
|
+
<ul>
|
114
|
+
<li><span class="error-message">Invalid joining date</span></li>
|
115
|
+
<li><span class="error-message">Joining date must be in the past</span></li>
|
116
|
+
</ul>
|
117
|
+
</legend>
|
118
|
+
<div class="form-date">
|
119
|
+
<div class="form-group form-group-day">
|
120
|
+
<label for="employee_joined_dd">Day</label>
|
121
|
+
<input class="form-control form-control-error" id="employee_joined_dd" name="employee[joined_dd]" type="number" min="0" max="31" aria-describedby="employee_date_joined-hint" value="1">
|
122
|
+
</div>
|
123
|
+
<div class="form-group form-group-month">
|
124
|
+
<label for="employee_joined_mm">Month</label>
|
125
|
+
<input class="form-control form-control-error" id="employee_joined_mm" name="employee[joined_mm]" type="number" min="0" max="12" value="4">
|
126
|
+
</div>
|
127
|
+
<div class="form-group form-group-year">
|
128
|
+
<label for="employee_joined_yyyy">Year</label>
|
129
|
+
<input class="form-control form-control-error" id="employee_joined_yyyy" name="employee[joined_yyyy]" type="number" min="0" max="2100" value="2015">
|
130
|
+
</div>
|
129
131
|
</div>
|
130
|
-
</
|
131
|
-
</
|
132
|
+
</fieldset>
|
133
|
+
</div>
|
132
134
|
}
|
133
135
|
end
|
134
136
|
|
135
137
|
def expected_fieldset_output_with_id
|
136
138
|
%Q{
|
137
|
-
<
|
138
|
-
<
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
139
|
+
<div class="form-group gov_uk_date" id="employee_date_joined">
|
140
|
+
<fieldset>
|
141
|
+
<legend>
|
142
|
+
<span class="form-label-bold">Joining date</span>
|
143
|
+
<span class="form-hint" id="employee_date_joined-hint">For example, 31 3 1980</span>
|
144
|
+
</legend>
|
145
|
+
<div class="form-date">
|
146
|
+
<div class="form-group form-group-day">
|
147
|
+
<label for="employee_joined_dd">Day</label>
|
148
|
+
<input class="form-control" id="employee_joined_dd" name="employee[joined_dd]" type="number" min="0" max="31" aria-describedby="employee_date_joined-hint" value="1">
|
149
|
+
</div>
|
150
|
+
<div class="form-group form-group-month">
|
151
|
+
<label for="employee_joined_mm">Month</label>
|
152
|
+
<input class="form-control" id="employee_joined_mm" name="employee[joined_mm]" type="number" min="0" max="12" value="4">
|
153
|
+
</div>
|
154
|
+
<div class="form-group form-group-year">
|
155
|
+
<label for="employee_joined_yyyy">Year</label>
|
156
|
+
<input class="form-control" id="employee_joined_yyyy" name="employee[joined_yyyy]" type="number" min="0" max="2100" value="2015">
|
157
|
+
</div>
|
152
158
|
</div>
|
153
|
-
</
|
154
|
-
</
|
159
|
+
</fieldset>
|
160
|
+
</div>
|
155
161
|
}
|
156
162
|
end
|
157
163
|
|
158
164
|
def expected_fieldset_output_with_form_hint
|
159
165
|
%Q{
|
160
|
-
<
|
161
|
-
<
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
|
170
|
-
|
171
|
-
|
172
|
-
|
173
|
-
|
174
|
-
|
166
|
+
<div class="form-group gov_uk_date">
|
167
|
+
<fieldset>
|
168
|
+
<legend class="govuk_legend_class">
|
169
|
+
<span class="form-label-bold">Date of birth</span>
|
170
|
+
<span class="form-hint" id="dob-hint">In the form: dd mm yyyy</span>
|
171
|
+
</legend>
|
172
|
+
<div class="form-date">
|
173
|
+
<div class="form-group form-group-day">
|
174
|
+
<label for="employee_dob_dd">Day</label>
|
175
|
+
<input class="form-control" id="employee_dob_dd" name="employee[dob_dd]" type="number" min="0" max="31" aria-describedby="dob-hint" value="7">
|
176
|
+
</div>
|
177
|
+
<div class="form-group form-group-month">
|
178
|
+
<label for="employee_dob_mm">Month</label>
|
179
|
+
<input class="form-control" id="employee_dob_mm" name="employee[dob_mm]" type="number" min="0" max="12" value="12">
|
180
|
+
</div>
|
181
|
+
<div class="form-group form-group-year">
|
182
|
+
<label for="employee_dob_yyyy">Year</label>
|
183
|
+
<input class="form-control" id="employee_dob_yyyy" name="employee[dob_yyyy]" type="number" min="0" max="2100" value="1963">
|
184
|
+
</div>
|
175
185
|
</div>
|
176
|
-
</
|
177
|
-
</
|
186
|
+
</fieldset>
|
187
|
+
</div>
|
178
188
|
}
|
179
189
|
end
|
180
190
|
|
181
191
|
def expected_fieldset_output_with_legend_class
|
182
192
|
%Q{
|
183
|
-
<
|
184
|
-
<
|
185
|
-
|
186
|
-
|
187
|
-
|
188
|
-
|
189
|
-
|
190
|
-
|
191
|
-
|
192
|
-
|
193
|
-
|
194
|
-
|
195
|
-
|
196
|
-
|
197
|
-
|
193
|
+
<div class="form-group gov_uk_date">
|
194
|
+
<fieldset>
|
195
|
+
<legend class="date-legend-class">
|
196
|
+
<span class="form-label-bold">Joining date</span>
|
197
|
+
<span class="form-hint" id="joined-hint">For example, 31 3 1980</span>
|
198
|
+
</legend>
|
199
|
+
<div class="form-date">
|
200
|
+
<div class="form-group form-group-day">
|
201
|
+
<label for="employee_joined_dd">Day</label>
|
202
|
+
<input class="form-control" id="employee_joined_dd" name="employee[joined_dd]" type="number" min="0" max="31" aria-describedby="joined-hint" value="1">
|
203
|
+
</div>
|
204
|
+
<div class="form-group form-group-month">
|
205
|
+
<label for="employee_joined_mm">Month</label>
|
206
|
+
<input class="form-control" id="employee_joined_mm" name="employee[joined_mm]" type="number" min="0" max="12" value="4">
|
207
|
+
</div>
|
208
|
+
<div class="form-group form-group-year">
|
209
|
+
<label for="employee_joined_yyyy">Year</label>
|
210
|
+
<input class="form-control" id="employee_joined_yyyy" name="employee[joined_yyyy]" type="number" min="0" max="2100" value="2015">
|
211
|
+
</div>
|
198
212
|
</div>
|
199
|
-
</
|
200
|
-
</
|
213
|
+
</fieldset>
|
214
|
+
</div>
|
201
215
|
}
|
202
216
|
end
|
203
217
|
|
204
218
|
def expected_fieldset_output_with_unstyled_today_button
|
205
219
|
%Q{
|
206
|
-
<
|
207
|
-
<
|
208
|
-
|
209
|
-
|
210
|
-
|
211
|
-
|
212
|
-
|
213
|
-
|
220
|
+
<div class="form-group gov_uk_date" id="employee_date_joined">
|
221
|
+
<fieldset>
|
222
|
+
<legend>
|
223
|
+
<span class="form-label-bold">Joining date</span>
|
224
|
+
<span class="form-hint" id="employee_date_joined-hint">For example, 31 3 1980</span>
|
225
|
+
</legend>
|
226
|
+
<div class="form-date">
|
227
|
+
<a class="button" role="button" href="#">Today</a>
|
228
|
+
<div class="form-group form-group-day">
|
229
|
+
<label for="employee_joined_dd">Day</label>
|
230
|
+
<input class="form-control" id="employee_joined_dd" name="employee[joined_dd]" type="number" min="0" max="31" aria-describedby="employee_date_joined-hint" value="1">
|
231
|
+
</div>
|
232
|
+
<div class="form-group form-group-month">
|
233
|
+
<label for="employee_joined_mm">Month</label>
|
234
|
+
<input class="form-control" id="employee_joined_mm" name="employee[joined_mm]" type="number" min="0" max="12" value="4">
|
235
|
+
</div>
|
236
|
+
<div class="form-group form-group-year">
|
237
|
+
<label for="employee_joined_yyyy">Year</label>
|
238
|
+
<input class="form-control" id="employee_joined_yyyy" name="employee[joined_yyyy]" type="number" min="0" max="2100" value="2015">
|
239
|
+
</div>
|
214
240
|
</div>
|
215
|
-
|
216
|
-
|
217
|
-
<input class="form-control" id="employee_joined_mm" name="employee[joined_mm]" type="number" min="0" max="12" value="4">
|
218
|
-
</div>
|
219
|
-
<div class="form-group form-group-year">
|
220
|
-
<label for="employee_joined_yyyy">Year</label>
|
221
|
-
<input class="form-control" id="employee_joined_yyyy" name="employee[joined_yyyy]" type="number" min="0" max="2100" value="2015">
|
222
|
-
</div>
|
223
|
-
</div>
|
224
|
-
</fieldset>
|
241
|
+
</fieldset>
|
242
|
+
</div>
|
225
243
|
}
|
226
244
|
end
|
227
245
|
|
228
246
|
def expected_fieldset_output_with_syled_today_button
|
229
247
|
%Q{
|
230
|
-
<
|
231
|
-
<
|
232
|
-
|
233
|
-
|
234
|
-
|
235
|
-
|
236
|
-
|
237
|
-
|
238
|
-
|
239
|
-
|
240
|
-
|
241
|
-
|
242
|
-
|
243
|
-
|
244
|
-
|
245
|
-
|
248
|
+
<div class="form-group gov_uk_date" id="employee_date_joined">
|
249
|
+
<fieldset>
|
250
|
+
<legend>
|
251
|
+
<span class="form-label-bold">Joining date</span>
|
252
|
+
<span class="form-hint" id="employee_date_joined-hint">For example, 31 3 1980</span>
|
253
|
+
</legend>
|
254
|
+
<div class="form-date">
|
255
|
+
<a class="today-button-class" role="button" href="#">Today</a>
|
256
|
+
<div class="form-group form-group-day">
|
257
|
+
<label for="employee_joined_dd">Day</label>
|
258
|
+
<input class="form-control" id="employee_joined_dd" name="employee[joined_dd]" type="number" min="0" max="31" aria-describedby="employee_date_joined-hint" value="1">
|
259
|
+
</div>
|
260
|
+
<div class="form-group form-group-month">
|
261
|
+
<label for="employee_joined_mm">Month</label>
|
262
|
+
<input class="form-control" id="employee_joined_mm" name="employee[joined_mm]" type="number" min="0" max="12" value="4">
|
263
|
+
</div>
|
264
|
+
<div class="form-group form-group-year">
|
265
|
+
<label for="employee_joined_yyyy">Year</label>
|
266
|
+
<input class="form-control" id="employee_joined_yyyy" name="employee[joined_yyyy]" type="number" min="0" max="2100" value="2015">
|
267
|
+
</div>
|
246
268
|
</div>
|
247
|
-
</
|
248
|
-
</
|
269
|
+
</fieldset>
|
270
|
+
</div>
|
249
271
|
}
|
250
272
|
end
|
251
273
|
|