Commit Graph

11048 Commits

Author SHA1 Message Date
Yves Senn
cfd61919da Merge pull request #23631 from y-yagi/generate_mailer_views_in_api
generate mailer views in Rails API
2016-02-15 15:25:52 +01:00
Yves Senn
07e422f58d test runner, relay minitest information about the error location.
This is a follow-up to ea70c29 to bring back the assertion error
location information provided by minitest.
2016-02-15 15:19:24 +01:00
Yves Senn
ea70c295ff Revert "Prefer Minitest's location for test failures."
This reverts commit 0db310586ac3e15be95d2ef27ff40cfa24c05c10.

Closes #23686.

Conflicts:
	railties/test/application/test_runner_test.rb

It's possible that the `result.location` returned by minitest is outside
the test file itself. For example in the case of mocha. This resulted in
bad rerun snipptets:

```
bin/rails test app/models/deliveries/delivery.rb:103
```

Let's always use the first line of the failed test-case in our rerun
snippet. We can display the line number of the assertion error elsewhere.
2016-02-15 15:19:16 +01:00
yuuji.yaginuma
0146a055c0 generate mailer views in Rails API
View files is necessary to send mail, it should be generated even Rails API.
Fixes #23617
2016-02-15 22:13:32 +09:00
Vipul A M
4feb34ddf2 Merge pull request #23569 from Gaurav2728/no_doc_of_some_railtie_methods
mark as #:nodoc:  [ci skip]
2016-02-15 15:19:47 +05:30
Yves Senn
2f284170c3 Merge pull request #23664 from y-yagi/remove_test_order_from_environment_file
remove `active_support.test_order` from environment file
2016-02-15 10:49:20 +01:00
Gaurav Sharma
d95cb0627a mark as #:nodoc: [ci skip]
can’t be instantiate directly or may be no need for doc.
2016-02-15 15:12:51 +05:30
Kasper Timm Hansen
3c96a6eaa4 Merge pull request #23505 from kaspth/inject-rails-config-through-railtie
Inject Rails related configuration through Railtie
2016-02-14 18:08:46 +01:00
Kasper Timm Hansen
661298176c Inject Rails' channel paths in engine.
We were explicitly referencing Rails.root in ActionCable::Server::Configuration.initialize,
thereby coupling ourselves to Rails.

Instead add `app/channels` to Rails' app paths and assign the existent files
to `channel_paths`.

Users can still append to those load paths with `<<` and `push` in `config/application.rb`.

This means we can remove the custom `Dir` lookup in `channel_paths` and the Rails
and root definitions in the tests.
2016-02-14 17:46:48 +01:00
yuuji.yaginuma
b9e226188a remove active_support.test_order from environment file
The default test order has been changed to `:random` in 5f777e4b5ee2e3e8e6fd0e2a208ec2a4d25a960d.
Therefore, it is no more need to be specified in the environment file.
2016-02-14 07:55:56 +09:00
Kasper Timm Hansen
6e8d70e697 Fix expected hash syntax.
3f70e8bd2 set a new bar for tests, but they weren't updated.

Update their expectation.
2016-02-12 23:31:46 +01:00
Rafael Mendonça França
3f70e8bd2d Use Ruby 1.9 hash syntax 2016-02-12 19:12:42 -02:00
Kasper Timm Hansen
8c53b41293 Merge pull request #23611 from abhishekjain16/routes_options
Fix routes to match verb and URL path with -g option also.
2016-02-12 20:20:14 +01:00
Tom von Schwerdtner
1a61496ae5 Use correct path in documentation.
s/config\/production/config\/environments\/production/

[ci skip]
2016-02-12 13:53:18 -05:00
Vipul A M
ef2a8c2391 - Fixed and removed long arguments to rake routes
- Fixed related documentation and usage all around

