easyqa_api 0.0.4 → 0.0.5

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 23cf047a87bd2350765f37cee2aff2bc77d070f8
4
- data.tar.gz: 19d934390e8d410f0a2b0ca09553359920f863c6
3
+ metadata.gz: 5144f63d0e4405f99b15b689f365bc227b5d2708
4
+ data.tar.gz: 27ec842293c95309b5e90d118695fa28cd6b474e
5
5
  SHA512:
6
- metadata.gz: 941d5b048afa284fcb90e7cd7c37ac2a00eadf3e1cecfb50cf473be7e8377d5e658b6723cb995711fd5a636c2a03f4c1786eea6d584f2abd83b043a7ee379041
7
- data.tar.gz: 25b13007eb354826d5cb990ef173da3dac27a1c776f208db62cfc7ade6079e94856413dbfc9a95898a3ef035a83a132283f914166bbe48878464a674620e941f
6
+ metadata.gz: 84261ce16589bb0dfbcd6ebf48a838b10eaa5a64d546c9df43c11d59395eb15bed2d08dc43c6b928e027ff751ed6412714a55cdfd1f1efe9b1a9b0d68fba95ab
7
+ data.tar.gz: d44187b627b3b40d8779b94613bcc47199b26e2312d52d689124ee32a0870cba01d2a8e258df31a8df623ea4f986c1658ac76bf9ba9921740c65575e9d1ef57a
data/.gitignore CHANGED
@@ -1,5 +1,4 @@
1
1
  /.bundle/
2
- /.rubocop.yml
3
2
  /.yardoc
4
3
  /Gemfile.lock
5
4
  /_yardoc/
@@ -0,0 +1,11 @@
1
+ Metrics/LineLength:
2
+ Max: 120
3
+ Documentation:
4
+ Enabled: false
5
+ AllCops:
6
+ Exclude:
7
+ - 'db/*.rb'
8
+ Metrics/MethodLength:
9
+ Max: 20
10
+ Metrics/AbcSize:
11
+ Max: 30
data/Gemfile CHANGED
@@ -4,3 +4,5 @@ source 'https://rubygems.org'
4
4
  gemspec
5
5
 
6
6
  gem 'pry'
7
+ gem 'simplecov'
8
+ gem 'webmock', path: '/media/warrior109/DATA/Programming/forks/webmock'
data/README.md CHANGED
@@ -19,6 +19,25 @@ Or install it yourself as:
19
19
  $ gem install easyqa_api
20
20
 
21
21
  ## Usage
22
+ Login user on EasyQA
23
+ ```ruby
24
+ user = EasyqaApi::User.new(email: 'test@gmail.com', password: '1234567890')
25
+ ```
26
+
27
+ And now you can do any action with easyqa_api. For example:
28
+ ```ruby
29
+ organization = EasyqaApi::Organization.create({ title: 'Test', description: 'Test' }, user)
30
+ ```
31
+
32
+ If you do not want to always point of the user during any action in easyqa_api - set it as default
33
+ ```ruby
34
+ user.set_default!
35
+ ```
36
+
37
+ And now:
38
+ ```ruby
39
+ organization = EasyqaApi::Organization.create(title: 'Test', description: 'Test')
40
+ ```
22
41
 
23
42
  Link to documentation
24
43
  http://www.rubydoc.info/gems/easyqa_api/0.0.3/
@@ -35,4 +35,5 @@ Gem::Specification.new do |spec|
35
35
  spec.add_dependency 'faraday', '~> 0.9.2'
36
36
  spec.add_dependency 'faraday_middleware', '~> 0.10.0'
37
37
  spec.add_dependency 'activesupport', '~> 5.0', '> 4.0'
38
+ # spec.add_dependency 'webmock', '~> 3.0'
38
39
  end
@@ -14,7 +14,7 @@ module EasyqaApi
14
14
  end
15
15
  end
16
16
 
17
- @url = 'https://app.geteasyqa.com/'
17
+ @url = 'https://app.geteasyqa.com'
18
18
  @api_version = 1
19
19
  end
20
20
 
@@ -53,8 +53,7 @@ module EasyqaApi
53
53
  req.body = {
54
54
  token: attrs[:project_token],
55
55
  auth_token: user.auth_token
56
- }.merge(attrs.except(:project_token, :attachments))
57
- .merge(retrieve_attachments(attrs[:attachments]))
56
+ }.merge(attrs.except(:project_token, :attachments)).merge(retrieve_attachments(attrs[:attachments] || []))
58
57
  end
