Commit Graph

2187 Commits

Author SHA1 Message Date
Aaron Patterson
5b27f1ea18 add a test for prepending SCRIPT_NAME to generated urls 2014-08-08 11:41:21 -07:00
Arun Agrawal
301b5fd522 Fixes test for Gemfile entry changes
Broken by fbe38c9e9d4fe9f82518e8ffc1d757459b0c5f1c
2014-08-08 19:50:25 +02:00
Aaron Patterson
e81453ef92 need to call super 2014-08-07 16:03:09 -07:00
Aaron Patterson
8121eefc22 add a new constructor that runs load hooks 2014-08-07 15:50:46 -07:00
Aaron Patterson
d25fe31c40 lazily instantiate application subclasses
this means we can meaningfully override methods in the subclass
2014-08-06 18:27:16 -07:00
Yves Senn
a819211984 Merge pull request #16359 from skanev/after-bundle-in-rails-templates
Add an after_bundle callback in Rails templates

Conflicts:
	railties/CHANGELOG.md
2014-08-06 08:49:00 +02:00
Yves Senn
53dba73dc1 Revert "Revert "Merge pull request #15394 from morgoth/fix-automatic-maintaining-test-schema-for-sql-format""
This reverts commit 5c87b5c5248154cf8aa76cce9a24a88769de022d.
2014-08-06 08:25:18 +02:00
Guillermo Iguaran
ab54ec7248 We don't need parenthesis for this 2014-08-05 11:51:12 -05:00
Arthur Neves
a7060a6e21
Fix digest ETAG test.
After
12528d4567
ETag will include a `W/` before the digest.
2014-08-05 12:40:54 -04:00
José Valim
e5e4d08450 Bring back the helpers tests
Also keep the hook as other tools may rely on it,
we just don't do anything by default on Rails.
2014-08-05 14:04:30 +02:00
David Heinemeier Hansson
611849772d Pull in the custom configuration concept from dhh/custom_configuration 2014-08-03 15:48:14 -07:00
David Heinemeier Hansson
e5632f37f7 A few more tests asserting the presence of helper test stubs 2014-08-03 15:12:27 -07:00
David Heinemeier Hansson
a1ede5a441 Stubs are no longer generated for helpers, so dont test for it 2014-08-03 14:59:24 -07:00
David Heinemeier Hansson
a34b6649d0 Generating stubs for helper tests is overly specific. Most helpers should simply be tested as part of the view thats using them. If you need something beyond that, you can add a test yourself for them 2014-08-03 14:50:50 -07:00
Stefan Kanev
097b210189 Add an after_bundle callback in Rails templates
The template runs before the generation of binstubs – this does not
allow to write one, that makes an initial commit to version control.
It is solvable by adding an after_bundle callback.
2014-08-03 00:29:29 +02:00
Carlos Antonio da Silva
811604f3f7 Avoid defining the test if it does not need to when not on JRuby 2014-07-30 23:41:19 -03:00
Carlos Antonio da Silva
72c96dea2d Use default argument when testing generators without the need for extra args 2014-07-30 23:41:19 -03:00
Carlos Antonio da Silva
bfc2b23128 Simplify path setup 2014-07-30 23:41:18 -03:00
Carlos Antonio da Silva
9023e3b773 Simplify plugin tests a bit, leave the regexp work for minitest 2014-07-30 23:41:18 -03:00
Carlos Antonio da Silva
c8c8fe98b3 Invert unless..else conditions on JRuby checks 2014-07-30 23:41:18 -03:00
Carlos Antonio da Silva
5d4fce640e Remove some more globals from tests
We are using blocks here so we have access to the environment around
them, no need for globals.
2014-07-30 22:52:38 -03:00
Carlos Antonio da Silva
32f49612e7 Fix / improve some assertions 2014-07-30 22:52:38 -03:00
Carlos Antonio da Silva
5fc5665066 Remove some globals from configuration tests 2014-07-30 22:52:38 -03:00
@schneems and @sgrif
2bbcca004c Deprecate *_path methods in mailers
Email does not support relative links since there is no implicit host. Therefore all links inside of emails must be fully qualified URLs. All path helpers are now deprecated. When removed, the error will give early indication to developers to use `*_url` methods instead.

Currently if a developer uses a `*_path` helper, their tests and `mail_view` will not catch the mistake. The only way to see the error is by sending emails in production. Preventing sending out emails with non-working path's is the desired end goal of this PR.

Currently path helpers are mixed-in to controllers (the ActionMailer::Base acts as a controller). All `*_url` and `*_path` helpers are made available through the same module. This PR separates this behavior into two modules so we can extend the `*_path` methods to add a Deprecation to them. Once deprecated we can use this same area to raise a NoMethodError and add an informative message directing the developer to use `*_url` instead.

The module with warnings is only mixed in when a controller returns false from the newly added `supports_relative_path?`.

Paired @sgrif & @schneems
2014-07-30 12:01:45 -05:00
Santiago Pastorino
4efb36e7b4 Revert "Merge pull request #15305 from tgxworld/remove_unnecessary_require"
This reverts commit f632f79b8dcd144408c66a544984b2ba9cf52f87, reversing
changes made to 98c7fe87690ca4de6c46e8f69806e82e3f8af42d.

Closes #16343
2014-07-30 09:46:33 -03:00
Rafael Mendonça França
b17330cf39 Remove mocha usage 2014-07-23 19:01:44 -03:00
Rafael Mendonça França
bec08e7744 Merge pull request #16267 from robin850/rbx-yaml
Set Psych as the YAML engine for Rubinius
2014-07-23 17:45:15 -03:00
Rafael Mendonça França
cd7d414e48 Do not set enforce_available_locales to i18n 0.7
Now the default is always true.

