cirandas.net

ref: master

plugins/solr/test/unit/solr_plugin/plugin_test.rb


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

class SolrPlugin::PluginTest < ActiveSupport::TestCase

  def setup
    @plugin = SolrPlugin.new
  end
  attr_reader :plugin

  should 'convert scopes to solr filters' do
    person = create_user('test').person
    result = plugin.send :scopes_to_solr_filters, person.files.public.published
    assert_equal result, ["profile_id:#{person.id}", "published:'true'", "solr_is_public:true"]
  end

end