Sha256: a54240c12d2efceea99bf88402ae95512fb72b5182bd74251378d2301798d734

Contents?: true

Size: 572 Bytes

Versions: 2

Compression:

Stored size: 572 Bytes

Contents

require 'spec_helper'

describe 'Sid' do
  before do
    reset_database
  end

  it "should auto increment the sid field of a model" do
    Page.create(:account_id => 1).sid.should == 1
    Page.create(:account_id => 1).sid.should == 2
    Page.create(:account_id => 1).destroy
    Page.create(:account_id => 1).sid.should == 3

    Page.create(:account_id => 2).sid.should == 1
    Page.create(:account_id => 1).sid.should == 4
    Page.create(:account_id => 2).sid.should == 2

    Page.find_by_sid(2).destroy
    Page.create(:account_id => 1).sid.should == 5
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
sid-0.0.2 spec/sid_spec.rb
sid-0.0.1 spec/sid_spec.rb