Sha256: 51be841d1752fba5eec5f9593272535682080f0743263d41aa95f1eb7f86dfb4

Contents?: true

Size: 487 Bytes

Versions: 14

Compression:

Stored size: 487 Bytes

Contents

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

class ReservedTest < MiniTest::Unit::TestCase

  include FriendlyId::Test

  class Journalist < ActiveRecord::Base
    extend FriendlyId
    friendly_id :name
  end


  def model_class
    Journalist
  end

  test "should reserve 'new' and 'edit' by default" do
    ["new", "edit"].each do |word|
      transaction do
        assert_raises(ActiveRecord::RecordInvalid) {model_class.create! :name => word}
      end
    end
  end
end


Version data entries

14 entries across 14 versions & 2 rubygems

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