rspec model callback

model

class User < ApplicationRecord
  before_save :set_name
  def set_name
    self.name = "set"
  end
end

rspec

require 'rails_helper'

describe 'test' do
  let(:user) { User.create }
  describe 'test' do
    before do
      user.name = "yohei"
      user.save // user.nameが"set"に更新される
    end
    it 'check name' do
      expect(user.name).to eq 'yohei' // このテストは通らない
    end
  end
end

spec結果

  1) test test check name
     Failure/Error: expect(user.name).to eq 'yohei'

       expected: "yohei"
            got: "set"

       (compared using ==)