aboutsummaryrefslogtreecommitdiffstats
path: root/railties/lib/rails/generators/test_unit
Commit message (Collapse)AuthorAgeFilesLines
* Refactor config settings to use generated fileeileencodes2017-02-203-2/+14
| | | | | | | | | | | | | | | | | | | Originally I had set up system testing to have one configuration option to be set in the test environment. After thinking it over I think a generated class on app creation would be best. The reason for this is Capybara has a ton of configuration options that I'm sure some folks want to use. Thinking about how we handle screenshots, database transactions, and a whole bunch of other settings it would be better for users to be able to turn all of that on and off. When an app or scaffold is generated a `test/system_test_helper.rb` test helper will be generated as well. This will contain the class for tests to inherit from `ActionSystemTestCase` which will inherit from `ActionSystemTest::Base`. Here is where users can change the test driver, remove the screenshot helper, and add their additional Capybara configuration.
* Turn system testing into it's own gem and renameeileencodes2017-02-201-1/+1
| | | | | | | | | | Renames `Rails::SystemTestCase` to `ActionSystemTest` and moves it to a gem under the Rails name. We need to name the class `ActionSystemTestCase` because the gem expects a module but tests themselves expect a class. Adds MIT-LICENSE, CHANGELOG, and README for the future.
* Appease Rubocopeileencodes2017-02-201-1/+1
| | | | Rubocop / code climate don't like single quotes and prefer doubles.
* Add generators and ability to run system testseileencodes2017-02-202-0/+20
| | | | | | | * Generates system test requirements with new Rails app * Includes required default gems in Gemfile for Rails app * Generates a single system test case * Generates a system test case with scaffold
* Add missing module namespacing wrapperShota Iguchi2017-02-151-0/+2
| | | | refs: #28011
* Fix generator command for nested (namespaced) rails engine (take 2)Fumiaki MATSUSHIMA2017-01-071-1/+1
| | | | | | | | | | | | | | | | | | | Rewrite https://github.com/rails/rails/pull/27550 085546df45 was reverted (b6ffb5efcb) because it change the return of `namespaced_path` from String to Array. ---------------- If we create nested (namespaced) rails engine such like bukkits-admin, `bin/rails g scaffold User name:string age:integer` will create `bukkits-admin/app/controllers/bukkits/users_controller.rb` but it should create `bukkits-admin/app/controllers/bukkits/admin/users_controller.rb`. In #6643, we changed `namespaced_path` as root path because we supposed application_controller is always in root but nested rails engine's application_controller will not.
* Revert "Merge pull request #27550 from ↵Rafael Mendonça França2017-01-031-1/+1
| | | | | | | | | mtsmfm/fix-generator-command-for-nested-rails-engine" This reverts commit 1e969bfb98b88799e2c759fce25a1d8cf00d7ce7, reversing changes made to a5041f267ded119c2d00b8786c2f2c1e3f93c8a1. Reason: It breaks the public API
* Fix generator command for nested (namespaced) rails engineFumiaki MATSUSHIMA2017-01-031-1/+1
| | | | | | | | | | | | | If we create nested (namespaced) rails engine such like bukkits-admin, `bin/rails g scaffold User name:string age:integer` will create `bukkits-admin/app/controllers/bukkits/users_controller.rb` but it should create `bukkits-admin/app/controllers/bukkits/admin/users_controller.rb`. In #6643, we changed `namespaced_path` as root path because we supposed application_controller is always in root but nested rails engine's application_controller will not.
* Privatize unneededly protected methods in RailtiesAkira Matsuda2016-12-252-2/+2
|
* applies remaining conventions across the projectXavier Noria2016-08-061-1/+0
|
* applies new string literal convention in railties/libXavier Noria2016-08-069-23/+23
| | | | | 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-5/+5
| | | | | | | - 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.
* Redirects are to urls, not pathsDavid Heinemeier Hansson2016-05-281-3/+3
|
* Remove redundant regexp escapes in generatorsGadzhi Gadzhiev2016-03-081-1/+1
|
* set association name to generated fixtures if attribute is referenceyuuji.yaginuma2016-02-061-1/+1
| | | | | | | 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
* make generated controller test work correctlyyuuji.yaginuma2016-01-061-1/+1
| | | | | | | Since the `#file_name` that not consideration for the namespace, if generate a controller with a namespace, not the correct url helper generation, it had become an error to run the test. Modified to generate the correct url helper, even if it is produced a namespace with controller.
* Merge branch 'master' of github.com:rails/docrailsVijay Dev2015-12-201-2/+2
|\
| * remove extra spaces in fixtures doc partGaurav Sharma2015-12-131-2/+2
| | | | | | | | | | | | | | | | | | | | | | ``` Every time when a fixture generate, it’s also generating improper doc. one: {} # column: value # two: {} # column: value ```
* | fix indentation of generated controller testyuuji.yaginuma2015-12-182-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ``` # before module Bukkits class UsersControllerTest < ActionDispatch::IntegrationTest include Engine.routes.url_helpers setup do @user = bukkits_users(:one) end ``` ``` # after module Bukkits class UsersControllerTest < ActionDispatch::IntegrationTest include Engine.routes.url_helpers setup do @user = bukkits_users(:one) end ```
* | Deal with leading CR when its not a mountable engineDavid Heinemeier Hansson2015-12-171-1/+1
| |
* | Update test generators to use ActionDispatch::IntegrationTestAbdelkader Boudih2015-12-153-25/+25
| | | | | | | | | | | | | | | | | | | | | | | | 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-133-17/+16
| | | | | | | | | | | | | | | | | | 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.
* | Controller generators should be creating IntegrationTest stubs instead of ↵Abdelkader Boudih2015-12-133-16/+17
|/ | | | ControllerTest
* make generated scaffold functional tests work inside API enginesyuuji.yaginuma2015-08-091-1/+4
| | | | | * set engine's route in setup * use fixture with engine namespace
* fix NoMethodError that occurs when generating scaffold inside full mode engineyuuji.yaginuma2015-06-283-3/+3
|
* assigns was removed from RailsRafael Mendonça França2015-06-111-1/+0
|
* Make Rails API apps return the full resource on updateSantiago Pastorino2015-06-111-1/+1
|
* Fix class_option description for api generatorsSantiago Pastorino2015-06-111-1/+1
|
* API apps scaffold generator generates an apropriate controllerSantiago Pastorino2015-06-112-1/+46
|
* Merge pull request #20387 from y-yagi/fix_engine_generated_controller_testYves Senn2015-06-023-1/+19
|\ | | | | | | set engine's route in the functional test is generated in the engine
| * add engine's namespace to fixture nameyuuji.yaginuma2015-05-312-1/+10
| |
| * set engine's route in the functional test is generated in the engineyuuji.yaginuma2015-05-312-0/+9
|/
* Removed `assigns` from functional_test templatesPrathamesh Sonpatki2015-05-021-3/+2
| | | | | - Based on DHH's suggestion about deprecating `assigns` in https://github.com/rails/rails/pull/18305#issuecomment-68605166.
* respect `pluralize_table_names` when generate fixture file. fixes #19519yuuji.yaginuma2015-03-271-1/+1
|
* add mailer suffix to comments for email previewsyuuji.yaginuma2015-03-151-2/+2
|
* Merge pull request #18393 from y-yagi/fix_mailerRafael Mendonça França2015-02-182-1/+6
|\ | | | | follow up to #18074
| * follow up to #18074yuuji.yaginuma2015-01-082-1/+6
| | | | | | | | | | * ignore mailer suffix when generate test files * add mailer suffix to view files
* | scaffold controller_test template should use kwargs. refs #18323.Yves Senn2015-01-301-5/+5
|/ | | | This prevents a flood of warnings when generating a new scaffold.
* Add mailer suffix to generated files and classesCarlos Souza2015-01-063-6/+6
| | | | | Following the same naming convention used in controllers and jobs.
* Generated fixtures won't use parent_id when generated with parent:referencesPablo Olmos de Aguilera Corradini2015-01-021-0/+2
| | | | Fix #18301
* correct filename for jobs testsAbdelkader Boudih2014-09-281-1/+1
|
* Change ActiveJob test directory to "test/jobs"yuuji.yaginuma2014-09-131-1/+1
|
* Remove extra newline from ActiveJob test templateyuuji.yaginuma2014-09-091-1/+0
|
* [ActiveJob] TestCaseAbdelkader Boudih2014-09-021-1/+0
|
* [ActiveJob] TestCaseAbdelkader Boudih2014-09-021-1/+3
|
* [ActiveJob] Add hook for test_framework and test templatesAbdelkader Boudih2014-08-222-0/+22
|
* Bring back the helpers testsJosé Valim2014-08-051-0/+9
| | | | | Also keep the hook as other tools may rely on it, we just don't do anything by default on Rails.
* Generating stubs for helper tests is overly specific. Most helpers should ↵David Heinemeier Hansson2014-08-032-19/+0
| | | | 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
* Add comments with urls for email previewsAndrew White2013-12-221-0/+2
|
* Add mailer previews feature based on mail_view gemAndrew White2013-12-172-1/+19
|