Sha256: 8bcc298fe0319fc1d1c9a9a75f0ed9ba0e134bbf71bdd433ac91bf868054d931

Contents?: true

Size: 662 Bytes

Versions: 30

Compression:

Stored size: 662 Bytes

Contents

require File.expand_path("../ar_test_helper", __FILE__)

module FriendlyId
  module Test
    module ActiveRecordAdapter
      module Slugged

        test "should allow eager loading of slugs" do
          assert_nothing_raised do
            klass.find(instance.friendly_id, :include => :slugs)
          end

          assert_nothing_raised do
            klass.find(instance.friendly_id, :include => :slug)
          end
        end

        def klass
          Post
        end

        def other_class
          District
        end

        def instance
          @instance ||= klass.create! :name => "hello world"
        end

      end
    end
  end
end

Version data entries

30 entries across 30 versions & 2 rubygems

Version Path
friendly_id-3.2.0.rc1 test/active_record_adapter/slugged.rb
friendly_id-3.2.0.beta1 test/active_record_adapter/slugged.rb
friendly_id-3.1.8 test/active_record_adapter/slugged.rb
friendly_id-3.1.7 test/active_record_adapter/slugged.rb
friendly_id-3.1.7.pre test/active_record_adapter/slugged.rb
friendly_id-3.1.6 test/active_record_adapter/slugged.rb
friendly_id-3.1.5 test/active_record_adapter/slugged.rb
friendly_id-3.1.4 test/active_record_adapter/slugged.rb
friendly_id-3.1.3 test/active_record_adapter/slugged.rb
friendly_id-3.1.2 test/active_record_adapter/slugged.rb