jira-ruby 0.1.11 → 0.1.12

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: fd0485d4d1924b9830318cc9875ff1d5284f605a
4
- data.tar.gz: b211fbe17e3ffa4033a93ab043abeeb93db0d5df
3
+ metadata.gz: a71320b3d2e4e2c3b7709892f8f2931f9a8f15da
4
+ data.tar.gz: 20f3e80ef169c21234e09670ebe06329a9ded01e
5
5
  SHA512:
6
- metadata.gz: d26f6b648a24d94301771c970c224acce705508354f58eee97884ddd92fcac60a1779c332a248a8b4ad9bd03af6ebb4ae10e4a37416f44f49ddab534416566fa
7
- data.tar.gz: 16293a18535b195e2df37a86b25195de1e39cd68ab350e3f872753e3537fd8090548058aa6d3ec52dcfdf8ac5c36326fcc6a3036e79edd49545c303d06c66f9b
6
+ metadata.gz: ad72ec2d1efafc290d1f426da4675f5714530bcdb7da79c219957d3361d5ee835df4418142f5d2dba472d757ddfbe81260f4992a611d98829c69eb82a7fac183
7
+ data.tar.gz: 3d40c6eed506122ee30ea0981c9776e46fa1d8521e7f5624662b55963ae26897b520839ebbbf806af0b6f696b43b6b78d62de78e1d2f1cfc9186af0a230e0ce8
data/README.rdoc CHANGED
@@ -163,7 +163,8 @@ Create a controller for handling the OAuth conversation.
163
163
  before_filter :get_jira_client
164
164
 
165
165
  def new
166
- request_token = @jira_client.request_token
166
+ callback_url = 'http://callback'
167
+ request_token = @jira_client.request_token(oauth_callback: callback_url)
167
168
  session[:request_token] = request_token.token
168
169
  session[:request_secret] = request_token.secret
169
170
 
@@ -306,4 +307,4 @@ Here's the same example as a Sinatra application:
306
307
  session.delete(:jira_auth)
307
308
  redirect "/"
308
309
  end
309
- end
310
+ end
data/lib/jira.rb CHANGED
@@ -24,6 +24,7 @@ require 'jira/resource/worklog'
24
24
  require 'jira/resource/issue'
25
25
  require 'jira/resource/filter'
26
26
  require 'jira/resource/field'
27
+ require 'jira/resource/rapidview'
27
28
 
28
29
  require 'jira/request_client'
29
30
  require 'jira/oauth_client'
data/lib/jira/base.rb CHANGED
@@ -290,7 +290,7 @@ module JIRA
290
290
  # Checks if method_name is set in the attributes hash
291
291
  # and returns true when found, otherwise proxies the
292
292
  # call to the superclass.
293
- def respond_to?(method_name)
293
+ def respond_to?(method_name, include_all=false)
294
294
  if attrs.keys.include? method_name.to_s
295
295
  true
296
296
  else
data/lib/jira/client.rb CHANGED
@@ -125,6 +125,10 @@ module JIRA
125
125
  JIRA::Resource::FieldFactory.new(self)
126
126
  end
127
127
 
128
+ def RapidView
129
+ JIRA::Resource::RapidViewFactory.new(self)
130
+ end
131
+
128
132
  # HTTP methods without a body
129
133
  def delete(path, headers = {})
130
134
  request(:delete, path, nil, merge_default_headers(headers))
@@ -44,8 +44,8 @@ module JIRA
44
44
 
45
45
  # Returns the current request token if it is set, else it creates
46
46
  # and sets a new token.
47
- def request_token
48
- @request_token ||= get_request_token
47
+ def request_token(options = {}, *arguments, &block)
48
+ @request_token ||= get_request_token(options, *arguments, block)
49
49
  end
50
50
 
51
51
  # Sets the request token from a given token and secret.
@@ -44,9 +44,13 @@ module JIRA
44
44
  end
45
45
  end
46
46
 
47
- def self.jql(client, jql, fields = nil)
47
+ def self.jql(client, jql, options = {fields: nil, start_at: nil, max_results: nil})
48
48
  url = client.options[:rest_base_path] + "/search?jql=" + CGI.escape(jql)
49
- url += CGI.escape("&fields=#{fields.join(",")}") if fields
49
+
50
+ url << "&fields=#{options[:fields].map{ |value| CGI.escape(value.to_s) }.join(',')}" if options[:fields]
51
+ url << "&startAt=#{CGI.escape(options[:start_at].to_s)}" if options[:start_at]
52
+ url << "&maxResults=#{CGI.escape(options[:max_results].to_s)}" if options[:max_results]
53
+
50
54
  response = client.get(url)
51
55
  json = parse_json(response.body)
52
56
  json['issues'].map do |issue|
@@ -54,7 +58,7 @@ module JIRA
54
58
  end
55
59
  end
