|
5 | 5 | context 'without enough items to give more than one page' do |
6 | 6 | it 'should not paginate' do |
7 | 7 | get :index, count: 20 |
8 | | - response.headers.keys.should_not include('Link') |
| 8 | + expect(response.headers.keys).not_to include('Link') |
9 | 9 | end |
10 | 10 | end |
11 | 11 |
|
|
16 | 16 | end |
17 | 17 |
|
18 | 18 | it 'should keep existing Links' do |
19 | | - @links.should include('<http://test.host/numbers?count=30>; rel="without"') |
| 19 | + expect(@links).to include('<http://test.host/numbers?count=30>; rel="without"') |
20 | 20 | end |
21 | 21 |
|
22 | 22 | it 'should contain pagination Links' do |
23 | | - @links.should include('<http://test.host/numbers?count=30&page=2>; rel="next"') |
24 | | - @links.should include('<http://test.host/numbers?count=30&page=2>; rel="last"') |
| 23 | + expect(@links).to include('<http://test.host/numbers?count=30&page=2>; rel="next"') |
| 24 | + expect(@links).to include('<http://test.host/numbers?count=30&page=2>; rel="last"') |
25 | 25 | end |
26 | 26 | end |
27 | 27 |
|
|
34 | 34 | end |
35 | 35 |
|
36 | 36 | it 'should not give a link with rel "first"' do |
37 | | - @links.should_not include('rel="first"') |
| 37 | + expect(@links).not_to include('rel="first"') |
38 | 38 | end |
39 | 39 |
|
40 | 40 | it 'should not give a link with rel "prev"' do |
41 | | - @links.should_not include('rel="prev"') |
| 41 | + expect(@links).not_to include('rel="prev"') |
42 | 42 | end |
43 | 43 |
|
44 | 44 | it 'should give a link with rel "last"' do |
45 | | - @links.should include('<http://test.host/numbers?count=100&page=4>; rel="last"') |
| 45 | + expect(@links).to include('<http://test.host/numbers?count=100&page=4>; rel="last"') |
46 | 46 | end |
47 | 47 |
|
48 | 48 | it 'should give a link with rel "next"' do |
49 | | - @links.should include('<http://test.host/numbers?count=100&page=2>; rel="next"') |
| 49 | + expect(@links).to include('<http://test.host/numbers?count=100&page=2>; rel="next"') |
50 | 50 | end |
51 | 51 | end |
52 | 52 |
|
|
58 | 58 | end |
59 | 59 |
|
60 | 60 | it 'should not give a link with rel "last"' do |
61 | | - @links.should_not include('rel="last"') |
| 61 | + expect(@links).not_to include('rel="last"') |
62 | 62 | end |
63 | 63 |
|
64 | 64 | it 'should not give a link with rel "next"' do |
65 | | - @links.should_not include('rel="next"') |
| 65 | + expect(@links).not_to include('rel="next"') |
66 | 66 | end |
67 | 67 |
|
68 | 68 | it 'should give a link with rel "first"' do |
69 | | - @links.should include('<http://test.host/numbers?count=100&page=1>; rel="first"') |
| 69 | + expect(@links).to include('<http://test.host/numbers?count=100&page=1>; rel="first"') |
70 | 70 | end |
71 | 71 |
|
72 | 72 | it 'should give a link with rel "prev"' do |
73 | | - @links.should include('<http://test.host/numbers?count=100&page=3>; rel="prev"') |
| 73 | + expect(@links).to include('<http://test.host/numbers?count=100&page=3>; rel="prev"') |
74 | 74 | end |
75 | 75 | end |
76 | 76 |
|
|
80 | 80 |
|
81 | 81 | links = response.headers['Link'].split(', ') |
82 | 82 |
|
83 | | - links.should include('<http://test.host/numbers?count=100&page=1>; rel="first"') |
84 | | - links.should include('<http://test.host/numbers?count=100&page=4>; rel="last"') |
85 | | - links.should include('<http://test.host/numbers?count=100&page=3>; rel="next"') |
86 | | - links.should include('<http://test.host/numbers?count=100&page=1>; rel="prev"') |
| 83 | + expect(links).to include('<http://test.host/numbers?count=100&page=1>; rel="first"') |
| 84 | + expect(links).to include('<http://test.host/numbers?count=100&page=4>; rel="last"') |
| 85 | + expect(links).to include('<http://test.host/numbers?count=100&page=3>; rel="next"') |
| 86 | + expect(links).to include('<http://test.host/numbers?count=100&page=1>; rel="prev"') |
87 | 87 | end |
88 | 88 | end |
89 | 89 | end |
|
0 commit comments