@@ -137,71 +137,41 class MyControllerTest < ActionController::TestCase | |||
|
137 | 137 | assert_equal ['documents', 'calendar', 'latestnews'], User.find(2).pref[:my_page_layout]['left'] |
|
138 | 138 | end |
|
139 | 139 | |
|
140 | context "POST to reset_rss_key" do | |
|
141 | context "with an existing rss_token" do | |
|
142 | setup do | |
|
140 | def test_reset_rss_key_with_existing_key | |
|
143 | 141 |
|
|
144 | 142 |
|
|
145 | end | |
|
146 | 143 | |
|
147 | should "destroy the existing token" do | |
|
148 | 144 |
|
|
149 | end | |
|
150 | ||
|
151 | should "create a new token" do | |
|
152 | 145 |
|
|
146 | assert_match /reset/, flash[:notice] | |
|
147 | assert_redirected_to '/my/account' | |
|
153 | 148 |
|
|
154 | 149 | |
|
155 | should_set_the_flash_to /reset/ | |
|
156 | should_redirect_to('my account') {'/my/account' } | |
|
157 | end | |
|
158 | ||
|
159 | context "with no rss_token" do | |
|
160 | setup do | |
|
150 | def test_reset_rss_key_without_existing_key | |
|
161 | 151 |
|
|
162 | 152 |
|
|
163 | end | |
|
164 | 153 | |
|
165 | should "create a new token" do | |
|
166 | 154 |
|
|
155 | assert_match /reset/, flash[:notice] | |
|
156 | assert_redirected_to '/my/account' | |
|
167 | 157 |
|
|
168 | 158 | |
|
169 | should_set_the_flash_to /reset/ | |
|
170 | should_redirect_to('my account') {'/my/account' } | |
|
171 | end | |
|
172 | end | |
|
173 | ||
|
174 | context "POST to reset_api_key" do | |
|
175 | context "with an existing api_token" do | |
|
176 | setup do | |
|
159 | def test_reset_api_key_with_existing_key | |
|
177 | 160 |
|
|
178 | 161 |
|
|
179 | end | |
|
180 | 162 | |
|
181 | should "destroy the existing token" do | |
|
182 | 163 |
|
|
183 | end | |
|
184 | ||
|
185 | should "create a new token" do | |
|
186 | 164 |
|
|
165 | assert_match /reset/, flash[:notice] | |
|
166 | assert_redirected_to '/my/account' | |
|
187 | 167 |
|
|
188 | 168 | |
|
189 | should_set_the_flash_to /reset/ | |
|
190 | should_redirect_to('my account') {'/my/account' } | |
|
191 | end | |
|
192 | ||
|
193 | context "with no api_token" do | |
|
194 | setup do | |
|
169 | def test_reset_api_key_without_existing_key | |
|
195 | 170 |
|
|
196 | 171 |
|
|
197 | end | |
|
198 | 172 | |
|
199 | should "create a new token" do | |
|
200 | 173 |
|
|
201 | end | |
|
202 | ||
|
203 | should_set_the_flash_to /reset/ | |
|
204 | should_redirect_to('my account') {'/my/account' } | |
|
205 | end | |
|
174 | assert_match /reset/, flash[:notice] | |
|
175 | assert_redirected_to '/my/account' | |
|
206 | 176 | end |
|
207 | 177 | end |
General Comments 0
You need to be logged in to leave comments.
Login now