Users still can set it using config.i18n.enforce_available_locales.
2014-07-23 17:40:44 -03:00
Robin Dupret
558f8aa2ee Set Psych as the YAML engine for Rubinius
Since the rubysl-yaml gem doesn't ship with Psych by default because of
its dependency on libyaml, on Rubinius, the default engine is Syck.

However, if we want to be able to run the application safely on
different rubies, we need to make people using Rubinius rely on Psych.

See http://git.io/uuLVag for further information.
2014-07-23 20:05:14 +02:00
Rafael Mendonça França
08754f12e6 Merge branch 'rm-remove-mocha'
Conflicts:
	actionpack/test/abstract_unit.rb
2014-07-19 18:17:13 -03:00
Rafael Mendonça França
fd6aaaa0c3 Stop requiring mocha automatically
We are planning to remove mocha from our test suite because of
performance problems. To make this possible we should stop require mocha
on ActionSupport::TestCase.

This should not affect applications since users still need to add mocha
to Gemfile and this already load mocha.

Added FIXME notes to place that still need mocha removal
2014-07-19 17:35:12 -03:00
Rafael Mendonça França
fcc2231a04 Stop using mocha on dbconsole_test 2014-07-15 23:36:45 -03:00
Rafael Mendonça França
3121412cf1 Keep quietly and capture undeprecated on your suite 2014-07-15 17:56:27 -03:00
Rafael Mendonça França
9629dea4fb Add Rails::Application#config_for
This is a convenience for loading configuration for the current Rails
environment.
2014-07-15 15:35:13 -03:00
Guo Xiang Tan
d9396a07eb Fix incorrect unsubscription. 2014-07-11 16:38:26 +08:00
Rafael Mendonça França
a83efa4a1f Stop using mocha on console_test 2014-07-07 23:39:18 -03:00
Rafael Mendonça França
57e298fcd5 Set the application logger using configuration 2014-07-07 22:57:55 -03:00
Rafael Mendonça França
d3af622586 Stop using mocha on configuration_test 2014-07-07 22:46:39 -03:00
Rafael Mendonça França
fb9eb7019e Stop using mocha on app_rails_loader_test 2014-07-07 22:05:30 -03:00
Arun Agrawal
e197fd7f37 Display notice in index.html pages in scaffolded generated views
As we are setting notice in destroy action we should display that

For more information see https://github.com/rails/rails/pull/14044
And https://github.com/rails/jbuilder/pull/191

closes #14044
2014-07-04 16:20:53 +02:00
Rafael Mendonça França
5c87b5c524 Revert "Merge pull request #15394 from morgoth/fix-automatic-maintaining-test-schema-for-sql-format"
This reverts commit 46139d33c06715e74ad450428ece3ee84da98579, reversing
changes made to 8f247871bb18b2e3036a05df5f62cbfe3b402586.

Conflicts:
	activerecord/CHANGELOG.md
2014-07-02 09:41:52 -03:00
Rafael Mendonça França
72f58b0244 Rename preview_enabled option to show_previews 2014-07-01 13:09:24 -03:00
Leonard Garvey
84ed7b8dfe Add configuration to enable mail previews
Adds `config.action_mailer.preview_enabled`

This allows mail previewing to be enabled easily in non-development
environments such as staging. The default is set to true for development
so no changes should be required to existing Rails applications.

The mail preview path can still be configured using the existing
`config.action_mailer.preview_path` configuration option.

Adding this avoids devs from having to do stuff like:
https://gist.github.com/lengarvey/fa2c9bd6cdbeba96526a

Update actionmailer/CHANGELOG with new configuration.
Update configuring guide with new configuratation.
Add `config.action_mailer.preview_path` to configuring guide.
2014-07-01 14:39:59 +10:00
Rafael Mendonça França
ebdedaec32 Merge pull request #15933 from rafael/master
Add always permitted parameters as a configurable option.

[Rafael Mendonça França + Gary S. Weaver]
2014-06-27 18:16:52 -03:00
Rafael Chacón
58399e1dc3 Improvements per code review.
* General style fixes.
* Add changes to configuration guide.
* Add missing tests.
2014-06-27 13:08:40 -07:00
Viktar Basharymau
0813607c70 Add a test for db:migrate:status to check missing file scenario 2014-06-27 18:28:12 +03:00
Rafael Chacón
c197a7dc41 Add always_permitted_parameters as an option.
* This commit adds back the always_permitted_parameters
  configuration option to strong paramaters.
* The initial pull requests where this feature was added
  are the following:
  - https://github.com/rails/rails/pull/12682
  - https://github.com/rails/strong_parameters/pull/174
2014-06-26 23:01:30 -07:00
Lucas Mazza
4b173b8ed9 Add a '--skip-routes' flag for the Controller generator.
This way it is possible to skip the addition of the 'get "foo/bar"' routes when
generating a controller.
2014-06-24 14:06:03 -03:00
Rafael Mendonça França
7f7e2f12ab initialize the right variable 2014-06-17 20:39:49 -03:00
Rafael Mendonça França
1056589580 Add a generic --skip-gems options to generator
Also remove --skip-turbolinks.

This option is useful if users want to remove some gems like jbuilder,
turbolinks, coffee-rails, etc that don't have specific options on the
generator.

    rails new my_app --skip-gems turbolinks coffee-rails
2014-06-17 20:35:09 -03:00