Commit Graph

2495 Commits

Author SHA1 Message Date
Andrei Istratii
d0e0fbafb2 Migrate to Sprockets 4. 2015-08-19 21:45:46 +03:00
Daniel Morris
0a888f0c0d Updated tests for the generated version number change 2015-08-16 23:45:55 +01:00
Kasper Timm Hansen
a0fa45c0e6 Merge pull request #21124 from kirs/feature/reload-i18n
Reload I18n.load_path in development
2015-08-10 07:34:13 +02:00
Kir Shatrov
f50e90a1ae Reload I18n locales in development 2015-08-10 00:17:49 +02:00
yuuji.yaginuma
22d863d272 make generated scaffold functional tests work inside API engines
* set engine's route in setup
* use fixture with engine namespace
2015-08-09 21:32:39 +09:00
Rafael Mendonça França
ce1bd47698 Merge pull request #21043 from y-yagi/loading_fixtures_in_engine_integration_tests
set the correct path to `ActionDispatch::IntegrationTest.fixture_path`
2015-08-06 17:29:19 -03:00
Chuck Callebs
a01e58afd9 Add rake dev:cache task to enable dev mode caching.
Taken from @Sonopa's commits on PR #19091.

Add support for dev caching via "rails s" flags.

Implement suggestions from @kaspth.

Remove temporary cache file if server does not have flags.

Break at 80 characters in railties/CHANGELOG.md

Remove ability to disable cache based on server options.

Add more comprehensive options: --dev-caching / --no-dev-caching
2015-08-04 23:41:23 -04:00
Yves Senn
bc3956c0d5 Revert "test runner should crash with non existing file argument."
This reverts commit 465f0fbca3d4a1c269038b84ec9cc248fdab5fab.

This breaks some cases where non file / directory arguments are passed
to the runner (for example db:migrate).

I still think that we can get this to work. From what I can tell there
is no reason why db:migrate is passed along to `Minitest.run`. I'll
revert and investigate possible solutions.
2015-08-03 13:42:30 +02:00
Yves Senn
465f0fbca3 test runner should crash with non existing file argument.
Before this patch, using `bin/rails test` with a non existing
file or directory argument would silently swallow the argument and
run the whole test suite.

After the patch the command fails with `cannot load such file --`.
2015-08-03 11:17:07 +02:00
schneems
9b18ba75b1 Fix rake/notes_test
Presumably due to https://github.com/rails/sprockets-rails/pull/265 sprockets was trying to load the "scss" gem but it isn't in the gemfile:

```
ApplicationTests::RakeTests::RakeNotesTest#test_register_a_new_extension:
LoadError: cannot load such file -- sass
```

If we use an empty precompile list, it won't try to load sass.
2015-07-29 20:12:56 -05:00
schneems
4bc2469156 Fix reported regression rails/sprockets-rails#265
We can prevent the UglifierCompressor from being instantiated prematurely by setting precompile to an empty array in this test.
2015-07-29 20:12:56 -05:00
yuuji.yaginuma
46599260b1 set the correct path to ActionDispatch::IntegrationTest.fixture_path
`ActionDispatch::IntegrationTest.fixture_path` set by `test_help.rb`, but if the engine,
path under the dummy is will be set, fixtures under test was not loaded.
2015-07-28 08:05:53 +09:00
Robin Dupret
a120f2716e Enable the api_only option for API plugins' generators
This way, running a generator inside the plugin's directory, files that
are not relevant won't be generated (e.g. views or assets).

This won't interfere with the application's generators configuration.
2015-07-23 19:36:49 +02:00
Robin Dupret
ce32c9da96 Generate an API dummy application for API plugins 2015-07-23 18:27:19 +02:00
Robin Dupret
e3cfd5b174 Make ApplicationController inherit from AC::API for API plugins 2015-07-23 18:27:18 +02:00
Robin Dupret
67863aa844 Skip assets, helpers and views generation for API plugins 2015-07-23 18:27:15 +02:00
Rafael Mendonça França
9582b3f509 Merge pull request #20819 from y-yagi/rails_api_gemfile
remove `web-console` from API app generated Gemfile
2015-07-21 10:59:30 -03:00
David Heinemeier Hansson
068865a7d5 Merge pull request #20384 from kaspth/per-request-cache
Use digest cache in development.
2015-07-20 13:15:55 +02:00
Kasper Timm Hansen
40f79da8f2 Make digest cache work in development.
Avoid computing the same fragment digest many times when looping over templates.

