Sha256: 369d452aefb70d72a4f8a3fa7545b86b3d028e3a9536c397287b101ea1f0a611

Contents?: true

Size: 919 Bytes

Versions: 21

Compression:

Stored size: 919 Bytes

Contents

# coding: utf-8
require File.dirname(__FILE__) + '/../spec_helper'

describe 'text input' do
  
  include FormtasticSpecHelper
  
  before do
    @output_buffer = ''
    mock_everything
    
    semantic_form_for(@new_post) do |builder|
      concat(builder.input(:body, :as => :text))
    end
  end
    
  it_should_have_input_wrapper_with_class("text")
  it_should_have_input_wrapper_with_id("post_body_input")
  it_should_have_label_with_text(/Body/)
  it_should_have_label_for("post_body")
  it_should_have_textarea_with_id("post_body")
  it_should_have_textarea_with_name("post[body]")
  it_should_apply_error_logic_for_input_type(:numeric)
  
  it 'should use input_html to style inputs' do
    semantic_form_for(@new_post) do |builder|
      concat(builder.input(:title, :as => :text, :input_html => { :class => 'myclass' }))
    end
    output_buffer.should have_tag("form li textarea.myclass")
  end
    
end

Version data entries

21 entries across 21 versions & 4 rubygems

Version Path
formtastic-1.0.1 spec/inputs/text_input_spec.rb
formtastic-1.0.0 spec/inputs/text_input_spec.rb
formtastic-1.0.0.rc2 spec/inputs/text_input_spec.rb
formtastic-1.0.0.rc spec/inputs/text_input_spec.rb
formtastic-1.0.0.beta4 spec/inputs/text_input_spec.rb
formtastic-1.0.0.beta3 spec/inputs/text_input_spec.rb
formtastic-1.0.0.beta2 spec/inputs/text_input_spec.rb
formtastic-1.0.0.beta spec/inputs/text_input_spec.rb
formtastic-0.9.10 spec/inputs/text_input_spec.rb
formtastic-0.9.9 spec/inputs/text_input_spec.rb
formtastic-0.9.8 spec/inputs/text_input_spec.rb
jintastic-1.1.0 vendor/plugins/formtastic/spec/inputs/text_input_spec.rb
jintastic-1.0.2 vendor/plugins/formtastic/spec/inputs/text_input_spec.rb
tmayad-formtastic-0.9.7 spec/inputs/text_input_spec.rb
ShadowBelmolve-formtastic-0.9.7 spec/inputs/text_input_spec.rb
formtastic-0.9.7 spec/inputs/text_input_spec.rb
formtastic-0.9.6 spec/inputs/text_input_spec.rb
formtastic-0.9.5 spec/inputs/text_input_spec.rb
formtastic-0.9.4 spec/inputs/text_input_spec.rb
formtastic-0.9.3 spec/inputs/text_input_spec.rb