Commit Graph

201 Commits

Author SHA1 Message Date
Staphany Park
3862c55049 Add fixture use case to testing.md.
I think people would find it useful to know that you can pass in multiple fixture names to get an array of all the fixtures. I've found this useful in my own app. It looks like there already a test case that supports this feature (https://github.com/rails/rails/blob/master/activerecord/test/cases/fixtures_test.rb#L398), but it's just not documented here.

I look forward to your feedback!
2015-06-13 01:11:25 -04:00
Guo Xiang Tan
ca83436d1b Remove assigns and assert_template. 2015-05-30 14:13:57 +08:00
Hiromichi Yamada
a227e88017 [ci skip] Fix block parameter of assert_no_difference 2015-05-28 21:20:01 +09:00
Eliot Sykes
b539760014 Make link to configuring guide relative [ci skip] 2015-05-22 07:55:54 +01:00
Arun Agrawal
879f316995 Fix broken link for minitest. [ci skip]
For more details see #20222
2015-05-20 14:55:58 +02:00
Gaurav Sharma
3e238b6b0f [ci skip] update ruby doc links; for rails next version ruby 2.2+ will be supported only 2015-05-20 17:41:17 +05:30
Benjamin Klotz
d5847f4cc0 Clarify view tests [ci skip]
Mention that view tests are made in controller tests.
2015-05-14 18:05:21 +02:00
yui-knk
5f3bd44710 [ci skip] Fix purpose of assert_kind_of 2015-05-10 21:40:31 +09:00
Yves Senn
a66a64aa2a guides, bring back minitest assertion table. [ci skip]
Rails has different naming conventions for the inverse assertion
methods. While minitest uses `refute` we use `_not`. We should have a
table listing the common assertions that you want to use in the Rails
context.

Refs #18305.
2015-04-28 12:16:19 +02:00
Kir Shatrov
afbd6559f9 No need to mention unit tests in testing guide anymore 2015-03-31 14:38:28 +03:00
Kir Shatrov
851621bf19 New test runner syntax in testing guide 2015-03-31 14:38:28 +03:00
Kir Shatrov
487aa51b14 Suggest new hash syntax in testing guide 2015-03-31 14:38:28 +03:00
Kir Shatrov
3cee8ce2e8 Don't suggest bin/rails test controllers 2015-03-31 13:45:17 +03:00
Hendy Tanata
b016533d5b Add missing "of" to testing guide. 2015-03-30 09:15:54 -07:00
Matthew Draper
ffd2f085a5 Merge branch 'kirs' 2015-03-30 17:06:09 +10:30
Kir Shatrov
09d2623783 Switch to bin/rails test in testing guide
rails/rails#18305
2015-03-30 00:11:02 +03:00
Vijay Dev
c26ee64b92 Merge branch 'master' of github.com:rails/docrails
Conflicts:
	guides/source/4_0_release_notes.md
2015-03-26 16:22:41 +00:00
Kyle Oba
138180252d [skip ci] Minor edits for clarity, to make smooth, & separate clauses.
* Add conjunction for clarity.
* Add comma between independent clauses: create command, and generation
  of fixtures.
2015-03-25 16:04:57 -10:00
yui-knk
39dfbf0b9c [ci skip] Capitalize title 2015-03-22 22:54:14 +09:00
Kir Shatrov
0d16c9d1a5 Better title in Testing Guide
suggested by @senny
https://github.com/rails/rails/pull/18305#issuecomment-73847595
2015-03-22 12:52:17 +02:00
Sean Collins
43fc9892ac Change 'girlfriend' to 'partner' 2015-03-20 15:24:54 -04:00
Rafael Mendonça França
675f299c8e Merge pull request #19322 from AndrewHendrie/AndrewHendrie-guides-testing-partials-patch
Asserting partials modification
2015-03-13 14:57:30 -03:00
Andrew Hendrie
3830854510 Asserting partials modification
Changed "create Articles view" to "new article view". The create action doesn't typically have a view assigned to it. The view that's being referred to is the 'new' Article view.
2015-03-13 11:28:18 -04:00
Marius Butuc
c921606d26 Fix typo in the “Testing Your Mailers” docs
* [ci skip]
2015-03-12 15:36:53 -04:00
Andrew Hendrie
3f0b7b41e1 Changed 'blank space' to 'blank line'
Line 85 stated that fixtures are typically separated by a blank space. I changed the wording to blank line because blank space could be misinterpreted as a non-breaking space character when in reality, each fixture record (in YAML) is separated by a blank line.
2015-03-09 20:20:06 -04:00
yuuji.yaginuma
4b0f0bc37e add ActiveJob::TestCase to list of classes providing for test [ci skip] 2015-02-28 23:31:11 +09:00
Robin Dupret
1747c4e2ce Tiny documentation edits [ci skip] 2015-02-15 19:19:04 +01:00
Yves Senn
714e6fc445 guides, various testing guide changes. [ci skip]
/cc @zzak
2015-02-11 09:27:14 +01:00
Kir Shatrov
b19999f3a7 Migrating xhr methods to keyword arguments syntax
in `ActionController::TestCase` and
`ActionDispatch::Integration`

