Sha256: 1358b471fc009550ed2ed37f7c8e9b3bf6519e30208c7e25ce6567634af7a97f

Contents?: true

Size: 575 Bytes

Versions: 7

Compression:

Stored size: 575 Bytes

Contents

require_relative "test_helper"

# Rails 5 introduced a new base class, and this is gonna test that
if defined?(ApplicationRecord)
  class ApplicationRecordTest < ActiveSupport::TestCase

    test "archive archives the record" do
      archival = ApplicationRecordRow.create!
      archival.archive!
      assert archival.reload.archived?
    end

    test "unarchive unarchives archival records" do
      archival = ApplicationRecordRow.create!(archived_at: Time.now, archive_number: 1)
      archival.unarchive!
      assert_not archival.reload.archived?
    end

  end
end

Version data entries

7 entries across 7 versions & 2 rubygems

Version Path
acts_as_archival-2.1.0 test/application_record_test.rb
acts_as_archival-2.0.0 test/application_record_test.rb
archival_record-2.0.2 test/application_record_test.rb
archival_record-2.0.1 test/application_record_test.rb
archival_record-2.0.0 test/application_record_test.rb
acts_as_archival-1.4.0 test/application_record_test.rb
acts_as_archival-1.3.0 test/application_record_test.rb