jira-ruby 1.5.0 → 1.6.0

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 (88) hide show
  1. checksums.yaml +5 -5
  2. data/Gemfile +7 -1
  3. data/Guardfile +1 -1
  4. data/Rakefile +4 -5
  5. data/http-basic-example.rb +13 -12
  6. data/jira-ruby.gemspec +9 -10
  7. data/lib/jira-ruby.rb +5 -2
  8. data/lib/jira/base.rb +49 -48
  9. data/lib/jira/base_factory.rb +1 -4
  10. data/lib/jira/client.rb +29 -20
  11. data/lib/jira/has_many_proxy.rb +0 -1
  12. data/lib/jira/http_client.rb +9 -10
  13. data/lib/jira/http_error.rb +3 -5
  14. data/lib/jira/oauth_client.rb +19 -20
  15. data/lib/jira/request_client.rb +3 -4
  16. data/lib/jira/resource/agile.rb +10 -8
  17. data/lib/jira/resource/applinks.rb +5 -8
  18. data/lib/jira/resource/attachment.rb +1 -2
  19. data/lib/jira/resource/board.rb +84 -0
  20. data/lib/jira/resource/comment.rb +0 -2
  21. data/lib/jira/resource/component.rb +1 -3
  22. data/lib/jira/resource/createmeta.rb +12 -14
  23. data/lib/jira/resource/field.rb +22 -22
  24. data/lib/jira/resource/filter.rb +2 -2
  25. data/lib/jira/resource/issue.rb +41 -39
  26. data/lib/jira/resource/issuelink.rb +3 -5
  27. data/lib/jira/resource/issuelinktype.rb +0 -1
  28. data/lib/jira/resource/issuetype.rb +1 -3
  29. data/lib/jira/resource/priority.rb +1 -3
  30. data/lib/jira/resource/project.rb +5 -7
  31. data/lib/jira/resource/rapidview.rb +28 -7
  32. data/lib/jira/resource/remotelink.rb +1 -4
  33. data/lib/jira/resource/resolution.rb +2 -4
  34. data/lib/jira/resource/serverinfo.rb +1 -2
  35. data/lib/jira/resource/sprint.rb +82 -18
  36. data/lib/jira/resource/sprint_report.rb +8 -0
  37. data/lib/jira/resource/status.rb +1 -3
  38. data/lib/jira/resource/transition.rb +2 -6
  39. data/lib/jira/resource/user.rb +12 -2
  40. data/lib/jira/resource/version.rb +1 -3
  41. data/lib/jira/resource/watcher.rb +1 -5
  42. data/lib/jira/resource/webhook.rb +3 -6
  43. data/lib/jira/resource/worklog.rb +3 -5
  44. data/lib/jira/version.rb +1 -1
  45. data/lib/tasks/generate.rake +4 -4
  46. data/spec/integration/attachment_spec.rb +15 -16
  47. data/spec/integration/comment_spec.rb +31 -34
  48. data/spec/integration/component_spec.rb +21 -24
  49. data/spec/integration/field_spec.rb +15 -18
  50. data/spec/integration/issue_spec.rb +44 -48
  51. data/spec/integration/issuelinktype_spec.rb +8 -11
  52. data/spec/integration/issuetype_spec.rb +5 -7
  53. data/spec/integration/priority_spec.rb +5 -8
  54. data/spec/integration/project_spec.rb +13 -20
  55. data/spec/integration/rapidview_spec.rb +17 -10
  56. data/spec/integration/resolution_spec.rb +7 -10
  57. data/spec/integration/status_spec.rb +5 -8
  58. data/spec/integration/transition_spec.rb +17 -20
  59. data/spec/integration/user_spec.rb +24 -8
  60. data/spec/integration/version_spec.rb +21 -25
  61. data/spec/integration/watcher_spec.rb +28 -34
  62. data/spec/integration/webhook.rb +8 -17
  63. data/spec/integration/worklog_spec.rb +30 -34
  64. data/spec/jira/base_factory_spec.rb +11 -12
  65. data/spec/jira/base_spec.rb +204 -228
  66. data/spec/jira/client_spec.rb +26 -28
  67. data/spec/jira/has_many_proxy_spec.rb +11 -12
  68. data/spec/jira/http_client_spec.rb +51 -52
  69. data/spec/jira/http_error_spec.rb +7 -9
  70. data/spec/jira/oauth_client_spec.rb +44 -46
  71. data/spec/jira/request_client_spec.rb +5 -5
  72. data/spec/jira/resource/agile_spec.rb +5 -7
  73. data/spec/jira/resource/attachment_spec.rb +25 -26
  74. data/spec/jira/resource/board_spec.rb +175 -0
  75. data/spec/jira/resource/createmeta_spec.rb +29 -32
  76. data/spec/jira/resource/field_spec.rb +42 -48
  77. data/spec/jira/resource/filter_spec.rb +40 -40
  78. data/spec/jira/resource/issue_spec.rb +87 -89
  79. data/spec/jira/resource/issuelink_spec.rb +1 -1
  80. data/spec/jira/resource/project_factory_spec.rb +2 -4
  81. data/spec/jira/resource/project_spec.rb +33 -33
  82. data/spec/jira/resource/sprint_spec.rb +78 -0
  83. data/spec/jira/resource/user_factory_spec.rb +6 -8
  84. data/spec/jira/resource/worklog_spec.rb +9 -11
  85. data/spec/spec_helper.rb +8 -9
  86. data/spec/support/clients_helper.rb +4 -4
  87. data/spec/support/shared_examples/integration.rb +60 -77
  88. metadata +59 -53
