Sha256: 1c9d7b8b023672820842c9432d711bf9615afb185ad9c042721f81267665ffed

Contents?: true

Size: 589 Bytes

Versions: 55

Compression:

Stored size: 589 Bytes

Contents

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

describe "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

55 entries across 55 versions & 7 rubygems

Version Path
binarylogic-searchlogic-2.2.0 spec/named_scopes/alias_scope_spec.rb
binarylogic-searchlogic-2.2.1 spec/named_scopes/alias_scope_spec.rb
binarylogic-searchlogic-2.2.2 spec/named_scopes/alias_scope_spec.rb
binarylogic-searchlogic-2.2.3 spec/named_scopes/alias_scope_spec.rb
binarylogic-searchlogic-2.3.0 spec/named_scopes/alias_scope_spec.rb
binarylogic-searchlogic-2.3.1 spec/named_scopes/alias_scope_spec.rb
binarylogic-searchlogic-2.3.2 spec/named_scopes/alias_scope_spec.rb
binarylogic-searchlogic-2.3.3 spec/named_scopes/alias_scope_spec.rb
binarylogic-searchlogic-2.3.4 spec/named_scopes/alias_scope_spec.rb
binarylogic-searchlogic-2.3.5 spec/named_scopes/alias_scope_spec.rb
joost-searchlogic-2.2.3.1 spec/named_scopes/alias_scope_spec.rb
kazjote-searchlogic-2.3.4 spec/named_scopes/alias_scope_spec.rb
searchlogic-donotuse-2.3.9 spec/named_scopes/alias_scope_spec.rb
aq1018-searchlogic-2.4.17 spec/named_scopes/alias_scope_spec.rb
aq1018-searchlogic-2.4.16 spec/named_scopes/alias_scope_spec.rb
aq1018-searchlogic-2.4.15 spec/named_scopes/alias_scope_spec.rb
searchlogic-2.4.14 spec/named_scopes/alias_scope_spec.rb
searchlogic-2.4.13 spec/named_scopes/alias_scope_spec.rb
searchlogic-2.4.12 spec/named_scopes/alias_scope_spec.rb
searchlogic-2.4.11 spec/named_scopes/alias_scope_spec.rb