Sha256: 9bb92a9ff41f7db8ba0bcd95867d68b886e20c86ce10d5c30ceb038c2b00b1d7

Contents?: true

Size: 616 Bytes

Versions: 5

Compression:

Stored size: 616 Bytes

Contents

require File.expand_path(File.dirname(__FILE__) + "/../../spec_helper")

describe Searchlogic::NamedScopes::AliasScope do
  before(:each) do
    User.alias_scope :username_has, lambda { |value| User.username_like(value) }
  end
  
  it "should allow alias scopes" do
    User.create(:username => "bjohnson")
    User.create(:username => "thunt")
    User.username_has("bjohnson").all.should == User.find_all_by_username("bjohnson")
  end
  
  it "should allow alias scopes from the search object" do
    search = User.search
    search.username_has = "bjohnson"
    search.username_has.should == "bjohnson"
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
searchlogic-2.4.19 spec/searchlogic/named_scopes/alias_scope_spec.rb
searchlogic-2.4.18 spec/searchlogic/named_scopes/alias_scope_spec.rb
searchlogic-2.4.17 spec/searchlogic/named_scopes/alias_scope_spec.rb
searchlogic-2.4.16 spec/searchlogic/named_scopes/alias_scope_spec.rb
searchlogic-2.4.15 spec/searchlogic/named_scopes/alias_scope_spec.rb