@@ -1,42 +1,39 @@
1
1
  require 'spec_helper'
2
2
 
3
3
  describe JIRA::Resource::Component do
4
-
5
-
6
4
  with_each_client do |site_url, client|
7
5
  let(:client) { client }
8
6
  let(:site_url) { site_url }
9
7
 
10
- let(:key) { "10000" }
8
+ let(:key) { '10000' }
11
9
 
12
10
  let(:expected_attributes) do
13
11
  {
14
- 'self' => "http://localhost:2990/jira/rest/api/2/component/10000",
12
+ 'self' => 'http://localhost:2990/jira/rest/api/2/component/10000',
15
13
  'id' => key,
16
- 'name' => "Cheesecake"
14
+ 'name' => 'Cheesecake'
17
15
  }
18
16
  end
19
17
 
20
- let(:attributes_for_post) {
21
- {"name" => "Test component", "project" => "SAMPLEPROJECT" }
22
- }
23
- let(:expected_attributes_from_post) {
24
- { "id" => "10001", "name" => "Test component" }
25
- }
26
-
27
- let(:attributes_for_put) {
28
- {"name" => "Jammy", "project" => "SAMPLEPROJECT" }
29
- }
30
- let(:expected_attributes_from_put) {
31
- { "id" => "10000", "name" => "Jammy" }
32
- }
18
+ let(:attributes_for_post) do
19
+ { 'name' => 'Test component', 'project' => 'SAMPLEPROJECT' }
20
+ end
21
+ let(:expected_attributes_from_post) do
22
+ { 'id' => '10001', 'name' => 'Test component' }
23
+ end
33
24
 
34
- it_should_behave_like "a resource"
35
- it_should_behave_like "a resource with a singular GET endpoint"
36
- it_should_behave_like "a resource with a DELETE endpoint"
37
- it_should_behave_like "a resource with a POST endpoint"
38
- it_should_behave_like "a resource with a PUT endpoint"
39
- it_should_behave_like "a resource with a PUT endpoint that rejects invalid fields"
25
+ let(:attributes_for_put) do
26
+ { 'name' => 'Jammy', 'project' => 'SAMPLEPROJECT' }
27
+ end
28
+ let(:expected_attributes_from_put) do
29
+ { 'id' => '10000', 'name' => 'Jammy' }
30
+ end
40
31
 
