Sha256: 11bf1211323562dcbdada142e7de55822958d9aef83299c43c6401dc3e40ade8

Contents?: true

Size: 515 Bytes

Versions: 3

Compression:

Stored size: 515 Bytes

Contents

require "spec_helper"

describe "attribute defailts" do
  let(:test_class) { ::DefaultAuthor }

  describe "string" do
    it "defaults to a string" do
      record = test_class.new
      expect(record.name).to eq("John Doe")
    end
  end

  describe "lambda" do
    it "calls the lambda" do
      record = test_class.new
      expect(record.guid).to eq(100)
    end
  end

  describe "array" do
    it "defaults to an array" do
      record = test_class.new
      expect(record.books).to eq([])
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
active_remote-2.4.0 spec/lib/active_remote/attribute_defaults_spec.rb
active_remote-2.3.5 spec/lib/active_remote/attribute_defaults_spec.rb
active_remote-2.3.4 spec/lib/active_remote/attribute_defaults_spec.rb