0
0

More than 3 years have passed since last update.

RSpecにてプライベートメソッドのテスト方法 自分用

Posted at

結論

sendで送る

calculate_average_scoreはプライベートメソッド

let!(:user) { create(:user) }
context 'calculate_average_score' do
  subject { user.send(:calculate_average_score) }
  it      { is_expected.to eq ** }
end
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0