Sha256: 85627aa23676f0c7fe3c396afd9753920476088896d3e5b308c5f29c9921b116

Contents?: true

Size: 709 Bytes

Versions: 1

Compression:

Stored size: 709 Bytes

Contents

require "spec_helper"

describe Form do
  describe ".new" do
    let(:data) { mock }
    let(:base_name) { mock }

    it "instantiates a new Form::Builder object" do
      Form::Builder.should_receive(:new).with(data, base_name)
      Form.new(data, base_name)
    end
  end

  describe ".add_locale" do
    let(:en) {
      File.expand_path("../../lib/form/locales/en.yml", __FILE__)
    }

    let(:ptBR) {
      File.expand_path("../../lib/form/locales/pt-BR.yml", __FILE__)
    }

    it "includes English by default" do
      I18n.load_path.should include(en)
    end

    it "appends other locales" do
      I18n.load_path.should_receive(:<<).with(ptBR)
      Form.add_locale "pt-BR"
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
form-0.0.1.alpha1 spec/form_spec.rb