32
+ it_should_behave_like 'a resource'
33
+ it_should_behave_like 'a resource with a singular GET endpoint'
34
+ it_should_behave_like 'a resource with a DELETE endpoint'
35
+ it_should_behave_like 'a resource with a POST endpoint'
36
+ it_should_behave_like 'a resource with a PUT endpoint'
37
+ it_should_behave_like 'a resource with a PUT endpoint that rejects invalid fields'
41
38
  end
42
39
  end
@@ -1,35 +1,32 @@
1
1
  require 'spec_helper'
2
2
 
3
3
  describe JIRA::Resource::Field do
4
-
5
4
  with_each_client do |site_url, client|
6
5
  let(:client) { client }
7
6
  let(:site_url) { site_url }
8
7
 
9
-
10
- let(:key) { "1" }
8
+ let(:key) { '1' }
11
9
 
12
10
  let(:expected_attributes) do
13
11
  {
14
- "id"=>key,
15
- "name"=>"Description",
16
- "custom"=>false,
17
- "orderable"=>true,
18
- "navigable"=>true,
19
- "searchable"=>true,
20
- "clauseNames"=>["description"],
21
- "schema"=> {
22
- "type"=>"string",
23
- "system"=>"description"
24
- }
12
+ 'id' => key,
13
+ 'name' => 'Description',
14
+ 'custom' => false,
15
+ 'orderable' => true,
16
+ 'navigable' => true,
17
+ 'searchable' => true,
18
+ 'clauseNames' => ['description'],
19
+ 'schema' => {
20
+ 'type' => 'string',
21
+ 'system' => 'description'
22
+ }
25
23
  }
26
24
  end
27
25
 
28
26
  let(:expected_collection_length) { 2 }
29
27
 
30
- it_should_behave_like "a resource"
31
- it_should_behave_like "a resource with a collection GET endpoint"
32
- it_should_behave_like "a resource with a singular GET endpoint"
33
-
28
+ it_should_behave_like 'a resource'
29
+ it_should_behave_like 'a resource with a collection GET endpoint'
30
+ it_should_behave_like 'a resource with a singular GET endpoint'
34
31
  end
35
32
  end
@@ -1,97 +1,93 @@
1
1
  require 'spec_helper'
2
2
 
3
3
  describe JIRA::Resource::Issue do
4
-
5
4
  with_each_client do |site_url, client|
6
5
  let(:client) { client }
7
6
  let(:site_url) { site_url }
8
7
 
9
-
10
- let(:key) { "10002" }
8
+ let(:key) { '10002' }
11
9
 
12
10
  let(:expected_attributes) do
13
11
  {
14
- 'self' => "http://localhost:2990/jira/rest/api/2/issue/10002",
15
- 'key' => "SAMPLEPROJECT-1",
16
- 'expand' => "renderedFields,names,schema,transitions,editmeta,changelog"
12
+ 'self' => 'http://localhost:2990/jira/rest/api/2/issue/10002',
13
+ 'key' => 'SAMPLEPROJECT-1',
14
+ 'expand' => 'renderedFields,names,schema,transitions,editmeta,changelog'
17
15
  }
18
16
  end
19
17
 
20
- let(:attributes_for_post) {
18
+ let(:attributes_for_post) do
21
19
  { 'foo' => 'bar' }
22
- }
23
- let(:expected_attributes_from_post) {
24
- { "id" => "10005", "key" => "SAMPLEPROJECT-4" }
25
- }
20
+ end
21
+ let(:expected_attributes_from_post) do
22
+ { 'id' => '10005', 'key' => 'SAMPLEPROJECT-4' }
23
+ end
26
24
 
