Sha256: 9bf6f337f3059660c226c2f531b289280f4b3967e7a3f10b982b7b4fb2c279da

Contents?: true

Size: 1.22 KB

Versions: 19

Compression:

Stored size: 1.22 KB

Contents

require File.dirname(__FILE__) + '/test_helper'

module FriendlyId
  module Test
    module ActiveRecord2
      module Simple

        module SimpleTest
          def klass
            @klass ||= User
          end

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

          def other_class
            Author
          end
        end

        class StatusTest < ::Test::Unit::TestCase

          include SimpleTest

          test "should default to not friendly" do
            assert !status.friendly?
          end

          test "should default to numeric" do
            assert status.numeric?
          end

          test "should be friendly if name is set" do
            status.name = "name"
            assert status.friendly?
          end

          test "should be best if it is numeric, but record has no friendly_id" do
            instance.send("#{klass.friendly_id_config.column}=", nil)
            assert status.best?
          end

          def status
            @status ||= instance.friendly_id_status
          end

        end

        class BasicTest < ::Test::Unit::TestCase
          include Core
          include SimpleTest
        end

      end
    end
  end
end

Version data entries

19 entries across 19 versions & 2 rubygems

Version Path
refinerycms-0.9.6.34 vendor/plugins/friendly_id/test/active_record2/simple_test.rb
refinerycms-0.9.6.33 vendor/plugins/friendly_id/test/active_record2/simple_test.rb
refinerycms-0.9.6.32 vendor/plugins/friendly_id/test/active_record2/simple_test.rb
refinerycms-0.9.6.31 vendor/plugins/friendly_id/test/active_record2/simple_test.rb
refinerycms-0.9.6.30 vendor/plugins/friendly_id/test/active_record2/simple_test.rb
refinerycms-0.9.6.29 vendor/plugins/friendly_id/test/active_record2/simple_test.rb
refinerycms-0.9.6.28 vendor/plugins/friendly_id/test/active_record2/simple_test.rb
refinerycms-0.9.6.27 vendor/plugins/friendly_id/test/active_record2/simple_test.rb
refinerycms-0.9.6.26 vendor/plugins/friendly_id/test/active_record2/simple_test.rb
refinerycms-0.9.6.25 vendor/plugins/friendly_id/test/active_record2/simple_test.rb
refinerycms-0.9.6.24 vendor/plugins/friendly_id/test/active_record2/simple_test.rb
refinerycms-0.9.6.23 vendor/plugins/friendly_id/test/active_record2/simple_test.rb
refinerycms-0.9.6.22 vendor/plugins/friendly_id/test/active_record2/simple_test.rb
refinerycms-0.9.6.21 vendor/plugins/friendly_id/test/active_record2/simple_test.rb
friendly_id-2.3.4 test/active_record2/simple_test.rb
friendly_id-2.3.3 test/active_record2/simple_test.rb
friendly_id-2.3.2 test/active_record2/simple_test.rb
friendly_id-2.3.1 test/active_record2/simple_test.rb
friendly_id-2.3.0 test/active_record2/simple_test.rb