lib/resttestrail/requests.rb in resttestrail-0.1.0 vs lib/resttestrail/requests.rb in resttestrail-0.1.1

- old
+ new

@@ -5,10 +5,11 @@ module Requests URI = "/index.php?/api/v2" ADD_CASE = "/add_case/" GET_CASE = "/get_case/" + GET_CASES = "/get_cases/" DELETE_CASE = "/delete_case/" ADD_RUN = "/add_run/" GET_RUN = "/get_run/" DELETE_RUN = "/delete_run/" ADD_RESULT_FOR_CASE = "/add_result_for_case/" @@ -48,9 +49,17 @@ request end def self.get_case(case_id) Net::HTTP::Get.new("#{URI}#{GET_CASE}#{case_id}", initheader = {'Content-Type' => 'application/json', 'Authorization' => basic_auth_string}) + end + + def self.get_cases(suite_id, section_id, filters) + uri = "#{URI}#{GET_CASES}#{Resttestrail.config.project_id}" + uri += "&suite_id=#{suite_id}" unless suite_id.nil? + uri += "&section_id=#{section_id}" unless section_id.nil? + uri += "&#{filters}" unless filters.nil? + Net::HTTP::Get.new(uri, initheader = {'Content-Type' => 'application/json', 'Authorization' => basic_auth_string}) end def self.delete_case(case_id) Net::HTTP::Post.new("#{URI}#{DELETE_CASE}#{case_id}", initheader = {'Content-Type' => 'application/json', 'Authorization' => basic_auth_string}) end