56
60
 
57
- def respond_to?(method_name)
61
+ def respond_to?(method_name, include_all=false)
58
62
  if attrs.keys.include?('fields') && attrs['fields'].keys.include?(method_name.to_s)
59
63
  true
60
64
  else
@@ -0,0 +1,46 @@
1
+ require 'cgi'
2
+
3
+ module JIRA
4
+ module Resource
5
+
6
+ class RapidViewFactory < JIRA::BaseFactory # :nodoc:
7
+ end
8
+
9
+ class RapidView < JIRA::Base
10
+
11
+ def self.all(client)
12
+ response = client.get(path_base(client) + '/rapidview')
13
+ json = parse_json(response.body)
14
+ json['views'].map do |view|
15
+ client.RapidView.build(view)
16
+ end
17
+ end
18
+
19
+ def self.find(client, key, options = {})
20
+ response = client.get(path_base(client) + "/rapidview/#{key}")
21
+ json = parse_json(response.body)
22
+ client.RapidView.build(json)
23
+ end
24
+
25
+ def issues
26
+ response = client.get(path_base(client) + "/xboard/plan/backlog/data?rapidViewId=#{id}")
27
+ json = self.class.parse_json(response.body)
28
+ # To get Issue objects with the same structure as for Issue.all
29
+ issue_ids = json['issues'].map { |issue| issue['id'] }
30
+ client.Issue.jql("id IN(#{issue_ids.join(', ')})")
31
+ end
32
+
33
+ private
34
+
35
+ def self.path_base(client)
36
+ client.options[:context_path] + '/rest/greenhopper/1.0'
37
+ end
38
+
39
+ def path_base(client)
40
+ self.class.path_base(client)
41
+ end
42
+
43
+ end
44
+
45
+ end
46
+ end
data/lib/jira/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module JIRA
2
- VERSION = "0.1.11"
2
+ VERSION = "0.1.12"
3
3
  end
@@ -0,0 +1,67 @@
1
+ require 'spec_helper'
2
+
3
+ describe JIRA::Resource::RapidView do
4
+
5
+ with_each_client do |site_url, client|
6
+ let(:client) { client }
7
+ let(:site_url) { site_url }
8
+
9
+ let(:key) { '1' }
10
+
11
+ let(:expected_collection_length) { 1 }
12
+
13
+ let(:expected_attributes) {
14
+ {
15
+ 'id' => 1,
16
+ 'name' => 'SAMPLEPROJECT',
17
+ 'canEdit' => true,
18
+ 'sprintSupportEnabled' => true
19
+ }
20
+ }
21
+
22
+ it_should_behave_like 'a resource'
23
+ # TODO@Anton: Add json file
24
+ # it_should_behave_like 'a resource with a singular GET endpoint'
25
+
26
+ describe 'GET all rapidviews' do
27
+ let(:client) { client }
28
+ let(:site_url) { site_url }
29
+
30
+ before(:each) do
31
+ stub_request(:get, site_url + '/jira/rest/greenhopper/1.0/rapidview').
32
+ to_return(:status => 200, :body => get_mock_response('rapidview.json'))
33
+ end
34
+ it_should_behave_like 'a resource with a collection GET endpoint'
35
+ end
36
+
37
+ describe 'issues' do
38
+ it 'should return all the issues' do
39
+ stub_request(
40
+ :get,
41
+ site_url +
42
+ '/jira/rest/greenhopper/1.0/xboard/plan/backlog/data?rapidViewId=1'
43
+ ).to_return(
44
+ :status => 200,
45
+ :body => get_mock_response('rapidview/SAMPLEPROJECT.issues.json')
46
+ )
47
+
48
+ stub_request(
49
+ :get,
50
+ site_url + '/jira/rest/api/2/search?jql=id IN(10000, 10001)'
51
+ ).to_return(
52
+ :status => 200,
53
+ :body => get_mock_response('rapidview/SAMPLEPROJECT.issues.full.json')
54
+ )
55
+
56
+ subject = client.RapidView.build('id' => 1)
57
+ issues = subject.issues
58
+ expect(issues.length).to eq(2)
59
+
60
+ issues.each do |issue|
61
+ expect(issue.class).to eq(JIRA::Resource::Issue)
62
+ expect(issue.expanded?).to be_falsey
63
+ end
64
+ end
65
+ end
66
+ end
67
+ end
@@ -2,6 +2,9 @@ require 'spec_helper'
2
2
 
3
3
  describe JIRA::Base do
4
4
 
5
+ class JIRADelegation < SimpleDelegator # :nodoc:
6
+ end
7
+
5
8
  class JIRA::Resource::Deadbeef < JIRA::Base # :nodoc:
6
9
  end
7
10
 
@@ -36,6 +39,21 @@ describe JIRA::Base do
36
39
 
37
40
  subject { JIRA::Resource::Deadbeef.new(client, :attrs => attrs) }
