require 'spec_helper' describe 'BooleanInput' do include RSpec::Rails::HelperExampleGroup include Webrat::HaveTagMatcher before(:each) do end it "should return check box tag" do helper.jquery_form_for(:new_post, :url => '/hello') do |builder| builder.input(:login, :as => :boolean).should have_tag("input[type='checkbox'].ui-boolean-input") end end it "should return check box tag with options" do helper.jquery_form_for(:new_post, :as => @object, :url => '/hello') do |builder| box = builder.input(:login, :as => :boolean, "data-name" =>"my-name", :checked_value => "One") box.should have_tag("input[type='checkbox'][data-name='my-name'][value='One'].ui-boolean-input") box.should have_tag("input[type='hidden'][value='0']") end end end