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