38
41
 
42
+ let(:decorated) { JIRADelegation.new(subject) }
43
+
44
+ describe "#respond_to?" do
45
+ describe "when decorated using SimpleDelegator" do
46
+ it "responds to client" do
47
+ expect(decorated.respond_to?(:client)).to eq(true)
48
+ end
49
+ it "does not raise an error" do
50
+ expect {
51
+ decorated.respond_to?(:client)
52
+ }.not_to raise_error
53
+ end
54
+ end
55
+ end
56
+
39
57
  it "assigns the client and attrs" do
40
58
  expect(subject.client).to eq(client)
41
59
  expect(subject.attrs).to eq(attrs)
@@ -2,8 +2,33 @@ require 'spec_helper'
2
2
 
3
3
  describe JIRA::Resource::Issue do
4
4
 
5
+ class JIRAResourceDelegation < SimpleDelegator # :nodoc:
6
+ end
7
+
5
8
  let(:client) { double(options: {rest_base_path: '/jira/rest/api/2'}) }
6
9
 
10
+ describe "#respond_to?" do
11
+ describe "when decorated by SimpleDelegator" do
12
+ before(:each) do
13
+ response = double()
14
+ allow(response).to receive(:body).and_return('{"key":"foo","id":"101"}')
15
+ allow(JIRA::Resource::Issue).to receive(:collection_path).and_return('/jira/rest/api/2/issue')
16
+ allow(client).to receive(:get).with('/jira/rest/api/2/issue/101').
17
+ and_return(response)
18
+
19
+ issue = JIRA::Resource::Issue.find(client,101)
20
+ @decorated = JIRAResourceDelegation.new( issue )
21
+ end
22
+ it "responds to key" do
23
+ expect(@decorated.respond_to?(:key)).to eq(true)
24
+ end
25
+ it "does not raise an error" do
26
+ expect {
27
+ @issue.respond_to?(:project)
28
+ }.not_to raise_error
29
+ end
30
+ end
31
+ end
7
32
  it "should find an issue by key or id" do
8
33
  response = double()
9
34
  allow(response).to receive(:body).and_return('{"key":"foo","id":"101"}')
@@ -34,13 +59,29 @@ describe JIRA::Resource::Issue do
34
59
  it "should search an issue with a jql query string and fields" do
35
60
  response = double()
36
61
  issue = double()
62
+
37
63
  allow(response).to receive(:body).and_return('{"issues": {"key":"foo"}}')
38
- expect(client).to receive(:get).with('/jira/rest/api/2/search?jql=foo+bar%26fields%3Dfoo%2Cbar').
39
- and_return(response)
64
+ expect(client).to receive(:get)
65
+ .with('/jira/rest/api/2/search?jql=foo+bar&fields=foo,bar')
66
+ .and_return(response)
67
+ expect(client).to receive(:Issue).and_return(issue)
68
+ expect(issue).to receive(:build).with(["key", "foo"]).and_return('')
69
+
70
+ expect(JIRA::Resource::Issue.jql(client, 'foo bar', fields: ['foo','bar'])).to eq([''])
71
+ end
72
+
73
+ it "should search an issue with a jql query string, start at, and maxResults" do
74
+ response = double()
75
+ issue = double()
76
+
77
+ allow(response).to receive(:body).and_return('{"issues": {"key":"foo"}}')
78
+ expect(client).to receive(:get)
79
+ .with('/jira/rest/api/2/search?jql=foo+bar&startAt=1&maxResults=3')
80
+ .and_return(response)
40
81
  expect(client).to receive(:Issue).and_return(issue)
41
82
  expect(issue).to receive(:build).with(["key", "foo"]).and_return('')
42
83
 
43
- expect(JIRA::Resource::Issue.jql(client,'foo bar',['foo','bar'])).to eq([''])
84
+ expect(JIRA::Resource::Issue.jql(client,'foo bar', start_at: 1, max_results: 3)).to eq([''])
44
85
  end
45
86
 
46
87
  it "provides direct accessors to the fields" do
