Sha256: a6d6dfe122e4c051948ce30838e0feb7e30c633dc195ffdd2c6dbf156215b7ab

Contents?: true

Size: 762 Bytes

Versions: 12

Compression:

Stored size: 762 Bytes

Contents

require File.dirname(__FILE__) + '/../spec_helper'
require 'ostruct'

describe Reorder::TagExtensions do
  before do
    @tag = OpenStruct.new
    @tag.attr = { :status => 'all' }
    @children_find_options = Page.new.method(:children_find_options)
  end
  
  it "should override default options" do
    opts = @children_find_options.call(@tag)
    opts[:order].should match(/position/)
  end
  
  it "should not override when 'by' is specified" do
    @tag.attr['by'] = "created_at"
    opts = @children_find_options.call(@tag)
    opts[:order].should_not match(/position/)
  end

  it "should be independent of order attributes" do
    @tag.attr['order'] = 'desc'
    opts = @children_find_options.call(@tag)
    opts[:order].should match(/position/)
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
trusty-reorder-extension-2.0.6 spec/model/tag_extensions_spec.rb
trusty-reorder-extension-2.0.5 spec/model/tag_extensions_spec.rb
trusty-reorder-extension-2.0.4 spec/model/tag_extensions_spec.rb
trusty-reorder-extension-2.0.3 spec/model/tag_extensions_spec.rb
trusty-reorder-extension-2.0.2 spec/model/tag_extensions_spec.rb
trusty-reorder-extension-2.0.1.pre.beta spec/model/tag_extensions_spec.rb
trusty-reorder-extension-2.0.0.pre.beta spec/model/tag_extensions_spec.rb
trusty-reorder-extension-1.1.0 spec/model/tag_extensions_spec.rb
trusty-reorder-extension-1.0.3 spec/model/tag_extensions_spec.rb
trusty-reorder-extension-1.0.2 spec/model/tag_extensions_spec.rb
trusty-reorder-extension-1.0.1 spec/model/tag_extensions_spec.rb
trusty-reorder-extension-1.0.0 spec/model/tag_extensions_spec.rb