This repository has been archived on 2024-07-22. You can view files and clone it, but cannot push or open issues or pull requests.
2023-03-10 04:33:30 -08:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
require 'rails_helper'
|
|
|
|
|
|
|
|
describe SearchQueryTransformer do
|
|
|
|
describe 'initialization' do
|
|
|
|
let(:parser) { SearchQueryParser.new.parse('query') }
|
|
|
|
|
|
|
|
it 'sets attributes' do
|
|
|
|
transformer = described_class.new.apply(parser)
|
|
|
|
|
2023-08-24 07:40:04 -07:00
|
|
|
expect(transformer.should_clauses.first).to be_nil
|
|
|
|
expect(transformer.must_clauses.first).to be_a(SearchQueryTransformer::TermClause)
|
2023-03-10 04:33:30 -08:00
|
|
|
expect(transformer.must_not_clauses.first).to be_nil
|
|
|
|
expect(transformer.filter_clauses.first).to be_nil
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|