Sha256: f2e1f2b9799dbdb38abd63fcad28c2da751de5a65bd8a1d3e67282ae77ec28af

Contents?: true

Size: 546 Bytes

Versions: 14

Compression:

Stored size: 546 Bytes

Contents

# rubocop:disable all
require 'test_helper'

describe 'String Flag' do
  let(:order) { Order.new }

  def setup
    reset_order
    order.update bigflags: '0'
    Order.add_to_flags a: 1000, origin: :bigflags
  end

  it 'set and reset flag' do
    assert order.bigflags.is_a?(String)
    order.a = true
    assert order.bigflags.is_a?(String)
    assert_equal true, order.a
    assert_equal true, order.a?

    order.a = 'false'
    assert order.bigflags.is_a?(String)
    assert_equal false, order.a
    assert_equal false, order.a?
  end

end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
act_with_flags-3.1.9 test/string_test.rb
act_with_flags-3.1.6 test/string_test.rb
act_with_flags-3.1.5 test/string_test.rb
act_with_flags-3.1.3 test/string_test.rb
act_with_flags-3.1.2 test/string_test.rb
act_with_flags-3.1.1 test/string_test.rb
act_with_flags-3.1.0 test/string_test.rb
act_with_flags-3.0.1 test/string_test.rb
act_with_flags-0.2.4 test/string_test.rb
act_with_flags-0.2.3 test/string_test.rb
act_with_flags-0.2.0 test/string_test.rb
act_with_flags-0.1.0 test/string_test.rb
act_with_flags-0.0.7 test/string_test.rb
act_with_flags-0.0.6 test/string_test.rb