|
23 | 23 | must_stub_query_params
|
24 | 24 |
|
25 | 25 | before do
|
26 |
| - proxy.stub('https://api.github.com:443/repos/jtarchie/test/pulls?base=my-base-branch&direction=desc&per_page=100&sort=updated&state=open') |
| 26 | + proxy.stub('https://api.github.com:443/repos/jtarchie/test/pulls?base=my-base-branch&direction=asc&per_page=100&sort=updated&state=open') |
27 | 27 | .and_return(json: [{ number: 1, head: { sha: 'abcdef' } }])
|
28 | 28 | end
|
29 | 29 |
|
|
56 | 56 | must_stub_query_params
|
57 | 57 |
|
58 | 58 | before do
|
59 |
| - proxy.stub('https://api.github.com:443/repos/jtarchie/test/pulls?direction=desc&per_page=100&sort=updated&state=open') |
| 59 | + proxy.stub('https://api.github.com:443/repos/jtarchie/test/pulls?direction=asc&per_page=100&sort=updated&state=open') |
60 | 60 | .and_return(json: [{ number: 1, head: { sha: 'abcdef' } }])
|
61 | 61 | end
|
62 | 62 |
|
|
76 | 76 | end
|
77 | 77 |
|
78 | 78 | context 'when there is more than one open pull request' do
|
| 79 | + must_stub_query_params |
| 80 | + |
79 | 81 | before do
|
80 |
| - proxy.stub('https://api.github.com:443/repos/jtarchie/test/pulls') |
81 |
| - .and_return(json: [ |
82 |
| - { number: 2, head: { sha: 'zyxwvu' } }, |
83 |
| - { number: 1, head: { sha: 'abcdef' } } |
84 |
| - ]) |
| 82 | + proxy.stub('https://api.github.com:443/repos/jtarchie/test/pulls?direction=asc&per_page=100&sort=updated&state=open') |
| 83 | + .and_return(json: [ |
| 84 | + { number: 1, head: { sha: 'abcdef' } }, |
| 85 | + { number: 2, head: { sha: 'zyxwvu' } } |
| 86 | + ]) |
85 | 87 | end
|
86 | 88 |
|
87 |
| - it 'returns all the pull request SHAs' do |
| 89 | + it 'returns all PRs oldest to newest last' do |
88 | 90 | expect(check(source: { repo: 'jtarchie/test', every: true }, version: {})).to eq [
|
89 |
| - { 'ref' => 'zyxwvu', 'pr' => '2' }, |
90 |
| - { 'ref' => 'abcdef', 'pr' => '1' } |
| 91 | + { 'ref' => 'abcdef', 'pr' => '1' }, |
| 92 | + { 'ref' => 'zyxwvu', 'pr' => '2' } |
91 | 93 | ]
|
92 | 94 | end
|
93 | 95 | end
|
|
0 commit comments