]> cat aescling's git repositories - mastodon.git/commitdiff
Add a test for Tag#to_param (#5705)
authorysksn <bluewhale1982@gmail.com>
Wed, 15 Nov 2017 15:04:41 +0000 (00:04 +0900)
committerEugen Rochko <eugen@zeonfederated.com>
Wed, 15 Nov 2017 15:04:41 +0000 (16:04 +0100)
spec/models/tag_spec.rb

index f727fa1ddf8f33d74430f9faeefc878d48d75c32..1ca50cc29f69b2d386deb5e776d18ae3371c6e00 100644 (file)
@@ -35,6 +35,13 @@ RSpec.describe Tag, type: :model do
     end
   end
 
+  describe '#to_param' do
+    it 'returns name' do
+      tag = Fabricate(:tag, name: 'foo')
+      expect(tag.to_param).to eq 'foo'
+    end
+  end
+
   describe '.search_for' do
     it 'finds tag records with matching names' do
       tag = Fabricate(:tag, name: "match")