@@ -0,0 +1,10 @@
1
+ {
2
+ "views": [
3
+ {
4
+ "id": 1,
5
+ "name": "SAMPLEPROJECT",
6
+ "canEdit": true,
7
+ "sprintSupportEnabled": true
8
+ }
9
+ ]
10
+ }
@@ -0,0 +1,276 @@
1
+ {
2
+ "expand": "schema,names",
3
+ "startAt": 0,
4
+ "maxResults": 50,
5
+ "total": 2,
6
+ "issues": [
7
+ {
8
+ "expand": "editmeta,renderedFields,transitions,changelog,operations",
9
+ "id": "10001",
10
+ "self": "http://localhost:2990/jira/rest/api/2/issue/10001",
11
+ "key": "SAM-2",
12
+ "fields": {
13
+ "summary": "Test issue 2",
14
+ "progress": {
15
+ "progress": 0,
16
+ "total": 0
17
+ },
18
+ "issuetype": {
19
+ "self": "http://localhost:2990/jira/rest/api/2/issuetype/10001",
20
+ "id": "10001",
21
+ "description": "",
22
+ "iconUrl": "http://localhost:2990/jira/images/icons/ico_story.png",
23
+ "name": "Story",
24
+ "subtask": false
25
+ },
26
+ "votes": {
27
+ "self": "http://localhost:2990/jira/rest/api/2/issue/SAM-2/votes",
28
+ "votes": 0,
29
+ "hasVoted": false
30
+ },
31
+ "resolution": null,
32
+ "fixVersions": [],
33
+ "resolutiondate": null,
34
+ "timespent": null,
35
+ "creator": {
36
+ "self": "http://localhost:2990/jira/rest/api/2/user?username=admin",
37
+ "name": "admin",
38
+ "emailAddress": "admin@example.com",
39
+ "avatarUrls": {
40
+ "16x16": "http://localhost:2990/jira/secure/useravatar?size=xsmall&avatarId=10122",
41
+ "24x24": "http://localhost:2990/jira/secure/useravatar?size=small&avatarId=10122",
42
+ "32x32": "http://localhost:2990/jira/secure/useravatar?size=medium&avatarId=10122",
43
+ "48x48": "http://localhost:2990/jira/secure/useravatar?avatarId=10122"
44
+ },
45
+ "displayName": "admin",
46
+ "active": true
47
+ },
48
+ "reporter": {
49
+ "self": "http://localhost:2990/jira/rest/api/2/user?username=admin",
50
+ "name": "admin",
51
+ "emailAddress": "admin@example.com",
52
+ "avatarUrls": {
53
+ "16x16": "http://localhost:2990/jira/secure/useravatar?size=xsmall&avatarId=10122",
54
+ "24x24": "http://localhost:2990/jira/secure/useravatar?size=small&avatarId=10122",
55
+ "32x32": "http://localhost:2990/jira/secure/useravatar?size=medium&avatarId=10122",
56
+ "48x48": "http://localhost:2990/jira/secure/useravatar?avatarId=10122"
57
+ },
58
+ "displayName": "admin",
59
+ "active": true
60
+ },
61
+ "aggregatetimeoriginalestimate": null,
62
+ "created": "2014-07-18T23:30:43.000+0700",
63
+ "updated": "2014-07-18T23:30:44.000+0700",
64
+ "description": null,
65
+ "priority": {
66
+ "self": "http://localhost:2990/jira/rest/api/2/priority/3",
67
+ "iconUrl": "http://localhost:2990/jira/images/icons/priorities/major.png",
68
+ "name": "Major",
69
+ "id": "3"
70
+ },
71
+ "duedate": null,
72
+ "customfield_10001": null,
73
+ "customfield_10002": null,
74
+ "customfield_10003": null,
75
+ "issuelinks": [],
76
+ "customfield_10004": null,
77
+ "watches": {
78
+ "self": "http://localhost:2990/jira/rest/api/2/issue/SAM-2/watchers",
79
+ "watchCount": 1,
80
+ "isWatching": true
81
+ },
82
+ "customfield_10000": null,
83
+ "subtasks": [],
84
+ "customfield_10009": "0|100004:",
85
+ "status": {
86
+ "self": "http://localhost:2990/jira/rest/api/2/status/1",
87
+ "description": "The issue is open and ready for the assignee to start work on it.",
88
+ "iconUrl": "http://localhost:2990/jira/images/icons/statuses/open.png",
89
+ "name": "Open",
90
+ "id": "1",
91
+ "statusCategory": {
92
+ "self": "http://localhost:2990/jira/rest/api/2/statuscategory/2",
93
+ "id": 2,
94
+ "key": "new",
95
+ "colorName": "blue-gray",
96
+ "name": "New"
97
+ }
98
+ },
99
+ "labels": [],
100
+ "customfield_10005": null,
101
+ "workratio": -1,
102
+ "assignee": {
103
+ "self": "http://localhost:2990/jira/rest/api/2/user?username=admin",
104
+ "name": "admin",
105
+ "emailAddress": "admin@example.com",
106
+ "avatarUrls": {
107
+ "16x16": "http://localhost:2990/jira/secure/useravatar?size=xsmall&avatarId=10122",
108
+ "24x24": "http://localhost:2990/jira/secure/useravatar?size=small&avatarId=10122",
109
+ "32x32": "http://localhost:2990/jira/secure/useravatar?size=medium&avatarId=10122",
110
+ "48x48": "http://localhost:2990/jira/secure/useravatar?avatarId=10122"
111
+ },
112
+ "displayName": "admin",
113
+ "active": true
114
+ },
115
+ "aggregatetimeestimate": null,
116
+ "project": {
117
+ "self": "http://localhost:2990/jira/rest/api/2/project/10000",
118
+ "id": "10000",
119
+ "key": "SAM",
120
+ "name": "SAMPLEPROJECT",
121
+ "avatarUrls": {
122
+ "16x16": "http://localhost:2990/jira/secure/projectavatar?size=xsmall&pid=10000&avatarId=10011",
123
+ "24x24": "http://localhost:2990/jira/secure/projectavatar?size=small&pid=10000&avatarId=10011",
124
+ "32x32": "http://localhost:2990/jira/secure/projectavatar?size=medium&pid=10000&avatarId=10011",
125
+ "48x48": "http://localhost:2990/jira/secure/projectavatar?pid=10000&avatarId=10011"
126
+ }
127
+ },
128
+ "versions": [],
129
+ "environment": null,
130
+ "timeestimate": null,
131
+ "aggregateprogress": {
132
+ "progress": 0,
133
+ "total": 0
134
+ },
135
+ "lastViewed": "2014-07-18T23:30:43.561+0700",
136
+ "components": [],
137
+ "timeoriginalestimate": null,
138
+ "aggregatetimespent": null
139
+ }
140
+ },
141
+ {
142
+ "expand": "editmeta,renderedFields,transitions,changelog,operations",
143
+ "id": "10000",
144
+ "self": "http://localhost:2990/jira/rest/api/2/issue/10000",
145
+ "key": "SAM-1",
146
+ "fields": {
147
+ "summary": "Test issue 1",
148
+ "progress": {
149
+ "progress": 0,
150
+ "total": 0
151
+ },
152
+ "issuetype": {
153
+ "self": "http://localhost:2990/jira/rest/api/2/issuetype/10001",
154
+ "id": "10001",
155
+ "description": "",
156
+ "iconUrl": "http://localhost:2990/jira/images/icons/ico_story.png",
157
+ "name": "Story",
158
+ "subtask": false
159
+ },
160
+ "votes": {
161
+ "self": "http://localhost:2990/jira/rest/api/2/issue/SAM-1/votes",
162
+ "votes": 0,
163
+ "hasVoted": false
164
+ },
165
+ "resolution": null,
166
+ "fixVersions": [],
167
+ "resolutiondate": null,
168
+ "timespent": null,
169
+ "creator": {
170
+ "self": "http://localhost:2990/jira/rest/api/2/user?username=admin",
171
+ "name": "admin",
172
+ "emailAddress": "admin@example.com",
173
+ "avatarUrls": {
174
+ "16x16": "http://localhost:2990/jira/secure/useravatar?size=xsmall&avatarId=10122",
175
+ "24x24": "http://localhost:2990/jira/secure/useravatar?size=small&avatarId=10122",
176
+ "32x32": "http://localhost:2990/jira/secure/useravatar?size=medium&avatarId=10122",
177
+ "48x48": "http://localhost:2990/jira/secure/useravatar?avatarId=10122"
178
+ },
179
+ "displayName": "admin",
180
+ "active": true
181
+ },
182
+ "reporter": {
183
+ "self": "http://localhost:2990/jira/rest/api/2/user?username=admin",
184
+ "name": "admin",
185
+ "emailAddress": "admin@example.com",
186
+ "avatarUrls": {
187
+ "16x16": "http://localhost:2990/jira/secure/useravatar?size=xsmall&avatarId=10122",
188
+ "24x24": "http://localhost:2990/jira/secure/useravatar?size=small&avatarId=10122",
189
+ "32x32": "http://localhost:2990/jira/secure/useravatar?size=medium&avatarId=10122",
190
+ "48x48": "http://localhost:2990/jira/secure/useravatar?avatarId=10122"
191
+ },
192
+ "displayName": "admin",
193
+ "active": true
194
+ },
195
+ "aggregatetimeoriginalestimate": null,
196
+ "created": "2014-07-18T23:30:26.000+0700",
197
+ "updated": "2014-07-18T23:30:26.000+0700",
198
+ "description": null,
199
+ "priority": {
200
+ "self": "http://localhost:2990/jira/rest/api/2/priority/3",
201
+ "iconUrl": "http://localhost:2990/jira/images/icons/priorities/major.png",
202
+ "name": "Major",
203
+ "id": "3"
204
+ },
205
+ "duedate": null,
206
+ "customfield_10001": null,
207
+ "customfield_10002": null,
208
+ "customfield_10003": null,
209
+ "issuelinks": [],
210
+ "customfield_10004": null,
211
+ "watches": {
212
+ "self": "http://localhost:2990/jira/rest/api/2/issue/SAM-1/watchers",
213
+ "watchCount": 1,
214
+ "isWatching": true
215
+ },
216
+ "customfield_10000": null,
217
+ "subtasks": [],
218
+ "customfield_10009": "0|100000:",
219
+ "status": {
220
+ "self": "http://localhost:2990/jira/rest/api/2/status/1",
221
+ "description": "The issue is open and ready for the assignee to start work on it.",
222
+ "iconUrl": "http://localhost:2990/jira/images/icons/statuses/open.png",
223
+ "name": "Open",
224
+ "id": "1",
225
+ "statusCategory": {
226
+ "self": "http://localhost:2990/jira/rest/api/2/statuscategory/2",
227
+ "id": 2,
228
+ "key": "new",
229
+ "colorName": "blue-gray",
230
+ "name": "New"
231
+ }
232
+ },
233
+ "labels": [],
234
+ "customfield_10005": null,
235
+ "workratio": -1,
236
+ "assignee": {
237
+ "self": "http://localhost:2990/jira/rest/api/2/user?username=admin",
238
+ "name": "admin",
239
+ "emailAddress": "admin@example.com",
240
+ "avatarUrls": {
241
+ "16x16": "http://localhost:2990/jira/secure/useravatar?size=xsmall&avatarId=10122",
242
+ "24x24": "http://localhost:2990/jira/secure/useravatar?size=small&avatarId=10122",
243
+ "32x32": "http://localhost:2990/jira/secure/useravatar?size=medium&avatarId=10122",
244
+ "48x48": "http://localhost:2990/jira/secure/useravatar?avatarId=10122"
245
+ },
246
+ "displayName": "admin",
247
+ "active": true
248
+ },
249
+ "aggregatetimeestimate": null,
250
+ "project": {
251
+ "self": "http://localhost:2990/jira/rest/api/2/project/10000",
252
+ "id": "10000",
253
+ "key": "SAM",
254
+ "name": "SAMPLEPROJECT",
255
+ "avatarUrls": {
256
+ "16x16": "http://localhost:2990/jira/secure/projectavatar?size=xsmall&pid=10000&avatarId=10011",
257
+ "24x24": "http://localhost:2990/jira/secure/projectavatar?size=small&pid=10000&avatarId=10011",
258
+ "32x32": "http://localhost:2990/jira/secure/projectavatar?size=medium&pid=10000&avatarId=10011",
259
+ "48x48": "http://localhost:2990/jira/secure/projectavatar?pid=10000&avatarId=10011"
260
+ }
261
+ },
262
+ "versions": [],
263
+ "environment": null,
264
+ "timeestimate": null,
265
+ "aggregateprogress": {
266
+ "progress": 0,
267
+ "total": 0
268
+ },
269
+ "lastViewed": "2014-07-18T23:30:28.576+0700",
270
+ "components": [],
271
+ "timeoriginalestimate": null,
272
+ "aggregatetimespent": null
273
+ }
274
+ }
275
+ ]
276
+ }
@@ -0,0 +1,111 @@
1
+ {
2
+ "sprintMarkersMigrated": true,
3
+ "issues": [
4
+ {
5
+ "id": 10000,
6
+ "key": "SAM-1",
7
+ "hidden": false,
8
+ "typeName": "Story",
9
+ "typeId": "10001",
10
+ "summary": "Test issue 1",
11
+ "typeUrl": "http://localhost:2990/jira/images/icons/ico_story.png",
12
+ "priorityUrl": "http://localhost:2990/jira/images/icons/priorities/major.png",
13
+ "priorityName": "Major",
14
+ "done": false,
15
+ "assignee": "admin",
16
+ "assigneeName": "admin",
17
+ "hasCustomUserAvatar": false,
18
+ "autoUserAvatar": {
19
+ "letter": "a",
20
+ "color": "#f691b2"
21
+ },
22
+ "color": "#cc0000",
23
+ "estimateStatistic": {
24
+ "statFieldId": "customfield_10002",
25
+ "statFieldValue": {}
26
+ },
27
+ "statusId": "1",
28
+ "statusName": "Open",
29
+ "statusUrl": "http://localhost:2990/jira/images/icons/statuses/open.png",
30
+ "status": {
31
+ "id": "1",
32
+ "name": "Open",
33
+ "description": "The issue is open and ready for the assignee to start work on it.",
34
+ "iconUrl": "http://localhost:2990/jira/images/icons/statuses/open.png",
35
+ "statusCategory": {
36
+ "id": "2",
37
+ "key": "new",
38
+ "colorName": "blue-gray"
39
+ }
40
+ },
41
+ "fixVersions": [],
42
+ "projectId": 10000,
43
+ "linkedPagesCount": 0
44
+ },
45
+ {
46
+ "id": 10001,
47
+ "key": "SAM-2",
48
+ "hidden": false,
49
+ "typeName": "Story",
50
+ "typeId": "10001",
51
+ "summary": "Test issue 2",
52
+ "typeUrl": "http://localhost:2990/jira/images/icons/ico_story.png",
53
+ "priorityUrl": "http://localhost:2990/jira/images/icons/priorities/major.png",
54
+ "priorityName": "Major",
55
+ "done": false,
56
+ "assignee": "admin",
57
+ "assigneeName": "admin",
58
+ "hasCustomUserAvatar": false,
59
+ "autoUserAvatar": {
60
+ "letter": "a",
61
+ "color": "#f691b2"
62
+ },
63
+ "color": "#cc0000",
64
+ "estimateStatistic": {
65
+ "statFieldId": "customfield_10002",
66
+ "statFieldValue": {}
67
+ },
68
+ "statusId": "1",
69
+ "statusName": "Open",
70
+ "statusUrl": "http://localhost:2990/jira/images/icons/statuses/open.png",
71
+ "status": {
72
+ "id": "1",
73
+ "name": "Open",
74
+ "description": "The issue is open and ready for the assignee to start work on it.",
75
+ "iconUrl": "http://localhost:2990/jira/images/icons/statuses/open.png",
76
+ "statusCategory": {
77
+ "id": "2",
78
+ "key": "new",
79
+ "colorName": "blue-gray"
80
+ }
81
+ },
82
+ "fixVersions": [],
83
+ "projectId": 10000,
84
+ "linkedPagesCount": 0
85
+ }
86
+ ],
87
+ "rankCustomFieldId": 10009,
88
+ "sprints": [],
89
+ "supportsPages": false,
90
+ "projects": [
91
+ {
92
+ "id": 10000,
93
+ "key": "SAM",
94
+ "name": "SAMPLEPROJECT"
95
+ }
96
+ ],
97
+ "epicData": {
98
+ "epics": [],
99
+ "canEditEpics": false,
100
+ "supportsPages": false
101
+ },
102
+ "canManageSprints": true,
103
+ "maxIssuesExceeded": false,
104
+ "queryResultLimit": 2147483647,
105
+ "versionData": {
106
+ "versionsPerProject": {
107
+ "10000": []
108
+ },
109
+ "canCreateVersion": true
110
+ }
111
+ }
@@ -0,0 +1,6 @@
1
+ {
2
+ "id": 1,
3
+ "name": "SAMPLEPROJECT",
4
+ "canEdit": true,
5
+ "sprintSupportEnabled": true
6
+ }
@@ -83,8 +83,14 @@ end
83
83
  shared_examples "a resource with JQL inputs and a collection GET endpoint" do
