Sha256: 46f937b15f460dd19fd412c06b39858da26dbe6af8cac4612350553473b66cc6

Contents?: true

Size: 1.04 KB

Versions: 1

Compression:

Stored size: 1.04 KB

Contents

require 'spec_helper'

describe RSpec::PaperTrailExtensions do
  context 'default' do
    it 'should have versioning off by default' do
      PaperTrail.enabled?.should_not be_true
    end
    it 'should turn versioning on in a with_versioning block' do
      PaperTrail.enabled?.should_not be_true
      with_versioning do
        PaperTrail.enabled?.should be_true
      end
      PaperTrail.enabled?.should_not be_true
    end
  end
  context 'versioning: true', :versioning => true do
    it 'should have versioning on by default' do
      PaperTrail.enabled?.should be_true
    end
    it 'should keep versioning on after a with_versioning block' do
      PaperTrail.enabled?.should be_true
      with_versioning do
        PaperTrail.enabled?.should be_true
      end
      PaperTrail.enabled?.should be_true
    end
  end
end

describe Model do
  context 'be_versioned matcher', :versioning => true do
    it 'should respond to be_versioned' do
      model = Model.create(:name => 'Bob', :color => 'blue')
      model.should be_versioned
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
rspec-paper_trail-0.0.10 spec/rspec-paper_trail/versioning_extensions_spec.rb