Permalink
Browse files

fixed up some specs

  • Loading branch information...
1 parent 8cff841 commit ae7fa87a1309793effd6ff32ff8aee89abe46b59 @benalavi benalavi committed Sep 26, 2008
View
11 lib/is_taggable.rb
@@ -1,6 +1,5 @@
-require 'acts_as_taggable_on/acts_as_taggable_on'
-require 'acts_as_taggable_on/acts_as_tagger'
-require 'acts_as_taggable_on/tag'
-require 'acts_as_taggable_on/tag_list'
-require 'acts_as_taggable_on/tags_helper'
-require 'acts_as_taggable_on/tagging'
+require 'is_taggable/is_taggable'
+require 'is_taggable/is_tagger'
+require 'is_taggable/tag_list'
+require 'is_taggable/tags_helper'
+require 'is_taggable/tagging'
View
7 spec/acts_as_taggable_on/tagging_spec.rb
@@ -1,7 +0,0 @@
-require File.dirname(__FILE__) + '/../spec_helper'
-
-describe Tagging do
- before(:each) do
- @tagging = Tagging.new
- end
-end
View
2 ...s_taggable_on/acts_as_taggable_on_spec.rb → spec/is_taggable/is_taggable_spec.rb
@@ -1,6 +1,6 @@
require File.dirname(__FILE__) + '/../spec_helper'
-describe "Acts As Taggable On" do
+describe "Is Taggable" do
it "should provide a class method 'taggable?' that is false for untaggable models" do
UntaggableModel.should_not be_taggable
end
View
2 ...cts_as_taggable_on/acts_as_tagger_spec.rb → spec/is_taggable/is_tagger_spec.rb
@@ -1,6 +1,6 @@
require File.dirname(__FILE__) + '/../spec_helper'
-describe "acts_as_tagger" do
+describe "is_tagger" do
context "Tagger Method Generation" do
before(:each) do
View
0 spec/acts_as_taggable_on/tag_list_spec.rb → spec/is_taggable/tag_list_spec.rb
File renamed without changes.
View
0 spec/acts_as_taggable_on/taggable_spec.rb → spec/is_taggable/taggable_spec.rb
File renamed without changes.
View
0 spec/acts_as_taggable_on/tagger_spec.rb → spec/is_taggable/tagger_spec.rb
File renamed without changes.
View
9 spec/acts_as_taggable_on/tag_spec.rb → spec/is_taggable/tagging_spec.rb
@@ -1,11 +1,10 @@
require File.dirname(__FILE__) + '/../spec_helper'
-describe Tag do
+describe Tagging do
before(:each) do
- @tag = Tag.new
- @user = TaggableModel.create(:name => "Pablo")
+ @tagging = Tagging.new
end
-
+
it "should require a name" do
@tag.should have(1).errors_on(:name)
@tag.name = "something"
@@ -22,4 +21,4 @@
@tag.name = "cool"
@tag.to_s.should == "cool"
end
-end
+end
View
6 spec/schema.rb
@@ -4,17 +4,15 @@
t.integer "taggable_id", :limit => 11
t.string "taggable_type"
t.string "context"
+ t.string "tag"
t.datetime "created_at"
t.integer "tagger_id", :limit => 11
t.string "tagger_type"
end
add_index "taggings", ["tag_id"], :name => "index_taggings_on_tag_id"
add_index "taggings", ["taggable_id", "taggable_type", "context"], :name => "index_taggings_on_taggable_id_and_taggable_type_and_context"
-
- create_table "tags", :force => true do |t|
- t.string "name"
- end
+ add_index "taggings", ["taggable_id", "taggable_type", "context", "tag"], :name => "index_taggings_on_taggable_and_context_and_tag", :uniq => true
create_table :taggable_models, :force => true do |t|
t.column :name, :string
View
14 spec/spec_helper.rb
@@ -1,4 +1,6 @@
require File.dirname(__FILE__) + '/../../../../spec/spec_helper'
+# hack the require with absolute path like this for now...
+#require '/Users/benalavi/Sites/causecast/spec/spec_helper'
module Spec::Example::ExampleGroupMethods
alias :context :describe
@@ -10,24 +12,24 @@ module Spec::Example::ExampleGroupMethods
load(File.dirname(__FILE__) + '/schema.rb')
class TaggableModel < ActiveRecord::Base
- acts_as_taggable_on :tags, :languages
- acts_as_taggable_on :skills
+ is_taggable :tags, :languages
+ is_taggable :skills
end
class OtherTaggableModel < ActiveRecord::Base
- acts_as_taggable_on :tags, :languages
+ is_taggable :tags, :languages
end
class InheritingTaggableModel < TaggableModel
end
class AlteredInheritingTaggableModel < TaggableModel
- acts_as_taggable_on :parts
+ is_taggable :parts
end
class TaggableUser < ActiveRecord::Base
- acts_as_tagger
+ is_tagger
end
class UntaggableModel < ActiveRecord::Base
-end
+end

0 comments on commit ae7fa87

Please sign in to comment.