Sha256: d6a11287874905629357e6331dab8e6b47b9816fb37ba0652b814b81510ca314

Contents?: true

Size: 1.14 KB

Versions: 6

Compression:

Stored size: 1.14 KB

Contents

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

describe Searchlogic::NamedScopes::Ordering do
  it "should allow ascending" do
    Company.ascend_by_users_username.should eq_scope(
      Company.joins(:users).order("users.username ASC")
    )
  end
  
#  it "should allow descending" do
#    Company.descend_by_users_username.proxy_options.should == User.descend_by_username.proxy_options.merge(:joins => :users)
#  end
#
#  it "should allow deep ascending" do
#    Company.ascend_by_users_orders_total.proxy_options.should == Order.ascend_by_total.proxy_options.merge(:joins => {:users => :orders})
#  end
#
#  it "should allow deep descending" do
#    Company.descend_by_users_orders_total.proxy_options.should == Order.descend_by_total.proxy_options.merge(:joins => {:users => :orders})
#  end
#
#  it "should ascend with a belongs to" do
#    User.ascend_by_company_name.proxy_options.should == Company.ascend_by_name.proxy_options.merge(:joins => :company)
#  end
#
#  it "should work through #order" do
#    Company.order('ascend_by_users_username').proxy_options.should == Company.ascend_by_users_username.proxy_options
#  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
rd_searchlogic-3.0.1 spec/searchlogic/named_scopes/association_ordering_spec.rb
rd_searchlogic-3.0.0 spec/searchlogic/named_scopes/association_ordering_spec.rb
rd_searchlogic-3.0.0.rc4 spec/searchlogic/named_scopes/association_ordering_spec.rb
rd_searchlogic-3.0.0.rc3 spec/searchlogic/named_scopes/association_ordering_spec.rb
rd_searchlogic-3.0.0.rc2 spec/searchlogic/named_scopes/association_ordering_spec.rb
rd_searchlogic-3.0.0.rc spec/searchlogic/named_scopes/association_ordering_spec.rb