Sha256: 117bd79e921e2c86a04417c30a62a115a52d9e2023bdca2a3a8a179a6246eee8

Contents?: true

Size: 1.24 KB

Versions: 9

Compression:

Stored size: 1.24 KB

Contents

require 'spec_helper'

describe JoinedVersion, :versioning => true do
  it { JoinedVersion.superclass.should == PaperTrail::Version }

  let(:widget) { Widget.create!(:name => Faker::Name.name) }
  let(:version) { JoinedVersion.first }

  describe "Scopes" do
    describe "default_scope" do
      it { JoinedVersion.default_scopes.should_not be_empty }
    end

    describe "VersionConcern::ClassMethods" do
      before { widget } # persist a widget

      describe :subsequent do
        it "shouldn't error out when there is a default_scope that joins" do
          JoinedVersion.subsequent(version).first
        end
      end

      describe :preceding do
        it "shouldn't error out when there is a default scope that joins" do
          JoinedVersion.preceding(version).first
        end
      end

      describe :between do
        it "shouldn't error out when there is a default scope that joins" do
          JoinedVersion.between(Time.now, 1.minute.from_now).first
        end
      end
    end
  end

  describe "Methods" do
    describe :index do
      it { should respond_to(:index) }

      it "shouldn't error out when there is a default scope that joins" do
        widget # persist a widget
        version.index
      end
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
paper_trail-3.0.9 spec/models/joined_version_spec.rb
paper_trail-3.0.8 spec/models/joined_version_spec.rb
paper_trail-3.0.7 spec/models/joined_version_spec.rb
paper_trail-3.0.6 spec/models/joined_version_spec.rb
paper_trail-3.0.5 spec/models/joined_version_spec.rb
paper_trail-3.0.2 spec/models/joined_version_spec.rb
paper_trail-3.0.1 spec/models/joined_version_spec.rb
paper_trail-3.0.0 spec/models/joined_version_spec.rb
paper_trail-3.0.0.rc2 spec/models/joined_version_spec.rb