aboutsummaryrefslogtreecommitdiffstats
path: root/railties/test/generators/scaffold_controller_generator_test.rb
Commit message (Collapse)AuthorAgeFilesLines
* `rails new` runs `rails active_storage:install`bogdanvlviv2017-11-061-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Omit `rails activestorage:install` for jdbcmysql, jdbc and shebang tests AppGeneratorTest#test_config_jdbcmysql_database rails aborted! LoadError: Could not load 'active_record/connection_adapters/mysql_adapter'. Make sure that the adapter in config/database.yml is valid. If you use an adapter other than 'mysql2', 'postgresql' or 'sqlite3' add the necessary adapter gem to the Gemfile. (compressed) bin/rails:4:in `<main>' Tasks: TOP => activestorage:install => environment (See full trace by running task with --trace) AppGeneratorTest#test_config_jdbc_database rails aborted! LoadError: Could not load 'active_record/connection_adapters/jdbc_adapter'. Make sure that the adapter in config/database.yml is valid. If you use an adapter other than 'mysql2', 'postgresql' or 'sqlite3' add the necessary adapter gem to the Gemfile. (compressed) bin/rails:4:in `<main>' Tasks: TOP => activestorage:install => environment (See full trace by running task with --trace) AppGeneratorTest#test_shebang_is_added_to_rails_file /home/ubuntu/.rbenv/versions/2.4.1/bin/ruby: no Ruby script found in input (LoadError) Prevent PendingMigrationError in tests * Run `bin/rails db:migrate RAILS_ENV=test` in test_cases before start tests to prevent PendingMigrationError * FileUtils.rm_r("db/migrate") * --skip-active-storage Fix failed tests in `railties/test/railties/engine_test.rb` Related to #30111 Imporve `SharedGeneratorTests#test_default_frameworks_are_required_when_others_are_removed` - Explicitly skip active_storage - Ensure that skipped frameworks are commented - Ensure that default frameworks are not commented Fix error `Errno::ENOSPC: No space left on device - sendfile` Since `rails new` runs `rails active_storage:install` that boots an app. Since adding Bootsnap 0312a5c67e35b960e33677b5358c539f1047e4e1 during booting an app, it creates the cache: 264K tmp/cache/bootsnap-load-path-cache 27M tmp/cache/bootsnap-compile-cache * teardown_app must remove app
* scaffold nested name controller should be fine.yalab2017-09-271-0/+23
|
* Adding frozen_string_literal pragma to Railties.Pat Allan2017-08-141-0/+2
|
* Revert "Merge pull request #29540 from kirs/rubocop-frozen-string"Matthew Draper2017-07-021-1/+0
| | | | | This reverts commit 3420a14590c0e6915d8b6c242887f74adb4120f9, reversing changes made to afb66a5a598ce4ac74ad84b125a5abf046dcf5aa.
* Enforce frozen string in RubocopKir Shatrov2017-07-011-0/+1
|
* Don't generate HTML/ERB templates for scaffold controller with --api flagPrathamesh Sonpatki2017-01-071-0/+6
| | | | - Fixes #27591.
* applies new string literal convention in railties/testXavier Noria2016-08-061-2/+2
| | | | | The current code base is not uniform. After some discussion, we have chosen to go with double quotes by default.
* Fix API controller tests by assigning them the encoding typePrathamesh Sonpatki2016-06-071-2/+2
| | | | | | | - Fixes #25183. - The `as: :json` feature was added in https://github.com/rails/rails/pull/21671 and recommended to use for JSON endpoints so let's use it by default for API controller tests.
* Update test generators to use ActionDispatch::IntegrationTestAbdelkader Boudih2015-12-151-9/+9
| | | | | | | | | | | | 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 #22076.
* Revert "Merge pull request #22569 from seuros/remove-test-case"eileencodes2015-12-131-3/+3
| | | | | | | | | This reverts commit 9712a7a12b7f9e4dcef751ceda8a73c3f4beb11f, reversing changes made to 3e65c3d3886336e9145438cdeacaf4ebec6a48b8. 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.
* Merge pull request #22569 from seuros/remove-test-caseEileen M. Uchitelle2015-12-131-3/+3
|\ | | | | Controller generators should be creating IntegrationTest stubs instea…
| * Controller generators should be creating IntegrationTest stubs instead of ↵Abdelkader Boudih2015-12-131-3/+3
| | | | | | | | ControllerTest
* | Prevent a 500 in the default controller scaffoldGenadi Samokovarov2015-12-131-1/+1
|/ | | | | | | | | | | | | | | 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.
* make test runner work correctly inside engineyuuji.yaginuma2015-07-121-2/+2
|
* fix NoMethodError that occurs when generating scaffold inside full mode engineyuuji.yaginuma2015-06-281-0/+11
|
* API apps scaffold generator generates an apropriate controllerSantiago Pastorino2015-06-111-0/+47
|
* add test to run generated test files inside mountable engineyuuji.yaginuma2015-06-021-0/+11
|
* build fix.Yves Senn2015-01-301-4/+4
|
* A few more tests asserting the presence of helper test stubsDavid Heinemeier Hansson2014-08-031-2/+0
|
* Display notice in index.html pages in scaffolded generated viewsArun Agrawal2014-07-041-0/+8
| | | | | | | | | 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
* Use short-form for the scaffold render calls and drop the needless testDavid Heinemeier Hansson2014-04-081-7/+0
|
* Added --model-name option scaffold_controller_generator.yalab2013-10-151-0/+9
|
* Added notice message for destroy method in scaffoldRahul P. Chaudhari2013-02-101-0/+1
|
* More consistent quotes in scaffold generatorPavel Pravosud2013-01-111-1/+1
|
* Include jbuilder by default and rely on its scaffold generator to show json ↵David Heinemeier Hansson2013-01-101-15/+1
| | | | API. The default scaffold will now just create HTML if the user actively opts out of jbuilder
* Merge pull request #8705 from amparo-luna/change_update_attributes_to_updateGuillermo Iguaran2013-01-031-1/+1
|\ | | | | Rename update_attributes method to update
| * Updating default application templates to use update instead of ↵Amparo Luna + Guillermo Iguaran2013-01-031-1/+1
| | | | | | | | update_attributes
* | test PATCH method for update action in generated scaffold controller test ↵Akira Matsuda2013-01-031-2/+2
|/ | | | rather than PUT
* Add --no-html to scaffold generatorYehuda Katz2012-12-221-0/+12
|
* Deal with polymorphic attributes correctly in the generatorsRafael Mendonça França2012-12-101-3/+12
|
* Put the reference and belongs_to attributes in the scaffold tests.Rafael Mendonça França2012-12-101-3/+3
|
* Use the references and belongs_id ids in the scaffold_controllerRafael Mendonça França2012-12-091-0/+9
| | | | generator
* Add test case for scaffold_controller generator without attributes.Rafael Mendonça França2012-12-091-0/+9
| | | | This is a test for 978c568a7bffe354180aaefa471092182fed1015
* Fix scaffold controller generator testsCarlos Antonio da Silva2012-12-081-8/+6
|
* Remove some line breaks between array items that make the assert file tests ↵Carlos Antonio da Silva2012-11-041-6/+3
| | | | harder to read
* Update test locationsMike Moore2012-10-091-4/+4
| | | | | | | | | | | | | | Change the default test locations to avoid confusion around the common testing terms "unit" and "functional". Add new rake tasks for the new locations, while maintaining backwards compatibility with the old rake tasks. New testing locations are as follows: app/models -> test/models (was test/units) app/helpers -> test/helpers (was test/units/helpers) app/controllers -> test/controllers (was test/functional) app/mailers -> test/mailers (was test/functional)
* Update test to match new non-sorting of attributes.Brian Morearty2012-09-231-1/+1
|
* Change scaffold_controller to generate and use private method to encapsulate ↵Guillermo Iguaran2012-09-161-2/+5
| | | | permissible params
* Remove --http.José Valim2012-03-141-37/+0
|
* Generate special controller and functional test templates for http appsCarlos Antonio da Silva2012-03-141-0/+37
| | | | | | | | | | | | The main goal is to not generate the format.html block in scaffold controller, and to generate a different functional test as we don't rely on redirects anymore, we should test for http responses. In addition to that, the :edit action is removed from the http controller and the edit route is not generated by default, as they usually do not make sense in this scenario. [Carlos Antonio da Silva & Santiago Pastorino]
* Refactor the test_unit scaffold generator to use the key_value methodRafael Mendonça França2012-03-131-4/+4
|
* Use the attributes hash explicitlyRafael Mendonça França2012-03-131-3/+13
|
* Do not use the attributes hash in the scaffold functional testsRafael Mendonça França2012-03-121-0/+3
|
* Get rid of --old-style-hashJosé Valim2011-12-201-12/+1
|
* be sure to parenthesize the arguments when the first one is a RegExp literalAkira Matsuda2011-05-181-23/+23
| | | | | | this fixes: "warning: ambiguous first argument; put parentheses or even spaces" because: you need this to tell the parser that you're not calling :/ method (division) details (Japanese!): http://blade.nagaokaut.ac.jp/cgi-bin/vframe.rb/ruby/ruby-dev/42445?42370-43277
* Add --old-style-hash option to force creating old style hash on Ruby 1.9Prem Sichanugrist2011-04-101-0/+7
| | | | That means if you don't like the new syntax, you can pass --old-style-hash to force Rails to generate code with hash rockets.
* Rails will now generate Ruby 1.9 style hash when running scaffold_controller ↵Prem Sichanugrist2011-04-101-0/+11
| | | | | | | | generator on Ruby 1.9.x The new hash syntax of Ruby 1.9 looks more superior, so we decide to switch to it in the places that appropriate. This patch has been requested by DHH.
* Remove the --singeleton option from scaffold generator.Prem Sichanugrist2010-06-241-14/+0
| | | | | | | | It turned out to be that scaffold for singeleton resource will always depend on another model, and it's not possible at the moment to make the application tests pass after generate the singeleton scafold. So, it would be better to remove it for now and probably provide another generator, such as singeleton_scaffold, in which also require the depended model name. [#4863 state:resolved] Signed-off-by: José Valim <jose.valim@gmail.com>
* Partially revert "A new application now comes with a layout and a stylesheet."Jeremy Kemper2010-04-091-0/+1
| | | | | | | | | This reverts commit ea2c5fa8046e2f953b366adc94f0610ccfea0828. Conflicts: railties/lib/rails/generators/rails/app/templates/app/views/layouts/application.html.erb railties/test/generators/app_generator_test.rb
* A new application now comes with a layout and a stylesheet.José Valim2010-04-061-1/+0
|