59
58
  end
60
59
 
@@ -63,7 +62,7 @@ module EasyqaApi
63
62
  def show(attrs = {}, user = @@default_user)
64
63
  attrs = { id: @id, project_token: @project_token }.merge(attrs)
65
64
  attrs[:id] = "pid#{attrs.delete(:id_in_project)}" if attrs[:id_in_project]
66
- @attributes = send_request("issues/#{id}", :get) do |req|
65
+ @attributes = send_request("issues/#{attrs[:id]}", :get) do |req|
67
66
  req.params = {
68
67
  token: attrs[:project_token],
69
68
  auth_token: user.auth_token
@@ -92,7 +91,7 @@ module EasyqaApi
92
91
  attrs = { id: @id, project_token: @project_token }.merge(attrs)
93
92
  attrs[:id] = "pid#{attrs.delete(:id_in_project)}" if attrs[:id_in_project]
94
93
  @attributes = send_request("issues/#{attrs[:id]}", :delete) do |req|
95
- req.params = {
94
+ req.body = {
96
95
  token: attrs[:project_token],
97
96
  auth_token: user.auth_token
98
97
  }
@@ -21,7 +21,7 @@ module EasyqaApi
21
21
  req.body = {
22
22
  token: attrs[:project_token],
23
23
  auth_token: user.auth_token
24
- }.merge(attrs.except(:project_token))
24
+ }.merge(attrs.except(:project_token, :issue_id))
25
25
  end
26
26
  end
27
27
 
@@ -30,7 +30,7 @@ module EasyqaApi
30
30
  def delete(attrs = {}, user = @@default_user)
31
31
  attrs = { id: @id, project_token: @project_token }.merge(attrs)
32
32
  @attributes = send_request("attachments/#{attrs[:id]}", :delete) do |req|
33
- req.params = {
33
+ req.body = {
34
34
  token: attrs[:project_token],
35
35
  auth_token: user.auth_token
36
36
  }
@@ -67,7 +67,7 @@ module EasyqaApi
67
67
  # @!macro organization_without_attrs
68
68
  def delete(id = @id, user = @@default_user)
69
69
  @attributes = send_request("organizations/#{id}", :delete) do |req|
70
- req.params = {
70
+ req.body = {
71
71
  auth_token: user.auth_token
72
72
  }
73
73
  end
@@ -68,7 +68,7 @@ module EasyqaApi
68
68
  # @macro project_without_attrs
69
69
  def delete(id = @id, user = @@default_user)
70
70
  @attributes = send_request("projects/#{id}", :delete) do |req|
71
- req.params = {
71
+ req.body = {
72
72
  auth_token: user.auth_token
73
73
  }
74
74
  end
@@ -37,10 +37,12 @@ module EasyqaApi
37
37
  # @option attrs [Fixnum] :user_id user id on EasyQA website.
38
38
  # @option attrs [String] :project_token Project token on EasyQA. Add this option if you want create project role
39
39
  def create(attrs, user = @@default_user)
40
- @attributes = send_request("organizations/#{attrs[:organization_id]}/roles", :post) do |req|
40
+ @attributes = send_request(
41
+ "organizations/#{attrs[:organization_id] || attrs['organization_id']}/roles", :post
42
+ ) do |req|
41
43
  req.body = {
42
44
  auth_token: user.auth_token
43
- }.merge(attrs.except(:organization_id))
45
+ }.merge(attrs.except(:organization_id, 'organization_id'))
44
46
  end
45
47
  end
46
48
 
@@ -70,7 +72,7 @@ module EasyqaApi
70
72
  # @macro role_without_attrs
71
73
  def delete(id = @id, user = @@default_user)
72
74
  @attributes = send_request("roles/#{id}", :delete) do |req|
73
- req.params = {
75
+ req.body = {
74
76
  auth_token: user.auth_token
75
77
  }
76
78
  end
@@ -72,7 +72,7 @@ module EasyqaApi
72
72
  # @macro status_without_attributes
73
73
  def delete(project_token = @project_token, id = @id, user = @@default_user)
74
74
  @attributes = send_request("statuses/#{id}", :delete) do |req|
75
- req.params = {
75
+ req.body = {
76
76
  token: project_token,
77
77
  auth_token: user.auth_token
78
78
  }
@@ -84,7 +84,7 @@ module EasyqaApi
84
84
  # @!macro test_case_without_attrs
85
85
  def delete(project_token = @project_token, id = @id, user = @@default_user)
86
86
  @attributes = send_request("test_cases/#{id}", :delete) do |req|
87
- req.params = {
87
+ req.body = {
88
88
  token: project_token,
89
89
  auth_token: user.auth_token
90
90
  }
@@ -69,7 +69,7 @@ module EasyqaApi
69
69
  attrs = { id: @id, project_token: @project_token }.merge(attrs)
70
70
  @attributes = send_request("test_modules/#{attrs[:id]}", :put) do |req|
71
71
  req.body = {
72
- test_module: attrs.except(:project_token),
72
+ test_module: attrs.except(:project_token, :id),
73
73
  token: attrs[:project_token],
74
74
  auth_token: user.auth_token
75
75
  }
@@ -80,7 +80,7 @@ module EasyqaApi
80
80
  # @!macro test_module_without_attrs
81
81
  def delete(project_token = @project_token, id = @id, user = @@default_user)
82
82
  @attributes = send_request("test_modules/#{id}", :delete) do |req|
83
- req.params = {
83
+ req.body = {
84
84
  token: project_token,
85
85
  auth_token: user.auth_token
86
86
  }
@@ -53,7 +53,7 @@ module EasyqaApi
53
53
  # @macro test_object_params
54
54
  def delete(project_token = @project_token, id = @id, user = @@default_user)
55
55
  @attributes = send_request("test_objects/#{id}", :delete) do |req|
56
- req.params = {
56
+ req.body = {
57
57
  token: project_token,
58
58
  auth_token: user.auth_token
59
59
  }
@@ -62,7 +62,7 @@ module EasyqaApi
62
62
  attrs = { id: @id, project_token: @project_token }.merge(attrs)
63
63
  @attributes = send_request("test_plans/#{attrs[:id]}", :put) do |req|
64
64
  req.body = {
65
- test_plan: attrs.except(:project_token),
65
+ test_plan: attrs.except(:project_token, :id),
66
66
  token: attrs[:project_token],
67
67
  auth_token: user.auth_token
68
68
  }
@@ -73,7 +73,7 @@ module EasyqaApi
73
73
  # @macro test_plan_without_attrs
74
74
  def delete(project_token = @project_token, id = @id, user = @@default_user)
75
75
  @attributes = send_request("test_plans/#{id}", :delete) do |req|
76
- req.params = {
76
+ req.body = {
77
77
  token: project_token,
78
78
  auth_token: user.auth_token
79
79
  }
@@ -4,7 +4,6 @@
4
4
  # * :project_token (String) [@project_token] Project token on EasyQA
5
5
  # * :title (String) test run title on EasyQA website
6
6
  # * :assigner_id (Fixnum) test run assigner id on EasyQA website
7
- # * :test_plan_id (Fixnum) test plan id on EasyQA website
8
7
  # * :description (String) test run description on EasyQA website
9
8
  # * :test_run_result_attributes (Array<Hash>) attributes of test run results.
10
9
  # * :test_plan_id (Fixnum) id of test plan
@@ -82,7 +81,7 @@ module EasyqaApi
82
81
  # @!macro test_run_without_attrs
83
82
  def delete(project_token = @project_token, id = @id, user = @@default_user)
84
83
  @attributes = send_request("test_runs/#{id}", :delete) do |req|
85
- req.params = {
84
+ req.body = {
86
85
  token: project_token,
87
86
  auth_token: user.auth_token
88
87
  }
@@ -57,7 +57,7 @@ module EasyqaApi
57
57
  # @macro test_run_results_without_attrs
58
58
  def delete(project_token = @project_token, id = @id, user = @@default_user)
59
59
  @attributes = send_request("test_run_results/#{id}", :delete) do |req|
60
- req.params = {
60
+ req.body = {
61
61
  token: project_token,
62
62
  auth_token: user.auth_token
63
63
  }
@@ -1,4 +1,4 @@
1
1
  module EasyqaApi
2
2
  # EasyqaApi gem version
3
- VERSION = '0.0.4'
3
+ VERSION = '0.0.5'
4
4
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: easyqa_api
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
4
+ version: 0.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Thinkmobiles
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2017-04-10 00:00:00.000000000 Z
11
+ date: 2017-05-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -109,6 +109,7 @@ extra_rdoc_files: []
109
109
  files:
110
110
  - ".gitignore"
111
111
  - ".rspec"
112
+ - ".rubocop.yml"
112
113
  - ".travis.yml"
113
114
  - CODE_OF_CONDUCT.md
114
115
  - Gemfile