Skip to content

Commit

Permalink
add test coverage for tag list default name
Browse files Browse the repository at this point in the history
  • Loading branch information
Daniel Haran committed Feb 8, 2009
1 parent a7d26f9 commit a754071
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
5 changes: 5 additions & 0 deletions test/is_taggable_test.rb
Expand Up @@ -8,6 +8,11 @@
expect Tagging do
Post.new.taggings.build
end

expect ["is_taggable", "has 'tags' by default"] do
n = Comment.new :tag_list => "is_taggable, has 'tags' by default"
n.tag_list
end

expect ["something cool", "something else cool"] do
p = Post.new :tag_list => "something cool, something else cool"
Expand Down
6 changes: 6 additions & 0 deletions test/test_helper.rb
Expand Up @@ -11,6 +11,9 @@
ActiveRecord::Base.logger.level = Logger::WARN

ActiveRecord::Schema.define(:version => 0) do
create_table :comments do |t|
end

create_table :posts do |t|
t.string :title, :default => ''
end
Expand All @@ -32,3 +35,6 @@ class Post < ActiveRecord::Base
is_taggable :tags, :languages
end

class Comment < ActiveRecord::Base
is_taggable
end

0 comments on commit a754071

Please sign in to comment.