Skip to content

Instantly share code, notes, and snippets.

@richdownie
Created February 7, 2014 16:48
Show Gist options
  • Save richdownie/8866657 to your computer and use it in GitHub Desktop.
Save richdownie/8866657 to your computer and use it in GitHub Desktop.
Given /I add a stub for "(.*)" "(.*)" with "(.*)"/i do |client, source, status|
if modal > 0 then
steps %Q{
* I wait until "modal-title" "class" renders
* I wait "1"
* I xpath "Select Client Name" "span"
* I wait "1"
* I xpath "#{client}" "div"
* I wait "1"
* I click_on "s2id_add-job-input-source" "id"
* I wait "1"
* I xpath "#{source}" "div"
* I wait "1"
* I click_on "s2id_add-job-input-stub-status" "id"
* I wait "1"
* I xpath "#{status}" "div"
* I wait "1"
* I xpath "Confirm Job" "button"
}
gateway = Net::SSH::Gateway.new('qa-database','rdownie',:password => "n3wBr@nd")
port = gateway.open('127.0.0.1', 3306, 3307)
class STUB_JOB < ActiveRecord::Base
self.table_name = 'STUB_JOB'
establish_connection(:adapter=>"mysql2",:host=>"127.0.0.1",:username => "rdownie",:password => "n3wBr@nd",:database=>"nba",:port=>3307)
end
query_chipotle_stub_jobs = "select * from nba.STUB_JOB where CLIENT_ID = 2485"
stub_job = STUB_JOB.find_by_sql(query_chipotle_stub_jobs)
puts stub_job.class
puts stub_job.count.should == 1
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment