Sha256: b54cc89012b7f6c8359cd958f5e9188a28c62e6253e388f55ba981ba3d9099c8

Contents?: true

Size: 434 Bytes

Versions: 8

Compression:

Stored size: 434 Bytes

Contents

require 'helper'

describe 'scope' do
  before do
    @klass = Class.new(ActiveRecord::Base)
  end

  it 'supports a finder hash' do
    assert_deprecated { @klass.scope :foo, conditions: :foo }
    @klass.foo.where_values.must_equal [:foo]
  end

  it 'supports a finder hash inside a callable' do
    @klass.scope :foo, ->(v) { { conditions: v } }
    assert_deprecated { @klass.foo(:bar) }.where_values.must_equal [:bar]
  end
end

Version data entries

8 entries across 8 versions & 2 rubygems

Version Path
challah-1.0.0 vendor/bundle/gems/activerecord-deprecated_finders-1.0.3/test/scope_test.rb
activerecord-deprecated_finders-1.0.3 test/scope_test.rb
activerecord-deprecated_finders-1.0.2 test/scope_test.rb
activerecord-deprecated_finders-1.0.1 test/scope_test.rb
activerecord-deprecated_finders-1.0.0 test/scope_test.rb
activerecord-deprecated_finders-0.0.3 test/scope_test.rb
activerecord-deprecated_finders-0.0.2 test/scope_test.rb
activerecord-deprecated_finders-0.0.1 test/scope_test.rb