aboutsummaryrefslogtreecommitdiffstats
path: root/railties/lib/rails/generators/test_unit/scaffold/templates/system_test.rb.tt
diff options
context:
space:
mode:
Diffstat (limited to 'railties/lib/rails/generators/test_unit/scaffold/templates/system_test.rb.tt')
-rw-r--r--railties/lib/rails/generators/test_unit/scaffold/templates/system_test.rb.tt8
1 files changed, 8 insertions, 0 deletions
diff --git a/railties/lib/rails/generators/test_unit/scaffold/templates/system_test.rb.tt b/railties/lib/rails/generators/test_unit/scaffold/templates/system_test.rb.tt
index 15bd7956b6..4f5bbf1108 100644
--- a/railties/lib/rails/generators/test_unit/scaffold/templates/system_test.rb.tt
+++ b/railties/lib/rails/generators/test_unit/scaffold/templates/system_test.rb.tt
@@ -16,8 +16,12 @@ class <%= class_name.pluralize %>Test < ApplicationSystemTestCase
click_on "New <%= class_name.titleize %>"
<%- attributes_hash.each do |attr, value| -%>
+ <%- if boolean?(attr) -%>
+ check "<%= attr.humanize %>" if <%= value %>
+ <%- else -%>
fill_in "<%= attr.humanize %>", with: <%= value %>
<%- end -%>
+ <%- end -%>
click_on "Create <%= human_name %>"
assert_text "<%= human_name %> was successfully created"
@@ -29,8 +33,12 @@ class <%= class_name.pluralize %>Test < ApplicationSystemTestCase
click_on "Edit", match: :first
<%- attributes_hash.each do |attr, value| -%>
+ <%- if boolean?(attr) -%>
+ check "<%= attr.humanize %>" if <%= value %>
+ <%- else -%>
fill_in "<%= attr.humanize %>", with: <%= value %>
<%- end -%>
+ <%- end -%>
click_on "Update <%= human_name %>"
assert_text "<%= human_name %> was successfully updated"