Sha256: 5675b27409ff95a2feec5931efc8903ac8300bf6d10d861dc1b5cef2277b6b21

Contents?: true

Size: 818 Bytes

Versions: 1

Compression:

Stored size: 818 Bytes

Contents

require File.expand_path('../../test_helper', __FILE__)

describe Formation::Types::TextArea do
  
  before do
    @field = Formation::Field.new('body', :type => :textarea)
    @type = @field.type
  end
  
  describe '.to_html' do
    
    describe 'with no value' do
      
      before do
        @field.value = nil
      end
    
      it 'should render correctly' do
        @type.to_html.must_equal <<-HTML.strip
          <textarea name="body"></textarea>
        HTML
      end
      
    end
    
    describe 'with a value' do
      
      before do
        @field.value = 'Blah, blah, blah'
      end
      
      it 'should render correctly' do
        @type.to_html.must_equal <<-HTML.strip
          <textarea name="body">Blah, blah, blah</textarea>
        HTML
      end
      
    end
    
  end
  
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
formation-0.0.1 test/types/text_area_spec.rb