require 'rails_helper'

RSpec.describe Tag, type: :model do
  it 'sets lowercase_name on save' do
    t = Tag.new(name: 'Tag')
    expect(t.name).to eq 'Tag'
    expect(t.lowercase_name).to be_nil

    t.save

    expect(t.name).to eq 'Tag'
    expect(t.lowercase_name).to eq 'tag'
  end
end
