require 'spec_helper' describe 'SelectInput' do include RSpec::Rails::HelperExampleGroup include Webrat::HaveTagMatcher before(:each) do end it "should return select tag" do helper.jquery_form_for(:new_post, :as => @object, :url => '/hello') do |builder| tag = builder.input(:mode, :collection => [["A","a"], ["B","b"]], :include_blank => true) tag.should have_tag("select.ui-select-input") tag.should have_tag("select>option", :count => 3) tag.should have_tag("select>option[value='a']") do |text| text.should contain("A") end end end it "should return select tag with options" do helper.jquery_form_for(:new_post, :as => @object, :url => '/hello') do |builder| builder.input(:mode, :collection => [], "data-name" =>"my-name").should have_tag("select[data-name='my-name'].ui-select-input") end end end