cirandas.net

ref: master

plugins/solr/test/unit/certifier_test.rb


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

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

  attr_accessor :environment

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