Sha256: c80545481208b2df952c392bbefd6261ac09507b93233a32b716634effb840ae

Contents?: true

Size: 809 Bytes

Versions: 16

Compression:

Stored size: 809 Bytes

Contents

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

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
jquery-ui-form-0.2.8 spec/inputs/boolean_input_spec.rb
jquery-ui-form-0.2.7 spec/inputs/boolean_input_spec.rb
jquery-ui-form-0.2.6 spec/inputs/boolean_input_spec.rb
jquery-ui-form-0.2.5 spec/inputs/boolean_input_spec.rb
jquery-ui-form-0.2.4 spec/inputs/boolean_input_spec.rb
jquery-ui-form-0.2.3 spec/inputs/boolean_input_spec.rb
jquery-ui-form-0.2.2 spec/inputs/boolean_input_spec.rb
jquery-ui-form-0.2.1 spec/inputs/boolean_input_spec.rb
jquery-ui-form-0.2.0 spec/inputs/boolean_input_spec.rb
jquery-ui-form-0.1.6 spec/inputs/boolean_input_spec.rb
jquery-ui-form-0.1.5 spec/inputs/boolean_input_spec.rb
jquery-ui-form-0.1.4 spec/inputs/boolean_input_spec.rb
jquery-ui-form-0.1.3 spec/inputs/boolean_input_spec.rb
jquery-ui-form-0.1.2 spec/inputs/boolean_input_spec.rb
jquery-ui-form-0.1.1 spec/inputs/boolean_input_spec.rb
jquery-ui-form-0.1.0 spec/inputs/boolean_input_spec.rb