27
- let(:attributes_for_put) {
25
+ let(:attributes_for_put) do
28
26
  { 'foo' => 'bar' }
29
- }
30
- let(:expected_attributes_from_put) {
27
+ end
28
+ let(:expected_attributes_from_put) do
31
29
  { 'foo' => 'bar' }
32
- }
30
+ end
33
31
  let(:expected_collection_length) { 11 }
34
32
 
35
- it_should_behave_like "a resource"
36
- it_should_behave_like "a resource with a singular GET endpoint"
37
- describe "GET all issues" do # JIRA::Resource::Issue.all uses the search endpoint
33
+ it_should_behave_like 'a resource'
34
+ it_should_behave_like 'a resource with a singular GET endpoint'
35
+ describe 'GET all issues' do # JIRA::Resource::Issue.all uses the search endpoint
38
36
  let(:client) { client }
39
37
  let(:site_url) { site_url }
40
38
 
41
- let(:expected_attributes) {
39
+ let(:expected_attributes) do
42
40
  {
43
- "id"=>"10014",
44
- "self"=>"http://localhost:2990/jira/rest/api/2/issue/10014",
45
- "key"=>"SAMPLEPROJECT-13"
41
+ 'id' => '10014',
42
+ 'self' => 'http://localhost:2990/jira/rest/api/2/issue/10014',
43
+ 'key' => 'SAMPLEPROJECT-13'
46
44
  }
47
- }
45
+ end
48
46
  before(:each) do
49
- stub_request(:get, site_url + "/jira/rest/api/2/search?expand=transitions.fields&maxResults=1000&startAt=0").
50
- to_return(:status => 200, :body => get_mock_response('issue.json'))
47
+ stub_request(:get, site_url + '/jira/rest/api/2/search?expand=transitions.fields&maxResults=1000&startAt=0')
48
+ .to_return(status: 200, body: get_mock_response('issue.json'))
51
49
 
52
- stub_request(:get, site_url + "/jira/rest/api/2/search?expand=transitions.fields&maxResults=1000&startAt=11").
53
- to_return(:status => 200, :body => get_mock_response('empty_issues.json'))
50
+ stub_request(:get, site_url + '/jira/rest/api/2/search?expand=transitions.fields&maxResults=1000&startAt=11')
51
+ .to_return(status: 200, body: get_mock_response('empty_issues.json'))
54
52
  end
55
- it_should_behave_like "a resource with a collection GET endpoint"
53
+ it_should_behave_like 'a resource with a collection GET endpoint'
56
54
  end
57
- it_should_behave_like "a resource with a DELETE endpoint"
58
- it_should_behave_like "a resource with a POST endpoint"
59
- it_should_behave_like "a resource with a PUT endpoint"
60
- it_should_behave_like "a resource with a PUT endpoint that rejects invalid fields"
55
+ it_should_behave_like 'a resource with a DELETE endpoint'
56
+ it_should_behave_like 'a resource with a POST endpoint'
57
+ it_should_behave_like 'a resource with a PUT endpoint'
58
+ it_should_behave_like 'a resource with a PUT endpoint that rejects invalid fields'
61
59
 
62
- describe "errors" do
60
+ describe 'errors' do
63
61
  before(:each) do
64
62
  stub_request(:get,
65
- site_url + "/jira/rest/api/2/issue/10002").
66
- to_return(:status => 200, :body => get_mock_response('issue/10002.json'))
67
- stub_request(:put, site_url + "/jira/rest/api/2/issue/10002").
68
- with(:body => '{"missing":"fields and update"}').
69
- to_return(:status => 400, :body => get_mock_response('issue/10002.put.missing_field_update.json'))
63
+ site_url + '/jira/rest/api/2/issue/10002')
64
+ .to_return(status: 200, body: get_mock_response('issue/10002.json'))
65
+ stub_request(:put, site_url + '/jira/rest/api/2/issue/10002')
66
+ .with(body: '{"missing":"fields and update"}')
67
+ .to_return(status: 400, body: get_mock_response('issue/10002.put.missing_field_update.json'))
70
68
  end
