Sha256: 8711d7219ce19cdd810a2908f8fc49f12c4fb0f6c6131e98b13f6b23c31a0ee2

Contents?: true

Size: 519 Bytes

Versions: 9

Compression:

Stored size: 519 Bytes

Contents

require 'rails_helper'

# This model is in the test suite soley for the purpose of testing ActiveRecord::Enum,
# which is available in ActiveRecord4+ only
describe PostWithStatus, :type => :model do
  if defined?(ActiveRecord::Enum)
    with_versioning do
      let(:post) { PostWithStatus.create!(:status => 'draft') }

      it "should stash the enum value properly in versions" do
        post.published!
        post.archived!
        expect(post.previous_version.published?).to be true
      end
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
paper_trail-4.2.0 spec/models/post_with_status_spec.rb
paper_trail-4.1.0 spec/models/post_with_status_spec.rb
paper_trail-4.0.2 spec/models/post_with_status_spec.rb
paper_trail-4.0.1 spec/models/post_with_status_spec.rb
paper_trail-4.0.0 spec/models/post_with_status_spec.rb
paper_trail-4.0.0.rc2 spec/models/post_with_status_spec.rb
paper_trail-4.0.0.rc1 spec/models/post_with_status_spec.rb
paper_trail-4.0.0.beta2 spec/models/post_with_status_spec.rb
paper_trail-4.0.0.beta1 spec/models/post_with_status_spec.rb