Commit 32bfefa1c40715eee2f768b910af6a7349902fdd
1 parent
a5ed1b99
Exists in
master
and in
22 other branches
Move "no crash" tests for doc controller to integration tests
In Rails 2.3, functional tests override the rescue functionality so that all exceptions are raised during tests (what makes sense). This way the tests for the fact that DocItem::NotFound implies a 404 error must be done as integration tests
Showing
2 changed files
with
15 additions
and
7 deletions
Show diff stats
test/functional/doc_controller_test.rb
... | ... | @@ -59,11 +59,4 @@ class DocControllerTest < ActionController::TestCase |
59 | 59 | get :topic, :section => 'user', :topic => 'accepting-friends' |
60 | 60 | end |
61 | 61 | |
62 | - should 'bail out gracefully for unexisting sections or topics' do | |
63 | - assert_nothing_raised do | |
64 | - get :section, :section => 'something-very-unlikely' | |
65 | - get :section, :section => 'something-very-unlikely', :topic => 'other-thing-very-unlikely' | |
66 | - end | |
67 | - end | |
68 | - | |
69 | 62 | end | ... | ... |
... | ... | @@ -0,0 +1,15 @@ |
1 | +require "#{File.dirname(__FILE__)}/../test_helper" | |
2 | + | |
3 | +class OnlineDocTest < ActionController::IntegrationTest | |
4 | + | |
5 | + def test_404_section | |
6 | + get '/doc/something-very-unlikely' | |
7 | + assert_response 404 | |
8 | + end | |
9 | + | |
10 | + def test_404_topic | |
11 | + get '/doc/something-very-unlikely/unexisting-topic' | |
12 | + assert_response 404 | |
13 | + end | |
14 | + | |
15 | +end | ... | ... |