71
69
 
72
- it "fails to save when fields and update are missing" do
70
+ it 'fails to save when fields and update are missing' do
73
71
  subject = client.Issue.build('id' => '10002')
74
72
  subject.fetch
75
73
  expect(subject.save('missing' => 'fields and update')).to be_falsey
76
74
  end
77
-
78
75
  end
79
76
 
80
- describe "GET jql issues" do # JIRA::Resource::Issue.jql uses the search endpoint
77
+ describe 'GET jql issues' do # JIRA::Resource::Issue.jql uses the search endpoint
81
78
  jql_query_string = "PROJECT = 'SAMPLEPROJECT'"
82
79
  let(:client) { client }
83
80
  let(:site_url) { site_url }
84
81
  let(:jql_query_string) { jql_query_string }
85
82
 
86
- let(:expected_attributes) {
83
+ let(:expected_attributes) do
87
84
  {
88
- "id"=>"10014",
89
- "self"=>"http://localhost:2990/jira/rest/api/2/issue/10014",
90
- "key"=>"SAMPLEPROJECT-13"
85
+ 'id' => '10014',
86
+ 'self' => 'http://localhost:2990/jira/rest/api/2/issue/10014',
87
+ 'key' => 'SAMPLEPROJECT-13'
91
88
  }
92
- }
93
- it_should_behave_like "a resource with JQL inputs and a collection GET endpoint"
89
+ end
90
+ it_should_behave_like 'a resource with JQL inputs and a collection GET endpoint'
94
91
  end
95
-
96
92
  end
97
93
  end
@@ -1,29 +1,26 @@
1
1
  require 'spec_helper'
2
2
 
3
3
  describe JIRA::Resource::Issuelinktype do
4
-
5
4
  with_each_client do |site_url, client|
6
5
  let(:client) { client }
7
6
  let(:site_url) { site_url }
8
7
 
9
-
10
- let(:key) { "10000" }
8
+ let(:key) { '10000' }
11
9
 
12
10
  let(:expected_attributes) do
13
11
  {
14
12
  'id' => key,
15
- "self"=>"http://localhost:2990/jira/rest/api/2/issueLinkType/10000",
16
- "name"=>"Blocks",
17
- "inward"=>"is blocked by",
18
- "outward"=>"blocks"
13
+ 'self' => 'http://localhost:2990/jira/rest/api/2/issueLinkType/10000',
14
+ 'name' => 'Blocks',
15
+ 'inward' => 'is blocked by',
16
+ 'outward' => 'blocks'
19
17
  }
20
18
  end
21
19
 
22
20
  let(:expected_collection_length) { 3 }
23
21
 
24
- it_should_behave_like "a resource"
25
- it_should_behave_like "a resource with a collection GET endpoint"
26
- it_should_behave_like "a resource with a singular GET endpoint"
27
-
22
+ it_should_behave_like 'a resource'
23
+ it_should_behave_like 'a resource with a collection GET endpoint'
24
+ it_should_behave_like 'a resource with a singular GET endpoint'
28
25
  end
29
26
  end
@@ -1,16 +1,15 @@
1
1
  require 'spec_helper'
2
2
 
3
3
  describe JIRA::Resource::Issuetype do
4
-
5
4
  with_each_client do |site_url, client|
6
5
  let(:client) { client }
7
6
  let(:site_url) { site_url }
8
7
 
9
- let(:key) { "5" }
8
+ let(:key) { '5' }
10
9
 
11
10
  let(:expected_attributes) do
12
11
  {
13
- 'self' => "http://localhost:2990/jira/rest/api/2/issuetype/5",
12
+ 'self' => 'http://localhost:2990/jira/rest/api/2/issuetype/5',
14
13
  'id' => key,
15
14
  'name' => 'Sub-task'
16
15
  }
@@ -18,9 +17,8 @@ describe JIRA::Resource::Issuetype do
18
17
 
