|
4 | 4 | let(:latest_year) { "2018" }
|
5 | 5 |
|
6 | 6 | describe "/" do
|
7 |
| - let(:res) { connection.get("http://rubykaigi.org/") } |
| 7 | + let(:res) { http_get("http://rubykaigi.org/") } |
8 | 8 | it "redirects to /?locale=en" do
|
9 |
| - expect(res.status).to eq(302) |
10 |
| - expect(res.headers["location"]).to eq("http://rubykaigi.org/#{latest_year}") |
| 9 | + expect(res.code).to eq("302") |
| 10 | + expect(res["location"]).to eq("http://rubykaigi.org/#{latest_year}") |
11 | 11 | end
|
12 | 12 | end
|
13 | 13 |
|
14 | 14 | describe "/?locale=en" do
|
15 |
| - let(:res) { connection.get("http://rubykaigi.org/?locale=en") } |
| 15 | + let(:res) { http_get("http://rubykaigi.org/?locale=en") } |
16 | 16 | it "redirects to the latest" do
|
17 |
| - expect(res.status).to eq(302) |
18 |
| - expect(res.headers["location"]).to eq("http://rubykaigi.org/#{latest_year}") |
| 17 | + expect(res.code).to eq("302") |
| 18 | + expect(res["location"]).to eq("http://rubykaigi.org/#{latest_year}") |
19 | 19 | end
|
20 | 20 | end
|
21 | 21 |
|
22 | 22 | describe "/?locale=ja" do
|
23 |
| - let(:res) { connection.get("http://rubykaigi.org/?locale=ja") } |
| 23 | + let(:res) { http_get("http://rubykaigi.org/?locale=ja") } |
24 | 24 | it "redirects to the latest" do
|
25 |
| - expect(res.status).to eq(302) |
26 |
| - expect(res.headers["location"]).to eq("http://rubykaigi.org/#{latest_year}") |
| 25 | + expect(res.code).to eq("302") |
| 26 | + expect(res["location"]).to eq("http://rubykaigi.org/#{latest_year}") |
27 | 27 | end
|
28 | 28 | end
|
29 | 29 |
|
30 | 30 | (2014..2017).each do |year|
|
31 | 31 | describe "/#{year}" do
|
32 |
| - let(:res) { connection.get("http://rubykaigi.org/#{year}") } |
| 32 | + let(:res) { http_get("http://rubykaigi.org/#{year}") } |
33 | 33 | it "should be available" do
|
34 |
| - expect(res.status).to eq(200) |
| 34 | + expect(res.code).to eq("200") |
35 | 35 | end
|
36 | 36 | end
|
37 | 37 | end
|
38 | 38 |
|
39 | 39 | describe "/2013" do
|
40 |
| - let(:res) { connection.get("http://rubykaigi.org/2013") } |
| 40 | + let(:res) { http_get("http://rubykaigi.org/2013") } |
41 | 41 | it "should render the top page" do
|
42 |
| - expect(res.status).to eq(200) |
| 42 | + expect(res.code).to eq("200") |
43 | 43 | expect(res.body).to include("<title>RubyKaigi 2013, May 30 - Jun 1</title>")
|
44 | 44 | end
|
45 | 45 | end
|
46 | 46 |
|
47 | 47 | describe "/2012" do
|
48 |
| - let(:res) { connection.get("http://rubykaigi.org/2012/") } |
| 48 | + let(:res) { http_get("http://rubykaigi.org/2012/") } |
49 | 49 | it "should render the special 200 (not 404) page" do
|
50 |
| - expect(res.status).to eq(200) |
| 50 | + expect(res.code).to eq("200") |
51 | 51 | expect(res.body).to include("<title>RubyKaigi 2012: 404 Kaigi Not Found</title>")
|
52 | 52 | end
|
53 | 53 | end
|
54 | 54 |
|
55 | 55 | describe "/2011" do
|
56 |
| - let(:res) { connection.get("http://rubykaigi.org/2011") } |
| 56 | + let(:res) { http_get("http://rubykaigi.org/2011") } |
57 | 57 | it "redirects to /2011/" do
|
58 |
| - expect(res.status).to eq(301) |
59 |
| - expect(res.headers["location"]).to eq("http://rubykaigi.org/2011/") |
| 58 | + expect(res.code).to eq("301") |
| 59 | + expect(res["location"]).to eq("http://rubykaigi.org/2011/") |
60 | 60 | end
|
61 | 61 | end
|
62 | 62 |
|
63 | 63 | describe "/2011/" do
|
64 |
| - let(:res) { connection.get("http://rubykaigi.org/2011/") } |
| 64 | + let(:res) { http_get("http://rubykaigi.org/2011/") } |
65 | 65 | it "should render the top page" do
|
66 |
| - expect(res.status).to eq(200) |
| 66 | + expect(res.code).to eq("200") |
67 | 67 | expect(res.body).to include("<title>RubyKaigi 2011(July 16 - 18)</title>")
|
68 | 68 | end
|
69 | 69 | end
|
70 | 70 |
|
71 | 71 | describe "/2010" do
|
72 |
| - let(:res) { connection.get("http://rubykaigi.org/2010") } |
| 72 | + let(:res) { http_get("http://rubykaigi.org/2010") } |
73 | 73 | it "redirects to /2010/" do
|
74 |
| - expect(res.status).to eq(301) |
75 |
| - expect(res.headers["location"]).to eq("http://rubykaigi.org/2010/") |
| 74 | + expect(res.code).to eq("301") |
| 75 | + expect(res["location"]).to eq("http://rubykaigi.org/2010/") |
76 | 76 | end
|
77 | 77 | end
|
78 | 78 |
|
79 | 79 | describe "/2010/en/" do
|
80 |
| - let(:res) { connection.get("http://rubykaigi.org/2010/en/") } |
| 80 | + let(:res) { http_get("http://rubykaigi.org/2010/en/") } |
81 | 81 | it "should render the top page" do
|
82 |
| - expect(res.status).to eq(200) |
| 82 | + expect(res.code).to eq("200") |
83 | 83 | expect(res.body).to include("<title>RubyKaigi 2010, August 27-29</title>")
|
84 | 84 | end
|
85 | 85 | end
|
86 | 86 |
|
87 | 87 | describe "/2009" do
|
88 |
| - let(:res) { connection.get("http://rubykaigi.org/2009") } |
| 88 | + let(:res) { http_get("http://rubykaigi.org/2009") } |
89 | 89 | it "redirects to /2009/" do
|
90 |
| - expect(res.status).to eq(301) |
91 |
| - expect(res.headers["location"]).to eq("http://rubykaigi.org/2009/") |
| 90 | + expect(res.code).to eq("301") |
| 91 | + expect(res["location"]).to eq("http://rubykaigi.org/2009/") |
92 | 92 | end
|
93 | 93 | end
|
94 | 94 |
|
95 | 95 | describe "/2009/en/" do
|
96 |
| - let(:res) { connection.get("http://rubykaigi.org/2009/en/") } |
| 96 | + let(:res) { http_get("http://rubykaigi.org/2009/en/") } |
97 | 97 | it "should render the top page" do
|
98 |
| - expect(res.status).to eq(200) |
| 98 | + expect(res.code).to eq("200") |
99 | 99 | expect(res.body).to include("<title>RubyKaigi2009</title>")
|
100 | 100 | end
|
101 | 101 | end
|
102 | 102 |
|
103 | 103 | describe "/2008" do
|
104 |
| - let(:res) { connection.get("http://rubykaigi.org/2008") } |
| 104 | + let(:res) { http_get("http://rubykaigi.org/2008") } |
105 | 105 | it "redirects to http://jp.rubyist.net/RubyKaigi2008" do
|
106 |
| - expect(res.status).to eq(301) |
107 |
| - expect(res.headers["location"]).to eq("http://jp.rubyist.net/RubyKaigi2008") |
| 106 | + expect(res.code).to eq("301") |
| 107 | + expect(res["location"]).to eq("http://jp.rubyist.net/RubyKaigi2008") |
108 | 108 | end
|
109 | 109 | end
|
110 | 110 |
|
111 | 111 | describe "/2008/en" do
|
112 |
| - let(:res) { connection.get("http://rubykaigi.org/2008/en") } |
| 112 | + let(:res) { http_get("http://rubykaigi.org/2008/en") } |
113 | 113 | it "should redirect to http://jp.rubyist.net/RubyKaigi2008" do
|
114 |
| - expect(res.status).to eq(301) |
115 |
| - expect(res.headers["location"]).to eq("http://jp.rubyist.net/RubyKaigi2008") |
| 114 | + expect(res.code).to eq("301") |
| 115 | + expect(res["location"]).to eq("http://jp.rubyist.net/RubyKaigi2008") |
116 | 116 | end
|
117 | 117 | end
|
118 | 118 |
|
119 | 119 | describe "/2007" do
|
120 |
| - let(:res) { connection.get("http://rubykaigi.org/2007") } |
| 120 | + let(:res) { http_get("http://rubykaigi.org/2007") } |
121 | 121 | it "redirects to http://jp.rubyist.net/RubyKaigi2007" do
|
122 |
| - expect(res.status).to eq(301) |
123 |
| - expect(res.headers["location"]).to eq("http://jp.rubyist.net/RubyKaigi2007") |
| 122 | + expect(res.code).to eq("301") |
| 123 | + expect(res["location"]).to eq("http://jp.rubyist.net/RubyKaigi2007") |
124 | 124 | end
|
125 | 125 | end
|
126 | 126 |
|
127 | 127 | describe "/2007/en" do
|
128 |
| - let(:res) { connection.get("http://rubykaigi.org/2007/en") } |
| 128 | + let(:res) { http_get("http://rubykaigi.org/2007/en") } |
129 | 129 | it "should redirect to http://jp.rubyist.net/RubyKaigi2007" do
|
130 |
| - expect(res.status).to eq(301) |
131 |
| - expect(res.headers["location"]).to eq("http://jp.rubyist.net/RubyKaigi2007") |
| 130 | + expect(res.code).to eq("301") |
| 131 | + expect(res["location"]).to eq("http://jp.rubyist.net/RubyKaigi2007") |
132 | 132 | end
|
133 | 133 | end
|
134 | 134 |
|
135 | 135 | describe "/2006" do
|
136 |
| - let(:res) { connection.get("http://rubykaigi.org/2006") } |
| 136 | + let(:res) { http_get("http://rubykaigi.org/2006") } |
137 | 137 | it "redirects to http://jp.rubyist.net/RubyKaigi2006" do
|
138 |
| - expect(res.status).to eq(301) |
139 |
| - expect(res.headers["location"]).to eq("http://jp.rubyist.net/RubyKaigi2006") |
| 138 | + expect(res.code).to eq("301") |
| 139 | + expect(res["location"]).to eq("http://jp.rubyist.net/RubyKaigi2006") |
140 | 140 | end
|
141 | 141 | end
|
142 | 142 |
|
143 | 143 | describe "/2006/en" do
|
144 |
| - let(:res) { connection.get("http://rubykaigi.org/2006/en") } |
| 144 | + let(:res) { http_get("http://rubykaigi.org/2006/en") } |
145 | 145 | it "should redirect to http://jp.rubyist.net/RubyKaigi2006" do
|
146 |
| - expect(res.status).to eq(301) |
147 |
| - expect(res.headers["location"]).to eq("http://jp.rubyist.net/RubyKaigi2006") |
| 146 | + expect(res.code).to eq("301") |
| 147 | + expect(res["location"]).to eq("http://jp.rubyist.net/RubyKaigi2006") |
148 | 148 | end
|
149 | 149 | end
|
150 | 150 |
|
151 | 151 | describe "/2005" do
|
152 |
| - let(:res) { connection.get("http://rubykaigi.org/2005") } |
| 152 | + let(:res) { http_get("http://rubykaigi.org/2005") } |
153 | 153 | it "should be 404" do
|
154 |
| - expect(res.status).to eq(404) |
| 154 | + expect(res.code).to eq("404") |
155 | 155 | end
|
156 | 156 | end
|
157 | 157 |
|
158 | 158 | describe "/2005/en" do
|
159 |
| - let(:res) { connection.get("http://rubykaigi.org/2005/en") } |
| 159 | + let(:res) { http_get("http://rubykaigi.org/2005/en") } |
160 | 160 | it "should be 404" do
|
161 |
| - expect(res.status).to eq(404) |
| 161 | + expect(res.code).to eq("404") |
162 | 162 | end
|
163 | 163 | end
|
164 | 164 |
|
|
0 commit comments