Permalink
Browse files

docs

  • Loading branch information...
1 parent af1102c commit 40d482bb7253d59b1074b953eb5f87efb1a51b45 @dchelimsky dchelimsky committed Apr 9, 2011
Showing with 18 additions and 10 deletions.
  1. +18 −10 features/controller_specs/README.md
@@ -21,16 +21,24 @@ To specify outcomes, you can use:
* `response.should redirect_to (wraps assert_redirected_to)`
* `assigns(:widget).should be_a_new(Widget)`
-## Conventions:
-
-### Controller
-
-* pass the controller being specified to the outermost `describe` method.
-
- describe AccountController do
- # ...
-
-### Views
+## Examples
+
+ describe TeamsController do
+ describe "GET index" do
+ it "assigns @teams" do
+ team = Team.create
+ get :index
+ assigns(:teams).should eq([team])
+ end
+
+ it "renders the index template" do
+ get :index
+ response.should render_template("index")
+ end
+ end
+ end
+
+## Views
* by default, views are not rendered. See
[views are stubbed by default](controller-specs/views-are-stubbed-by-default) and

0 comments on commit 40d482b

Please sign in to comment.