Skip to content

Commit

Permalink
Added tests for AR class with no table.
Browse files Browse the repository at this point in the history
  • Loading branch information
norman committed Nov 30, 2009
1 parent a501180 commit 127c19d
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
8 changes: 8 additions & 0 deletions test/slugged_model_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -289,6 +289,14 @@ class SluggedModelTest < Test::Unit::TestCase

end

context "when table does not exist" do
should "not raise an error when doing friendly_id setup" do
assert_nothing_raised do
Question.has_friendly_id :title, :use_slug => true
end
end
end

context "when using an array as the find argument" do

setup do
Expand Down
5 changes: 5 additions & 0 deletions test/test_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -109,3 +109,8 @@ class Book < ActiveRecord::Base ; end
class Novel < ::Book
has_friendly_id :name, :use_slug => true
end

# A model with no table
class Question < ActiveRecord::Base
has_friendly_id :name, :use_slug => true
end

0 comments on commit 127c19d

Please sign in to comment.