You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: test/bootstrap_form_test.rb
+11-2Lines changed: 11 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -198,15 +198,24 @@ def setup
198
198
assert_equalexpected,output
199
199
end
200
200
201
-
test'control_group renders the "error" class corrrectly when object is invalid'do
201
+
test'control_group renders the :help corrrectly'do
202
+
output=@builder.control_groupnil,help: 'Foobar'do
203
+
'<span>custom control here</span>'
204
+
end
205
+
206
+
expected=%{<div class="control-group"><div class="controls"><span>custom control here</span><span class="help-inline">Foobar</span></div></div>}
207
+
assert_equalexpected,output
208
+
end
209
+
210
+
test'control_group renders the "error" class and message corrrectly when object is invalid'do
202
211
@user.email=nil
203
212
@user.valid?
204
213
205
214
output=@builder.control_group:emaildo
206
215
'<span>custom control here</span>'
207
216
end
208
217
209
-
expected=%{<div class="control-group error"><div class="controls"><span>custom control here</span></div></div>}
218
+
expected=%{<div class="control-group error"><div class="controls"><span>custom control here</span><span class="help-inline">can't be blank, is too short (minimum is 5 characters)</span></div></div>}
0 commit comments