Sha256: 40d4306c15bd1042f8ae39a915508bdcda0aade64ee8554c3383e1b9dcb14eb2

Contents?: true

Size: 1.37 KB

Versions: 3

Compression:

Stored size: 1.37 KB

Contents

require 'spec_helper'
require 'orm/models/person'
require 'orm/models/person_with_timestamp'
require 'orm/models/address'
require 'orm/models/address_with_timestamp'

describe "timestamps" do
  include SetUpHbaseConnectionBeforeAll
  include SetTableNamesToTestTable

  describe "on table classes" do
    let(:attribute_to_be_changed) { 'name' }

    describe PersonWithTimestamp do
      subject { PersonWithTimestamp.create!(:name => "John Doe", :email => "john@base.com", :age => "20") }

      it_should_behave_like "a model with timestamps"
    end

    describe Person do
      subject { Person.create!(:name => "John Doe", :email => "john@base.com", :age => "20") }

      it_should_behave_like "a model without timestamps"
    end
  end


  describe "on embedded classes" do
    let(:attribute_to_be_changed) { 'street' }
    let(:person) { Person.create!(:name => "John Doe", :email => "john@base.com", :age => "20") }

    describe AddressWithTimestamp do
      subject { AddressWithTimestamp.new "id1", :street => "Karl Johans gate 13" }
      before { person.addresses_with_timestamp << subject; subject }

      it_should_behave_like "a model with timestamps"
    end

    describe Address do
      subject { Address.new "id1", :street => "Karl Johans gate 13" }
      before { person.addresses << subject; subject }

      it_should_behave_like "a model without timestamps"
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
massive_record-0.2.2 spec/orm/cases/timestamps_spec.rb
massive_record-0.2.2.rc2 spec/orm/cases/timestamps_spec.rb
massive_record-0.2.2.rc1 spec/orm/cases/timestamps_spec.rb