Sha256: dc682b2d4d849c48afe98b9b6467b51c1f4bbec6115f32938e8a6e59e3b48e3c

Contents?: true

Size: 1.72 KB

Versions: 16

Compression:

Stored size: 1.72 KB

Contents

require 'spec_helper'

describe 'DateInput' do
  
  include RSpec::Rails::HelperExampleGroup
  include Webrat::HaveTagMatcher
  
  before(:each) do
    
  end
  
  it "should return date tag" do
    helper.jquery_form_for(:new_post, :as => @object, :url => '/hello') do |builder|
      builder.input(:birthdate, :as => :date).should have_tag("input[type='text'].ui-date-input")
    end
  end
  
  it "should return date tag with options" do
    helper.jquery_form_for(:new_post, :as => @object, :url => '/hello') do |builder|
      builder.input(:birthdate, :as => :date, "data-name" =>"my-name").should have_tag("input[type='text'][data-name='my-name'].ui-date-input")
    end
  end
  
  it "should return datetime tag" do
    helper.jquery_form_for(:new_post, :as => @object, :url => '/hello') do |builder|
      builder.input(:birthdate, :as => :datetime).should have_tag("input[type='text'].ui-datetime-input")
    end
  end
  
  it "should return datetime tag with options" do
    helper.jquery_form_for(:new_post, :as => @object, :url => '/hello') do |builder|
      builder.input(:birthdate, :as => :datetime, "data-name" =>"my-name").should have_tag("input[type='text'][data-name='my-name'].ui-datetime-input")
    end
  end
  
  it "should return time tag" do
    helper.jquery_form_for(:new_post, :as => @object, :url => '/hello') do |builder|
      builder.input(:birthdate, :as => :time).should have_tag("input[type='text'].ui-time-input")
    end
  end
  
  it "should return time tag with options" do
    helper.jquery_form_for(:new_post, :as => @object, :url => '/hello') do |builder|
      builder.input(:birthdate, :as => :time, "data-name" =>"my-name").should have_tag("input[type='text'][data-name='my-name'].ui-time-input")
    end
  end
end

Version data entries

16 entries across 16 versions & 1 rubygems

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