2019-07-25 01:21:37 -04:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2015-12-30 12:16:53 -05:00
|
|
|
require 'spec_helper'
|
|
|
|
|
2020-06-24 05:08:32 -04:00
|
|
|
RSpec.describe Banzai::Querying do
|
2015-12-30 12:16:53 -05:00
|
|
|
describe '.css' do
|
|
|
|
it 'optimizes queries for elements with classes' do
|
|
|
|
document = double(:document)
|
|
|
|
|
|
|
|
expect(document).to receive(:xpath).with(/^descendant::a/)
|
|
|
|
|
|
|
|
described_class.css(document, 'a.gfm')
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|