Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Merge remote-tracking branch 'upstream/master' into bootstrap-4-rails…
…-5-1
  • Loading branch information
lcreid committed Aug 28, 2017
commit 4c83ea2262145b127929fcef665fbe786d6db46e
7 changes: 6 additions & 1 deletion test/bootstrap_form_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,12 @@ def setup
end

test "bootstrap_form_tag allows an empty name for checkboxes" do
expected = %{<form accept-charset="UTF-8" action="/users" method="post" role="form"><div style="margin:0;padding:0;display:inline"><input name="utf8" type="hidden" value="&#x2713;" /></div><div class="form-check"><label class="form-check-label" for="_misc"><input name="[misc]" type="hidden" value="0" /><input class="form-check-input" id="_misc" name="[misc]" type="checkbox" value="1" /> Misc</label></div></form>}
checkbox = if ::Rails::VERSION::STRING >= '5.1'
%{<div class="checkbox"><label for="misc"><input name="misc" type="hidden" value="0" /><input id="misc" name="misc" type="checkbox" value="1" /> Misc</label></div>}
else
%{<div class="checkbox"><label for="_misc"><input name="[misc]" type="hidden" value="0" /><input id="_misc" name="[misc]" type="checkbox" value="1" /> Misc</label></div>}
end
expected = %{<form accept-charset="UTF-8" action="/users" method="post" role="form"><div style="margin:0;padding:0;display:inline"><input name="utf8" type="hidden" value="&#x2713;" /></div>#{checkbox}</form>}
assert_equivalent_xml expected, bootstrap_form_tag(url: '/users') { |f| f.check_box :misc }
end

Expand Down
2 changes: 1 addition & 1 deletion test/bootstrap_selects_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ def setup
test 'selects with addons are wrapped correctly' do
expected = <<-HTML.strip_heredoc
<div class="form-group">
<label class="form-control-label" for="user_status">Status</label>
<label class="control-label" for="user_status">Status</label>
<div class="input-group">
<span class="input-group-addon">Before</span>
<select class="form-control" id="user_status" name="user[status]">
Expand Down
You are viewing a condensed version of this merge commit. You can view the full changes here.