84
84
 
85
85
  it "should get the collection" do
86
- stub_request(:get, site_url + client.options[:rest_base_path] + '/search?jql=' + CGI.escape(jql_query_string)).
87
- to_return(:status => 200, :body => get_mock_response('issue.json'))
86
+ stub_request(
87
+ :get,
88
+ site_url +
89
+ client.options[:rest_base_path] +
90
+ '/search?jql=' +
91
+ CGI.escape(jql_query_string)
92
+ ).to_return(:status => 200, :body => get_mock_response('issue.json'))
93
+
88
94
  collection = build_receiver.jql(jql_query_string)
89
95
 
90
96
  expect(collection.length).to eq(expected_collection_length)
metadata CHANGED
@@ -1,97 +1,97 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jira-ruby
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.11
4
+ version: 0.1.12
5
5
  platform: ruby
6
6
  authors:
7
7
  - SUMO Heavy Industries
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-07-21 00:00:00.000000000 Z
11
+ date: 2015-01-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: railties
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - ~>
17
+ - - "~>"
18
18
  - !ruby/object:Gem::Version
19
19
  version: 4.1.4
20
20
  type: :development
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - ~>
24
+ - - "~>"
25
25
  - !ruby/object:Gem::Version
26
26
  version: 4.1.4
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: oauth
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - ~>
31
+ - - "~>"
32
32
  - !ruby/object:Gem::Version