19
18
  let(:expected_collection_length) { 5 }
20
19
 
21
- it_should_behave_like "a resource"
22
- it_should_behave_like "a resource with a collection GET endpoint"
23
- it_should_behave_like "a resource with a singular GET endpoint"
24
-
20
+ it_should_behave_like 'a resource'
21
+ it_should_behave_like 'a resource with a collection GET endpoint'
22
+ it_should_behave_like 'a resource with a singular GET endpoint'
25
23
  end
26
24
  end
@@ -1,17 +1,15 @@
1
1
  require 'spec_helper'
2
2
 
3
3
  describe JIRA::Resource::Priority do
4
-
5
4
  with_each_client do |site_url, client|
6
5
  let(:client) { client }
7
6
  let(:site_url) { site_url }
8
7
 
9
-
10
- let(:key) { "1" }
8
+ let(:key) { '1' }
11
9
 
12
10
  let(:expected_attributes) do
13
11
  {
14
- 'self' => "http://localhost:2990/jira/rest/api/2/priority/1",
12
+ 'self' => 'http://localhost:2990/jira/rest/api/2/priority/1',
15
13
  'id' => key,
16
14
  'name' => 'Blocker'
17
15
  }
@@ -19,9 +17,8 @@ describe JIRA::Resource::Priority do
19
17
 
20
18
  let(:expected_collection_length) { 5 }
21
19
 
22
- it_should_behave_like "a resource"
23
- it_should_behave_like "a resource with a collection GET endpoint"
24
- it_should_behave_like "a resource with a singular GET endpoint"
25
-
20
+ it_should_behave_like 'a resource'
21
+ it_should_behave_like 'a resource with a collection GET endpoint'
22
+ it_should_behave_like 'a resource with a singular GET endpoint'
26
23
  end
27
24
  end
@@ -1,33 +1,30 @@
1
1
  require 'spec_helper'
2
2
 
3
3
  describe JIRA::Resource::Project do
4
-
5
4
  with_each_client do |site_url, client|
6
5
  let(:client) { client }
7
6
  let(:site_url) { site_url }
8
7
 
9
-
10
- let(:key) { "SAMPLEPROJECT" }
8
+ let(:key) { 'SAMPLEPROJECT' }
11
9
 
12
10
  let(:expected_attributes) do
13
11
  {
14
- 'self' => "http://localhost:2990/jira/rest/api/2/project/SAMPLEPROJECT",
12
+ 'self' => 'http://localhost:2990/jira/rest/api/2/project/SAMPLEPROJECT',
15
13
  'key' => key,
16
- 'name' => "Sample Project for Developing RoR RESTful API"
14
+ 'name' => 'Sample Project for Developing RoR RESTful API'
17
15
  }
18
16
  end
19
17
 
20
18
  let(:expected_collection_length) { 1 }
21
19
 
22
- it_should_behave_like "a resource"
23
- it_should_behave_like "a resource with a collection GET endpoint"
24
- it_should_behave_like "a resource with a singular GET endpoint"
20
+ it_should_behave_like 'a resource'
21
+ it_should_behave_like 'a resource with a collection GET endpoint'
22
+ it_should_behave_like 'a resource with a singular GET endpoint'
25
23
 
26
- describe "issues" do
27
-
28
- it "returns all the issues" do
29
- stub_request(:get, site_url + "/jira/rest/api/2/search?jql=project=\"SAMPLEPROJECT\"").
30
- to_return(:status => 200, :body => get_mock_response('project/SAMPLEPROJECT.issues.json'))
24
+ describe 'issues' do
25
+ it 'returns all the issues' do
26
+ stub_request(:get, site_url + '/jira/rest/api/2/search?jql=project="SAMPLEPROJECT"')
27
+ .to_return(status: 200, body: get_mock_response('project/SAMPLEPROJECT.issues.json'))
31
28
  subject = client.Project.build('key' => key)
32
29
  issues = subject.issues
