Your code looks good, is it not working?
You can also try to use the Frank predefined steps, and just do:
When I touch "Cancel"
Then I should not see an alert view
Or if you want the actual step for "When I touch ..", it would be:
When /^I touch "([^\"]*)"$/ do |mark|
quote = get_selector_quote(mark)
selector = "view marked:#{quote}#{mark}#{quote} first"
if element_exists(selector)
touch( selector )
else
raise "Could not touch [#{mark}], it does not exist."
end
sleep 1
end