Fixes #23561
2016-02-12 14:35:57 +05:30
Abhishek Jain
4e3931aac2 Fixes routes to match verbs and path with -g option 2016-02-11 15:16:33 +05:30
Richard Schneeman
391061a30d Merge pull request #23528 from bensheldon/patch-1
Set database poolsize via rails_max_threads
2016-02-10 14:19:21 -06:00
Ben Sheldon
1273fc9b1d Set postgresql poolsize via RAILS_MAX_THREADS 2016-02-10 11:39:48 -08:00
David Heinemeier Hansson
437a7a406c Merge pull request #23512 from y-yagi/set_association_name_to_fixture
set association name to generated fixtures if attribute is reference
2016-02-10 17:23:30 +01:00
Xavier Noria
bd69718124 prevent apps in the railties test suite from running the evented monitor 2016-02-10 01:32:17 +01:00
Xavier Noria
00a5eb6aeb include spring-watcher-listen in the Gemfile of new applications 2016-02-10 00:45:19 +01:00
Xavier Noria
de6ad5665d enables the evented monitor in new applications 2016-02-10 00:28:50 +01:00
Scott Bronson
ba2aea9807 revert dev:cache to rake task, fixes #23410 2016-02-07 14:32:43 -08:00
Syamil MJ
04021c4b78 Remove unused private method 2016-02-07 04:07:48 +08:00
yuuji.yaginuma
00c64e8ae2 set association name to generated fixtures if attribute is reference
It has been changed to require `belongs_to` by default in Rails 5.
Therefore in order to pass the controller test, have association of set to fixtures.

Fixes #23384
2016-02-06 22:41:10 +09:00
Genadi Samokovarov
91678fe9f7 Replace old Rails greeting references
A couple of the READMEs were still referring the old welcome page. This
is a small change that goes over it.

[ci skip]
2016-02-06 09:14:42 +02:00
Kasper Timm Hansen
84b72a812f Fix mixing line filters with Minitest's -n filter.
Previous commit accidentally broke mixing line filters with string -n filter.

Fix by checking if it is a string and returning it.

We also need to ensure the -n filter carry forward into any other composite filters.

Fix by letting the named filter be extractable, so we'll keep this for the next runnable's
run.
2016-02-05 21:53:27 +01:00
yuuji.yaginuma
c9768b8a88 move CHANGELOG entry to the appropriate position [ci skip]
Dummy apple icon files has been added after the 5.0.0.beta2 release.
ref: #23455
2016-02-05 18:27:22 +09:00
Vipul A M
c074343cff - app generate option --skip-sprockets leaves jquery-rails gem, which relies on sprockets environment
- Remove jquery-rails if --skip-sprockets is true

Fixes #23431
2016-02-04 21:01:45 +05:30
Prem Sichanugrist
b1ae3a32b5 Update assertion on redis in generated Gemfile
Redis now included in Gemfile but commented out. This change was made in
91864439c7aebb6ca710831aac6781903a433904 and is causing the test
failure.

See https://travis-ci.org/rails/rails/jobs/106994913#L1025
2016-02-04 09:47:24 -05:00
Rafael França
83147f1ff3 Merge pull request #23478 from vipulnsward/23470-pass-api-in-update-generator
Pass api only option to rails rails:update task to update only based on api Apps
2016-02-04 12:12:53 -02:00
Vipul A M
e0e872f675 Pass api only option to rails rails:update task to update only based on API.
Fixes #23470
2016-02-04 19:40:23 +05:30
David Heinemeier Hansson
f2306d05d8 Turbolinks has moved out
All grown up and shit!
2016-02-04 12:17:12 +01:00
David Heinemeier Hansson
91864439c7 Redis is now only needed if you want to use Action Cable in production
So no need to have it on by default in the Gemfile.
2016-02-04 12:16:57 +01:00
Akira Matsuda
dfa48f200c rake stats dynamically scales now
So it can properly show stats for an app with 1,000,000+ LOC
2016-02-04 18:25:05 +09:00
Akira Matsuda
2cd405f340 Revert "Lines of code can be 100,000+ in a Rails app"
This reverts commit 293bd95c3e77275193130bc14c986348aae8b0e2.

