I tried many ways but cannot seem to be able to mock the instance variable in the test in my request test @somevariable – this is initialized in different controler though or on edit but i want to specifically test new how can i mock it?
class SomeController do
def new
....
end
end
end
context 'something' do
before do
get send("new_url", **param)
end
it { is_expected.to have_http_status(:success) }
end
to @somevariable be mocked or initialized within the test using factory or somehting
New contributor
Dzi is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.