Sha256: d9bdc621014e755fdc32f5fda6cce7f495537e9df45462263573b4b34a0b98fc
Contents?: true
Size: 868 Bytes
Versions: 14
Compression:
Stored size: 868 Bytes
Contents
# frozen_string_literal: true module Shared module NoAddition def setup (1..4).each { |counter| NoAdditionMixin.create! pos: counter, parent_id: 5 } end def test_insert new = NoAdditionMixin.create(parent_id: 20) assert_nil new.pos assert !new.in_list? new = NoAdditionMixin.create(parent_id: 20) assert_nil new.pos end def test_update_does_not_add_to_list new = NoAdditionMixin.create(parent_id: 20) new.update_attribute(:updated_at, Time.now) # force some change new.reload assert !new.in_list? end def test_update_scope_does_not_add_to_list new = NoAdditionMixin.create new.update_attribute(:parent_id, 20) new.reload assert !new.in_list? new.update_attribute(:parent_id, 5) new.reload assert !new.in_list? end end end
Version data entries
14 entries across 14 versions & 1 rubygems