33
33
  version: 0.4.7
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - ~>
38
+ - - "~>"
39
39
  - !ruby/object:Gem::Version
40
40
  version: 0.4.7
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: activesupport
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
- - - ~>
45
+ - - "~>"
46
46
  - !ruby/object:Gem::Version
47
47
  version: 4.1.4
48
48
  type: :runtime
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
- - - ~>
52
+ - - "~>"
53
53
  - !ruby/object:Gem::Version
54
54
  version: 4.1.4
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: webmock
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
- - - ~>
59
+ - - "~>"
60
60
  - !ruby/object:Gem::Version
61
61
  version: 1.18.0
62
62
  type: :development
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
- - - ~>
66
+ - - "~>"
67
67
  - !ruby/object:Gem::Version
68
68
  version: 1.18.0
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: rspec
71
71
  requirement: !ruby/object:Gem::Requirement
72
72
  requirements:
73
- - - ~>
73
+ - - "~>"
74
74
  - !ruby/object:Gem::Version
75
75
  version: 3.0.0
76
76
  type: :development
77
77
  prerelease: false
78
78
  version_requirements: !ruby/object:Gem::Requirement
79
79
  requirements:
80
- - - ~>
80
+ - - "~>"
81
81
  - !ruby/object:Gem::Version
82
82
  version: 3.0.0
