Skip to content

Commit

Permalink
Add tests for context-related bug
Browse files Browse the repository at this point in the history
  • Loading branch information
d4rky-pl committed Feb 10, 2015
1 parent 6a2dc7c commit 17f6aa8
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions spec/acts_as_taggable_on/related_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,15 @@
expect(taggable1.find_related_tags_for(OtherTaggableModel)).to_not include(taggable2)
end

it 'should find other related objects based on tags only from particular context' do
taggable1 = TaggableModel.create!(name: 'Taggable 1',tag_list: 'one, two')
taggable2 = TaggableModel.create!(name: 'Taggable 2',tag_list: 'three, four', skill_list: 'one, two')
taggable3 = TaggableModel.create!(name: 'Taggable 3',tag_list: 'one, four')

expect(taggable1.find_related_tags_for(OtherTaggableModel)).to include(taggable3)
expect(taggable1.find_related_tags_for(OtherTaggableModel)).to_not include(taggable2)
end


shared_examples "a collection" do
it do
Expand Down

0 comments on commit 17f6aa8

Please sign in to comment.