Simplify TabularFormBuilder field label specs

Signed-off-by: Alex Coles <alex@alexbcoles.com>
pull/2933/head
Alex Coles 10 years ago committed by Jan Sandbrink
parent 06bb524f3a
commit da4d6ef6a7
  1. 8
      spec/lib/tabular_form_builder_spec.rb

@ -538,18 +538,14 @@ JJ Abrams</textarea>
describe 'labels for fields' do
let(:options) { {} }
shared_examples_for "generated label" do
def remove_form_field_container(string)
string.gsub(/<span class="form--field-container">.+<\/span>/m,'')
end
def expected_label_like(expected_title)
expect(remove_form_field_container(output)).to be_html_eql(%{
expect(output).to be_html_eql(%{
<label class="form--label"
for="user_name"
title="#{expected_title}">
#{expected_title}
</label>
})
}).at_path('label')
end
context 'with a label specified as string' do

Loading…
Cancel
Save