# controller
def index
p = params[:p]
raise ABCException if p
end
# test
test "expect index controller raise ABCException" do
assert_raise ABCException do
# how do I write this block?
end
end
I would like to call the index controller with :p => true to raise an exception.
I understand the assert_raise function, but don’t know how to call controller as same as an end-user requests.
You can do