Old syntax:

    `xhr :get, :create, params: { id: 1 }`

New syntax example:

    `get :create, params: { id: 1 }, xhr: true`
2015-02-01 16:07:42 +03:00
Rafael Mendonça França
bb6fe7e73a Consistent usage of spaces in hashes across our codebase 2015-01-29 12:19:41 -02:00
Rafael Mendonça França
7814f901e1 Use fixed fonts only in the name of the parameter 2015-01-29 12:19:21 -02:00
Kir Shatrov
baf14ae513 Switch to kwargs in ActionController::TestCase and ActionDispatch::Integration
Non-kwargs requests are deprecated now.
Guides are updated as well.

`post url, nil, nil, { a: 'b' }` doesn't make sense.
`post url, params: { y: x }, session: { a: 'b' }` would be an explicit way to do the same
2015-01-29 14:44:46 +02:00
Rafael Mendonça França
01c1667b97 Fix test case class in the testing guide [ci skip] 2015-01-21 13:12:24 -02:00
Vijay Dev
3f96b6973b Merge branch 'master' of github.com:rails/docrails 2015-01-15 07:28:21 +00:00
Vipul A M
5cfaf5a46e - Changed IN to ON in markdown renderer condition
- Changed `IN` to `ON` in all note sentences in guides.
2015-01-14 11:52:13 +05:30
Kir Shatrov
ef7274be87 Better example of teardown method in test guide
rails/rails#18305, thanks for @dhh suggestion
2015-01-03 23:45:50 +01:00
Kir Shatrov
cf87cfeb57 Demonstrate example of assert_emails in testing guide
rails/rails#18305, thanks for @dhh suggestion
2015-01-03 23:25:09 +01:00
Kir Shatrov
4a3b9c8283 Docs for controller test helpers
rails/rails#18305
2015-01-03 20:18:56 +01:00
Kir Shatrov
bb3c054358 Avoid double negation in test guide
rails/rails#18305
2015-01-03 20:16:06 +01:00
Kir Shatrov
1ffd1a305c Section about testing xhr requests
rails/rails#18305
2015-01-03 20:16:06 +01:00
yuuji.yaginuma
54368bb339 fix rake command typo in Testing guide [ci skip] 2014-12-31 22:36:22 +09:00
Zachary Scott
5c35f704d1 Replace exhaustive list of methods with pointer to API docs. [ci skip] 2014-12-30 11:07:38 -08:00
Zachary Scott
eeccdacbba Add result of running articles_routes_test and point to more information for
RoutingAssertions. [ci skip]
2014-12-30 11:03:13 -08:00
Zachary Scott
12c6de9aae Move request tests after functional and before views, and move helper tests
after views. [ci skip]
2014-12-30 10:56:12 -08:00
Zachary Scott
eb9eb42c2b Make "Testing Views" separate section, move "Setup and Teardown" into
functional testing section and implement :show, :destroy, and :update tests.

[ci skip]
2014-12-30 10:42:20 -08:00
Zachary Scott
0874bff480 Add implement integration test to Testing Guide. [ci skip] 2014-12-30 10:15:54 -08:00
Zachary Scott
2326e0ee9f Replace exhaustive list of helper methods with pointers to helper classes found
in the Action Dispatch Integration module. [ci skip]
2014-12-30 09:37:20 -08:00
Zachary Scott
9c9e7226c8 Remove this line which was added by accident [ci skip] 2014-12-30 09:27:44 -08:00
Zachary Scott
d9b080bf3b Move Rake tasks list to a smaller heading section earlier in the guide.
It makes more sense here, rather than after explaining all of the testing
facilities of Rails. [ci skip]
2014-12-29 18:13:47 -08:00
Zachary Scott
7e00ca987c Condense notes regarding Minitest and its available assertions removed in:
82b75eda70f8c30f7c418e7350532a3a0ed2a8c3

Also explain how Rails inherits capabilities from Minitest. Test classes should
be roughly the same based on this information, we can address them at a high
level when introducing the first test case. [ci skip]
2014-12-29 18:07:48 -08:00