Sha256: 1d4b008864334109425023ddff855913b619940c021020c5ad6a6daab8c8ea6e

Contents?: true

Size: 651 Bytes

Versions: 3

Compression:

Stored size: 651 Bytes

Contents

require 'spec_helper'

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

    @options = {}
    @block = Proc.new {}
  end

  context "#checkbox" do
    before(:each) do
      @input = Formic::Checkbox.new @page, 'name', @options, &@block
    end

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

    it "should have type file" do
      @input.options[:type].should == 'checkbox'
    end

    it "should set field value" do
      @input.field.should == 'name'
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

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