Skip to content

Instantly share code, notes, and snippets.

@rlmattax
Created April 22, 2010 15:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rlmattax/375356 to your computer and use it in GitHub Desktop.
Save rlmattax/375356 to your computer and use it in GitHub Desktop.
namespace :feedback do
desc "Feedback request email"
task :feedback_request => [:login, :environment] do
#... some unrelated code
begin
# opening a page using mechanize
page = open_order_contact_page(o.order_number,"FDBK")
form = page.form('comments')
form.comments = @@feedback_request_body.gsub("<order_number>",o.order_number).gsub(/(\w.{1,72})(\s+)/s, "\\1\n")
form.button_with(:name=>'sendemail').x=1
form.button_with(:name=>'sendemail').y=1
select_list = form.field_with(:name=>'subject')
if !select_list.option_with(:text=>'Option I am Looking for...I am not going to find this')
raise(Error::InterfaceChangeException , "No matching email subject found in mailer form")
end
rescue => e
puts "There was a problem with order"
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment