forked from bootstrap-ruby/bootstrap_form
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fixing bug when both input and append text are specified
- Loading branch information
Showing
2 changed files
with
14 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -160,6 +160,11 @@ def setup | |
assert_equal expected, @builder.text_field(:email, append: '.00') | ||
end | ||
|
||
test "adding both prepend and append text" do | ||
expected = %{<div class="form-group"><label for="user_email">Email</label><div class="input-group"><span class="input-group-addon">$</span><input class="form-control" id="user_email" name="user[email]" type="text" value="[email protected]" /><span class="input-group-addon">.00</span></div></div>} | ||
assert_equal expected, @builder.text_field(:email, prepend: '$', append: '.00') | ||
end | ||
|
||
test "help messages for default forms" do | ||
expected = %{<div class="form-group"><label for="user_email">Email</label><input class="form-control" id="user_email" name="user[email]" type="text" value="[email protected]" /><span class="help-block">This is required</span></div>} | ||
assert_equal expected, @builder.text_field(:email, help: 'This is required') | ||
|