Sha256: 8bc35d2a1f53202b01a1bd80fb75186784181d3eca9e2250abd1569bb8c4c7bf

Contents?: true

Size: 402 Bytes

Versions: 6

Compression:

Stored size: 402 Bytes

Contents

require "test_helper"

class Order < ActiveRecord::Base
  add_to_bag :aa, :bb, :cc
  delete_from_bag :bb
end

class DeleteTest < ActiveSupport::TestCase
  def setup
    @order = Order.new
  end

  test "delete a field" do
    @order.aa = "aa"
    @order.bb = "bb"
    @order.cc = "cc"
    @order.save
    assert_equal "aa", @order.aa
    assert_nil @order.bb
    assert_equal "cc", @order.cc
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
act_with_bag-1.1.5 test/delete_test.rb
act_with_bag-1.1.4 test/delete_test.rb
act_with_bag-1.1.3 test/delete_test.rb
act_with_bag-1.1.2 test/delete_test.rb
act_with_bag-1.1.1 test/delete_test.rb
act_with_bag-1.1.0 test/delete_test.rb