The cache is cleared on every request so template changes are still picked up.
2015-07-18 21:54:19 +02:00
yuuji.yaginuma
824246f66b make test runner work correctly inside engine 2015-07-12 18:29:31 +09:00
yuuji.yaginuma
8c6f7ca888 remove web-console from API app generated Gemfile 2015-07-09 17:51:30 +09:00
Matthew Draper
383fed5f23 Rely on the load interlock for non-caching reloads, too 2015-07-09 03:31:30 +09:30
Matthew Draper
c37d47e308 Soften the lock requirements when eager_load is disabled
We don't need to fully disable concurrent requests: just ensure that
loads are performed in isolation.
2015-07-09 02:23:23 +09:30
Robin Dupret
42b5906523 Display a more human readable list of reserved names
Interpolating an array inside a String will call #inspect on it. Let's
call #join to display a more human-readable error message.
2015-07-01 16:58:42 +02:00
Yves Senn
2183caa24a dump_schema_after_migration applies migration tasks other than db:migrate
Closes #20743.

The task `db:_dump` now only dumps the schema if
`ActiveRecord::Base.dump_schema_after_migration` is true. This has
effects:

- `db:migrate:up`
- `db:migrate:down`
- `db:forward`
- `db:rollback`
2015-06-30 16:36:03 +02:00
Yves Senn
a8f250a22c tests, railties tests should use bin/ executables when possible.
We recommend using the `bin/` executables in our docs and guides.
Let's make sure that our tests execute the same code path.
2015-06-30 11:19:01 +02:00
yuuji.yaginuma
b1738e1a02 fix NoMethodError that occurs when generating scaffold inside full mode engine 2015-06-28 18:16:01 +09:00
Hirofumi Wakasugi
e6be33f1dd cherry-pick test and source doc from #20050 2015-06-25 15:25:49 +09:00
yuuji.yaginuma
1d3e0f5872 do not show "Failed tests" message when a failed test is not 2015-06-23 07:53:17 +09:00
yuuji.yaginuma
3bcb637eab remove unused variable in reporter test 2015-06-22 08:04:53 +09:00
Yves Senn
e97b8cb15f Merge pull request #20605 from dcrec1/assert_file
assert_file understands paths with special characters
2015-06-19 11:25:03 +02:00
Diego Carrion
6074d0f6d3 assert_file understands paths with special characters
fixes #20042
2015-06-18 11:59:47 -03:00
Mehmet Emin İNAÇ
c76b11244c fix railties tests 2015-06-18 14:45:45 +03:00
Yves Senn
2e59604909 make it possible to customize the executable inside rereun snippets.
In the Rails repository we use a `bin/test` executable to run our tests.
However the rerun snippets still included `bin/rails test`:

BEFORE:
```
Failed tests:

bin/rails test test/cases/adapters/postgresql/schema_test.rb:91
```

AFTER:
```
Failed tests:

bin/test test/cases/adapters/postgresql/schema_test.rb:91
```
2015-06-13 11:58:43 +02:00
Sean Griffin
de45e4c6cd Fix failing tests for Rails-API
This looks to be just out of sync tests
2015-06-11 17:24:59 -06:00
Jorge Bejar
cf9f2f329a Enable wrap_parameter by default in rails api applications 2015-06-11 16:54:16 -03:00
Jorge Bejar
ebcc15ca4e Add rake-cors gem (commented) in Gemfile for rails api apps 2015-06-11 16:54:16 -03:00
Santiago Pastorino
511c33a157 Add AMS 0.10.0.rc1 by default for api apps 2015-06-11 16:54:15 -03:00
Santiago Pastorino
dc4c68aaaa Fix scaffold generator test for resource routes 2015-06-11 16:54:15 -03:00
Jorge Bejar
fa11f10c94 Api only apps should include tmp and vendor folders 2015-06-11 16:54:14 -03:00
Jorge Bejar
674dab30bc Routes resources avoid :new and :edit endpoints if api_only is enabled 2015-06-11 16:54:14 -03:00
Santiago Pastorino
440b334cbb Use new hash syntax 2015-06-11 16:54:13 -03:00
Santiago Pastorino
3d3730040d Disable jbuilder for Rails API apps, meanwhile it doesn't play nicely 2015-06-11 16:54:12 -03:00
Santiago Pastorino
7d17269be3 Add test to show api only apps allow overriding generator options 2015-06-11 16:54:12 -03:00
Santiago Pastorino
e9e94c1d15 Add config.api_only = true to config/application.rb when using rails new --api 2015-06-11 16:54:12 -03:00
Santiago Pastorino
98a9936228 config.api_only = true implies config.generators.api_only = true 2015-06-11 16:54:12 -03:00
Santiago Pastorino
decc4e8f82 Do not generate lib/assets directory for api apps 2015-06-11 16:54:12 -03:00
Santiago Pastorino
94fdba9c92 Api apps scaffold does not generate assets 2015-06-11 16:54:12 -03:00
Santiago Pastorino
e5b6188b47 Api apps scaffold does not generate helpers 2015-06-11 16:54:12 -03:00
Santiago Pastorino
6d2b405a4e Api apps scaffold does not generate views 2015-06-11 16:54:12 -03:00