83
83
  - !ruby/object:Gem::Dependency
84
84
  name: rake
85
85
  requirement: !ruby/object:Gem::Requirement
86
86
  requirements:
87
- - - ~>
87
+ - - "~>"
88
88
  - !ruby/object:Gem::Version
89
89
  version: 10.3.2
90
90
  type: :development
91
91
  prerelease: false
92
92
  version_requirements: !ruby/object:Gem::Requirement
93
93
  requirements:
94
- - - ~>
94
+ - - "~>"
95
95
  - !ruby/object:Gem::Version
96
96
  version: 10.3.2
97
97
  description: API for JIRA
@@ -100,8 +100,8 @@ executables: []
100
100
  extensions: []
101
101
  extra_rdoc_files: []
102
102
  files:
103
- - .gitignore
104
- - .travis.yml
103
+ - ".gitignore"
104
+ - ".travis.yml"
105
105
  - Gemfile
106
106
  - LICENSE.txt
107
107
  - README.rdoc
@@ -128,6 +128,7 @@ files:
128
128
  - lib/jira/resource/issuetype.rb
129
129
  - lib/jira/resource/priority.rb
130
130
  - lib/jira/resource/project.rb
131
+ - lib/jira/resource/rapidview.rb
131
132
  - lib/jira/resource/status.rb
