Sha256: 48656cdbea7b8481dc42961ef4fb1f9479a481d9c39bbf7bc0ecdc57ee647c41

Contents?: true

Size: 647 Bytes

Versions: 27

Compression:

Stored size: 647 Bytes

Contents

require 'test_helper'

module Workarea
  class Segment
    class LifeCycleTest < TestCase
      class FooSegment < Segment
        include LifeCycle
        self.default_rules = [Rules::Orders.new(maximum: 0)]
      end

      def test_name_given
        life_cycle = FooSegment.instance # create it
        assert_equal('Foo Segment', life_cycle.name)
      end

      def test_cannot_destroy
        life_cycle = FooSegment.instance # create it

        assert_no_difference 'Segment.count' do
          refute(life_cycle.destroy)
        end

        assert_nothing_raised do
          life_cycle.reload
        end
      end
    end
  end
end

Version data entries

27 entries across 27 versions & 1 rubygems

Version Path
workarea-core-3.5.27 test/models/workarea/segment/life_cycle_test.rb
workarea-core-3.5.26 test/models/workarea/segment/life_cycle_test.rb
workarea-core-3.5.25 test/models/workarea/segment/life_cycle_test.rb
workarea-core-3.5.23 test/models/workarea/segment/life_cycle_test.rb
workarea-core-3.5.22 test/models/workarea/segment/life_cycle_test.rb
workarea-core-3.5.21 test/models/workarea/segment/life_cycle_test.rb
workarea-core-3.5.20 test/models/workarea/segment/life_cycle_test.rb
workarea-core-3.5.19 test/models/workarea/segment/life_cycle_test.rb
workarea-core-3.5.18 test/models/workarea/segment/life_cycle_test.rb
workarea-core-3.5.17 test/models/workarea/segment/life_cycle_test.rb
workarea-core-3.5.16 test/models/workarea/segment/life_cycle_test.rb
workarea-core-3.5.15 test/models/workarea/segment/life_cycle_test.rb
workarea-core-3.5.14 test/models/workarea/segment/life_cycle_test.rb
workarea-core-3.5.13 test/models/workarea/segment/life_cycle_test.rb
workarea-core-3.5.12 test/models/workarea/segment/life_cycle_test.rb
workarea-core-3.5.11 test/models/workarea/segment/life_cycle_test.rb
workarea-core-3.5.10 test/models/workarea/segment/life_cycle_test.rb
workarea-core-3.5.9 test/models/workarea/segment/life_cycle_test.rb
workarea-core-3.5.8 test/models/workarea/segment/life_cycle_test.rb
workarea-core-3.5.7 test/models/workarea/segment/life_cycle_test.rb