Sha256: 1e202d5e544b4f3ce20a29f8819d349520abb7d5f5a27428df910f3ec0192704

Contents?: true

Size: 834 Bytes

Versions: 16

Compression:

Stored size: 834 Bytes

Contents

require "test_helper"

module PushType
  describe Trashable do

    describe 'query scopes' do
      it { PushType::Node.respond_to?(:trashed).must_equal true }
      it { PushType::Node.respond_to?(:not_trash).must_equal true }
    end

    describe '#trashed?' do
      describe 'when not trash' do
        let(:page) { FactoryGirl.create :node }
        it { page.trashed?.must_equal false }
        describe '#trash!' do
          before { page.trash! }
          it { page.trashed?.must_equal true }
        end
      end

      describe 'when trash' do
        let(:page) { FactoryGirl.create :node, deleted_at: Time.zone.now }
        it { page.trashed?.must_equal true }
        describe '#restore!' do
          before { page.restore! }
          it { page.trashed?.must_equal false }
        end
      end
    end

  end
end

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
push_type_core-0.5.1 test/models/concerns/push_type/trashable_test.rb
push_type_core-0.5.0 test/models/concerns/push_type/trashable_test.rb
push_type_core-0.5.0.alpha.5 test/models/concerns/push_type/trashable_test.rb
push_type_core-0.5.0.alpha.4 test/models/concerns/push_type/trashable_test.rb
push_type_core-0.5.0.alpha.3 test/models/concerns/push_type/trashable_test.rb
push_type_core-0.5.0.alpha.2 test/models/concerns/push_type/trashable_test.rb
push_type_core-0.5.0.alpha.1 test/models/concerns/push_type/trashable_test.rb
push_type_core-0.4.0 test/models/concerns/push_type/trashable_test.rb
push_type_core-0.4.0.beta.3 test/models/concerns/push_type/trashable_test.rb
push_type_core-0.3.3 test/models/concerns/push_type/trashable_test.rb
push_type_core-0.3.1 test/models/concerns/push_type/trashable_test.rb
push_type_core-0.2.1 test/models/concerns/push_type/trashable_test.rb
push_type_core-0.2.0 test/models/concerns/push_type/trashable_test.rb
push_type_core-0.2.0.beta2 test/models/concerns/push_type/trashable_test.rb
push_type_core-0.1.1 test/models/concerns/push_type/trashable_test.rb
push_type_core-0.1.0 test/models/concerns/push_type/trashable_test.rb