cirandas.net

ref: master

plugins/solr/test/unit/qualifier_test.rb


 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
require_relative '../test_helper'

class QualifierTest < ActiveSupport::TestCase
  def setup
    @environment = Environment.default
    @environment.enable_plugin(SolrPlugin)
  end

  attr_accessor :environment

  should 'reindex products after saving' do
    product = mock
    Qualifier.any_instance.stubs(:products).returns([product])
    Qualifier.expects(:solr_batch_add).with(includes(product))
    qual = fast_create(Qualifier)
    qual.save!
  end
end