To test this out in RSpec you need to manipulate the parameters that are pass to the controller to generate the variables on the condition@question.user_id == current_user.id
.
usually in rspec you would have something like this to all the controller usually inclosed with a before action
before do
get :edit, params
end
The params
you pass in should vary based on the conditions you want to test.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…