Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

update the guides to reflect the new `rails test` command #10073

Closed
wants to merge 2 commits into from

3 participants

@senny
Owner

There were a few sections in the guides that still mentioned the rake tasks to run the tests. I updated them to reference the new rails test command and added some links to the testing guide.

Also while I was at it I reconditioned the references section in the testing guide.

@sikachu sikachu commented on the diff
guides/source/command_line.md
@@ -300,6 +300,17 @@ irb(main):001:0>
INFO: You can also use the alias "db" to invoke the dbconsole: `rails db`.
+### `rails test`
+
+INFO: A good description of unit testing in Rails is given in
+[A Guide to Testing Rails Applications](testing.html)
+
+Rails comes with a test suite called `Test::Unit`. Rails owes its stability to
@sikachu Collaborator
sikachu added a note

I'm not sure if we should call it Test::Unit specifically, since:

  1. It's now Minitest.
  2. Test classes are inherited from ActiveSupport::TestCase.
@senny Owner
senny added a note

I copied this part from below so I don't mind using a different name.

@carlosantoniodasilva @rafaelfranca what do you guys think?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
@steveklabnik
Collaborator

I thought rails test was going away, or at least, @tenderlove is shooting for it.

@senny
Owner

@steveklabnik thanks for the heads-up. As rails test won't be in Rails 4 this PR does not make a lot of sense.

@senny senny closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
This page is out of date. Refresh to see the latest.
Showing with 30 additions and 10 deletions.
  1. +14 −3 guides/source/command_line.md
  2. +16 −7 guides/source/testing.md
View
17 guides/source/command_line.md
@@ -300,6 +300,17 @@ irb(main):001:0>
INFO: You can also use the alias "db" to invoke the dbconsole: `rails db`.
+### `rails test`
+
+INFO: A good description of unit testing in Rails is given in
+[A Guide to Testing Rails Applications](testing.html)
+
+Rails comes with a test suite called `Test::Unit`. Rails owes its stability to
@sikachu Collaborator
sikachu added a note

I'm not sure if we should call it Test::Unit specifically, since:

  1. It's now Minitest.
  2. Test classes are inherited from ActiveSupport::TestCase.
@senny Owner
senny added a note

I copied this part from below so I don't mind using a different name.

@carlosantoniodasilva @rafaelfranca what do you guys think?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
+the use of tests. The `rails test` command helps in running the different tests
+you will hopefully write. The
+[commands section in the testing guide](testing.html#commands-to-run-your-tests)
+describes `rails test` in depth.
+
### `rails runner`
`runner` runs Ruby code in the context of Rails non-interactively. For instance:
@@ -460,9 +471,9 @@ rspec/model/user_spec.rb:
### `test`
-INFO: A good description of unit testing in Rails is given in [A Guide to Testing Rails Applications](testing.html)
-
-Rails comes with a test suite called `Test::Unit`. Rails owes its stability to the use of tests. The tasks available in the `test:` namespace helps in running the different tests you will hopefully write.
+See the
+[commands section in the testing guide](testing.html#commands-to-run-your-tests)
+for a summary of available tasks.
### `tmp`
View
23 guides/source/testing.md
@@ -754,7 +754,7 @@ class UserFlowsTest < ActionDispatch::IntegrationTest
end
```
-Rake Tasks for Running your Tests
+Commands to Run your Tests
---------------------------------
You don't need to set up and run your tests by hand on a test-by-test basis. Rails comes with a number of commands to help in testing. The table below lists all commands that come along in the default Rakefile when you initiate a Rails project.
@@ -994,9 +994,18 @@ Other Testing Approaches
The built-in `test/unit` based testing is not the only way to test Rails applications. Rails developers have come up with a wide variety of other approaches and aids for testing, including:
-* [NullDB](http://avdi.org/projects/nulldb/), a way to speed up testing by avoiding database use.
-* [Factory Girl](https://github.com/thoughtbot/factory_girl/tree/master), a replacement for fixtures.
-* [Machinist](https://github.com/notahat/machinist/tree/master), another replacement for fixtures.
-* [MiniTest::Spec Rails](https://github.com/metaskills/minitest-spec-rails), use the MiniTest::Spec DSL within your rails tests.
-* [Shoulda](http://www.thoughtbot.com/projects/shoulda), an extension to `test/unit` with additional helpers, macros, and assertions.
-* [RSpec](http://relishapp.com/rspec), a behavior-driven development framework
+* [NullDB](http://avdi.org/projects/nulldb/), a way to speed up
+ testing by avoiding database use.
+* [Factory Girl](https://github.com/thoughtbot/factory_girl), a
+ replacement for fixtures.
+* [Machinist](https://github.com/notahat/machinist), another
+ replacement for fixtures.
+* [MiniTest::Spec Rails](https://github.com/metaskills/minitest-spec-rails),
+ use the MiniTest::Spec DSL within your rails tests.
+* [Shoulda](https://github.com/thoughtbot/shoulda), an extension to
+ `test/unit` and `rspec` with additional helpers, macros, and
+ assertions.
+* [RSpec](http://relishapp.com/rspec), a behavior-driven development
+ framework
+* [Mocha](https://github.com/freerange/mocha), a mocking and stubbing
+ library for Ruby
Something went wrong with that request. Please try again.