Sha256: bbe038ff20a9bbe488f148b1eeea8b7cc27ab05eae06b953da3fbfbd4f913882

Contents?: true

Size: 643 Bytes

Versions: 3

Compression:

Stored size: 643 Bytes

Contents

require 'spec_helper'

describe Formic::Hidden 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 "#file" do
    before(:each) do
      @hidden = Formic::Hidden.new @page, 'name', @options, &@block
    end

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

    it "should have type hidden" do
      @hidden.options[:type].should == 'hidden'
    end

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

Version data entries

3 entries across 3 versions & 1 rubygems

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