I am trying to set local variable in view helper through rspec. My routine is as follow
def time_format(time)
now = Time.now.in_time_zone(current_user.timezone)
end
My spec file is as follow:
it 'return 12 hour format' do
user = User.first
assign(:current_user, user)
expect(helper.time_format(900)).to eq('9:00 AM')
end
Spec is failing throwing me error undefined local variable or method 'current_user'
'current_user' resided in application_controller