Sha256: 3b8f9bacc6980ec9990452dae948a517610574fc7142167f44c08b891712010e

Contents?: true

Size: 847 Bytes

Versions: 3

Compression:

Stored size: 847 Bytes

Contents

require 'spec_helper'

describe Formic::Textarea do
  before(:each) do
    @model = Object.new
    stub(@page = Object.new).url_for(@model) {'/models/1'}
    stub(@page).render

    @options = {:value => 'some value'}
    @block = Proc.new {}
  end

  context "#initialize" do
    before(:each) do
      @textarea = Formic::Textarea.new @page, 'name', @options, &@block
    end

    it "should have template formic/default/textarea" do
      @textarea.template.should == 'formic/default/textarea'
    end

    it "should have value for field" do
      @textarea.options[:value].should == 'some value'
    end

    it "should have class textarea" do
      @textarea.should have_class 'textarea'
    end

    it "should initilize other attributes" do
      @textarea.content.should == @block
      @textarea.field.should == 'name'
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
formic-0.2.5 spec/formic/textarea_spec.rb
formic-0.2.1 spec/formic/textarea_spec.rb
formic-0.1.0 spec/formic/textarea_spec.rb