aboutsummaryrefslogtreecommitdiffstats
path: root/railties/test
Commit message (Collapse)AuthorAgeFilesLines
...
* | | Remove this conditionalEileen Uchitelle2018-08-291-1/+1
| | | | | | | | | | | | I removed the argument so I should remove the conditional too.
* | | Remove unused argumentEileen Uchitelle2018-08-291-1/+1
| | | | | | | | | | | | The test that used this was updated and it's no longer needed.
* | | Merge pull request #33748 from eileencodes/fix-erb-loading-issue-with-db-yamlEileen M. Uchitelle2018-08-291-3/+7
|\ \ \ | |/ / |/| | Drop load_database_yaml and fix test
| * | Drop load_database_yaml and fix testEileen Uchitelle2018-08-291-3/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We originally did the whole `load_database_yaml` thing because this test wasn't cooperating and we needed to finish the namespaced rake tasks for multiple databases. However, it turns out that YAML can't eval ERB if you don't tell it it's ERB so you get Pysch parse errors if you're using multi-line ERB or ERB with conditionals. It's a hot mess. After trying a few things and thinking it over we decided that it wasn't worth bandaiding over, the test needed to be improved. The test was added in #31135 to test that the env is loaded in these tasks. But it was blowing up because we were trying to read a database name out of the configuration - however that's not the purpose of this change. We want to read environment files in the rake tasks, but not in the config file. In this PR we changed the test to test what the PR was actually fixing. We've also deleted the `load_database_yaml` because it caused more problems than it was worth. This should fix the issues described in https://github.com/rails/rails/pull/32274#issuecomment-384161057. We also had these problems at GitHub. Co-authored-by: alimi <aibrahim2k2@gmail.com>
* | | Merge pull request #33718 from kddeisz/permit-listMatthew Draper2018-08-291-2/+2
|\ \ \ | |_|/ |/| | Finish converting whitelist and blacklist references
| * | Permit list usage cleanup and clearer documentationKevin Deisz2018-08-271-2/+2
| | |
| * | Convert over the rest of the blacklist referencesKevin Deisz2018-08-241-2/+2
| |/
* / Generate the same value as a label of view in system test templateyuuji.yaginuma2018-08-291-1/+1
|/ | | | | | | | | | | | | | | | | | | | | | In the system test template, enter a value based on label. However, since `label` method does not use `titleize` by default. If generate a value including underscore, cannot find a label and the test will fail. ``` $ ./bin/rails g scaffold user name:string phone_number:string $ ./bin/rails t test/system/users_test.rb E Error: UsersTest#test_creating_a_User: Capybara::ElementNotFound: Unable to find field "Phone Number" test/system/users_test.rb:18:in `block in <class:UsersTest>' ``` This removes unnecessary `titleize` so that the generated file will pass even if the attribute contains an underscore.
* Merge pull request #33660 from y-yagi/follow_up_32121Richard Schneeman2018-08-211-0/+44
|\ | | | | Make `rake routes` deprecate before deleting
| * Make `rake routes` deprecate before deletingyuuji.yaginuma2018-08-201-0/+44
| | | | | | | | | | | | | | `rake routes` was a public task. Therefore, I think that we should deprecate it before deleting it. Related to #32121.
* | Fix `rails routes -c` for controller name consists of multiple word.Yoshiyuki Kinjo2018-08-201-22/+64
|/
* Update 'rake initializers' to use Rails::Command under the hoodAnnie-Claude Côté2018-08-161-0/+42
| | | | | | * Invoke Rails::Command within the rake task * Adds test for calling initializers with 'bin/rake' * Adds deprecation warning to the rake task
* Move 'rails initializers' command to Rails::CommandAnnie-Claude Côté2018-08-161-0/+32
|
* Merge pull request #33499 from lsylvester/caller-ignore-pathsKasper Timm Hansen2018-08-151-16/+0
|\ | | | | use BacktraceCleaner for ActiveRecord verbose logging
| * Use backtrace cleaner to clean up backtrace for verbose query logsLachlan Sylvester2018-08-141-16/+0
| |
* | Have `bin:rake dev:cache` use the Dev Rails Command under the hoodAnnie-Claude Côté2018-08-131-15/+28
| | | | | | | | | | * Call the Rails::Command::DevCommand in the rake task for dev:cache * Add deprecation for using `bin/rake` in favor of `bin/rails`
* | Adds Rails:Command for `dev:cache` that has the same behaviour as the rake taskAnnie-Claude Côté2018-08-131-0/+65
|/
* Purpose Metadata For Signed And Encrypted CookiesAssain2018-08-122-10/+10
| | | | | | | | | | | | | | | | Purpose metadata prevents cookie values from being copy-pasted and ensures that the cookie is used only for its originally intended purpose. The Purpose and Expiry metadata are embedded inside signed/encrypted cookies and will not be readable on previous versions of Rails. We can switch off purpose and expiry metadata embedded in signed and encrypted cookies using config.action_dispatch.use_cookies_with_metadata = false if you want your cookies to be readable on older versions of Rails.
* `bundle binstubs bundler` should be executed after `bundle install`bogdanvlviv2018-08-111-1/+1
| | | | | | | | | | | | | | | | | | | | | Fixes: `bundle binstubs bundler` doesn't generate `bin/bundle` for newly generated Rails app. ``` ... (snip) run bundle binstubs bundler The git source https://github.com/rails/web-console.git is not yet checked out. Please run `bundle install` before trying to start your application run bundle install Fetching https://github.com/rails/web-console.git (snip) ... ``` Related to #33202
* Merge pull request #33202 from deivid-rodriguez/bundler_binstubsEileen M. Uchitelle2018-08-112-30/+21
|\ | | | | Bundler binstubs
| * Generate bundler-compatible bundler binstubDavid Rodríguez2018-06-232-4/+6
| |
| * Improve readability of some specsDavid Rodríguez2018-06-231-9/+9
| |
| * Factor out some common bundler mocking logicDavid Rodríguez2018-06-231-20/+9
| |
* | Ensure that running tests in parallel doesn't display schema load outputbogdanvlviv2018-08-081-0/+18
| | | | | | | | | | | | | | | | https://github.com/rails/rails/pull/33479 changed `#load_schema` to prevent displaying schema load on running tests in parallel. We should test this in order to prevent any regression in the future. Context https://github.com/rails/rails/pull/33479#discussion_r206870727
* | update BacktraceCleaner::RENDER_TEMPLATE_PATTERN to match the ↵Lachlan Sylvester2018-08-071-0/+7
| | | | | | | | ActionView::Template method names
* | Filter backtrace in test to ensure irb counts as user codeLachlan Sylvester2018-08-061-5/+6
| |
* | Log the remote IP addr of clients behind a proxyAtul Bhosale2018-07-311-0/+6
| | | | | | | | [Atul Bhosale, Victor Nawothnig]
* | Merge pull request #32381 from q-centrix/update-codeclimate-configsRichard Schneeman2018-07-252-10/+7
|\ \ | | | | | | Turn on performance based cops
| * | Turn on performance based copsDillon Welch2018-07-232-10/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Use attr_reader/attr_writer instead of methods method is 12% slower Use flat_map over map.flatten(1) flatten is 66% slower Use hash[]= instead of hash.merge! with single arguments merge! is 166% slower See https://github.com/rails/rails/pull/32337 for more conversation
* | | Merge pull request #33229 from ↵Matthew Draper2018-07-256-12/+12
|\ \ \ | |/ / |/| | | | | | | | albertoalmagro/albertoalmagro/prefer-rails-command-over-bin-rails Prefer rails command over bin/rails
| * | Show rails instead of bin/rails on USAGE instructionsAlberto Almagro2018-07-064-9/+9
| | | | | | | | | | | | | | | With this commit, rails commands usage instructions display now +rails+ instead of +bin/rails+ within their recommendations.
| * | Recommend use of rails over bin/railsAlberto Almagro2018-07-063-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | As discussed in #33203 rails command already looks for, and runs, bin/rails if it is present. We were mixing recommendations within guides and USAGE guidelines, in some files we recommended using rails, in others bin/rails and in some cases we even had both options mixed together.
* | | Clarify `railties/test/application/rake/notes_test.rb`bogdanvlviv2018-07-211-59/+58
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | After 1996fbe2a3e46ff5698bfa3812afb7f42cdfa899 `rails notes` isn't the same as `rake notes`. Since that, we should test `rake routes` instead of `rails notes` in `railties/test/application/rake/notes_test.rb` file. So I changed all occurrences of `rails routes` to `rake routes` in that file, and added assertions about deprecation warning of using `rake notes`. It will help to figure out that we should remove `railties/test/application/rake/notes_test.rb` entirely in favour of `railties/test/commands/notes_test.rb` that was added in 1996fbe2a3e46ff5698bfa3812afb7f42cdfa899.
* | | Fix deprecation message for `SOURCE_ANNOTATION_DIRECTORIES`yuuji.yaginuma2018-07-201-0/+3
| | | | | | | | | | | | Also, added a test that a deprecated message will be output.
* | | Enable `Layout/EmptyLinesAroundBlockBody` to reduce review cost in the futureRyuta Kamizono2018-07-121-1/+0
| | | | | | | | | | | | | | | | | | | | | We sometimes ask "✂️ extra blank lines" to a contributor in reviews like https://github.com/rails/rails/pull/33337#discussion_r201509738. It is preferable to deal automatically without depending on manpower.
* | | Allow to explicitly specify whether to output Rails' log to stdoutMarkus Doits2018-07-081-0/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Before Rails' logger output is mirrored to std out if: * environment is development and * the process is not daemonized It was not possible to change that behaviour, e.g. to disable log output in that case or enable it in other cases. Now you can explicitly disable or enable output with the new command line switch `--log-to-stdout`, regardless of any other circumstances. ``` // enable output in production rails server -e production --log-to-stdout // disable output in development rails server -e development --no-log-to-stdout ``` Enabling output when daemonized still makes no sense (since tty is detached), but this is ignored for now. If the command line flag is not specified, old behaviour still applies, so this change is completely backward compatible.
* | | Don't show unneeded deprecation warning on server restart.Kasper Timm Hansen2018-07-071-3/+2
|/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If booting a server via `rails s -u puma`, we'd convert the option to a `using` positional. When using `rails restart` our `restart_command` would the option converted to the using positional and put that in the restart command. Thus we'd show users deprecation warnings for our own code. Fix that by converting a passed positional to an option instead. Also: fix initialize method signature. The local_options are an array, not a hash. But don't even bother assigning defaults as Thor passes them in.
* | Make NotesCommand tests more performant by getting rid of unecessary mapAnnie-Claude Côté2018-07-051-12/+12
| | | | | | | | | | | | | | * Get rid of map and replace it with a multiplication of "\n" to generate document with multiple line preceding the annotation * Reduce number from 1000 to 100 since it achieves the same goal * Only keep one test for the multiple lines document since it's unecessary to test multiple times * Update some language in tests names to make it clearer what we are testing
* | Merge pull request #33220 from anniecodes/notes-commandKasper Timm Hansen2018-07-051-0/+128
|\ \ | | | | | | Adds `Rails::Command::NotesCommand` and makes `rake notes` use it under the hood
| * | Adds support to register directories and extensions to NotesCommandAnnie-Claude Côté2018-07-041-0/+44
| | | | | | | | | | | | | | | * Require the application and environnement in the notes command in order to load the config files * Adds tests for both register_directories and register_extensions added to a config file
| * | Adds a Rails::Command for NotesAnnie-Claude Côté2018-07-041-0/+84
| | | | | | | | | | | | | | | | | | | | | | | | * It is called with `rails notes` * It defaults to displaying [OPTIMIZE, FIXME and TODO] annotations * It accepts custom annotations by using `rails notes -a CUSTOM_ANNOTATION OTHER_ANNOTATION` * It defaults to look for annotations in [app config db lib test] as dictated by SourceAnnotationExtractor * It supports ENV["SOURCE_ANNOTATION_DIRECTORIES"] but adds a deprecation warning and recommends using register_directories instead
* | | Merge pull request #32706 from ↵Kasper Timm Hansen2018-07-011-0/+24
|\ \ \ | | | | | | | | | | | | | | | | yhirano55/fix-app-update-when-hyphenated-name-is-given Fix app:update when hyphenated name is given
| * | | Fix app:update when hyphenated name is givenYoshiyuki Hirano2018-04-241-0/+24
| | | | | | | | | | | | | | | | | | | | | | | | * Fixed app_name's difference between `rails new` and `app:update` * Changed be prefer to const name than directory name. * Kept original app name which use exception message.
* | | | Add an assertion that `credentials:edit` works when `RAILS_MASTER_KEY` env ↵yuuji.yaginuma2018-06-241-1/+1
| |_|/ |/| | | | | | | | is specified
* | | OS X -> macOS [Closes #30313]Xavier Noria2018-06-231-1/+1
| | | | | | | | | | | | [Jon Moss & Xavier Noria]
* | | Fix Ruby version in `.ruby-version`bogdanvlviv2018-06-181-1/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Since #30016 Rails generates `.ruby-version` file in order to help Ruby version manager tools like `rbenv`, `rvm` determine which Ruby version should be used for the current Rails project. Since #32649 Rails sets Ruby version to the file compatible with MRI/JRuby by default. Pull Request #31496 reports that `.ruby-version` doesn't match ruby version other than stable version and recommends to use `ENV["RBENV_VERSION"]`, and `ENV["rvm_ruby_string"]` in order to set correct Ruby version to the file that `rbenv` or `rvm` can understand. Also, there is another similar issue that reports the same case if use JRuby https://github.com/jruby/jruby/issues/5144. Closes #31496, https://github.com/jruby/jruby/issues/5144.
* | | Include `ActiveSupport::Testing::MethodCallAssertions` in ↵bogdanvlviv2018-06-092-2/+2
| | | | | | | | | | | | | | | | | | `railties/test/isolation/abstract_unit.rb` Related to #33102
* | | Remove unnecessary testyuuji.yaginuma2018-06-031-6/+0
| |/ |/| | | | | | | Since #32289, `Spellchecker.suggest` returns only one value, multiple suggestions not output.
* | Enable `Lint/StringConversionInInterpolation` rubocop ruleRyuta Kamizono2018-05-211-1/+1
| | | | | | | | | | To prevent redundant `to_s` like https://github.com/rails/rails/pull/32923#discussion_r189460008 automatically in the future.
* | Add test case that configure ↵yuuji.yaginuma2018-05-201-0/+17
| | | | | | | | | | | | `config.action_view.finalize_compiled_template_methods` Follow up of #32418.