Sha256: 84741e0dd83d78768f890f238c05c34ededd9b4010096bc97848d31132a9c56e

Contents?: true

Size: 451 Bytes

Versions: 2

Compression:

Stored size: 451 Bytes

Contents

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

context 'Given an empty redirects table' do
  setup do
    Redirect.delete_all
  end

  specify 'redirects are unique' do
    lambda { Redirect.create!(:from_path => 'foo/bar', :to_path => '/') }.should_not_raise

    redirect = Redirect.new(:from_path => 'foo/bar', :to_path => '/')

    redirect.should_not_be_valid
    redirect.errors.on(:from_path).should == 'has already been taken'
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
typo-4.1.1 spec/models/redirect_spec.rb
typo-4.1 spec/models/redirect_spec.rb