132
133
  - lib/jira/resource/transition.rb
133
134
  - lib/jira/resource/user.rb
@@ -144,6 +145,7 @@ files:
144
145
  - spec/integration/issuetype_spec.rb
145
146
  - spec/integration/priority_spec.rb
146
147
  - spec/integration/project_spec.rb
148
+ - spec/integration/rapidview_spec.rb
147
149
  - spec/integration/status_spec.rb
148
150
  - spec/integration/transition_spec.rb
149
151
  - spec/integration/user_spec.rb
@@ -192,6 +194,10 @@ files:
192
194
  - spec/mock_responses/project.json
193
195
  - spec/mock_responses/project/SAMPLEPROJECT.issues.json
194
196
  - spec/mock_responses/project/SAMPLEPROJECT.json
197
+ - spec/mock_responses/rapidview.json
198
+ - spec/mock_responses/rapidview/SAMPLEPROJECT.issues.full.json
199
+ - spec/mock_responses/rapidview/SAMPLEPROJECT.issues.json
200
+ - spec/mock_responses/rapidview/SAMPLEPROJECT.json
195
201
  - spec/mock_responses/status.json
196
202
  - spec/mock_responses/status/1.json
197
203
  - spec/mock_responses/user_username=admin.json
@@ -215,17 +221,17 @@ require_paths:
215
221
  - lib
216
222
  required_ruby_version: !ruby/object:Gem::Requirement
217
223
  requirements:
218
- - - '>='
224
+ - - ">="
219
225
  - !ruby/object:Gem::Version
220
226
  version: '0'
221
227
  required_rubygems_version: !ruby/object:Gem::Requirement
222
228
  requirements:
223
- - - '>='
229
+ - - ">="
224
230
  - !ruby/object:Gem::Version
225
231
  version: '0'
226
232
  requirements: []
227
233
  rubyforge_project: jira-ruby
228
- rubygems_version: 2.0.5
234
+ rubygems_version: 2.4.3
229
235
  signing_key:
230
236
  specification_version: 4
231
237
  summary: Ruby Gem for use with the Atlassian JIRA REST API
@@ -238,6 +244,7 @@ test_files:
238
244
  - spec/integration/issuetype_spec.rb
239
245
  - spec/integration/priority_spec.rb
240
246
  - spec/integration/project_spec.rb
247
+ - spec/integration/rapidview_spec.rb
241
248
  - spec/integration/status_spec.rb
242
249
  - spec/integration/transition_spec.rb
243
250
  - spec/integration/user_spec.rb
@@ -286,6 +293,10 @@ test_files:
286
293
  - spec/mock_responses/project.json
287
294
  - spec/mock_responses/project/SAMPLEPROJECT.issues.json
288
295
  - spec/mock_responses/project/SAMPLEPROJECT.json
296
+ - spec/mock_responses/rapidview.json
297
+ - spec/mock_responses/rapidview/SAMPLEPROJECT.issues.full.json
298
+ - spec/mock_responses/rapidview/SAMPLEPROJECT.issues.json
299
+ - spec/mock_responses/rapidview/SAMPLEPROJECT.json
289
300
  - spec/mock_responses/status.json
290
301
  - spec/mock_responses/status/1.json
291
302
  - spec/mock_responses/user_username=admin.json