jira_client 1.0.1 → 1.0.2
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.
data/lib/jira_client/issue.rb
CHANGED
@@ -6,7 +6,8 @@ require "jira_client/issue_type"
|
|
6
6
|
|
7
7
|
module JiraClient
|
8
8
|
class Issue < JiraClient::Base
|
9
|
-
attr_reader :key, :description, :summary, :status, :timetracking,
|
9
|
+
attr_reader :key, :description, :summary, :status, :timetracking,
|
10
|
+
:project, :worklog, :comment, :issuetype, :subtasks, :assignee
|
10
11
|
|
11
12
|
convert :status, JiraClient::Status
|
12
13
|
convert :timetracking, JiraClient::Timetracking
|
@@ -15,6 +16,7 @@ module JiraClient
|
|
15
16
|
convert :worklog, JiraClient::Worklog
|
16
17
|
convert :issuetype, JiraClient::IssueType
|
17
18
|
convert :subtasks, JiraClient::Issue
|
19
|
+
convert :assignee, JiraClient::User
|
18
20
|
|
19
21
|
alias :comments :comment
|
20
22
|
|
data/lib/jira_client/version.rb
CHANGED
@@ -0,0 +1 @@
|
|
1
|
+
{"username":"admin","fullName":"Admin Admin","email":"admin@example.com"}
|
@@ -0,0 +1,19 @@
|
|
1
|
+
{
|
2
|
+
"expand": "renderedFields,names,schema,transitions,operations,editmeta,changelog",
|
3
|
+
"id": "10000",
|
4
|
+
"self": "http://localhost:2990/jira/rest/api/2/issue/10000",
|
5
|
+
"key": "TEST-1",
|
6
|
+
"fields": {
|
7
|
+
"assignee": {
|
8
|
+
"self": "http://localhost:2990/jira/rest/api/2/user?username=admin",
|
9
|
+
"name": "admin",
|
10
|
+
"emailAddress": "admin@example.com",
|
11
|
+
"avatarUrls": {
|
12
|
+
"16x16": "http://localhost:2990/jira/secure/useravatar?size=small&avatarId=10122",
|
13
|
+
"48x48": "http://localhost:2990/jira/secure/useravatar?avatarId=10122"
|
14
|
+
},
|
15
|
+
"displayName": "admin",
|
16
|
+
"active": true
|
17
|
+
}
|
18
|
+
}
|
19
|
+
}
|
@@ -127,6 +127,25 @@ describe JiraClient::API::Issues do
|
|
127
127
|
end
|
128
128
|
end
|
129
129
|
end
|
130
|
+
context "with assignee" do
|
131
|
+
|
132
|
+
before do
|
133
|
+
stub_get("/issue/PROJECT-1234").with(:query => {:fields => "assignee"}).to_return(:body => fixture("issue_with_assignee.json"))
|
134
|
+
@issue = JiraClient.find_issue_by_key("PROJECT-1234", :fields => [:assignee])
|
135
|
+
@assignee = @issue.assignee
|
136
|
+
end
|
137
|
+
|
138
|
+
it "requests the correct resource" do
|
139
|
+
expect(a_get("/issue/PROJECT-1234?fields=assignee")).to have_been_made
|
140
|
+
end
|
141
|
+
it "returns a user object" do
|
142
|
+
expect(@assignee).to be_a_kind_of JiraClient::User
|
143
|
+
end
|
144
|
+
it "sets the right data" do
|
145
|
+
@assignee.name.should == "admin"
|
146
|
+
@assignee.email_address.should == "admin@example.com"
|
147
|
+
end
|
148
|
+
end
|
130
149
|
context "with comments" do
|
131
150
|
|
132
151
|
before do
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: jira_client
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.2
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2013-05-
|
12
|
+
date: 2013-05-16 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: bundler
|
@@ -136,9 +136,11 @@ files:
|
|
136
136
|
- spec/fixtures/basic_issue.json
|
137
137
|
- spec/fixtures/comment.json
|
138
138
|
- spec/fixtures/comments.json
|
139
|
+
- spec/fixtures/current_user.json
|
139
140
|
- spec/fixtures/invalid_assignee.json
|
140
141
|
- spec/fixtures/invalid_comment.json
|
141
142
|
- spec/fixtures/invalid_jql.json
|
143
|
+
- spec/fixtures/issue_with_assignee.json
|
142
144
|
- spec/fixtures/issue_with_comments.json
|
143
145
|
- spec/fixtures/issue_with_description.json
|
144
146
|
- spec/fixtures/issue_with_issuetype.json
|
@@ -197,9 +199,11 @@ test_files:
|
|
197
199
|
- spec/fixtures/basic_issue.json
|
198
200
|
- spec/fixtures/comment.json
|
199
201
|
- spec/fixtures/comments.json
|
202
|
+
- spec/fixtures/current_user.json
|
200
203
|
- spec/fixtures/invalid_assignee.json
|
201
204
|
- spec/fixtures/invalid_comment.json
|
202
205
|
- spec/fixtures/invalid_jql.json
|
206
|
+
- spec/fixtures/issue_with_assignee.json
|
203
207
|
- spec/fixtures/issue_with_comments.json
|
204
208
|
- spec/fixtures/issue_with_description.json
|
205
209
|
- spec/fixtures/issue_with_issuetype.json
|