Skip to content

Commit

Permalink
Merge pull request #641 from nathanscott/master
Browse files Browse the repository at this point in the history
label => false on timish not html_safe > fixed
  • Loading branch information
sobrinho committed Jul 31, 2011
2 parents 18639a1 + 0acfe94 commit 4202457
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lib/formtastic/inputs/base/timeish.rb
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ def fragments_label
:class => "label"
)
else
""
"".html_safe
end
end

Expand Down
8 changes: 8 additions & 0 deletions spec/inputs/label_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,14 @@
output_buffer.should_not have_tag('label')
output_buffer.should_not include(">")
end

it 'should return nil if label is false for timeish fragments' do
concat(semantic_form_for(@new_post) do |builder|
builder.input(:title, :as => :time, :label => false)
end)
output_buffer.should_not have_tag('li.time > label')
output_buffer.should_not include(">")
end

it 'should html escape the label string by default' do
concat(semantic_form_for(@new_post) do |builder|
Expand Down

0 comments on commit 4202457

Please sign in to comment.