Sha256: 267ed536f3725ba2b0f9f905ec40e6717db3d7e6045d6a5bb567ac5a200148f9

Contents?: true

Size: 637 Bytes

Versions: 20

Compression:

Stored size: 637 Bytes

Contents

require "spec_helper"

describe ScopedSearch::AutoCompleteBuilder do

  before(:each) do
    @definition = double('ScopedSearch::Definition')
    @definition.stub(:klass).and_return(Class.new(ActiveRecord::Base))
    @definition.stub(:profile).and_return(:default)
    @definition.stub(:profile=).and_return(true)
  end

  it "should return empty suggestions if the search query is nil" do
    ScopedSearch::AutoCompleteBuilder.auto_complete(@definition, nil).should == []
  end

  it "should return empty suggestions if the query is blank" do
    ScopedSearch::AutoCompleteBuilder.auto_complete(@definition, "").should == []
  end

end

Version data entries

20 entries across 20 versions & 1 rubygems

Version Path
scoped_search-4.1.4 spec/unit/auto_complete_builder_spec.rb
scoped_search-4.1.3 spec/unit/auto_complete_builder_spec.rb
scoped_search-4.1.2 spec/unit/auto_complete_builder_spec.rb
scoped_search-4.1.1 spec/unit/auto_complete_builder_spec.rb
scoped_search-4.1.0 spec/unit/auto_complete_builder_spec.rb
scoped_search-4.0.0 spec/unit/auto_complete_builder_spec.rb
scoped_search-3.3.0 spec/unit/auto_complete_builder_spec.rb
scoped_search-3.2.2 spec/unit/auto_complete_builder_spec.rb
scoped_search-3.2.1 spec/unit/auto_complete_builder_spec.rb
scoped_search-3.2.0 spec/unit/auto_complete_builder_spec.rb
scoped_search-3.1.0 spec/unit/auto_complete_builder_spec.rb
scoped_search-3.0.1 spec/unit/auto_complete_builder_spec.rb
scoped_search-3.0.0 spec/unit/auto_complete_builder_spec.rb
scoped_search-2.7.1 spec/unit/auto_complete_builder_spec.rb
scoped_search-2.7.0 spec/unit/auto_complete_builder_spec.rb
scoped_search-2.6.5 spec/unit/auto_complete_builder_spec.rb
scoped_search-2.6.4 spec/unit/auto_complete_builder_spec.rb
scoped_search-2.6.3 spec/unit/auto_complete_builder_spec.rb
scoped_search-2.6.2 spec/unit/auto_complete_builder_spec.rb
scoped_search-2.6.1 spec/unit/auto_complete_builder_spec.rb