testrail-ruby 0.0.28 → 0.0.29

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/lib/endpoints.rb +34 -15
  3. data/lib/version.rb +1 -1
  4. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: bfc411c67bb3d1920e59b1523435c7cd105c7b02
4
- data.tar.gz: f73f7dcbccc7f16ede17c3657c0dc5ddec6dbdc5
3
+ metadata.gz: 9fababdb47877a98b0af381779e41742b0473b9d
4
+ data.tar.gz: e07143b1223c7bf4b2bedd23ce8b40f7865ac380
5
5
  SHA512:
6
- metadata.gz: d3c037e5e711b9eeed531a6e2fd6b82629b2cf218eb6d16716c09a7eb7064e44d1cecd9baa469fdc14959c7b67264fff8c9c148a175743a7e31c9e8879f8ec6b
7
- data.tar.gz: 4b88dce3fb1bf394bc497eeed5158103a7361b74545cc9ecdbeca53d7cea313d454def42514b99b74ba5c3f12b452a69a4865cbb1cd1ffbaa74f59909afbc590
6
+ metadata.gz: 9c56f29fdab8c80181aa06aa97254c683ae91da48e0cc61b229471b6625ab7ddabe805e5a45edaeff3cbd46662eeb9a10fc604f20537e2dc5d21289ddb46f26b
7
+ data.tar.gz: 54f6efd89094778832c9121afaba520c32dadf7d513a3b174a3f1f0b9cbd5b0e429e0c6c7b55c9c75aafd37a8e3b7348e18317bc7f7b7c88cd9095dbe5beef57
@@ -81,20 +81,22 @@ module Endpoints
81
81
  ####add_case################
82
82
  ############################
83
83
  # Creates a new test case
84
- # @param section_id [int] The id of the test case
85
- # @param [Hash] opts
86
- # @option opts [string] :title The title of the test case (required)
87
- # @option opts [int] :template_id The ID of the template (field layout) (requires TestRail 5.2 or later)
88
- # @option opts [int] :type_id The ID of the case type
89
- # @option opts [int] :priority_id The ID of the case priority
90
- # @option opts [timespan] :estimate The estimate, e.g. "30s" or "1m 45s"
91
- # @option opts [int] :milestone_id The ID of the milestone to link to the test case
92
- # @option opts [string] :refs A comma-separated list of references/requirements
84
+ # @param section_id [int] The ID of the section the test case should be added to
85
+ # @param [Hash] opts
86
+ # @option opts [string] :title The title of the test case (required)
87
+ # @option opts [int] :template_id The ID of the template (field layout) (requires TestRail 5.2 or later)
88
+ # @option opts [int] :type_id The ID of the case type
89
+ # @option opts [int] :priority_id The ID of the case priority
90
+ # @option opts [timespan] :estimate The estimate, e.g. "30s" or "1m 45s"
91
+ # @option opts [int] :milestone_id The ID of the milestone to link to the test case
92
+ # @option opts [string] :refs A comma-separated list of references/requirements
93
+ # @option opts [varies] :custom_fields Custom fields are supported as well and must be submitted with their system name, prefixed with 'custom_'
93
94
  # @example Code Example
94
95
  # @client.add_case(1, {"title":"testCaseName", "type_id":1})
95
96
  # @example Endpoint Example
96
97
  # index.php?/api/v2/add_case/1&title="foo"&type_id=1
97
98
  # @see http://docs.gurock.com/testrail-api2/reference-cases
99
+ # @note For more information about custom fields, see guroc docs
98
100
  def add_case(section_id, opts = {})
99
101
  send_post("add_case/#{section_id.to_s}", opts)
100
102
  end
@@ -204,17 +206,21 @@ module Endpoints
204
206
  send_get("get_section/:#{section_id.to_s}", opts)
205
207
  end
206
208
 
207
- ############################
209
+ ##########################++
208
210
  ####get_sections############
209
211
  ############################
210
212
  # Get sections for suite
211
- # @param suite_id [int]
213
+ # @param project_id [int]
212
214
  # @param [Hash] opts
215
+ # @options opts [int] :suite_id
213
216
  # @example Endpoint Example
214
- # index.php?/api/v2/get_sections/:project_id&suite_id=:suite_id
217
+ # index.php?/api/v2/get_sections/1&suite_id=2
218
+ # @example Code Example
219
+ # client.get_sections(1, {"suite_id":2})
215
220
  # @see http://docs.gurock.com/testrail-api2/reference-sections
216
- def get_sections(project_id, suite_id, opts = {})
217
- send_get("get_sections/#{project_id.to_s}&suite_id=#{suite_id.to_s}")
221
+ def get_sections(project_id, opts = {})
222
+ options = opts.to_a.map { |x| "#{x[0]}=#{x[1]}" }.join("&")
223
+ send_get("get_sections/#{project_id.to_s}&#{options}")
218
224
  end
219
225
 
220
226
  ############################
@@ -425,13 +431,26 @@ module Endpoints
425
431
  send_get("get_project/#{project_id.to_s}&#{options}")
426
432
  end
427
433
 
428
- ############################
434
+ ##########################++
429
435
  ####get_projects############
430
436
  ############################
431
437
  # Get all projects
432
438
  # @param [Hash] opts
439
+ # @option opts [bool] :is_completed 1 == completed projects, 2 == active projects
433
440
  # @example Endpoint Example
434
441
  # index.php?/api/v2/get_projects
442
+ # @example Code Example [get all projects]
443
+ # client.get_projects
444
+ # @example Code Example [get active projects]
445
+ # client.get_projects({'is_completed':0})
446
+ # @example Code Example [get completed projects]
447
+ # client.get_projects({'is_completed':1})
448
+ # @example Response Example
449
+ # [
450
+ # { "id": 1, "name": "Project1", ... },
451
+ # { "id": 2, "name": "Project2", ... },
452
+ # ..
453
+ # ]
435
454
  # @see http://docs.gurock.com/testrail-api2/reference-projects
436
455
  def get_projects(opts = {})
437
456
  options = opts.to_a.map { |x| "#{x[0]}=#{x[1]}" }.join("&")
@@ -1,3 +1,3 @@
1
1
  module Testrail
2
- VERSION = '0.0.28'.freeze
2
+ VERSION = '0.0.29'.freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: testrail-ruby
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.28
4
+ version: 0.0.29
5
5
  platform: ruby
6
6
  authors:
7
7
  - Frances Morales
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-06-14 00:00:00.000000000 Z
11
+ date: 2017-06-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler