DEV Community

n350071πŸ‡―πŸ‡΅
n350071πŸ‡―πŸ‡΅

Posted on

[RSpec] for helper

TL;DR

define let(:helper) { get_helper } and use it as the receiver.

πŸ‘ You can write like this

describe ApplicationController, type: :controller do
  let(:helper) { get_helper }

  describe '#hello' do
    it { expect(helper.hello).to eq 'hello' }
  end
end

πŸ”— Parent Note

Top comments (0)