Sha256: 3d3cf5731b0d2769ee2a14b1dddb931d368810944690c8a0a1ee7c5e170762ac

Contents?: true

Size: 894 Bytes

Versions: 16

Compression:

Stored size: 894 Bytes

Contents

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

Version data entries

16 entries across 16 versions & 1 rubygems

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