You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: features/controller_specs/README.md
+26-22
Original file line number
Diff line number
Diff line change
@@ -42,21 +42,23 @@ To specify outcomes, you can use:
42
42
43
43
## Examples
44
44
45
-
RSpec.describe TeamsControllerdo
46
-
describe "GET index"do
47
-
it "assigns @teams"do
48
-
team =Team.create
49
-
get :index
50
-
expect(assigns(:teams)).to eq([team])
51
-
end
52
-
53
-
it "renders the index template"do
54
-
get :index
55
-
expect(response).to render_template("index")
56
-
end
57
-
end
45
+
```ruby
46
+
RSpec.describe TeamsController do
47
+
describe "GET index" do
48
+
it "assigns @teams" do
49
+
team = Team.create
50
+
get :index
51
+
expect(assigns(:teams)).to eq([team])
58
52
end
59
53
54
+
it "renders the index template" do
55
+
get :index
56
+
expect(response).to render_template("index")
57
+
end
58
+
end
59
+
end
60
+
```
61
+
60
62
## Views
61
63
62
64
* by default, views are not rendered. See
@@ -67,14 +69,16 @@ To specify outcomes, you can use:
67
69
68
70
We encourage you to use [request specs](./request-specs/request-spec) if you want to set headers in your call. If you still want to use controller specs with custom http headers you can use `request.headers`:
0 commit comments