Commit Graph

50382 Commits

Author SHA1 Message Date
Arthur Neves
45786be516 Merge branch 'bin_test_runner'. #19216
3 commits were missing when we merged the PR, probably they were lost
when that branch was rebased against latest master.
This merge, contains those 3 commits.
2015-03-19 10:16:05 -04:00
Arthur Neves
a9eb12393f Use absolute path on find_method location for the runner 2015-03-19 10:15:03 -04:00
Arthur Neves
4bb9268474 Fix test rake when passing multiple arguments
bundle exec db:migrate rake was not working, with the new runner, before this commit
2015-03-19 10:15:03 -04:00
Arthur Neves
9afd9d232c method_source needs to be a hard dependency on railties 2015-03-19 10:15:03 -04:00
Yves Senn
9959e9525b Merge pull request #19216 from senny/bin_test_runner
`bin/rails test` runner (rerun snippets, run tests by line, option documentation)
2015-03-19 14:27:01 +01:00
Arthur Nogueira Neves
bee9434cdf Merge pull request #19387 from arthurnn/fix_route_regression
Add a new-line to the end of route method generated code.
2015-03-19 09:19:22 -04:00
Yves Senn
dfdb08f092 Merge pull request #19406 from larskanis/add_changelog_entry_for_17680
ActiveRecord: Add a changelog entry for issue #17680. [ci skip]
Conflicts:
	activerecord/CHANGELOG.md
2015-03-19 14:06:26 +01:00
Yves Senn
338d25083b Merge pull request #19401 from jonatack/patch-3
Active Record changelog pass [skip ci]
2015-03-19 10:04:08 +01:00
Abdelkader Boudih
7f338b9082 Merge pull request #19403 from akshay-vishnoi/docs
[ci skip] use true as value rather than symbol
2015-03-19 06:25:38 +00:00
Kasper Timm Hansen
26122797e2 Merge pull request #19400 from jamesbowles/patch-1
[skip ci] Fixed typo in asset pipeline documentation
2015-03-19 06:42:58 +01:00
Akshay Vishnoi
e3c70df197 [ci skip] use true as value rather than symbol 2015-03-19 10:50:50 +05:30
Jon Atack
dbf5433978 Active Record changelog pass [skip ci] 2015-03-19 10:04:11 +05:30
James
63d7fd6e94 [skip ci] Fixed typo 2015-03-19 17:12:09 +13:00
Claudio B.
257fd1b391 Merge pull request #19398 from akshay-vishnoi/docs
[ci skip] use false as value rather than symbol
2015-03-18 19:55:50 -07:00
Akshay Vishnoi
64e27f9230 [ci skip] use false as value rather than symbol 2015-03-19 07:25:59 +05:30
Yves Senn
c2152a0dd7 Merge pull request #19391 from crackofdusk/docs_binstubs
Change commands in the Getting Started guide to use scripts in bin/ [ci skip]
2015-03-18 21:19:14 +01:00
Dimiter Petrov
a3e4c15048 Change commands in the Getting Started guide to use scripts in bin/
[ci skip]
2015-03-18 21:14:18 +01:00
Arthur Neves
2f23f97b2e Add a new-line to the end of route method generated code.
Fix regression on route method that was added by
bac812a7ef2660a2fe2ab00822e5e66228379822. The regression was that when
calling the `route` method, we were not appending a \n anymore.