This broke the header :<
2016-02-04 18:07:35 +09:00
Sean Griffin
9df3083926 Merge pull request #23458 from kamipo/activerecord_supports_mysql_5.0_and_up
Active Record supports MySQL >= 5.0
2016-02-03 19:12:20 -07:00
Ryuta Kamizono
c7f8019bff Active Record supports MySQL >= 5.0
Currently some features uses `information_schema` (e.g. foreign key
support). `information_schema` introduced since MySQL 5.0.
2016-02-04 07:08:33 +09:00
Kasper Timm Hansen
13b918d1e9 Merge pull request #23456 from kaspth/line-filter-triggers-one-runnable
Fix line filters running tests from multiple runnables.
2016-02-03 22:55:50 +01:00
Kasper Timm Hansen
d10b48dd0a Fix model test path typo uncovered in previous commit.
Because of the expanding whitelist for test filters, this test ended up
running the tests on lines 4 and 9 in the post test even though the path
wasn't right.

Happened incidentally because the same line numbers were used in both
account and post test.

Add the .rb line so the file is required correctly and the filters are
applied.
2016-02-03 22:14:51 +01:00
Kasper Timm Hansen
e4f0608164 Fix line filters running tests from multiple runnables.
`derive_regexp` was written with the assumption that we were run from a
blank slate — that if the filter didn't match we might as well return it
because it was nil.

This isn't the case because minitest calls `run` on every runnable. Which
is any subclass of Minitest::Runnable, such as ActiveSupport::TestCase,
ActionDispatch::IntegrationTest as well as any inheriting from those.

Thus after the first `run` we'd have put in a composite filter in
`options[:filter]` making the next `run` create a linked list when it
failed to match the regexp and put the composite filter as the head.

Every runnable would accumulate more and more of the same filters,
which effectively acted like an expanding whitelist and we ran tests
from other runnables.

Clog the accumulation by returning nil if there's no filter to derive
a regexp from.

Note: we pass a seed in the tests because Minitest shuffles the runnables
to ensure the whitelist is expanded enough that the failure is triggered.
2016-02-03 22:13:09 +01:00
Alexey Zabelin
deae52a62e Add dummy apple icon files
Previously Safari would try to load these files when you visit
localhost:3000. That created two exceptions in the log. It also caused
the exception notifier to send them out.

In response to #23427
2016-02-03 14:55:37 -05:00
Yves Senn
2144c75cf2 Merge pull request #23447 from y-yagi/update_pg_supported_version_in_docs
update supported version of PostgreSQL in docs [ci skip]
2016-02-03 14:26:32 +01:00
yuuji.yaginuma
33681d0001 update supported version of PostgreSQL in docs [ci skip]
Follow up to  #23434
2016-02-03 22:24:29 +09:00
yuuji.yaginuma
fae1724398 use rails command in routes task
For other task has become to use the rails command at doc and test,
I think that routes task also it is better to use the rails command.
2016-02-03 08:17:25 +09:00
Rafael França
2c7bc9251c Merge pull request #23420 from y-yagi/move_api_test_to_appropriate_file
move `test_generator_if_skip_action_cable_is_given_for_an_api_app` to the appropriate file
2016-02-02 04:44:23 -02:00
yuuji.yaginuma
b700d4811d move test_generator_if_skip_action_cable_is_given_for_an_api_app to the appropriate file
Test of Rails API should be in `api_app_generator_test.rb`.
2016-02-02 15:41:17 +09:00
Aaron Patterson
538bce1f7c Generated engines should protect from forgery
Generated engines should call `protect_from_forgery`.  If this method
isn't called, then the Engine could be susceptible to XSS attacks.
Thanks @tomekr for reporting this to us!
2016-02-01 17:18:08 -08:00
Akira Matsuda
96b9609e2b ⚠️ assigned but unused variable - err 2016-02-02 09:04:37 +09:00
Rafael Mendonça França
60b040e362 Add some Action Cable CHANGELOG entries
And improve changelongs.

[ci skip]
2016-02-01 19:57:50 -02:00