sclemmer-jira-ruby 0.1.12
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +10 -0
- data/.travis.yml +6 -0
- data/Gemfile +4 -0
- data/LICENSE.txt +46 -0
- data/README.rdoc +309 -0
- data/Rakefile +28 -0
- data/example.rb +119 -0
- data/http-basic-example.rb +112 -0
- data/lib/jira.rb +33 -0
- data/lib/jira/base.rb +497 -0
- data/lib/jira/base_factory.rb +49 -0
- data/lib/jira/client.rb +165 -0
- data/lib/jira/has_many_proxy.rb +43 -0
- data/lib/jira/http_client.rb +69 -0
- data/lib/jira/http_error.rb +16 -0
- data/lib/jira/oauth_client.rb +84 -0
- data/lib/jira/railtie.rb +10 -0
- data/lib/jira/request_client.rb +18 -0
- data/lib/jira/resource/attachment.rb +12 -0
- data/lib/jira/resource/comment.rb +14 -0
- data/lib/jira/resource/component.rb +10 -0
- data/lib/jira/resource/field.rb +10 -0
- data/lib/jira/resource/filter.rb +15 -0
- data/lib/jira/resource/issue.rb +80 -0
- data/lib/jira/resource/issuetype.rb +10 -0
- data/lib/jira/resource/priority.rb +10 -0
- data/lib/jira/resource/project.rb +31 -0
- data/lib/jira/resource/status.rb +10 -0
- data/lib/jira/resource/transition.rb +33 -0
- data/lib/jira/resource/user.rb +14 -0
- data/lib/jira/resource/version.rb +10 -0
- data/lib/jira/resource/worklog.rb +16 -0
- data/lib/jira/tasks.rb +0 -0
- data/lib/jira/version.rb +3 -0
- data/lib/tasks/generate.rake +18 -0
- data/sclemmer-jira-ruby.gemspec +28 -0
- data/spec/integration/attachment_spec.rb +23 -0
- data/spec/integration/comment_spec.rb +55 -0
- data/spec/integration/component_spec.rb +42 -0
- data/spec/integration/field_spec.rb +35 -0
- data/spec/integration/issue_spec.rb +94 -0
- data/spec/integration/issuetype_spec.rb +26 -0
- data/spec/integration/priority_spec.rb +27 -0
- data/spec/integration/project_spec.rb +56 -0
- data/spec/integration/status_spec.rb +27 -0
- data/spec/integration/transition_spec.rb +52 -0
- data/spec/integration/user_spec.rb +25 -0
- data/spec/integration/version_spec.rb +43 -0
- data/spec/integration/worklog_spec.rb +55 -0
- data/spec/jira/base_factory_spec.rb +46 -0
- data/spec/jira/base_spec.rb +583 -0
- data/spec/jira/client_spec.rb +188 -0
- data/spec/jira/has_many_proxy_spec.rb +47 -0
- data/spec/jira/http_client_spec.rb +109 -0
- data/spec/jira/http_error_spec.rb +26 -0
- data/spec/jira/oauth_client_spec.rb +111 -0
- data/spec/jira/request_client_spec.rb +14 -0
- data/spec/jira/resource/attachment_spec.rb +20 -0
- data/spec/jira/resource/filter_spec.rb +97 -0
- data/spec/jira/resource/issue_spec.rb +123 -0
- data/spec/jira/resource/project_factory_spec.rb +13 -0
- data/spec/jira/resource/project_spec.rb +70 -0
- data/spec/jira/resource/worklog_spec.rb +24 -0
- data/spec/mock_responses/attachment/10000.json +20 -0
- data/spec/mock_responses/component.post.json +28 -0
- data/spec/mock_responses/component/10000.invalid.put.json +5 -0
- data/spec/mock_responses/component/10000.json +39 -0
- data/spec/mock_responses/component/10000.put.json +39 -0
- data/spec/mock_responses/field.json +32 -0
- data/spec/mock_responses/field/1.json +15 -0
- data/spec/mock_responses/issue.json +1108 -0
- data/spec/mock_responses/issue.post.json +5 -0
- data/spec/mock_responses/issue/10002.invalid.put.json +6 -0
- data/spec/mock_responses/issue/10002.json +126 -0
- data/spec/mock_responses/issue/10002.put.missing_field_update.json +6 -0
- data/spec/mock_responses/issue/10002/comment.json +65 -0
- data/spec/mock_responses/issue/10002/comment.post.json +29 -0
- data/spec/mock_responses/issue/10002/comment/10000.json +29 -0
- data/spec/mock_responses/issue/10002/comment/10000.put.json +29 -0
- data/spec/mock_responses/issue/10002/transitions.json +49 -0
- data/spec/mock_responses/issue/10002/transitions.post.json +1 -0
- data/spec/mock_responses/issue/10002/worklog.json +98 -0
- data/spec/mock_responses/issue/10002/worklog.post.json +30 -0
- data/spec/mock_responses/issue/10002/worklog/10000.json +31 -0
- data/spec/mock_responses/issue/10002/worklog/10000.put.json +30 -0
- data/spec/mock_responses/issuetype.json +42 -0
- data/spec/mock_responses/issuetype/5.json +8 -0
- data/spec/mock_responses/priority.json +42 -0
- data/spec/mock_responses/priority/1.json +8 -0
- data/spec/mock_responses/project.json +12 -0
- data/spec/mock_responses/project/SAMPLEPROJECT.issues.json +1108 -0
- data/spec/mock_responses/project/SAMPLEPROJECT.json +84 -0
- data/spec/mock_responses/status.json +37 -0
- data/spec/mock_responses/status/1.json +7 -0
- data/spec/mock_responses/user_username=admin.json +17 -0
- data/spec/mock_responses/version.post.json +7 -0
- data/spec/mock_responses/version/10000.invalid.put.json +5 -0
- data/spec/mock_responses/version/10000.json +11 -0
- data/spec/mock_responses/version/10000.put.json +7 -0
- data/spec/spec_helper.rb +22 -0
- data/spec/support/clients_helper.rb +16 -0
- data/spec/support/matchers/have_attributes.rb +11 -0
- data/spec/support/matchers/have_many.rb +9 -0
- data/spec/support/matchers/have_one.rb +5 -0
- data/spec/support/shared_examples/integration.rb +194 -0
- metadata +302 -0
@@ -0,0 +1,14 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe JIRA::RequestClient do
|
4
|
+
|
5
|
+
it "raises an exception for non success responses" do
|
6
|
+
response = double()
|
7
|
+
allow(response).to receive(:kind_of?).with(Net::HTTPSuccess).and_return(false)
|
8
|
+
rc = JIRA::RequestClient.new
|
9
|
+
expect(rc).to receive(:make_request).with(:get, '/foo', '', {}).and_return(response)
|
10
|
+
expect {
|
11
|
+
rc.request(:get, '/foo', '', {})
|
12
|
+
}.to raise_exception(JIRA::HTTPError)
|
13
|
+
end
|
14
|
+
end
|
@@ -0,0 +1,20 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe JIRA::Resource::Attachment do
|
4
|
+
|
5
|
+
let(:client) { double() }
|
6
|
+
|
7
|
+
describe "relationships" do
|
8
|
+
subject {
|
9
|
+
JIRA::Resource::Attachment.new(client, :attrs => {
|
10
|
+
'author' => {'foo' => 'bar'}
|
11
|
+
})
|
12
|
+
}
|
13
|
+
|
14
|
+
it "has the correct relationships" do
|
15
|
+
expect(subject).to have_one(:author, JIRA::Resource::User)
|
16
|
+
expect(subject.author.foo).to eq('bar')
|
17
|
+
end
|
18
|
+
end
|
19
|
+
|
20
|
+
end
|
@@ -0,0 +1,97 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe JIRA::Resource::Filter do
|
4
|
+
let(:client) do
|
5
|
+
client = double()
|
6
|
+
allow(client).to receive(:Issue).and_return(JIRA::Resource::IssueFactory.new(self))
|
7
|
+
client
|
8
|
+
end
|
9
|
+
let(:collection_path) { '/rest/api/2/filter' }
|
10
|
+
let(:jira_user) do
|
11
|
+
{
|
12
|
+
:self => "https://localhost/rest/api/2/user?username=ljharb",
|
13
|
+
:name => 'ljharb',
|
14
|
+
:avatarUrls => {
|
15
|
+
'16x16' => 'https://localhost/secure/useravatar?size=small&ownerId=ljharb&avatarId=1',
|
16
|
+
'48x48' => 'https://localhost/secure/useravatar?ownerId=ljharb&avatarId=1'
|
17
|
+
},
|
18
|
+
:displayName => 'Jordan Harband',
|
19
|
+
:active => true
|
20
|
+
}
|
21
|
+
end
|
22
|
+
let(:filter_attrs) do
|
23
|
+
{
|
24
|
+
:self => "https://localhost#{collection_path}/42",
|
25
|
+
:id => 42,
|
26
|
+
:name => 'Resolved Tickets',
|
27
|
+
:description => '',
|
28
|
+
:owner => jira_user,
|
29
|
+
:jql => '"Git Repository" ~ jira-ruby AND status = Resolved',
|
30
|
+
:viewUrl => 'https://localhost/secure/IssueNavigator.jspa?mode=hide&requestId=42',
|
31
|
+
:searchUrl => 'https://localhost/rest/api/2/search?jql=%22Git+Repository%22+~+jira-ruby+AND+status+%3D+Resolved',
|
32
|
+
:favourite => false,
|
33
|
+
:sharePermissions => [
|
34
|
+
{
|
35
|
+
:id => 123,
|
36
|
+
:type => 'global'
|
37
|
+
}
|
38
|
+
],
|
39
|
+
:subscriptions => {
|
40
|
+
:size => 0,
|
41
|
+
:items => []
|
42
|
+
}
|
43
|
+
}
|
44
|
+
end
|
45
|
+
let(:filter_response) do
|
46
|
+
response = double()
|
47
|
+
allow(response).to receive(:body).and_return(filter_attrs.to_json)
|
48
|
+
response
|
49
|
+
end
|
50
|
+
let(:filter) do
|
51
|
+
expect(client).to receive(:get).with("#{collection_path}/42").and_return(filter_response)
|
52
|
+
allow(JIRA::Resource::Filter).to receive(:collection_path).and_return(collection_path)
|
53
|
+
JIRA::Resource::Filter.find(client, 42)
|
54
|
+
end
|
55
|
+
let(:jql_issue) do
|
56
|
+
{
|
57
|
+
:id => '663147',
|
58
|
+
:self => 'https://localhost/rest/api/2/issue/663147',
|
59
|
+
:key => "JIRARUBY-2386",
|
60
|
+
:fields => {
|
61
|
+
:reporter => jira_user,
|
62
|
+
:created => '2013-12-11T23:28:02.000+0000',
|
63
|
+
:assignee => jira_user
|
64
|
+
}
|
65
|
+
}
|
66
|
+
end
|
67
|
+
let(:jql_attrs) do
|
68
|
+
{
|
69
|
+
:startAt => 0,
|
70
|
+
:maxResults => 50,
|
71
|
+
:total => 2,
|
72
|
+
:issues => [jql_issue]
|
73
|
+
}
|
74
|
+
end
|
75
|
+
let(:issue_jql_response) do
|
76
|
+
response = double()
|
77
|
+
allow(response).to receive(:body).and_return(jql_attrs.to_json)
|
78
|
+
response
|
79
|
+
end
|
80
|
+
|
81
|
+
it "can be found by ID" do
|
82
|
+
expect(JSON.parse(filter.attrs.to_json)).to eql(JSON.parse(filter_attrs.to_json))
|
83
|
+
end
|
84
|
+
|
85
|
+
it "returns issues" do
|
86
|
+
expect(filter).to be_present
|
87
|
+
allow(client).to receive(:options).and_return({ :rest_base_path => 'localhost' })
|
88
|
+
expect(client).to receive(:get).
|
89
|
+
with("localhost/search?jql=#{CGI.escape(filter.jql)}").
|
90
|
+
and_return(issue_jql_response)
|
91
|
+
issues = filter.issues
|
92
|
+
expect(issues).to be_an(Array)
|
93
|
+
expect(issues.size).to eql(1)
|
94
|
+
expected_issue = client.Issue.build(JSON.parse(jql_issue.to_json))
|
95
|
+
expect(issues.first.attrs).to eql(expected_issue.attrs)
|
96
|
+
end
|
97
|
+
end
|
@@ -0,0 +1,123 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe JIRA::Resource::Issue do
|
4
|
+
|
5
|
+
let(:client) { double(options: {rest_base_path: '/jira/rest/api/2'}) }
|
6
|
+
|
7
|
+
it "should find an issue by key or id" do
|
8
|
+
response = double()
|
9
|
+
allow(response).to receive(:body).and_return('{"key":"foo","id":"101"}')
|
10
|
+
allow(JIRA::Resource::Issue).to receive(:collection_path).and_return('/jira/rest/api/2/issue')
|
11
|
+
expect(client).to receive(:get).with('/jira/rest/api/2/issue/foo').
|
12
|
+
and_return(response)
|
13
|
+
expect(client).to receive(:get).with('/jira/rest/api/2/issue/101').
|
14
|
+
and_return(response)
|
15
|
+
|
16
|
+
issue_from_id = JIRA::Resource::Issue.find(client,101)
|
17
|
+
issue_from_key = JIRA::Resource::Issue.find(client,'foo')
|
18
|
+
|
19
|
+
expect(issue_from_id.attrs).to eq(issue_from_key.attrs)
|
20
|
+
end
|
21
|
+
|
22
|
+
it "should search an issue with a jql query string" do
|
23
|
+
response = double()
|
24
|
+
issue = double()
|
25
|
+
allow(response).to receive(:body).and_return('{"issues": {"key":"foo"}}')
|
26
|
+
expect(client).to receive(:get).with('/jira/rest/api/2/search?jql=foo+bar').
|
27
|
+
and_return(response)
|
28
|
+
expect(client).to receive(:Issue).and_return(issue)
|
29
|
+
expect(issue).to receive(:build).with(["key", "foo"]).and_return('')
|
30
|
+
|
31
|
+
expect(JIRA::Resource::Issue.jql(client,'foo bar')).to eq([''])
|
32
|
+
end
|
33
|
+
|
34
|
+
it "should search an issue with a jql query string and fields" do
|
35
|
+
response = double()
|
36
|
+
issue = double()
|
37
|
+
|
38
|
+
allow(response).to receive(:body).and_return('{"issues": {"key":"foo"}}')
|
39
|
+
expect(client).to receive(:get)
|
40
|
+
.with('/jira/rest/api/2/search?jql=foo+bar&fields=foo,bar')
|
41
|
+
.and_return(response)
|
42
|
+
expect(client).to receive(:Issue).and_return(issue)
|
43
|
+
expect(issue).to receive(:build).with(["key", "foo"]).and_return('')
|
44
|
+
|
45
|
+
expect(JIRA::Resource::Issue.jql(client, 'foo bar', fields: ['foo','bar'])).to eq([''])
|
46
|
+
end
|
47
|
+
|
48
|
+
it "should search an issue with a jql query string, start at, and maxResults" do
|
49
|
+
response = double()
|
50
|
+
issue = double()
|
51
|
+
|
52
|
+
allow(response).to receive(:body).and_return('{"issues": {"key":"foo"}}')
|
53
|
+
expect(client).to receive(:get)
|
54
|
+
.with('/jira/rest/api/2/search?jql=foo+bar&startAt=1&maxResults=3')
|
55
|
+
.and_return(response)
|
56
|
+
expect(client).to receive(:Issue).and_return(issue)
|
57
|
+
expect(issue).to receive(:build).with(["key", "foo"]).and_return('')
|
58
|
+
|
59
|
+
expect(JIRA::Resource::Issue.jql(client,'foo bar', start_at: 1, max_results: 3)).to eq([''])
|
60
|
+
end
|
61
|
+
|
62
|
+
it "provides direct accessors to the fields" do
|
63
|
+
subject = JIRA::Resource::Issue.new(client, :attrs => {'fields' => {'foo' =>'bar'}})
|
64
|
+
expect(subject).to respond_to(:foo)
|
65
|
+
expect(subject.foo).to eq('bar')
|
66
|
+
end
|
67
|
+
|
68
|
+
describe "relationships" do
|
69
|
+
subject {
|
70
|
+
JIRA::Resource::Issue.new(client, :attrs => {
|
71
|
+
'id' => '123',
|
72
|
+
'fields' => {
|
73
|
+
'reporter' => {'foo' => 'bar'},
|
74
|
+
'assignee' => {'foo' => 'bar'},
|
75
|
+
'project' => {'foo' => 'bar'},
|
76
|
+
'priority' => {'foo' => 'bar'},
|
77
|
+
'issuetype' => {'foo' => 'bar'},
|
78
|
+
'status' => {'foo' => 'bar'},
|
79
|
+
'components' => [{'foo' => 'bar'}, {'baz' => 'flum'}],
|
80
|
+
'versions' => [{'foo' => 'bar'}, {'baz' => 'flum'}],
|
81
|
+
'comment' => { 'comments' => [{'foo' => 'bar'}, {'baz' => 'flum'}]},
|
82
|
+
'attachment' => [{'foo' => 'bar'}, {'baz' => 'flum'}],
|
83
|
+
'worklog' => { 'worklogs' => [{'foo' => 'bar'}, {'baz' => 'flum'}]},
|
84
|
+
}
|
85
|
+
})
|
86
|
+
}
|
87
|
+
|
88
|
+
it "has the correct relationships" do
|
89
|
+
expect(subject).to have_one(:reporter, JIRA::Resource::User)
|
90
|
+
expect(subject.reporter.foo).to eq('bar')
|
91
|
+
|
92
|
+
expect(subject).to have_one(:assignee, JIRA::Resource::User)
|
93
|
+
expect(subject.assignee.foo).to eq('bar')
|
94
|
+
|
95
|
+
expect(subject).to have_one(:project, JIRA::Resource::Project)
|
96
|
+
expect(subject.project.foo).to eq('bar')
|
97
|
+
|
98
|
+
expect(subject).to have_one(:issuetype, JIRA::Resource::Issuetype)
|
99
|
+
expect(subject.issuetype.foo).to eq('bar')
|
100
|
+
|
101
|
+
expect(subject).to have_one(:priority, JIRA::Resource::Priority)
|
102
|
+
expect(subject.priority.foo).to eq('bar')
|
103
|
+
|
104
|
+
expect(subject).to have_one(:status, JIRA::Resource::Status)
|
105
|
+
expect(subject.status.foo).to eq('bar')
|
106
|
+
|
107
|
+
expect(subject).to have_many(:components, JIRA::Resource::Component)
|
108
|
+
expect(subject.components.length).to eq(2)
|
109
|
+
|
110
|
+
expect(subject).to have_many(:comments, JIRA::Resource::Comment)
|
111
|
+
expect(subject.comments.length).to eq(2)
|
112
|
+
|
113
|
+
expect(subject).to have_many(:attachments, JIRA::Resource::Attachment)
|
114
|
+
expect(subject.attachments.length).to eq(2)
|
115
|
+
|
116
|
+
expect(subject).to have_many(:versions, JIRA::Resource::Version)
|
117
|
+
expect(subject.attachments.length).to eq(2)
|
118
|
+
|
119
|
+
expect(subject).to have_many(:worklogs, JIRA::Resource::Worklog)
|
120
|
+
expect(subject.worklogs.length).to eq(2)
|
121
|
+
end
|
122
|
+
end
|
123
|
+
end
|
@@ -0,0 +1,13 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe JIRA::Resource::ProjectFactory do
|
4
|
+
|
5
|
+
let(:client) { double() }
|
6
|
+
subject { JIRA::Resource::ProjectFactory.new(client) }
|
7
|
+
|
8
|
+
it "initializes correctly" do
|
9
|
+
expect(subject.class).to eq(JIRA::Resource::ProjectFactory)
|
10
|
+
expect(subject.client).to eq(client)
|
11
|
+
end
|
12
|
+
|
13
|
+
end
|
@@ -0,0 +1,70 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe JIRA::Resource::Project do
|
4
|
+
|
5
|
+
let(:client) { double("client", :options => {
|
6
|
+
:rest_base_path => '/jira/rest/api/2'
|
7
|
+
})
|
8
|
+
}
|
9
|
+
|
10
|
+
describe "relationships" do
|
11
|
+
subject {
|
12
|
+
JIRA::Resource::Project.new(client, :attrs => {
|
13
|
+
'lead' => {'foo' => 'bar'},
|
14
|
+
'issueTypes' => [{'foo' =>'bar'},{'baz' => 'flum'}],
|
15
|
+
'versions' => [{'foo' =>'bar'},{'baz' => 'flum'}],
|
16
|
+
})
|
17
|
+
}
|
18
|
+
|
19
|
+
it "has the correct relationships" do
|
20
|
+
expect(subject).to have_one(:lead, JIRA::Resource::User)
|
21
|
+
expect(subject.lead.foo).to eq('bar')
|
22
|
+
|
23
|
+
expect(subject).to have_many(:issuetypes, JIRA::Resource::Issuetype)
|
24
|
+
expect(subject.issuetypes.length).to eq(2)
|
25
|
+
|
26
|
+
expect(subject).to have_many(:versions, JIRA::Resource::Version)
|
27
|
+
expect(subject.versions.length).to eq(2)
|
28
|
+
end
|
29
|
+
end
|
30
|
+
|
31
|
+
describe "issues" do
|
32
|
+
subject {
|
33
|
+
JIRA::Resource::Project.new(client, :attrs => {
|
34
|
+
'key' => 'test'
|
35
|
+
})
|
36
|
+
}
|
37
|
+
|
38
|
+
it "returns issues" do
|
39
|
+
response_body = '{"expand":"schema,names","startAt":0,"maxResults":1,"total":1,"issues":[{"expand":"editmeta,renderedFields,transitions,changelog,operations","id":"53062","self":"/rest/api/2/issue/53062","key":"test key","fields":{"summary":"test summary"}}]}'
|
40
|
+
response = double("response",
|
41
|
+
:body => response_body)
|
42
|
+
issue_factory = double("issue factory")
|
43
|
+
|
44
|
+
expect(client).to receive(:get)
|
45
|
+
.with('/jira/rest/api/2/search?jql=project%3D%22test%22')
|
46
|
+
.and_return(response)
|
47
|
+
expect(client).to receive(:Issue).and_return(issue_factory)
|
48
|
+
expect(issue_factory).to receive(:build)
|
49
|
+
.with(JSON.parse(response_body)["issues"][0])
|
50
|
+
subject.issues
|
51
|
+
end
|
52
|
+
|
53
|
+
context "with changelog" do
|
54
|
+
it "returns issues" do
|
55
|
+
response_body = '{"expand":"schema,names","startAt":0,"maxResults":1,"total":1,"issues":[{"expand":"editmeta,renderedFields,transitions,changelog,operations","id":"53062","self":"/rest/api/2/issue/53062","key":"test key","fields":{"summary":"test summary"},"changelog":{}}]}'
|
56
|
+
response = double("response",
|
57
|
+
:body => response_body)
|
58
|
+
issue_factory = double("issue factory")
|
59
|
+
|
60
|
+
expect(client).to receive(:get)
|
61
|
+
.with('/jira/rest/api/2/search?jql=project%3D%22test%22&expand=changelog&startAt=1&maxResults=100')
|
62
|
+
.and_return(response)
|
63
|
+
expect(client).to receive(:Issue).and_return(issue_factory)
|
64
|
+
expect(issue_factory).to receive(:build)
|
65
|
+
.with(JSON.parse(response_body)["issues"][0])
|
66
|
+
subject.issues({expand:'changelog', startAt:1, maxResults:100})
|
67
|
+
end
|
68
|
+
end
|
69
|
+
end
|
70
|
+
end
|
@@ -0,0 +1,24 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe JIRA::Resource::Worklog do
|
4
|
+
|
5
|
+
let(:client) { double() }
|
6
|
+
|
7
|
+
describe "relationships" do
|
8
|
+
subject {
|
9
|
+
JIRA::Resource::Worklog.new(client, :issue_id => '99999', :attrs => {
|
10
|
+
'author' => {'foo' => 'bar'},
|
11
|
+
'updateAuthor' => {'foo' => 'bar'}
|
12
|
+
})
|
13
|
+
}
|
14
|
+
|
15
|
+
it "has the correct relationships" do
|
16
|
+
expect(subject).to have_one(:author, JIRA::Resource::User)
|
17
|
+
expect(subject.author.foo).to eq('bar')
|
18
|
+
|
19
|
+
expect(subject).to have_one(:update_author, JIRA::Resource::User)
|
20
|
+
expect(subject.update_author.foo).to eq('bar')
|
21
|
+
end
|
22
|
+
end
|
23
|
+
|
24
|
+
end
|
@@ -0,0 +1,20 @@
|
|
1
|
+
{
|
2
|
+
"self": "http://localhost:2990/jira/rest/api/2/attachment/10000",
|
3
|
+
"filename": "ballmer.png",
|
4
|
+
"author": {
|
5
|
+
"self": "http://localhost:2990/jira/rest/api/2/user?username=admin",
|
6
|
+
"name": "admin",
|
7
|
+
"avatarUrls": {
|
8
|
+
"16x16": "http://localhost:2990/jira/secure/useravatar?size=small&avatarId=10122",
|
9
|
+
"48x48": "http://localhost:2990/jira/secure/useravatar?avatarId=10122"
|
10
|
+
},
|
11
|
+
"displayName": "admin",
|
12
|
+
"active": true
|
13
|
+
},
|
14
|
+
"created": "2012-01-11T10:54:50.875+1300",
|
15
|
+
"size": 15360,
|
16
|
+
"mimeType": "image/png",
|
17
|
+
"properties": {},
|
18
|
+
"content": "http://localhost:2990/jira/secure/attachment/10000/ballmer.png",
|
19
|
+
"thumbnail": "http://localhost:2990/jira/secure/thumbnail/10000/_thumb_10000.png"
|
20
|
+
}
|
@@ -0,0 +1,28 @@
|
|
1
|
+
{
|
2
|
+
"self": "http://localhost:2990/jira/rest/api/2/component/10001",
|
3
|
+
"id": "10001",
|
4
|
+
"name": "Test component",
|
5
|
+
"assigneeType": "PROJECT_DEFAULT",
|
6
|
+
"assignee": {
|
7
|
+
"self": "http://localhost:2990/jira/rest/api/2/user?username=admin",
|
8
|
+
"name": "admin",
|
9
|
+
"avatarUrls": {
|
10
|
+
"16x16": "http://localhost:2990/jira/secure/useravatar?size=small&avatarId=10122",
|
11
|
+
"48x48": "http://localhost:2990/jira/secure/useravatar?avatarId=10122"
|
12
|
+
},
|
13
|
+
"displayName": "admin",
|
14
|
+
"active": true
|
15
|
+
},
|
16
|
+
"realAssigneeType": "PROJECT_DEFAULT",
|
17
|
+
"realAssignee": {
|
18
|
+
"self": "http://localhost:2990/jira/rest/api/2/user?username=admin",
|
19
|
+
"name": "admin",
|
20
|
+
"avatarUrls": {
|
21
|
+
"16x16": "http://localhost:2990/jira/secure/useravatar?size=small&avatarId=10122",
|
22
|
+
"48x48": "http://localhost:2990/jira/secure/useravatar?avatarId=10122"
|
23
|
+
},
|
24
|
+
"displayName": "admin",
|
25
|
+
"active": true
|
26
|
+
},
|
27
|
+
"isAssigneeTypeValid": true
|
28
|
+
}
|
@@ -0,0 +1,39 @@
|
|
1
|
+
{
|
2
|
+
"self": "http://localhost:2990/jira/rest/api/2/component/10000",
|
3
|
+
"id": "10000",
|
4
|
+
"name": "Cheesecake",
|
5
|
+
"description": "Description!",
|
6
|
+
"lead": {
|
7
|
+
"self": "http://localhost:2990/jira/rest/api/2/user?username=admin",
|
8
|
+
"name": "admin",
|
9
|
+
"avatarUrls": {
|
10
|
+
"16x16": "http://localhost:2990/jira/secure/useravatar?size=small&avatarId=10122",
|
11
|
+
"48x48": "http://localhost:2990/jira/secure/useravatar?avatarId=10122"
|
12
|
+
},
|
13
|
+
"displayName": "admin",
|
14
|
+
"active": true
|
15
|
+
},
|
16
|
+
"assigneeType": "PROJECT_DEFAULT",
|
17
|
+
"assignee": {
|
18
|
+
"self": "http://localhost:2990/jira/rest/api/2/user?username=admin",
|
19
|
+
"name": "admin",
|
20
|
+
"avatarUrls": {
|
21
|
+
"16x16": "http://localhost:2990/jira/secure/useravatar?size=small&avatarId=10122",
|
22
|
+
"48x48": "http://localhost:2990/jira/secure/useravatar?avatarId=10122"
|
23
|
+
},
|
24
|
+
"displayName": "admin",
|
25
|
+
"active": true
|
26
|
+
},
|
27
|
+
"realAssigneeType": "PROJECT_DEFAULT",
|
28
|
+
"realAssignee": {
|
29
|
+
"self": "http://localhost:2990/jira/rest/api/2/user?username=admin",
|
30
|
+
"name": "admin",
|
31
|
+
"avatarUrls": {
|
32
|
+
"16x16": "http://localhost:2990/jira/secure/useravatar?size=small&avatarId=10122",
|
33
|
+
"48x48": "http://localhost:2990/jira/secure/useravatar?avatarId=10122"
|
34
|
+
},
|
35
|
+
"displayName": "admin",
|
36
|
+
"active": true
|
37
|
+
},
|
38
|
+
"isAssigneeTypeValid": true
|
39
|
+
}
|