Skip to content

Commit 922bb07

Browse files
camillevillatjgrathwell
authored andcommitted
Update controller test example
1 parent 80dfcda commit 922bb07

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

sites/en/testing/types_of_tests.step

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ steps do
6060
console_without_message "rails g controller Oranges"
6161
end
6262
step do
63-
message "Then, run rspec."
63+
message "Then, run RSpec."
6464

6565
console_without_message "bundle exec rspec"
6666

@@ -82,9 +82,13 @@ steps do
8282
end
8383
RUBY
8484

85-
message "Great, that test should be passing! That's an example of a controller test on the index action. Let's modify that test to fail. Then, run 'bundle exec rspec' and see what happens. Awesome! Let's revert back to the passing test. Now, write another controller test for the new action (hint: you might need to look up what a mock is)."
85+
message "You should see two failing tests. You'll need to add a route, index action, and a view. Not sure where to start? Read the errors in your failing tests for a hint. Run 'bundle exec rspec' after each change until both tests pass."
86+
87+
message "Note: as you write the controller tests, you may be prompted to install a missing gem called 'rails-controller-testing' to use the assert_template method. If prompted, please add it to your Gemfile and do a bundle install!"
88+
end
8689

87-
message "Note: as you write the controller tests, you may be prompted to install a missing gem called 'rails-controller-testing' to use the assert_template method. If prompted, please add it and do a bundle install!"
90+
step do
91+
message "Now, write another controller test for the new action (hint: you might need to look up what a mock is)."
8892
end
8993
end
9094

0 commit comments

Comments
 (0)