Add a test for Tag#to_param (#5705)

lolsob-rspec
ysksn 2017-11-16 00:04:41 +09:00 committed by Eugen Rochko
parent 7d3b67e1c8
commit 2e5aec4479
1 changed files with 7 additions and 0 deletions

View File

@ -35,6 +35,13 @@ RSpec.describe Tag, type: :model do
end end
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 describe '.search_for' do
it 'finds tag records with matching names' do it 'finds tag records with matching names' do
tag = Fabricate(:tag, name: "match") tag = Fabricate(:tag, name: "match")