Sha256: 47873f4840d45c0a53acb254d6bbe098fb84532f5bbe0c186e55a608af0be1ab
Contents?: true
Size: 778 Bytes
Versions: 2
Compression:
Stored size: 778 Bytes
Contents
require 'spec_helper' describe MemoryModel::Base::Persistence do let(:model) do Class.new(MemoryModel::Base) do field :foo end end let(:value) { 'bar' } subject(:instance) { model.new(foo: value) } before(:each) do stub_const('MyModel', model) end describe '#persisted?' do it 'should be true if persisted' do instance.commit instance.persisted?.should be_true end it 'should be false if not persisted' do instance.persisted?.should be_false end end describe '#new_record?' do it 'should be true unless persisted' do instance.commit instance.new_record?.should be_false end it 'should be false unless not persisted' do instance.new_record?.should be_true end end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
memory_model-0.0.2 | spec/memory_model/base/persistence_spec.rb |
memory_model-0.0.1 | spec/memory_model/base/persistence_spec.rb |