Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

docs

  • Loading branch information...
commit 40d482bb7253d59b1074b953eb5f87efb1a51b45 1 parent af1102c
@dchelimsky dchelimsky authored
Showing with 18 additions and 10 deletions.
  1. +18 −10 features/controller_specs/README.md
View
28 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
Please sign in to comment.
Something went wrong with that request. Please try again.