[fixes #19316]
2015-03-18 10:33:59 -04:00
eileencodes
4df806f95f Improve test for leaky scope chain
This is a better test for 51660f0. It is testing that the SQL is the
same before and after the previously leaky scope is called. Before if
`hotel.drink_designers` was called first then `hotel.recipes` would
incorrectly get the scope applied. We want to be sure that the
polymorphic hm:t association is not leaking into or affecting the
SQL for the hm:t association on `Hotel`.

The reason I couldn't do this before was because there was an issue with
the SQL getting cached and wanted to resolve that later and then fix the
test to be better. Because of the caching, this test requires that
`Hotel.reflect_on_association(:recipes).clear_association_scope_cache`
be called after the first call to `hotel.recipes` to clear the
assocation scope chain and not interfere with the rest of the test.
2015-03-18 08:13:54 -04:00
eileencodes
cce5126eb2 Add clear_association_scope_cache method
In the tests if I were to call `post.categorizations.to_a` and then later call
`post.categorizations.to_a` expecting to have different results the 2 queries
would be the same because of the caching involved in
`@association_scope_cache`. The chain gets cached and the queries will
be the same even if they are not supposed to be (i.e. testing an order
dependent scoping issue).

I found this issue because I was working on a bug with cached scoped
in hm:t and hm:t polymorphic relationships but `capture_sql` was
outputting the wrong SQL to write a good test.
2015-03-18 08:13:53 -04:00
Yves Senn
8adfba360b Merge pull request #19240 from yui-knk/refactor/guide_rb
Remove gem check in guides/rails_guides.rb

Conflicts:
	guides/rails_guides.rb
2015-03-18 12:32:10 +01:00
Carlos Antonio da Silva
e121fae966 Remove additional handling of boolean attributes on button to helper
This logic was just doing duplicated work, since the button_to helper
relies on tag/content_tag to generate the button html, which already
handles all boolean attributes it knows about.

The code dates back to 2005: 43c470fae468ef63e0d5c3dc1e202925685fd47b.
2015-03-18 07:34:16 -03:00
Yves Senn
08615a3bcb Merge pull request #19348 from Empact/null-scope
Reuse the CollectionAssociation#reader proxy cache if the foreign key is present from the start.

Conflicts:
	activerecord/CHANGELOG.md
2015-03-18 11:20:47 +01:00
Yves Senn
848680015b Merge pull request #19383 from mechanicles/use-consistent-example
Make example code consistent for better understanding. [ci skip]
2015-03-18 10:11:46 +01:00
Santosh Wadghule
4fd571abe2 - Make example code consistent for better understanding. [ci skip] 2015-03-18 14:30:05 +05:30
Yves Senn
0a6873cbd9 Merge pull request #19382 from leishman/patch-1
Update old link in pessimistic.rb comments [ci skip]
2015-03-18 09:59:03 +01:00
Yves Senn
d9bbafb2e7 run test_test.rb using the bin/rails test. 2015-03-18 09:52:19 +01:00
Arthur Neves
8017e6af31 Use Rails::TestRunner on rake test 2015-03-18 09:52:19 +01:00
Arthur Neves
f10c7e1849 Fix reporter test and verbose mode 2015-03-18 09:52:19 +01:00
Yves Senn
6ccbeb458a move ENV["BACKTRACE"] support into the TestRunner. 2015-03-18 09:52:19 +01:00
Yves Senn
ac5ead59ae -p, --pattern to run tests using a pattern. 2015-03-18 09:52:19 +01:00
Yves Senn
f78708c180 use bin/rails t runner in test_runner_test.rb. 2015-03-18 09:52:18 +01:00
Arthur Neves
de94929d70 Fix relative dir call on test runner 2015-03-18 09:52:18 +01:00
Arthur Neves
3cc783b6bf Add tests for runner#test_files method 2015-03-18 09:52:18 +01:00
Arthur Neves
b58c0914f4 Run multiple files on runner 2015-03-18 09:52:18 +01:00
Yves Senn
090c83672f -e / --environment for the test runner. 2015-03-18 09:52:18 +01:00
Yves Senn
f4ea8dda1b move argument parsing into the Runner. 2015-03-18 09:52:18 +01:00
Yves Senn
613bdd9d4c get rid of NAMED_PATTERNS in favor of running a whole directory 2015-03-18 09:52:18 +01:00
Yves Senn
fb2dc2adca document running a test by line number. 2015-03-18 09:52:17 +01:00
Yves Senn
7e9775bdb0 pluralize rerun snippet heading. 2015-03-18 09:52:17 +01:00
Yves Senn
ff79441d49 add tests for our minitest reporter. 2015-03-18 09:52:17 +01:00
Arthur Neves
ccee7eea8e Show the right file when test raises 2015-03-18 09:52:17 +01:00
Arthur Neves
a71bcdb4f3 Move minitest plugin
Minitest Rails plugin should be loaded on test_help, so we report errors
even when not running from the runner.

Also fix the backtrace
2015-03-18 09:52:17 +01:00
Arthur Neves
739cfd5d90 Move some logic to runner 2015-03-18 09:52:17 +01:00
Arthur Neves
5ae2c7060f Dont display Failed test if suite passed 2015-03-18 09:52:17 +01:00
Arthur Neves
d1a5460e3e Better file:line parsing and filter method by file too 2015-03-18 09:52:17 +01:00
Arthur Neves
d6ed046d30 Add method_source to gemfile 2015-03-18 09:52:16 +01:00
Arthur Neves
cf7ba1fbbd no need to escape the method in a regex wrap, minitest does that for us 2015-03-18 09:52:16 +01:00
Arthur Neves
5d934caabb If a nem given, use that name to filter the test 2015-03-18 09:52:16 +01:00
Arthur Neves
ff0a7611cf Add test run by line, and report error by line 2015-03-18 09:52:16 +01:00