Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

fixed up some specs

  • Loading branch information...
commit ae7fa87a1309793effd6ff32ff8aee89abe46b59 1 parent 8cff841
Ben Alavi benalavi authored
11 lib/is_taggable.rb
View
@@ -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'
7 spec/acts_as_taggable_on/tagging_spec.rb
View
@@ -1,7 +0,0 @@
-require File.dirname(__FILE__) + '/../spec_helper'
-
-describe Tagging do
- before(:each) do
- @tagging = Tagging.new
- end
-end
2  spec/acts_as_taggable_on/acts_as_taggable_on_spec.rb → spec/is_taggable/is_taggable_spec.rb
View
@@ -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
2  spec/acts_as_taggable_on/acts_as_tagger_spec.rb → spec/is_taggable/is_tagger_spec.rb
View
@@ -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
0  spec/acts_as_taggable_on/tag_list_spec.rb → spec/is_taggable/tag_list_spec.rb
View
File renamed without changes
0  spec/acts_as_taggable_on/taggable_spec.rb → spec/is_taggable/taggable_spec.rb
View
File renamed without changes
0  spec/acts_as_taggable_on/tagger_spec.rb → spec/is_taggable/tagger_spec.rb
View
File renamed without changes
9 spec/acts_as_taggable_on/tag_spec.rb → spec/is_taggable/tagging_spec.rb
View
@@ -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
6 spec/schema.rb
View
@@ -4,6 +4,7 @@
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"
@@ -11,10 +12,7 @@
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
14 spec/spec_helper.rb
View
@@ -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
Please sign in to comment.
Something went wrong with that request. Please try again.