Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Bootstrap 3 s/div.controls/span.form-wrapper/

  • Loading branch information...
commit ee1bd160a898713d553c6fb8b10b0408071a1f2e 1 parent d364e03
@sodabrew sodabrew authored
View
60 spec/inputs/boolean_input_spec.rb
@@ -23,38 +23,38 @@
it 'should generate a label containing the input' do
output_buffer.should_not have_tag('label.label')
- output_buffer.should have_tag('form div.form-group div.controls label', :count => 1)
- output_buffer.should have_tag('form div.form-group div.controls label.checkbox', :count => 1)
- output_buffer.should have_tag('form div.form-group div.controls label[@for="post_allow_comments"]')
- output_buffer.should have_tag('form div.form-group div.controls label', /Allow comments/)
- output_buffer.should have_tag('form div.form-group div.controls label input[@type="checkbox"]', :count => 1)
+ output_buffer.should have_tag('form div.form-group span.form-wrapper label', :count => 1)
+ output_buffer.should have_tag('form div.form-group span.form-wrapper label.checkbox', :count => 1)
+ output_buffer.should have_tag('form div.form-group span.form-wrapper label[@for="post_allow_comments"]')
+ output_buffer.should have_tag('form div.form-group span.form-wrapper label', /Allow comments/)
+ output_buffer.should have_tag('form div.form-group span.form-wrapper label input[@type="checkbox"]', :count => 1)
output_buffer.should have_tag('form div.form-group input[@type="hidden"]', :count => 1)
- output_buffer.should_not have_tag('form div.form-group div.controls label input[@type="hidden"]', :count => 1) # invalid HTML5
+ output_buffer.should_not have_tag('form div.form-group span.form-wrapper label input[@type="hidden"]', :count => 1) # invalid HTML5
end
it 'should not add a "name" attribute to the label' do
- output_buffer.should_not have_tag('form div.form-group div.controls label[@name]')
+ output_buffer.should_not have_tag('form div.form-group span.form-wrapper label[@name]')
end
it 'should generate a checkbox input' do
- output_buffer.should have_tag('form div.form-group div.controls label input')
- output_buffer.should have_tag('form div.form-group div.controls label input#post_allow_comments')
- output_buffer.should have_tag('form div.form-group div.controls label input[@type="checkbox"]')
- output_buffer.should have_tag('form div.form-group div.controls label input[@name="post[allow_comments]"]')
- output_buffer.should have_tag('form div.form-group div.controls label input[@type="checkbox"][@value="1"]')
+ output_buffer.should have_tag('form div.form-group span.form-wrapper label input')
+ output_buffer.should have_tag('form div.form-group span.form-wrapper label input#post_allow_comments')
+ output_buffer.should have_tag('form div.form-group span.form-wrapper label input[@type="checkbox"]')
+ output_buffer.should have_tag('form div.form-group span.form-wrapper label input[@name="post[allow_comments]"]')
+ output_buffer.should have_tag('form div.form-group span.form-wrapper label input[@type="checkbox"][@value="1"]')
end
it 'should generate a checked input if object.method returns true' do
- output_buffer.should have_tag('form div.form-group div.controls label input[@checked="checked"]')
+ output_buffer.should have_tag('form div.form-group span.form-wrapper label input[@checked="checked"]')
output_buffer.should have_tag('form div.form-group input[@name="post[allow_comments]"]', :count => 2)
- output_buffer.should have_tag('form div.form-group div.controls input#post_allow_comments', :count => 1)
+ output_buffer.should have_tag('form div.form-group span.form-wrapper input#post_allow_comments', :count => 1)
end
it 'should generate a checked input if :input_html is passed :checked => checked' do
concat(semantic_form_for(@new_post) do |builder|
concat(builder.input(:answer_comments, :as => :boolean, :input_html => {:checked => 'checked'}))
end)
- output_buffer.should have_tag('form div.form-group div.controls label input[@checked="checked"]')
+ output_buffer.should have_tag('form div.form-group span.form-wrapper label input[@checked="checked"]')
end
it 'should name the hidden input with the :name html_option' do
@@ -87,17 +87,17 @@
concat(semantic_form_for(@new_post) do |builder|
concat(builder.input(:allow_comments, :as => :boolean, :input_html => {:id => 'custom_id'}))
end)
- output_buffer.should have_tag('form div.form-group div.controls label input[@id="custom_id"]')
- output_buffer.should have_tag('form div.form-group div.controls label[@for="custom_id"]')
+ output_buffer.should have_tag('form div.form-group span.form-wrapper label input[@id="custom_id"]')
+ output_buffer.should have_tag('form div.form-group span.form-wrapper label[@for="custom_id"]')
end
it 'should allow checked and unchecked values to be sent' do
concat(semantic_form_for(@new_post) do |builder|
concat(builder.input(:allow_comments, :as => :boolean, :checked_value => 'checked', :unchecked_value => 'unchecked'))
end)
- output_buffer.should have_tag('form div.form-group div.controls label input[@type="checkbox"][@value="checked"]:not([@unchecked_value][@checked_value])')
+ output_buffer.should have_tag('form div.form-group span.form-wrapper label input[@type="checkbox"][@value="checked"]:not([@unchecked_value][@checked_value])')
output_buffer.should have_tag('form div.form-group input[@type="hidden"][@value="unchecked"]')
- output_buffer.should_not have_tag('form div.form-group div.controls label input[@type="hidden"]') # invalid HTML5
+ output_buffer.should_not have_tag('form div.form-group span.form-wrapper label input[@type="hidden"]') # invalid HTML5
end
it 'should generate a checked input if object.method returns checked value' do
@@ -107,7 +107,7 @@
concat(builder.input(:allow_comments, :as => :boolean, :checked_value => 'yes', :unchecked_value => 'no'))
end)
- output_buffer.should have_tag('form div.form-group div.controls label input[@type="checkbox"][@value="yes"][@checked="checked"]')
+ output_buffer.should have_tag('form div.form-group span.form-wrapper label input[@type="checkbox"][@value="yes"][@checked="checked"]')
end
it 'should not generate a checked input if object.method returns unchecked value' do
@@ -117,7 +117,7 @@
concat(builder.input(:allow_comments, :as => :boolean, :checked_value => 'yes', :unchecked_value => 'no'))
end)
- output_buffer.should have_tag('form div.form-group div.controls label input[@type="checkbox"][@value="yes"]:not([@checked])')
+ output_buffer.should have_tag('form div.form-group span.form-wrapper label input[@type="checkbox"][@value="yes"]:not([@checked])')
end
it 'should generate a checked input if object.method returns checked value' do
@@ -127,7 +127,7 @@
concat(builder.input(:allow_comments, :as => :boolean, :checked_value => 'yes', :unchecked_value => 'no'))
end)
- output_buffer.should have_tag('form div.form-group div.controls label input[@type="checkbox"][@value="yes"][@checked="checked"]')
+ output_buffer.should have_tag('form div.form-group span.form-wrapper label input[@type="checkbox"][@value="yes"][@checked="checked"]')
end
it 'should not generate a checked input if object.method returns unchecked value' do
@@ -137,7 +137,7 @@
concat(builder.input(:allow_comments, :as => :boolean, :checked_value => 'yes', :unchecked_value => 'no'))
end)
- output_buffer.should have_tag('form div.form-group div.controls label input[@type="checkbox"][@value="yes"]:not([@checked])')
+ output_buffer.should have_tag('form div.form-group span.form-wrapper label input[@type="checkbox"][@value="yes"]:not([@checked])')
end
it 'should generate a label and a checkbox even if no object is given' do
@@ -145,13 +145,13 @@
concat(builder.input(:allow_comments, :as => :boolean))
end)
- output_buffer.should have_tag('form div.form-group div.controls label[@for="project_allow_comments"]')
- output_buffer.should have_tag('form div.form-group div.controls label', /Allow comments/)
- output_buffer.should have_tag('form div.form-group div.controls label input[@type="checkbox"]')
+ output_buffer.should have_tag('form div.form-group span.form-wrapper label[@for="project_allow_comments"]')
+ output_buffer.should have_tag('form div.form-group span.form-wrapper label', /Allow comments/)
+ output_buffer.should have_tag('form div.form-group span.form-wrapper label input[@type="checkbox"]')
- output_buffer.should have_tag('form div.form-group div.controls label input#project_allow_comments')
- output_buffer.should have_tag('form div.form-group div.controls label input[@type="checkbox"]')
- output_buffer.should have_tag('form div.form-group div.controls label input[@name="project[allow_comments]"]')
+ output_buffer.should have_tag('form div.form-group span.form-wrapper label input#project_allow_comments')
+ output_buffer.should have_tag('form div.form-group span.form-wrapper label input[@type="checkbox"]')
+ output_buffer.should have_tag('form div.form-group span.form-wrapper label input[@name="project[allow_comments]"]')
end
it "should render hints" do
@@ -159,7 +159,7 @@
concat(builder.input(:allow_comments, :as => :boolean, :hint => 'Allow user to post comment'))
end)
- output_buffer.should have_tag("form div.form-group div.controls span.help-block")
+ output_buffer.should have_tag("form div.form-group span.form-wrapper span.help-block")
end
context "when required" do
View
82 spec/inputs/check_boxes_input_spec.rb
@@ -42,15 +42,15 @@
end
it 'should have one option with a "checked" attribute' do
- output_buffer.should have_tag('form div.form-group div.controls input[@checked]', :count => 1)
+ output_buffer.should have_tag('form div.form-group span.form-wrapper input[@checked]', :count => 1)
end
it 'should not generate hidden inputs with default value blank' do
- output_buffer.should_not have_tag("form div.form-group div.controls label input[@type='hidden'][@value='']")
+ output_buffer.should_not have_tag("form div.form-group span.form-wrapper label input[@type='hidden'][@value='']")
end
- it 'should not render hidden inputs inside div.controls' do
- output_buffer.should_not have_tag("form div.controls input[@type='hidden']")
+ it 'should not render hidden inputs inside span.form-wrapper' do
+ output_buffer.should_not have_tag("form span.form-wrapper input[@type='hidden']")
end
it 'should render one hidden input for each choice outside the ol' do
@@ -60,30 +60,30 @@
describe "each choice" do
it 'should not give the choice label the label class' do
- output_buffer.should_not have_tag('div.controls label.label')
+ output_buffer.should_not have_tag('span.form-wrapper label.label')
end
it 'should not be marked as required' do
- output_buffer.should_not have_tag('div.controls input[@required]')
+ output_buffer.should_not have_tag('span.form-wrapper input[@required]')
end
it 'should contain a label for the radio input with a nested input and label text' do
::Post.all.each do |post|
- output_buffer.should have_tag('form div.form-group div.controls label', /#{post.to_label}/)
- output_buffer.should have_tag("form div.form-group div.controls label[@for='author_post_ids_#{post.id}']")
+ output_buffer.should have_tag('form div.form-group span.form-wrapper label', /#{post.to_label}/)
+ output_buffer.should have_tag("form div.form-group span.form-wrapper label[@for='author_post_ids_#{post.id}']")
end
end
it 'should use values as label.class when value_as_class is true' do
::Post.all.each do |post|
- output_buffer.should have_tag("form div.form-group div.controls label.post_#{post.id}")
+ output_buffer.should have_tag("form div.form-group span.form-wrapper label.post_#{post.id}")
end
end
it 'should have a checkbox input but no hidden field for each post' do
::Post.all.each do |post|
- output_buffer.should have_tag("form div.form-group div.controls label input#author_post_ids_#{post.id}")
- output_buffer.should have_tag("form div.form-group div.controls label input[@name='author[post_ids][]']", :count => 1)
+ output_buffer.should have_tag("form div.form-group span.form-wrapper label input#author_post_ids_#{post.id}")
+ output_buffer.should have_tag("form div.form-group span.form-wrapper label input[@name='author[post_ids][]']", :count => 1)
end
end
@@ -91,8 +91,8 @@
output_buffer.should have_tag("form div.form-group > input[@type=hidden][@name='author[post_ids][]'][@value='']", :count => 1)
end
- it 'the hidden field with an empty array value should be followed by the div.controls' do
- output_buffer.should have_tag("form div.form-group > input[@type=hidden][@name='author[post_ids][]'][@value=''] + div.controls", :count => 1)
+ it 'the hidden field with an empty array value should be followed by the span.form-wrapper' do
+ output_buffer.should have_tag("form div.form-group > input[@type=hidden][@name='author[post_ids][]'][@value=''] + span.form-wrapper", :count => 1)
end
it 'should not have a hidden field with an empty string value for the collection' do
@@ -107,15 +107,15 @@
end)
::Post.all.each do |post|
- output_buffer.should have_tag("form div.form-group div.controls label input#author_post_ids_#{post.id}")
- output_buffer.should have_tag("form div.form-group div.controls label input[@name='author[post_ids][]']", :count => 2)
+ output_buffer.should have_tag("form div.form-group span.form-wrapper label input#author_post_ids_#{post.id}")
+ output_buffer.should have_tag("form div.form-group span.form-wrapper label input[@name='author[post_ids][]']", :count => 2)
end
end
it "should mark input as checked if it's the the existing choice" do
::Post.all.include?(@fred.posts.first).should be_true
- output_buffer.should have_tag("form div.form-group div.controls label input[@checked='checked']")
+ output_buffer.should have_tag("form div.form-group span.form-wrapper label input[@checked='checked']")
end
end
@@ -141,17 +141,17 @@
it 'should generate labels for each item' do
::Author.all.each do |author|
- output_buffer.should have_tag('form div.form-group div.controls label', /#{author.to_label}/)
- output_buffer.should have_tag("form div.form-group div.controls label[@for='project_author_id_#{author.id}']")
+ output_buffer.should have_tag('form div.form-group span.form-wrapper label', /#{author.to_label}/)
+ output_buffer.should have_tag("form div.form-group span.form-wrapper label[@for='project_author_id_#{author.id}']")
end
end
it 'should generate inputs for each item' do
::Author.all.each do |author|
- output_buffer.should have_tag("form div.form-group div.controls label input#project_author_id_#{author.id}")
- output_buffer.should have_tag("form div.form-group div.controls label input[@type='checkbox']")
- output_buffer.should have_tag("form div.form-group div.controls label input[@value='#{author.id}']")
- output_buffer.should have_tag("form div.form-group div.controls label input[@name='project[author_id][]']")
+ output_buffer.should have_tag("form div.form-group span.form-wrapper label input#project_author_id_#{author.id}")
+ output_buffer.should have_tag("form div.form-group span.form-wrapper label input[@type='checkbox']")
+ output_buffer.should have_tag("form div.form-group span.form-wrapper label input[@value='#{author.id}']")
+ output_buffer.should have_tag("form div.form-group span.form-wrapper label input[@name='project[author_id][]']")
end
end
@@ -160,7 +160,7 @@
concat(builder.input(:author_id, :as => :check_boxes, :collection => [["<b>Item 1</b>", 1], ["<b>Item 2</b>", 2]]))
end)
- output_buffer.should have_tag('form div.form-group div.controls label') do |label|
+ output_buffer.should have_tag('form div.form-group span.form-wrapper label') do |label|
label.body.should match /&lt;b&gt;Item [12]&lt;\/b&gt;$/
end
end
@@ -178,18 +178,18 @@
it 'should have a checkbox input for each post' do
::Post.all.each do |post|
- output_buffer.should have_tag("form div.form-group div.controls label input#author_post_ids_#{post.id}")
- output_buffer.should have_tag("form div.form-group div.controls label input[@name='author[post_ids][]']", :count => ::Post.all.length)
+ output_buffer.should have_tag("form div.form-group span.form-wrapper label input#author_post_ids_#{post.id}")
+ output_buffer.should have_tag("form div.form-group span.form-wrapper label input[@name='author[post_ids][]']", :count => ::Post.all.length)
end
end
it "should mark input as checked if it's the the existing choice" do
::Post.all.include?(@fred.posts.first).should be_true
- output_buffer.should have_tag("form div.form-group div.controls label input[@checked='checked']")
+ output_buffer.should have_tag("form div.form-group span.form-wrapper label input[@checked='checked']")
end
it 'should not generate empty hidden inputs' do
- output_buffer.should_not have_tag("form div.form-group div.controls label input[@type='hidden'][@value='']", :count => ::Post.all.length)
+ output_buffer.should_not have_tag("form div.form-group span.form-wrapper label input[@type='hidden'][@value='']", :count => ::Post.all.length)
end
end
@@ -208,7 +208,7 @@
end
it 'should not have any disabled item(s)' do
- output_buffer.should_not have_tag("form div.form-group div.controls label input[@disabled='disabled']")
+ output_buffer.should_not have_tag("form div.form-group span.form-wrapper label input[@disabled='disabled']")
end
end
@@ -222,9 +222,9 @@
end
it "should have one item disabled; the specified one" do
- output_buffer.should have_tag("form div.form-group div.controls label input[@disabled='disabled']", :count => 1)
- output_buffer.should have_tag("form div.form-group div.controls label[@for='post_author_ids_#{@fred.id}']", /fred/i)
- output_buffer.should have_tag("form div.form-group div.controls label input[@disabled='disabled'][@value='#{@fred.id}']")
+ output_buffer.should have_tag("form div.form-group span.form-wrapper label input[@disabled='disabled']", :count => 1)
+ output_buffer.should have_tag("form div.form-group span.form-wrapper label[@for='post_author_ids_#{@fred.id}']", /fred/i)
+ output_buffer.should have_tag("form div.form-group span.form-wrapper label input[@disabled='disabled'][@value='#{@fred.id}']")
end
end
@@ -238,11 +238,11 @@
end
it "should have multiple items disabled; the specified ones" do
- output_buffer.should have_tag("form div.form-group div.controls label input[@disabled='disabled']", :count => 2)
- output_buffer.should have_tag("form div.form-group div.controls label[@for='post_author_ids_#{@bob.id}']", /bob/i)
- output_buffer.should have_tag("form div.form-group div.controls label input[@disabled='disabled'][@value='#{@bob.id}']")
- output_buffer.should have_tag("form div.form-group div.controls label[@for='post_author_ids_#{@fred.id}']", /fred/i)
- output_buffer.should have_tag("form div.form-group div.controls label input[@disabled='disabled'][@value='#{@fred.id}']")
+ output_buffer.should have_tag("form div.form-group span.form-wrapper label input[@disabled='disabled']", :count => 2)
+ output_buffer.should have_tag("form div.form-group span.form-wrapper label[@for='post_author_ids_#{@bob.id}']", /bob/i)
+ output_buffer.should have_tag("form div.form-group span.form-wrapper label input[@disabled='disabled'][@value='#{@bob.id}']")
+ output_buffer.should have_tag("form div.form-group span.form-wrapper label[@for='post_author_ids_#{@fred.id}']", /fred/i)
+ output_buffer.should have_tag("form div.form-group span.form-wrapper label input[@disabled='disabled'][@value='#{@fred.id}']")
end
end
@@ -375,8 +375,8 @@
end
it 'should check the correct checkboxes' do
- output_buffer.should have_tag("form div.form-group div.controls label input[@value='fiction'][@checked='checked']")
- output_buffer.should have_tag("form div.form-group div.controls label input[@value='biography'][@checked='checked']")
+ output_buffer.should have_tag("form div.form-group span.form-wrapper label input[@value='fiction'][@checked='checked']")
+ output_buffer.should have_tag("form div.form-group span.form-wrapper label input[@value='biography'][@checked='checked']")
end
end
@@ -392,7 +392,7 @@
end
it "should have a label for #context2_author_post_ids_19" do
- output_buffer.should have_tag("form div.form-group div.controls label[@for='context2_author_post_ids_19']")
+ output_buffer.should have_tag("form div.form-group span.form-wrapper label[@for='context2_author_post_ids_19']")
end
it_should_have_input_with_id('context2_author_post_ids_19')
@@ -440,8 +440,8 @@
it "should use array items for labels and values" do
@_collection.each do |post|
- output_buffer.should have_tag('form div.form-group div.controls label', /#{post.first}/)
- output_buffer.should have_tag("form div.form-group div.controls label[@for='author_post_ids_#{post.last}']")
+ output_buffer.should have_tag('form div.form-group span.form-wrapper label', /#{post.first}/)
+ output_buffer.should have_tag("form div.form-group span.form-wrapper label[@for='author_post_ids_#{post.last}']")
end
end
View
10 spec/inputs/date_select_input_spec.rb
@@ -35,14 +35,14 @@
end
it 'should not have three labels for year, month and day' do
- output_buffer.should_not have_tag('form div.form-group div.controls label', :count => 3)
- output_buffer.should_not have_tag('form div.form-group div.controls label', /year/i)
- output_buffer.should_not have_tag('form div.form-group div.controls label', /month/i)
- output_buffer.should_not have_tag('form div.form-group div.controls label', /day/i)
+ output_buffer.should_not have_tag('form div.form-group span.form-wrapper label', :count => 3)
+ output_buffer.should_not have_tag('form div.form-group span.form-wrapper label', /year/i)
+ output_buffer.should_not have_tag('form div.form-group span.form-wrapper label', /month/i)
+ output_buffer.should_not have_tag('form div.form-group span.form-wrapper label', /day/i)
end
it 'should have three selects for year, month and day' do
- output_buffer.should have_tag('form div.form-group div.controls select', :count => 3)
+ output_buffer.should have_tag('form div.form-group span.form-wrapper select', :count => 3)
end
end
View
2  spec/inputs/datetime_select_input_spec.rb
@@ -31,7 +31,7 @@
end
it 'should have five selects' do
- output_buffer.should have_tag('form div.form-group.datetime_select div.controls select', :count => 5)
+ output_buffer.should have_tag('form div.form-group.datetime_select span.form-wrapper select', :count => 5)
end
end
View
2  spec/inputs/file_input_spec.rb
@@ -28,7 +28,7 @@
concat(semantic_form_for(@new_post) do |builder|
concat(builder.input(:title, :as => :file, :input_html => { :class => 'myclass' }))
end)
- output_buffer.should have_tag("form div.form-group div.controls input.myclass")
+ output_buffer.should have_tag("form div.form-group span.form-wrapper input.myclass")
end
describe "when namespace is provided" do
View
24 spec/inputs/hidden_input_spec.rb
@@ -27,30 +27,30 @@
it_should_not_have_a_label
it "should generate a input field" do
- output_buffer.should have_tag("form div.form-group div.controls input#post_secret")
- output_buffer.should have_tag("form div.form-group div.controls input#post_secret[@type=\"hidden\"]")
- output_buffer.should have_tag("form div.form-group div.controls input#post_secret[@name=\"post[secret]\"]")
+ output_buffer.should have_tag("form div.form-group span.form-wrapper input#post_secret")
+ output_buffer.should have_tag("form div.form-group span.form-wrapper input#post_secret[@type=\"hidden\"]")
+ output_buffer.should have_tag("form div.form-group span.form-wrapper input#post_secret[@name=\"post[secret]\"]")
end
it "should get value from the object" do
- output_buffer.should have_tag("form div.form-group div.controls input#post_secret[@type=\"hidden\"][@value=\"1\"]")
+ output_buffer.should have_tag("form div.form-group span.form-wrapper input#post_secret[@type=\"hidden\"][@value=\"1\"]")
end
it "should pass any explicitly specified value - using :value" do
- output_buffer.should have_tag("form div.form-group div.controls input#post_author_id[@type=\"hidden\"][@value=\"99\"]")
+ output_buffer.should have_tag("form div.form-group span.form-wrapper input#post_author_id[@type=\"hidden\"][@value=\"99\"]")
end
# Handle Formtastic :input_html options for consistency.
it "should pass any explicitly specified value - using :input_html options" do
- output_buffer.should have_tag("form div.form-group div.controls input#post_published[@type=\"hidden\"][@value=\"true\"]")
+ output_buffer.should have_tag("form div.form-group span.form-wrapper input#post_published[@type=\"hidden\"][@value=\"true\"]")
end
it "should pass any option specified using :input_html" do
- output_buffer.should have_tag("form div.form-group div.controls input#new_post_reviewer[@type=\"hidden\"][@class=\"new_post_reviewer\"]")
+ output_buffer.should have_tag("form div.form-group span.form-wrapper input#new_post_reviewer[@type=\"hidden\"][@class=\"new_post_reviewer\"]")
end
it "should prefer :input_html over directly supplied options" do
- output_buffer.should have_tag("form div.form-group div.controls input#post_author_id[@type=\"hidden\"][@value=\"formtastic_value\"]")
+ output_buffer.should have_tag("form div.form-group span.form-wrapper input#post_author_id[@type=\"hidden\"][@value=\"formtastic_value\"]")
end
it "should not render inline errors" do
@@ -62,8 +62,8 @@
concat(builder.input(:secret, :as => :hidden))
end)
- output_buffer.should_not have_tag("form div.form-group div.controls p.inline-errors")
- output_buffer.should_not have_tag("form div.form-group div.controls ul.errors")
+ output_buffer.should_not have_tag("form div.form-group span.form-wrapper p.inline-errors")
+ output_buffer.should_not have_tag("form div.form-group span.form-wrapper ul.errors")
end
it "should not render inline hints" do
@@ -71,8 +71,8 @@
concat(builder.input(:secret, :as => :hidden, :hint => "all your base are belong to use"))
end)
- output_buffer.should_not have_tag("form div.form-group div.controls p.inline-hints")
- output_buffer.should_not have_tag("form div.form-group div.controls ul.hints")
+ output_buffer.should_not have_tag("form div.form-group span.form-wrapper p.inline-hints")
+ output_buffer.should_not have_tag("form div.form-group span.form-wrapper ul.hints")
end
describe "when namespace is provided" do
View
46 spec/inputs/radio_input_spec.rb
@@ -33,39 +33,39 @@
end
it 'should have one option with a "checked" attribute' do
- output_buffer.should have_tag('form div.form-group div.controls input[@checked]', :count => 1)
+ output_buffer.should have_tag('form div.form-group span.form-wrapper input[@checked]', :count => 1)
end
describe "each choice" do
it 'should not give the choice label the .label class' do
- output_buffer.should_not have_tag('div.controls label.label')
+ output_buffer.should_not have_tag('span.form-wrapper label.label')
end
it 'should not add the required attribute to each input' do
- output_buffer.should_not have_tag('div.controls input[@required]')
+ output_buffer.should_not have_tag('span.form-wrapper input[@required]')
end
it 'should contain a label for the radio input with a nested input and label text' do
::Author.all.each do |author|
- output_buffer.should have_tag('form div.form-group div.controls label', /#{author.to_label}/)
- output_buffer.should have_tag("form div.form-group div.controls label[@for='post_author_id_#{author.id}']")
+ output_buffer.should have_tag('form div.form-group span.form-wrapper label', /#{author.to_label}/)
+ output_buffer.should have_tag("form div.form-group span.form-wrapper label[@for='post_author_id_#{author.id}']")
end
end
it 'should use values as li.class when value_as_class is true' do
::Author.all.each do |author|
- output_buffer.should have_tag("form div.form-group div.controls label.author_#{author.id}")
+ output_buffer.should have_tag("form div.form-group span.form-wrapper label.author_#{author.id}")
end
end
it "should have a radio input" do
::Author.all.each do |author|
- output_buffer.should have_tag("form div.form-group div.controls label input#post_author_id_#{author.id}")
- output_buffer.should have_tag("form div.form-group div.controls label input[@type='radio']")
- output_buffer.should have_tag("form div.form-group div.controls label input[@value='#{author.id}']")
- output_buffer.should have_tag("form div.form-group div.controls label input[@name='post[author_id]']")
+ output_buffer.should have_tag("form div.form-group span.form-wrapper label input#post_author_id_#{author.id}")
+ output_buffer.should have_tag("form div.form-group span.form-wrapper label input[@type='radio']")
+ output_buffer.should have_tag("form div.form-group span.form-wrapper label input[@value='#{author.id}']")
+ output_buffer.should have_tag("form div.form-group span.form-wrapper label input[@name='post[author_id]']")
end
end
@@ -78,7 +78,7 @@
concat(builder.input(:author, :as => :radio))
end)
- output_buffer.should have_tag("form div.form-group div.controls label input[@checked='checked']")
+ output_buffer.should have_tag("form div.form-group span.form-wrapper label input[@checked='checked']")
end
it "should mark the input as disabled if options attached for disabling" do
@@ -86,8 +86,8 @@
concat(builder.input(:author, :as => :radio, :collection => [["Test", 'test'], ["Try", "try", {:disabled => true}]]))
end)
- output_buffer.should_not have_tag("form div.form-group div.controls label input[@value='test'][@disabled='disabled']")
- output_buffer.should have_tag("form div.form-group div.controls label input[@value='try'][@disabled='disabled']")
+ output_buffer.should_not have_tag("form div.form-group span.form-wrapper label input[@value='test'][@disabled='disabled']")
+ output_buffer.should have_tag("form div.form-group span.form-wrapper label input[@value='try'][@disabled='disabled']")
end
it "should not contain invalid HTML attributes" do
@@ -111,8 +111,8 @@
it 'should generate labels for each item' do
::Author.all.each do |author|
- output_buffer.should have_tag('form div.form-group div.controls label', /#{author.to_label}/)
- output_buffer.should have_tag("form div.form-group div.controls label[@for='project_author_id_#{author.id}']")
+ output_buffer.should have_tag('form div.form-group span.form-wrapper label', /#{author.to_label}/)
+ output_buffer.should have_tag("form div.form-group span.form-wrapper label[@for='project_author_id_#{author.id}']")
end
end
@@ -120,17 +120,17 @@
concat(semantic_form_for(:project, :url => 'http://test.host') do |builder|
concat(builder.input(:author_id, :as => :radio, :collection => [["<b>Item 1</b>", 1], ["<b>Item 2</b>", 2]]))
end)
- output_buffer.should have_tag('form div.form-group div.controls label') do |label|
+ output_buffer.should have_tag('form div.form-group span.form-wrapper label') do |label|
label.body.should match /&lt;b&gt;Item [12]&lt;\/b&gt;$/
end
end
it 'should generate inputs for each item' do
::Author.all.each do |author|
- output_buffer.should have_tag("form div.form-group div.controls label input#project_author_id_#{author.id}")
- output_buffer.should have_tag("form div.form-group div.controls label input[@type='radio']")
- output_buffer.should have_tag("form div.form-group div.controls label input[@value='#{author.id}']")
- output_buffer.should have_tag("form div.form-group div.controls label input[@name='project[author_id]']")
+ output_buffer.should have_tag("form div.form-group span.form-wrapper label input#project_author_id_#{author.id}")
+ output_buffer.should have_tag("form div.form-group span.form-wrapper label input[@type='radio']")
+ output_buffer.should have_tag("form div.form-group span.form-wrapper label input[@value='#{author.id}']")
+ output_buffer.should have_tag("form div.form-group span.form-wrapper label input[@name='project[author_id]']")
end
end
end
@@ -258,9 +258,9 @@
end
it 'should output the correct labels' do
- output_buffer.should have_tag("div.controls label", /1/)
- output_buffer.should have_tag("div.controls label", /2/)
- output_buffer.should have_tag("div.controls label", /3/)
+ output_buffer.should have_tag("span.form-wrapper label", /1/)
+ output_buffer.should have_tag("span.form-wrapper label", /2/)
+ output_buffer.should have_tag("span.form-wrapper label", /3/)
end
end
View
126 spec/inputs/select_input_spec.rb
@@ -23,10 +23,10 @@
it 'should have a option for each key and/or value' do
@array_with_values.each do |v|
- output_buffer.should have_tag("form div.form-group div.controls select option[@value='#{v}']", /^#{v}$/)
+ output_buffer.should have_tag("form div.form-group span.form-wrapper select option[@value='#{v}']", /^#{v}$/)
end
@array_with_keys_and_values.each do |v|
- output_buffer.should have_tag("form div.form-group div.controls select option[@value='#{v.second}']", /^#{v.first}$/)
+ output_buffer.should have_tag("form div.form-group span.form-wrapper select option[@value='#{v.second}']", /^#{v.first}$/)
end
end
end
@@ -40,9 +40,9 @@
end
it 'should draw select options' do
- output_buffer.should have_tag('form div.form-group div.controls select')
- output_buffer.should have_tag('form div.form-group div.controls select#post_reviewer_id')
- output_buffer.should_not have_tag('form div.form-group div.controls select#post_mongoid_reviewer_id')
+ output_buffer.should have_tag('form div.form-group span.form-wrapper select')
+ output_buffer.should have_tag('form div.form-group span.form-wrapper select#post_reviewer_id')
+ output_buffer.should_not have_tag('form div.form-group span.form-wrapper select#post_mongoid_reviewer_id')
end
end
@@ -56,7 +56,7 @@
it 'should have an option for each value' do
@range_with_values.each do |v|
- output_buffer.should have_tag("form div.form-group div.controls select option[@value='#{v}']", /^#{v}$/)
+ output_buffer.should have_tag("form div.form-group span.form-wrapper select option[@value='#{v}']", /^#{v}$/)
end
end
end
@@ -71,7 +71,7 @@
it 'should render select options using provided HTML string' do
2.times do |v|
- output_buffer.should have_tag("form div.form-group div.controls select option[@value='#{v}']", /^#{v}$/)
+ output_buffer.should have_tag("form div.form-group span.form-wrapper select option[@value='#{v}']", /^#{v}$/)
end
end
end
@@ -109,8 +109,8 @@
# it 'should render a select with at least options: true/false' do
# # I don't wanna deal with this right now.
# pending
- # # output_buffer.should have_tag("form div.form-group div.controls select option[@value='true']", /^Yes$/)
- # # output_buffer.should have_tag("form div.form-group div.controls select option[@value='false']", /^No$/)
+ # # output_buffer.should have_tag("form div.form-group span.form-wrapper select option[@value='true']", /^Yes$/)
+ # # output_buffer.should have_tag("form div.form-group span.form-wrapper select option[@value='false']", /^No$/)
# end
# end
#
@@ -129,8 +129,8 @@
# end
#
# it 'should render a select with at least options: true/false' do
- # output_buffer.should have_tag("form div.form-group div.controls select option[@value='true']", /#{@boolean_select_labels[:yes]}/)
- # output_buffer.should have_tag("form div.form-group div.controls select option[@value='false']", /#{@boolean_select_labels[:no]}/)
+ # output_buffer.should have_tag("form div.form-group span.form-wrapper select option[@value='true']", /#{@boolean_select_labels[:yes]}/)
+ # output_buffer.should have_tag("form div.form-group span.form-wrapper select option[@value='false']", /#{@boolean_select_labels[:no]}/)
# end
# end
end
@@ -154,19 +154,19 @@
it_should_use_the_collection_when_provided(:select, 'option')
it 'should have a select inside the wrapper' do
- output_buffer.should have_tag('form div.form-group div.controls select')
- output_buffer.should have_tag('form div.form-group div.controls select#post_author_id')
- output_buffer.should have_tag('form div.form-group div.controls select#post_reviewer_id')
+ output_buffer.should have_tag('form div.form-group span.form-wrapper select')
+ output_buffer.should have_tag('form div.form-group span.form-wrapper select#post_author_id')
+ output_buffer.should have_tag('form div.form-group span.form-wrapper select#post_reviewer_id')
end
it 'should have a valid name' do
- output_buffer.should have_tag("form div.form-group div.controls select[@name='post[author_id]']")
- output_buffer.should_not have_tag("form div.form-group div.controls select[@name='post[author_id][]']")
- output_buffer.should_not have_tag("form div.form-group div.controls select[@name='post[reviewer_id][]']")
+ output_buffer.should have_tag("form div.form-group span.form-wrapper select[@name='post[author_id]']")
+ output_buffer.should_not have_tag("form div.form-group span.form-wrapper select[@name='post[author_id][]']")
+ output_buffer.should_not have_tag("form div.form-group span.form-wrapper select[@name='post[reviewer_id][]']")
end
it 'should not create a multi-select' do
- output_buffer.should_not have_tag('form div.form-group div.controls select[@multiple]')
+ output_buffer.should_not have_tag('form div.form-group span.form-wrapper select[@multiple]')
end
it 'should not add a hidden input' do
@@ -174,22 +174,22 @@
end
it 'should create a select without size' do
- output_buffer.should_not have_tag('form div.form-group div.controls select[@size]')
+ output_buffer.should_not have_tag('form div.form-group span.form-wrapper select[@size]')
end
it 'should have a blank option' do
- output_buffer.should have_tag("form div.form-group div.controls select option[@value='']")
+ output_buffer.should have_tag("form div.form-group span.form-wrapper select option[@value='']")
end
it 'should have a select option for each Author' do
- output_buffer.should have_tag("form div.form-group div.controls select[@name='post[author_id]'] option", :count => ::Author.all.size + 1)
+ output_buffer.should have_tag("form div.form-group span.form-wrapper select[@name='post[author_id]'] option", :count => ::Author.all.size + 1)
::Author.all.each do |author|
- output_buffer.should have_tag("form div.form-group div.controls select option[@value='#{author.id}']", /#{author.to_label}/)
+ output_buffer.should have_tag("form div.form-group span.form-wrapper select option[@value='#{author.id}']", /#{author.to_label}/)
end
end
it 'should have one option with a "selected" attribute (bob)' do
- output_buffer.should have_tag("form div.form-group div.controls select[@name='post[author_id]'] option[@selected]", :count => 1)
+ output_buffer.should have_tag("form div.form-group span.form-wrapper select[@name='post[author_id]'] option[@selected]", :count => 1)
end
it 'should not singularize the association name' do
@@ -201,7 +201,7 @@
concat(builder.input(:author_status, :as => :select))
end)
- output_buffer.should have_tag('form div.form-group div.controls select#post_author_status_id')
+ output_buffer.should have_tag('form div.form-group span.form-wrapper select#post_author_status_id')
end
end
@@ -286,29 +286,29 @@
0.upto(1) do |i|
it 'should have all option groups and the right values' do
- output_buffer.should have_tag("form div.form-group div.controls select optgroup[@label='#{@continent_names[i]}']", @authors[i].to_label)
+ output_buffer.should have_tag("form div.form-group span.form-wrapper select optgroup[@label='#{@continent_names[i]}']", @authors[i].to_label)
end
it 'should have custom group labels' do
- output_buffer.should have_tag("form div.form-group div.controls select optgroup[@label='#{@continents[i].id}']", @authors[i].to_label)
+ output_buffer.should have_tag("form div.form-group span.form-wrapper select optgroup[@label='#{@continents[i].id}']", @authors[i].to_label)
end
it 'should have custom author labels' do
- output_buffer.should have_tag("form div.form-group div.controls select optgroup[@label='#{@continent_names[i]}']", @authors[i].login)
+ output_buffer.should have_tag("form div.form-group span.form-wrapper select optgroup[@label='#{@continent_names[i]}']", @authors[i].login)
end
it 'should have custom author and group labels' do
- output_buffer.should have_tag("form div.form-group div.controls select optgroup[@label='#{@continents[i].id}']", @authors[i].login)
+ output_buffer.should have_tag("form div.form-group span.form-wrapper select optgroup[@label='#{@continents[i].id}']", @authors[i].login)
end
end
it 'should have no duplicate groups' do
- output_buffer.should have_tag('form div.form-group div.controls select optgroup', :count => 8)
+ output_buffer.should have_tag('form div.form-group span.form-wrapper select optgroup', :count => 8)
end
it 'should sort the groups on the label method' do
- output_buffer.should have_tag("form div.form-group div.controls select optgroup[@label='Africa']")
- output_buffer.should have_tag("form div.form-group div.controls select optgroup[@label='99']")
+ output_buffer.should have_tag("form div.form-group span.form-wrapper select optgroup[@label='Africa']")
+ output_buffer.should have_tag("form div.form-group span.form-wrapper select optgroup[@label='99']")
end
it 'should call find with :include for more optimized queries' do
@@ -338,16 +338,16 @@
it_should_use_the_collection_when_provided(:select, 'option')
it 'should have a select inside the wrapper' do
- output_buffer.should have_tag('form div.form-group div.controls select')
- output_buffer.should have_tag('form div.form-group div.controls select#author_post_ids')
+ output_buffer.should have_tag('form div.form-group span.form-wrapper select')
+ output_buffer.should have_tag('form div.form-group span.form-wrapper select#author_post_ids')
end
it 'should have a multi-select select' do
- output_buffer.should have_tag('form div.form-group div.controls select[@multiple="multiple"]')
+ output_buffer.should have_tag('form div.form-group span.form-wrapper select[@multiple="multiple"]')
end
it 'should append [] to the name attribute for multiple select' do
- output_buffer.should have_tag('form div.form-group div.controls select[@multiple="multiple"][@name="author[post_ids][]"]')
+ output_buffer.should have_tag('form div.form-group span.form-wrapper select[@multiple="multiple"][@name="author[post_ids][]"]')
end
it 'should have a hidden field' do
@@ -355,14 +355,14 @@
end
it 'should have a select option for each Post' do
- output_buffer.should have_tag('form div.form-group div.controls select option', :count => ::Post.all.size)
+ output_buffer.should have_tag('form div.form-group span.form-wrapper select option', :count => ::Post.all.size)
::Post.all.each do |post|
- output_buffer.should have_tag("form div.form-group div.controls select option[@value='#{post.id}']", /#{post.to_label}/)
+ output_buffer.should have_tag("form div.form-group span.form-wrapper select option[@value='#{post.id}']", /#{post.to_label}/)
end
end
it 'should not have a blank option by default' do
- output_buffer.should_not have_tag("form div.form-group div.controls select option[@value='']")
+ output_buffer.should_not have_tag("form div.form-group span.form-wrapper select option[@value='']")
end
it 'should respect the :include_blank option for single selects' do
@@ -370,7 +370,7 @@
concat(builder.input(:posts, :as => :select, :multiple => false, :include_blank => true))
end)
- output_buffer.should have_tag("form div.form-group div.controls select option[@value='']")
+ output_buffer.should have_tag("form div.form-group span.form-wrapper select option[@value='']")
end
it 'should respect the :include_blank option for multiple selects' do
@@ -378,11 +378,11 @@
concat(builder.input(:posts, :as => :select, :multiple => true, :include_blank => true))
end)
- output_buffer.should have_tag("form div.form-group div.controls select option[@value='']")
+ output_buffer.should have_tag("form div.form-group span.form-wrapper select option[@value='']")
end
it 'should have one option with a "selected" attribute' do
- output_buffer.should have_tag('form div.form-group div.controls select option[@selected]', :count => 1)
+ output_buffer.should have_tag('form div.form-group span.form-wrapper select option[@selected]', :count => 1)
end
end
@@ -402,23 +402,23 @@
it_should_use_the_collection_when_provided(:select, 'option')
it 'should have a select inside the wrapper' do
- output_buffer.should have_tag('form div.form-group div.controls select')
- output_buffer.should have_tag('form div.form-group div.controls select#post_author_ids')
+ output_buffer.should have_tag('form div.form-group span.form-wrapper select')
+ output_buffer.should have_tag('form div.form-group span.form-wrapper select#post_author_ids')
end
it 'should have a multi-select select' do
- output_buffer.should have_tag('form div.form-group div.controls select[@multiple="multiple"]')
+ output_buffer.should have_tag('form div.form-group span.form-wrapper select[@multiple="multiple"]')
end
it 'should have a select option for each Author' do
- output_buffer.should have_tag('form div.form-group div.controls select option', :count => ::Author.all.size)
+ output_buffer.should have_tag('form div.form-group span.form-wrapper select option', :count => ::Author.all.size)
::Author.all.each do |author|
- output_buffer.should have_tag("form div.form-group div.controls select option[@value='#{author.id}']", /#{author.to_label}/)
+ output_buffer.should have_tag("form div.form-group span.form-wrapper select option[@value='#{author.id}']", /#{author.to_label}/)
end
end
it 'should not have a blank option by default' do
- output_buffer.should_not have_tag("form div.form-group div.controls select option[@value='']")
+ output_buffer.should_not have_tag("form div.form-group span.form-wrapper select option[@value='']")
end
it 'should respect the :include_blank option for single selects' do
@@ -426,7 +426,7 @@
concat(builder.input(:authors, :as => :select, :multiple => false, :include_blank => true))
end)
- output_buffer.should have_tag("form div.form-group div.controls select option[@value='']")
+ output_buffer.should have_tag("form div.form-group span.form-wrapper select option[@value='']")
end
it 'should respect the :include_blank option for multiple selects' do
@@ -434,11 +434,11 @@
concat(builder.input(:authors, :as => :select, :multiple => true, :include_blank => true))
end)
- output_buffer.should have_tag("form div.form-group div.controls select option[@value='']")
+ output_buffer.should have_tag("form div.form-group span.form-wrapper select option[@value='']")
end
it 'should have one option with a "selected" attribute' do
- output_buffer.should have_tag('form div.form-group div.controls select option[@selected]', :count => 1)
+ output_buffer.should have_tag('form div.form-group span.form-wrapper select option[@selected]', :count => 1)
end
end
@@ -451,11 +451,11 @@
end
it 'should have a select with prompt' do
- output_buffer.should have_tag("form div.form-group div.controls select option[@value='']", /choose author/, :count => 1)
+ output_buffer.should have_tag("form div.form-group span.form-wrapper select option[@value='']", /choose author/, :count => 1)
end
it 'should not have a second blank select option' do
- output_buffer.should have_tag("form div.form-group div.controls select option[@value='']", :count => 1)
+ output_buffer.should have_tag("form div.form-group span.form-wrapper select option[@value='']", :count => 1)
end
end
@@ -472,13 +472,13 @@
end
it 'should generate select inputs' do
- output_buffer.should have_tag('form div.form-group div.controls select#project_author')
- output_buffer.should have_tag('form div.form-group div.controls select option', :count => ::Author.all.size + 1)
+ output_buffer.should have_tag('form div.form-group span.form-wrapper select#project_author')
+ output_buffer.should have_tag('form div.form-group span.form-wrapper select option', :count => ::Author.all.size + 1)
end
it 'should generate an option to each item' do
::Author.all.each do |author|
- output_buffer.should have_tag("form div.form-group div.controls select option[@value='#{author.id}']", /#{author.to_label}/)
+ output_buffer.should have_tag("form div.form-group span.form-wrapper select option[@value='#{author.id}']", /#{author.to_label}/)
end
end
end
@@ -489,7 +489,7 @@
concat(semantic_form_for(:project, :url => 'http://test.host') do |builder|
concat(builder.input(:author_name, :as => :select, :collection => ::Author.all))
end)
- output_buffer.should have_tag("form div.form-group div.controls select[@name='project[author_name]']")
+ output_buffer.should have_tag("form div.form-group span.form-wrapper select[@name='project[author_name]']")
end
describe 'and :multiple is set to true through :input_html' do
@@ -497,7 +497,7 @@
concat(semantic_form_for(:project, :url => 'http://test.host') do |builder|
concat(builder.input(:author_name, :as => :select, :input_html => {:multiple => true} ))
end)
- output_buffer.should have_tag("form div.form-group div.controls select[@multiple]")
+ output_buffer.should have_tag("form div.form-group span.form-wrapper select[@multiple]")
end
end
@@ -506,7 +506,7 @@
concat(semantic_form_for(:project, :url => 'http://test.host') do |builder|
concat(builder.input(:author_name, :as => :select, :multiple => true, :collection => ["Fred", "Bob"]))
end)
- output_buffer.should have_tag("form div.form-group div.controls select[@multiple]")
+ output_buffer.should have_tag("form div.form-group span.form-wrapper select[@multiple]")
end
end
@@ -524,12 +524,12 @@
it 'should generate an option to each item' do
@grouped_opts.each do |opt_pair|
- output_buffer.should have_tag("form div.form-group div.controls select optgroup[@label='#{opt_pair[0]}']")
+ output_buffer.should have_tag("form div.form-group span.form-wrapper select optgroup[@label='#{opt_pair[0]}']")
opt_pair[1].each do |v|
- output_buffer.should have_tag("form div.form-group div.controls select optgroup[@label='#{opt_pair[0]}'] option[@value='#{v}']")
+ output_buffer.should have_tag("form div.form-group span.form-wrapper select optgroup[@label='#{opt_pair[0]}'] option[@value='#{v}']")
end
end
- output_buffer.should have_tag("form div.form-group div.controls select optgroup option[@selected]","hands")
+ output_buffer.should have_tag("form div.form-group span.form-wrapper select optgroup option[@selected]","hands")
end
end
@@ -551,7 +551,7 @@
end
it "should render a select field" do
- output_buffer.should have_tag("form div.form-group div.controls select", :count => 2)
+ output_buffer.should have_tag("form div.form-group span.form-wrapper select", :count => 2)
end
end
@@ -567,7 +567,7 @@
end
it "should render a text field" do
- output_buffer.should have_tag("form div.form-group div.controls input[@type='text']", :count => 2)
+ output_buffer.should have_tag("form div.form-group span.form-wrapper input[@type='text']", :count => 2)
end
end
end
View
2  spec/inputs/string_input_spec.rb
@@ -63,7 +63,7 @@ def should_have_maxlength(maxlength, options)
concat(builder.input(:title))
end)
- output_buffer.should have_tag("form div.form-group div.controls input##{@new_post.class.name.underscore}_title[@maxlength='#{maxlength}']")
+ output_buffer.should have_tag("form div.form-group span.form-wrapper input##{@new_post.class.name.underscore}_title[@maxlength='#{maxlength}']")
end
it 'should have maxlength if the optional :if or :unless options are not supplied' do
View
18 spec/inputs/text_input_spec.rb
@@ -29,7 +29,7 @@
concat(semantic_form_for(@new_post) do |builder|
concat(builder.input(:title, :as => :text, :input_html => { :class => 'myclass' }))
end)
- output_buffer.should have_tag("form div.form-group div.controls textarea.myclass")
+ output_buffer.should have_tag("form div.form-group span.form-wrapper textarea.myclass")
end
it "should have a cols attribute when :cols is a number in :input_html" do
@@ -37,7 +37,7 @@
concat(semantic_form_for(@new_post) do |builder|
concat(builder.input(:title, :as => :text, :input_html => { :cols => 42 }))
end)
- output_buffer.should have_tag("form div.form-group div.controls textarea[@cols='42']")
+ output_buffer.should have_tag("form div.form-group span.form-wrapper textarea[@cols='42']")
end
it "should not have a cols attribute when :cols is nil in :input_html" do
@@ -45,7 +45,7 @@
concat(semantic_form_for(@new_post) do |builder|
concat(builder.input(:title, :as => :text, :input_html => { :cols => nil }))
end)
- output_buffer.should_not have_tag("form div.form-group div.controls textarea[@cols]")
+ output_buffer.should_not have_tag("form div.form-group span.form-wrapper textarea[@cols]")
end
it "should have a rows attribute when :rows is a number in :input_html" do
@@ -53,7 +53,7 @@
concat(semantic_form_for(@new_post) do |builder|
concat(builder.input(:title, :as => :text, :input_html => { :rows => 42 }))
end)
- output_buffer.should have_tag("form div.form-group div.controls textarea[@rows='42']")
+ output_buffer.should have_tag("form div.form-group span.form-wrapper textarea[@rows='42']")
end
@@ -62,7 +62,7 @@
concat(semantic_form_for(@new_post) do |builder|
concat(builder.input(:title, :as => :text, :input_html => { :rows => nil }))
end)
- output_buffer.should_not have_tag("form div.form-group div.controls textarea[@rows]")
+ output_buffer.should_not have_tag("form div.form-group span.form-wrapper textarea[@rows]")
end
describe "when namespace is provided" do
@@ -144,7 +144,7 @@
concat(semantic_form_for(@new_post) do |builder|
concat(builder.input(:title, :as => :text))
end)
- output_buffer.should have_tag("form div.form-group div.controls textarea[@rows='12']")
+ output_buffer.should have_tag("form div.form-group span.form-wrapper textarea[@rows='12']")
end
end
@@ -153,7 +153,7 @@
concat(semantic_form_for(@new_post) do |builder|
concat(builder.input(:title, :as => :text))
end)
- output_buffer.should_not have_tag("form div.form-group div.controls textarea[@rows]")
+ output_buffer.should_not have_tag("form div.form-group span.form-wrapper textarea[@rows]")
end
end
@@ -169,7 +169,7 @@
concat(semantic_form_for(@new_post) do |builder|
concat(builder.input(:title, :as => :text))
end)
- output_buffer.should have_tag("form div.form-group div.controls textarea[@cols='10']")
+ output_buffer.should have_tag("form div.form-group span.form-wrapper textarea[@cols='10']")
end
end
@@ -178,7 +178,7 @@
concat(semantic_form_for(@new_post) do |builder|
concat(builder.input(:title, :as => :text))
end)
- output_buffer.should_not have_tag("form div.form-group div.controls textarea[@cols]")
+ output_buffer.should_not have_tag("form div.form-group span.form-wrapper textarea[@cols]")
end
end
View
4 spec/inputs/time_select_input_spec.rb
@@ -105,7 +105,7 @@
end
it 'should have two selects for hour and minute' do
- output_buffer.should have_tag('form div.form-group.time_select div.controls select', :count => 2)
+ output_buffer.should have_tag('form div.form-group.time_select span.form-wrapper select', :count => 2)
end
end
@@ -117,7 +117,7 @@
end
it 'should have three selects for hour, minute and seconds' do
- output_buffer.should have_tag('form div.form-group.time_select div.controls select', :count => 3)
+ output_buffer.should have_tag('form div.form-group.time_select span.form-wrapper select', :count => 3)
end
end
end
View
14 spec/inputs/time_zone_input_spec.rb
@@ -27,16 +27,16 @@
end
it "should generate a select" do
- output_buffer.should have_tag("form div.form-group div.controls select")
- output_buffer.should have_tag("form div.form-group div.controls select#post_time_zone")
- output_buffer.should have_tag("form div.form-group div.controls select[@name=\"post[time_zone]\"]")
+ output_buffer.should have_tag("form div.form-group span.form-wrapper select")
+ output_buffer.should have_tag("form div.form-group span.form-wrapper select#post_time_zone")
+ output_buffer.should have_tag("form div.form-group span.form-wrapper select[@name=\"post[time_zone]\"]")
end
it 'should use input_html to style inputs' do
concat(semantic_form_for(@new_post) do |builder|
concat(builder.input(:time_zone, :input_html => { :class => 'myclass' }))
end)
- output_buffer.should have_tag("form div.form-group div.controls select.myclass")
+ output_buffer.should have_tag("form div.form-group span.form-wrapper select.myclass")
end
describe "when namespace is provided" do
@@ -98,9 +98,9 @@
end
it 'should generate select inputs' do
- output_buffer.should have_tag("form div.form-group div.controls select")
- output_buffer.should have_tag("form div.form-group div.controls select#project_time_zone")
- output_buffer.should have_tag("form div.form-group div.controls select[@name=\"project[time_zone]\"]")
+ output_buffer.should have_tag("form div.form-group span.form-wrapper select")
+ output_buffer.should have_tag("form div.form-group span.form-wrapper select#project_time_zone")
+ output_buffer.should have_tag("form div.form-group span.form-wrapper select[@name=\"project[time_zone]\"]")
end
end
View
36 spec/support/custom_macros.rb
@@ -58,55 +58,55 @@ def it_should_have_label_for(element_id)
def it_should_have_an_inline_label_for(element_id)
it "should have a label for ##{element_id}" do
- output_buffer.should have_tag("form div.form-group div.controls label[@for='#{element_id}']")
+ output_buffer.should have_tag("form div.form-group span.form-wrapper label[@for='#{element_id}']")
end
end
def it_should_have_input_with_id(element_id)
it "should have an input with id '#{element_id}'" do
- output_buffer.should have_tag("form div.form-group div.controls input[@id=\"#{element_id}\"]")
+ output_buffer.should have_tag("form div.form-group span.form-wrapper input[@id=\"#{element_id}\"]")
end
end
def it_should_have_select_with_id(element_id)
it "should have a select box with id '#{element_id}'" do
- output_buffer.should have_tag("form div.form-group div.controls select##{element_id}")
+ output_buffer.should have_tag("form div.form-group span.form-wrapper select##{element_id}")
end
end
def it_should_have_input_with_type(input_type)
it "should have a #{input_type} input" do
- output_buffer.should have_tag("form div.form-group div.controls input[@type=\"#{input_type}\"]")
+ output_buffer.should have_tag("form div.form-group span.form-wrapper input[@type=\"#{input_type}\"]")
end
end
def it_should_have_input_with_name(name)
it "should have an input named #{name}" do
- output_buffer.should have_tag("form div.form-group div.controls input[@name=\"#{name}\"]")
+ output_buffer.should have_tag("form div.form-group span.form-wrapper input[@name=\"#{name}\"]")
end
end
def it_should_have_select_with_name(name)
it "should have an input named #{name}" do
- output_buffer.should have_tag("form div.form-group div.controls select[@name=\"#{name}\"]")
+ output_buffer.should have_tag("form div.form-group span.form-wrapper select[@name=\"#{name}\"]")
end
end
def it_should_have_textarea_with_name(name)
it "should have an input named #{name}" do
- output_buffer.should have_tag("form div.form-group div.controls textarea[@name=\"#{name}\"]")
+ output_buffer.should have_tag("form div.form-group span.form-wrapper textarea[@name=\"#{name}\"]")
end
end
def it_should_have_textarea_with_id(element_id)
it "should have an input with id '#{element_id}'" do
- output_buffer.should have_tag("form div.form-group div.controls textarea##{element_id}")
+ output_buffer.should have_tag("form div.form-group span.form-wrapper textarea##{element_id}")
end
end
def it_should_have_label_and_input_with_id(element_id)
it "should have an input with id '#{element_id}'" do
- output_buffer.should have_tag("form div.form-group div.controls input##{element_id}")
+ output_buffer.should have_tag("form div.form-group span.form-wrapper input##{element_id}")
output_buffer.should have_tag("form div.form-group label.control-label[@for='#{element_id}']")
end
end
@@ -117,7 +117,7 @@ def it_should_use_default_text_field_size_when_not_nil(as)
concat(semantic_form_for(@new_post) do |builder|
concat(builder.input(:title, :as => as))
end)
- output_buffer.should have_tag("form div.form-group div.controls input[@size='#{Formtastic::FormBuilder.default_text_field_size}']")
+ output_buffer.should have_tag("form div.form-group span.form-wrapper input[@size='#{Formtastic::FormBuilder.default_text_field_size}']")
end
end
end
@@ -128,8 +128,8 @@ def it_should_not_use_default_text_field_size_when_nil(as)
concat(semantic_form_for(@new_post) do |builder|
concat(builder.input(:title, :as => as))
end)
- output_buffer.should have_tag("form div.form-group div.controls input")
- output_buffer.should_not have_tag("form div.form-group div.controls input[@size]")
+ output_buffer.should have_tag("form div.form-group span.form-wrapper input")
+ output_buffer.should_not have_tag("form div.form-group span.form-wrapper input[@size]")
end
end
end
@@ -139,7 +139,7 @@ def it_should_apply_custom_input_attributes_when_input_html_provided(as)
concat(semantic_form_for(@new_post) do |builder|
concat(builder.input(:title, :as => as, :input_html => { :class => 'myclass' }))
end)
- output_buffer.should have_tag("form div.form-group div.controls input.myclass")
+ output_buffer.should have_tag("form div.form-group span.form-wrapper input.myclass")
end
end
@@ -155,7 +155,7 @@ def it_should_apply_custom_for_to_label_when_input_html_id_provided(as)
def it_should_have_maxlength_matching_column_limit
it 'should have a maxlength matching column limit' do
@new_post.column_for_attribute(:title).limit.should == 50
- output_buffer.should have_tag("form div.form-group div.controls input[@maxlength='50']")
+ output_buffer.should have_tag("form div.form-group span.form-wrapper input[@maxlength='50']")
end
end
@@ -314,10 +314,10 @@ def it_should_use_the_collection_when_provided(as, countable)
end
concat(fields)
end)
- output_buffer.should have_tag("form div.form-group div.controls label[@for='post_author_category_name_general']")
- output_buffer.should have_tag("form div.form-group div.controls label[@for='post_author_category_name_design']")
- output_buffer.should have_tag("form div.form-group div.controls label[@for='post_author_category_name_development']")
- output_buffer.should have_tag("form div.form-group div.controls label[@for='post_author_category_name_quasi-serious_inventions']")
+ output_buffer.should have_tag("form div.form-group span.form-wrapper label[@for='post_author_category_name_general']")
+ output_buffer.should have_tag("form div.form-group span.form-wrapper label[@for='post_author_category_name_design']")
+ output_buffer.should have_tag("form div.form-group span.form-wrapper label[@for='post_author_category_name_development']")
+ output_buffer.should have_tag("form div.form-group span.form-wrapper label[@for='post_author_category_name_quasi-serious_inventions']")
end
end
end
View
4 spec/support/fb_custom_macros.rb
@@ -8,13 +8,13 @@ module ClassMethods
def it_should_have_bootstrap_horizontal_wrapping
it "should have 'input' class in the right place" do
- output_buffer.should have_tag("form div.form-group div.controls")
+ output_buffer.should have_tag("form div.form-group span.form-wrapper")
end
end
def it_should_have_bootstrap_controls_label_with(class_name)
it "should have bootstrap controls wrapper with class '#{class_name}'" do
- output_buffer.should have_tag("form div.controls label.#{class_name}")
+ output_buffer.should have_tag("form span.form-wrapper label.#{class_name}")
end
end
Please sign in to comment.
Something went wrong with that request. Please try again.