aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--guides/source/testing.md10
1 files changed, 6 insertions, 4 deletions
diff --git a/guides/source/testing.md b/guides/source/testing.md
index 5b8829b89a..50115607c9 100644
--- a/guides/source/testing.md
+++ b/guides/source/testing.md
@@ -438,10 +438,12 @@ Now that we have used Rails scaffold generator for our `Post` resource, it has a
Let me take you through one such test, `test_should_get_index` from the file `posts_controller_test.rb`.
```ruby
-test "should get index" do
- get :index
- assert_response :success
- assert_not_nil assigns(:posts)
+class PostsControllerTest < ActionController::TestCase
+ test "should get index" do
+ get :index
+ assert_response :success
+ assert_not_nil assigns(:posts)
+ end
end
```