33
30
  expect(issues.length).to eq(11)
@@ -35,22 +32,18 @@ describe JIRA::Resource::Project do
35
32
  expect(issue.class).to eq(JIRA::Resource::Issue)
36
33
  expect(issue.expanded?).to be_falsey
37
34
  end
38
-
39
35
  end
40
-
41
36
  end
42
37
 
43
- it "returns a collection of components" do
44
-
45
- stub_request(:get, site_url + described_class.singular_path(client, key)).
46
- to_return(:status => 200, :body => get_mock_response('project/SAMPLEPROJECT.json'))
38
+ it 'returns a collection of components' do
39
+ stub_request(:get, site_url + described_class.singular_path(client, key))
40
+ .to_return(status: 200, body: get_mock_response('project/SAMPLEPROJECT.json'))
47
41
 
48
42
  subject = client.Project.find(key)
49
43
  expect(subject.components.length).to eq(2)
50
44
  subject.components.each do |component|
51
45
  expect(component.class).to eq(JIRA::Resource::Component)
52
46
  end
53
-
54
47
  end
55
48
  end
56
49
  end
@@ -1,7 +1,6 @@
1
1
  require 'spec_helper'
2
2
 
3
3
  describe JIRA::Resource::RapidView do
4
-
5
4
  with_each_client do |site_url, client|
6
5
  let(:client) { client }
7
6
  let(:site_url) { site_url }
@@ -10,14 +9,14 @@ describe JIRA::Resource::RapidView do
10
9
 
11
10
  let(:expected_collection_length) { 1 }
12
11
 
13
- let(:expected_attributes) {
12
+ let(:expected_attributes) do
14
13
  {
15
14
  'id' => 1,
16
15
  'name' => 'SAMPLEPROJECT',
17
16
  'canEdit' => true,
18
17
  'sprintSupportEnabled' => true
19
18
  }
20
- }
19
+ end
21
20
 
22
21
  it_should_behave_like 'a resource'
23
22
  # TODO@Anton: Add json file
@@ -28,8 +27,8 @@ describe JIRA::Resource::RapidView do
28
27
  let(:site_url) { site_url }
29
28
 
30
29
  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'))
30
+ stub_request(:get, site_url + '/jira/rest/greenhopper/1.0/rapidview')
31
+ .to_return(status: 200, body: get_mock_response('rapidview.json'))
33
32
  end
34
33
  it_should_behave_like 'a resource with a collection GET endpoint'
35
34
  end
@@ -41,16 +40,24 @@ describe JIRA::Resource::RapidView do
41
40
  site_url +
42
41
  '/jira/rest/greenhopper/1.0/xboard/plan/backlog/data?rapidViewId=1'
43
42
  ).to_return(
44
- :status => 200,
45
- :body => get_mock_response('rapidview/SAMPLEPROJECT.issues.json')
43
+ status: 200,
44
+ body: get_mock_response('rapidview/SAMPLEPROJECT.issues.json')
45
+ )
46
+
47
+ stub_request(
48
+ :get,
49
+ site_url + '/jira/rest/api/2/search?jql=id IN(10001, 10000)'
50
+ ).to_return(
51
+ status: 200,
52
+ body: get_mock_response('rapidview/SAMPLEPROJECT.issues.full.json')
46
53
  )
47
54
 
48
55
  stub_request(
49
56
  :get,
50
- site_url + '/jira/rest/api/2/search?jql=id IN(10000, 10001)'
57
+ site_url + '/jira/rest/api/2/search?jql=id IN(10000, 10001) AND sprint IS NOT EMPTY'
51
58
  ).to_return(
52
- :status => 200,
53
- :body => get_mock_response('rapidview/SAMPLEPROJECT.issues.full.json')
59
+ status: 200,
60
+ body: get_mock_response('rapidview/SAMPLEPROJECT.issues.full.json')
54
61
  )
55
62
 
56
63
  subject = client.RapidView.build('id' => 1)