Sha256: f1ee131eb7f81f14c895c9f29b244ce8df21d1cd0822fea019f86200617de5e7

Contents?: true

Size: 754 Bytes

Versions: 1

Compression:

Stored size: 754 Bytes

Contents

require File.dirname(__FILE__) + "/spec_helper"

describe 'Paranoia' do
  
  before(:all) do
    class Scared < DataMapper::Base
      property :name, :string
      property :deleted_at, :datetime
    end
    
    Scared.auto_migrate!
  end
  
  after(:all) do
    database.table(Scared).drop!
  end
  
  it "should not be found" do
    cat = Scared.create(:name => 'bob')
    
    database.query('SELECT name FROM scareds').should have(1).entries
    
    cat2 = Scared.first(:name => 'bob')
    cat2.should_not be_nil
    cat2.should be_a_kind_of(Scared)
    
    cat.destroy!
    
    Scared.first(:name => 'bob').should be_nil
    
    Scared.first.should be_nil
    
    database.query('SELECT name FROM scareds').should have(1).entries
  end
  
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
datamapper-0.2.4 spec/paranoia_spec.rb