Sha256: f42481c3bab00bc351c5bf282ac2e30448285b263bb2f09b4f7d5aa83137d56b

Contents?: true

Size: 811 Bytes

Versions: 11

Compression:

Stored size: 811 Bytes

Contents

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

describe "Association Ordering" do
  it "should allow ascending" do
    Company.ascend_by_users_username.proxy_options.should == User.ascend_by_username.proxy_options.merge(:joins => :users)
  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
end

Version data entries

11 entries across 11 versions & 4 rubygems

Version Path
binarylogic-searchlogic-2.1.6 spec/named_scopes/association_ordering_spec.rb
binarylogic-searchlogic-2.1.7 spec/named_scopes/association_ordering_spec.rb
binarylogic-searchlogic-2.1.8 spec/named_scopes/association_ordering_spec.rb
joost-searchlogic-2.1.7.1 spec/named_scopes/association_ordering_spec.rb
joost-searchlogic-2.2.3.1 spec/named_scopes/association_ordering_spec.rb
kazjote-searchlogic-2.1.9.1 spec/named_scopes/association_ordering_spec.rb
kazjote-searchlogic-2.1.9.3 spec/named_scopes/association_ordering_spec.rb
kazjote-searchlogic-2.1.9 spec/named_scopes/association_ordering_spec.rb
searchlogic-2.1.6 spec/named_scopes/association_ordering_spec.rb
searchlogic-2.1.7 spec/named_scopes/association_ordering_spec.rb
searchlogic-2.1.8 spec/named_scopes/association_ordering_spec.rb