Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save richdownie/4956a451ecf873cd57173162232d2758 to your computer and use it in GitHub Desktop.
Save richdownie/4956a451ecf873cd57173162232d2758 to your computer and use it in GitHub Desktop.
Feature: API Tests
@api_test
Scenario Outline: Test URLS for Response Codes and Message
* I verify <endpoint> <params> <response_code> and <response_message>
Examples:
| endpoint | params | response_code | response_message |
| "https://qa.cloudcheckr.com/api/inventory.xml/get_resources_ami_details" | "&use_account=2150ApiAuto" | "200" | "OK" |
Given /I verify "(.*)" "(.*)" "(.*)" and "(.*)"/i do |endpoint, params, response_code, response_message|
account_api_key = "?access_key=PEQ1Z5YPM07JK295R271YKZMH84EZ0C5JDSPBBH8SR9M5GV2S1SZH7GS5YO600MJ"
response = HTTParty.get(endpoint + account_api_key + params, :verify => false )
puts response.code.should == response_code.to_i
puts response.message.should == response_message
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment