1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00
Commit graph

2619 commits

Author SHA1 Message Date
yuuji.yaginuma
571b090a85 correctly presence check of application_record.rb in plugin 2016-01-02 14:44:50 +09:00
yuuji.yaginuma
541caffa39 add test of that application_record.rb is generated in plugin 2016-01-02 13:20:46 +09:00
Rafael França
1f85e1c9f3 Merge pull request from timrogers/actiondispatch-ssl-config
Configurable redirect and secure cookies for ActionDispatch::SSL
2015-12-31 03:25:47 -02:00
Rafael Mendonça França
692bb7cebc Add sass-rails back to the default Gemfile
It was removed by mistake at 877a411d0c
2015-12-30 17:42:19 -02:00
Tim Rogers
32b1c90837 Flexible configuration for ActionDispatch::SSL 2015-12-29 13:07:51 +00:00
Kasper Timm Hansen
552e4e6b9e Merge pull request from lucasmazza/lm-test-reporter-colored-output
Add colored output to the new test reporter.
2015-12-23 23:07:14 +01:00
Lucas Mazza
7fa3a0c90a Add colored output to the new test reporter. 2015-12-22 10:58:05 -02:00
yuuji.yaginuma
9917c0c255 remove cors initializer from rails app
`rack-cors` gem is defined in Gemfile by default only if the api,
not defined by default in rails app.
2015-12-22 18:39:08 +09:00
Rafael França
73dcf00c1f Merge pull request from jeyb/remove_cable_files_for_skip_action_cable
Ensure Action Cable files are removed when `skip_action_cable` is set.
2015-12-21 19:01:34 -02:00
Rafael Mendonça França
f51a30c666 Use the generators options to not generate channel assets 2015-12-21 18:58:08 -02:00
Jey Balachandran
96093e3cf7 Ensure Action Cable files are removed when skip_action_cable is set.
The Action Cable generators creates four files which need to be removed
if `skip_action_cable` is set.

1. `app/assets/javascripts/cable.coffee`
2. `app/channels/application_cable/channel.rb`
3. `app/channels/application_cable/connection.rb`
4. `config/redis/cable.yml`

Fixes .
2015-12-21 15:27:42 -05:00
Kasper Timm Hansen
daa890331e Merge pull request from prathamesh-sonpatki/fix-master
Ensure that assets are enabled back after the test that tests assets are disabled
2015-12-21 21:18:40 +01:00
Prathamesh Sonpatki
8b8b6e9378 Ensure that assets are enabled back after the test that tests assets are disabled 2015-12-21 22:33:16 +05:30
Yves Senn
a88ab73f7e Merge pull request from teknofire/fix-using-add_resource-with-a-block-after-gem-call
Fix using add_resource with a block after gem in custom generators
2015-12-21 16:46:42 +01:00
Will Fisher
12dd2ca863 Fixes using add_source with a block after using gem in a custom rails
generator template.
2015-12-21 06:06:30 -09:00
David Heinemeier Hansson
26a8320c72 Merge pull request from ryohashimoto/22669_api_generator
Action Cable channel generator doesn't create JS assets if options[:rails][:assets] is false
2015-12-21 14:31:42 +01:00
yuuji.yaginuma
4f8c36ab70 display detailed information in inline reporting
The errors message only was not displayed, as if it did not use the inline reporting,
modified to also information the method name and the like in error are displayed.

```
# before
Failed assertion, no message given.

bin/rails test test/models/user_test.rb:5
```

```
# after
Failure:
UserTest#test_the_truth:
Failed assertion, no message given.

bin/rails test test/models/user_test.rb:5
```
2015-12-21 07:48:53 +09:00
Ryo Hashimoto
61366f5a3d Action Cable channel generator should not create JS assets in --api mode 2015-12-19 13:43:11 +09:00
Rafael Mendonça França
840b3dd9b2 Do not check the version anymore
Our logic is complex now and we don't need to check the version to asset
the behavior so I'm removing the checking here.
2015-12-18 12:39:19 -02:00
Matthew Draper
46d1cc90be Allow normal version updates within a release series
We originally chose to apply very strict versioning on the `rails` entry
in the Gemfile, because our future versioning policy was not strongly
defined.

Now it is, and our policy is very much designed on the expectation that
people will regularly update to the latest patch level in their release
series... so we should encourage that.

Of course, Gemfile.lock will do its job and prevent unplanned updates,
just as it does for every other gem in the bundle... but if you run
`bundle update`, we want to get you the latest bug/security fixes
without requiring a manual edit of the Gemfile entry.

Our current version could be a few different shapes, so it takes a bit
of work to find the right specifier, but in principle, we match anything
of the form x.y.*, where x.y matches our current release series.
2015-12-18 18:02:21 +10:30
Matthew Draper
4a58aef7e3 Merge pull request from seuros/remove-mysql-adapter
Remove legacy mysql adapter
2015-12-18 13:51:04 +10:30
David Heinemeier Hansson
293d35e256 ApplicationMailer should be generated by default just like every other Application* parent 2015-12-17 17:35:20 -02:00
Rafael Mendonça França
80ba81d2a0 Fix warning 2015-12-17 17:35:20 -02:00
Abdelkader Boudih
fb24d0ed6c Remove legacy mysql adapter 2015-12-17 15:54:57 +00:00
yuuji.yaginuma
f34beb52e2 README.rdoc -> README.md for newly generated plugins
I think Markdown is nowadays a better default.
2015-12-17 21:24:52 +09:00
David Heinemeier Hansson
d15de0cfb8 Fix tests 2015-12-17 11:49:06 +01:00
David Heinemeier Hansson
457f92e824 No longer uses keep now that we have ApplicationRecord 2015-12-16 23:18:03 +01:00
David Heinemeier Hansson
60bbd1571a Fix test 2015-12-16 22:59:22 +01:00
David Heinemeier Hansson
42b9126610 Fix test now that cable is in there by default too 2015-12-16 22:02:43 +01:00
Rafael Mendonça França
4b669dbb91 Merge branch 'master' into merge-action-cable 2015-12-16 17:05:16 -02:00
Rafael Mendonça França
877a411d0c Use sprockets 3 in the Rails 5 release 2015-12-16 16:30:58 -02:00
Rafael França
1d7d8062b2 Merge pull request from gsamokovarov/introduce-application-record
Introduce ApplicationRecord, an Active Record layer supertype
2015-12-16 14:37:57 -02:00
Genadi Samokovarov
2067fff9e3 Introduce ApplicationRecord, an Active Record layer supertype
It's pretty common for folks to monkey patch `ActiveRecord::Base` to
work around an issue or introduce extra functionality. Instead of
shoving even more stuff in `ActiveRecord::Base`, `ApplicationRecord` can
hold all those custom work the apps may need.

Now, we don't wanna encourage all of the application models to inherit
from `ActiveRecord::Base`, but we can encourage all the models that do,
to inherit from `ApplicationRecord`.

Newly generated applications have `app/models/application_record.rb`
present by default. The model generators are smart enough to recognize
that newly generated models have to inherit from `ApplicationRecord`,
but only if it's present.
2015-12-16 10:30:09 +01:00
eileencodes
becf1bcb1d Run railties generated app tests in test env
Running railties generated app tests in development env can cause unintended
consequences. The environments are different and tests aren't meant to be
run in development mode.

The changes to the generator exposed this issue where the random test
order in the generated apps could cause problems when those tests are
run in development mode.

Particularly we saw failures in `railties/test/application/rake_test.rb`
generated apps that used the scaffold to create applications and then
run the migration and immediately run the tests. The error we saw was
`ActiveRecord::RecordNotFound: Couldn't find User with 'id'=980190962`
and seemed to only occur if the destroy test ran first. I'm not entirely
sure _why_ this causes that error to be thrown but I believe it is
related to the environments being different.
2015-12-15 15:19:26 -05:00
Abdelkader Boudih
98a039dcd9 Update test generators to use ActionDispatch::IntegrationTest
In Rails 5.1 `ActionController::TestCase` will be moved out of Rails
into it's own gem. Please use `ActionDispatch::IntegrationTest` going
forward.

This changes the generators to use `ActionDispatch::IntegrationTest` and
the required URL setup (rather than symbols) for each of the controller
actions.

Updated fix to .
2015-12-15 15:19:16 -05:00
Santiago Pastorino
f8edd2043e Do not default to any Serializer
We will wait until 5.1 to make a decision
2015-12-15 16:46:02 -03:00
Rafael Mendonça França
fc635b5653 Accept a Pathname in Application#config_for
That would make possible to use it with action cable configuration.
2015-12-15 15:53:53 -02:00
Rafael Mendonça França
ca8e14862a Merge remote-tracking branch 'origin/master' into merge-action-cable 2015-12-15 15:22:33 -02:00
Matthew Draper
a6d4e5e532 Internal test migrations use the private 'Current' version
Apart from specific versioning support, our tests should focus on the
behaviour of whatever version they're accompanying, regardless of when
they were written.

Application code should *not* do this.
2015-12-15 17:18:09 +10:30
Matthew Draper
dc8d40af58 Ensure generated migrations include a version number 2015-12-15 17:18:09 +10:30
Rafael Mendonça França
65f65d67ba Add option to skip Action Cable 2015-12-14 23:44:52 -02:00
eileencodes
2dd64a7bbb Revert "Merge pull request from seuros/remove-test-case"
This reverts commit 9712a7a12b, reversing
changes made to 3e65c3d388.

Reverting because this caused test failures and while we have a followup
branch there is still one failure that happens randomly and isn't
straight forward to fix.
2015-12-13 21:24:40 -05:00
Eileen M. Uchitelle
9712a7a12b Merge pull request from seuros/remove-test-case
Controller generators should be creating IntegrationTest stubs instea…
2015-12-13 16:19:30 -05:00
Kasper Timm Hansen
02eef9459a Merge pull request from gsamokovarov/scaffold-500
Prevent a 500 in the default controller scaffold
2015-12-13 20:57:51 +01:00
Genadi Samokovarov
c83ace7b6a Prevent a 500 in the default controller scaffold
If you update a record with no attributes, you'll hit a 500 from a guard
in `assign_attributes` raising:

```ruby
ArgumentError: When assigning attributes, you must pass a hash as an argument.
    app/controllers/users_controller.rb:44:in `block in update'
    app/controllers/users_controller.rb:43:in `update'
    test/controllers/users_controller_test.rb:37:in `block in <class:UsersControllerTest>'
```

Not a biggie, but may be quite confusing for the folks new to the
framework.
2015-12-13 20:18:19 +01:00
Genadi Samokovarov
3ba44275f6 Update web-console to 3.0.0
Web Console 3.0.0 is compatible with Rails 5, while the 2.x.x releases
aren't.
2015-12-13 18:10:46 +01:00
Abdelkader Boudih
5541d640cf Controller generators should be creating IntegrationTest stubs instead of ControllerTest 2015-12-13 01:06:03 +00:00
yuuji.yaginuma
e4e42d0b34 show relative path the rerun snippet of test runner in rails engine
Since the absolute path is not required to re-run the test,
modified so that unnecessary information is not displayed.

```ruby
# before
bin/rails test /path/to/blorgh/test/integration/navigation_test.rb:5

# after
bin/rails test test/integration/navigation_test.rb:5
```
2015-12-10 16:08:37 +09:00
Jorge Bejar
3a94ced8a1 Remove duplicated assertion from api_app_generator tests 2015-12-09 10:53:47 -03:00
Jorge Bejar
34bfca2fee We don't need to set config.debug_exception_response_format given that :api is the default value for only API apps 2015-12-09 10:53:47 -03:00