Sha256: 0299f1c95e5b5b40173acbbf1ed2aaf610e059d46bf057b86eedc0c74320abb3

Contents?: true

Size: 772 Bytes

Versions: 4

Compression:

Stored size: 772 Bytes

Contents

require 'test_helper'

describe 'Testing origin' do
  let(:admin) { Order.act_with_flags }
  let(:order) { Order.new }

  def setup
    reset_order
  end

  it 'origin category' do
    Order.add_to_flags :x, origin: :category
    assert_equal :category, admin.origin
  end

  it 'origin category #2' do
    Order.add_to_flags :x, origin: :category
    assert_raises { Order.add_to_flags origin: :category2 }
  end

  it 'origin category #3' do
    Order.add_to_flags :x, origin: :category
    Order.add_to_flags origin: :category
  end

  it 'origin default' do
    Order.add_to_flags :x
    assert_equal :flags, admin.origin
  end

  it 'origin 1' do
    Order.add_to_flags origin: 1
    assert_equal :flags, admin.origin
    assert order.respond_to?(:origin)
  end

end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
act_with_flags-0.1.0 test/origin_test.rb
act_with_flags-0.0.7 test/origin_test.rb
act_with_flags-0.0.6 test/origin_test.rb
act_with_flags-0.0.4 test/origin_test.rb