diff --git a/spec/lib/acts_as_taggable_on_spec.rb b/spec/lib/acts_as_taggable_on_spec.rb index dbf76d52b..59a469f88 100644 --- a/spec/lib/acts_as_taggable_on_spec.rb +++ b/spec/lib/acts_as_taggable_on_spec.rb @@ -64,6 +64,26 @@ describe 'ActsAsTaggableOn' do expect(tag.proposals_count).to eq(1) end end + + describe "public_for_api scope" do + it "returns tags whose kind is NULL" do + tag = create(:tag, kind: nil) + + expect(ActsAsTaggableOn::Tag.public_for_api).to include(tag) + end + + it "returns tags whose kind is 'category'" do + tag = create(:tag, kind: 'category') + + expect(ActsAsTaggableOn::Tag.public_for_api).to include(tag) + end + + it "blocks other kinds of tags" do + tag = create(:tag, kind: 'foo') + + expect(ActsAsTaggableOn::Tag.public_for_api).not_to include(tag) + end + end end end diff --git a/spec/models/tag_spec.rb b/spec/models/tag_spec.rb deleted file mode 100644 index fa26b7622..000000000 --- a/spec/models/tag_spec.rb +++ /dev/null @@ -1,24 +0,0 @@ -require 'rails_helper' - -describe 'Tag' do - - describe "public_for_api scope" do - it "returns tags whose kind is NULL" do - tag = create(:tag, kind: nil) - - expect(Tag.public_for_api).to include(tag) - end - - it "returns tags whose kind is 'category'" do - tag = create(:tag, kind: 'category') - - expect(Tag.public_for_api).to include(tag) - end - - it "blocks other kinds of tags" do - tag = create(:tag, kind: 'foo') - - expect(Tag.public_for_api).not_to include(tag) - end - end -end