Sha256: 4ff3f50bf8ce19932b176d45571597279a448f5e71314353b651862228c0ca80

Contents?: true

Size: 721 Bytes

Versions: 12

Compression:

Stored size: 721 Bytes

Contents

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

class ConfigurationTest < MiniTest::Unit::TestCase

  include FriendlyId::Test

  def setup
    @model_class = Class.new(ActiveRecord::Base)
  end

  test "should set model class on initialization" do
    config = FriendlyId::Configuration.new @model_class
    assert_equal @model_class, config.model_class
  end

  test "should set options on initialization if present" do
    config = FriendlyId::Configuration.new @model_class, :base => "hello"
    assert_equal "hello", config.base
  end

  test "should raise error if passed unrecognized option" do
    assert_raises NoMethodError do
      FriendlyId::Configuration.new @model_class, :foo => "bar"
    end
  end

end

Version data entries

12 entries across 12 versions & 2 rubygems

Version Path
friendly_id-4.0.0 test/configuration_test.rb
friendly_id-4.0.0.rc2 test/configuration_test.rb
friendly_id-4.0.0.rc1 test/configuration_test.rb
friendly_id-4.0.0.beta14 test/configuration_test.rb
friendly_id-4.0.0.beta13 test/configuration_test.rb
friendly_id-4.0.0.beta12 test/configuration_test.rb
friendly_id-4.0.0.beta11 test/configuration_test.rb
friendly_id-4.0.0.beta10 test/configuration_test.rb
friendly_id-4.0.0.beta8 test/configuration_test.rb
friendly_id-4.0.0.beta7 test/configuration_test.rb
friendly_id4-4.0.0.beta6 test/configuration_test.rb
friendly_id4-4.0.0.beta5 test/configuration_test.rb