aboutsummaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* Only commit the cookie jar if it hasn't been committedeileencodes2015-12-061-1/+1
| | | | | | | We don't want to commit the cookie jar more than once because then we will be attempting to modify a frozen hash. Fixes Railties test failure caused by 492b134.
* Stop violating law of demeter in response cookie_jareileencodes2015-12-063-1/+10
| | | | | | | | | | | This adds a new method to request and response so we don't need to violate the law of demeter. We are changing `Request` and `Response` so that they always have a `cookie_jar` This is a continuation on work to combine integration and controller test code bases in Rails.
* Push `before_sending` to super classeileencodes2015-12-0610-11/+17
| | | | | | | | | | | | We want to get rid of the `Live::Response` so we are consolidating methods from `Live::Response` and `Response` by merging them together. This adds an `#empty` method to the request so we don't need to hard-code the empty array each time we call an empty `ActionDispatch::Request`. The work here is a continuation on combining controller and integration test code bases into one.
* Merge pull request #22516 from gsamokovarov/after-create-update-destroy-commitDavid Heinemeier Hansson2015-12-064-6/+63
|\ | | | | Introduce after_{create,update,delete}_commit callbacks
| * Introduce after_{create,update,delete}_commit callbacksGenadi Samokovarov2015-12-064-6/+63
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Those are actually shortcuts for `after_commit`. Before: after_commit :add_to_index_later, on: :create after_commit :update_in_index_later, on: :update after_commit :remove_from_index_later, on: :destroy After: after_create_commit :add_to_index_later after_update_commit :update_in_index_later after_destroy_commit :remove_from_index_later
* | Merge pull request #22428 from thedarkone/subs-notifEileen M. Uchitelle2015-12-063-4/+24
|\ \ | | | | | | Subscribing to notifications while inside the said instrumented section
| * | Subscribing to notifications while inside the said instrumented section.thedarkone2015-11-283-4/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The issue is that on the exit from Instrumenter#instrument section, an Evented listener will run into an error because its thread local (Thread.current[:_timestack]) has not been set up by the #start method (this obviously happens because the Evented listeners didn't exist at the time, since no subscribtion to that section was made yet). Note: support for subscribing to instrumented sections, while being inside those instrumented sections, might be removed in the future. Maybe fixes #21873.
* | | Merge pull request #22453 from wjessop/use_action_dispatch_default_tld_lengthEileen M. Uchitelle2015-12-061-26/+30
|\ \ \ | | | | | | | | Test against the real value of tld_length unless explicitly set
| * | | Test against the real value of tld_length unless explicitly setWill Jessop2015-12-041-26/+30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There were two places where the tld_length default was hard-coded to 1, both overriding the real default value of ActionDispatch::Http::URL.tld_length in this set of tests. This commit removes both of those, relying on the actual value of ActionDispatch::Http::URL.tld_length, unless it's specifically overridden.
* | | | Merge pull request #22480 from keepcosmos/add-translate-testEileen M. Uchitelle2015-12-061-0/+5
|\ \ \ \ | | | | | | | | | | add test for namespaced model name translation
| * | | | add test for nested model translationkeepcosmos2015-12-031-0/+5
| | | | |
* | | | | Ditch `Commands` namespace for base command.Kasper Timm Hansen2015-12-064-83/+78
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Reading `Rails::Commands::Command` feels excessive. Especially if users can subclass command to write their own commands — which I'd like to aim for. Switch to `Rails::Command` before we get too far into things.
* | | | | Invert command and commands tasks reference.Kasper Timm Hansen2015-12-063-10/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We should first attempt to run commands through Rails command, and then fall back to trying the commands tasks. Because eventually the commands tasks should be their own commands.
* | | | | Remove "run with rake" suggestion.Kasper Timm Hansen2015-12-061-22/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When attempting to run a `rake` task with `bin/rails`, Rails would see check that a Rake task existed and ask users if they meant to run it with rake. We don't need that anymore, as the goal is to have `rails` be a valid way to run rake tasks.
* | | | | Add class level `run` to Rails command.Kasper Timm Hansen2015-12-062-22/+15
| |_|_|/ |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The class level version is responsible for changing a task name to command name, then finding a command and run it if there is one. The instance level `run` then makes sure arguments have been parsed into `@options` and runs the command by sending it. `Rails::Commands::Command.run` returns true to make it work within `Rails::CommandsTask`, but won't in the future when it handles all option parsing.
* | | | Merge pull request #19977 from ↵Arthur Nogueira Neves2015-12-052-1/+31
|\ \ \ \ | | | | | | | | | | | | | | | | | | | | prathamesh-sonpatki/mention-redirect-path-in-assert-response Add redirection path in the error message of assert_response if response is :redirect
| * | | | Add redirection path in the error message of assert_response if response is ↵Prathamesh Sonpatki2015-12-042-1/+31
| | |/ / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | :redirect - If the assert_response is checking for any non-redirect response like :success and actual response is :redirect then, the error message displayed was - Expected response to be a <success>, but was <302> - This commit adds the redirect path to the error message of assert_response if the response is :redirect. So above message is changed to - Expected response to be a <success>, but was a redirect to <http://test.host/posts/lol>
* | | | Replace `-> {}` with a proc.Kasper Timm Hansen2015-12-051-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When `parse_options_for` was called for a command that hadn't set up any option parsing with `options_for`, the `call` method would be sent to `-> {}`, which didn't like to be passed two arguments. Switch to `proc {}` which can accept several arguments.
* | | | Merge pull request #22202 from grosser/grosser/write-consistentArthur Nogueira Neves2015-12-052-4/+12
|\ \ \ \ | | | | | | | | | | even if a write fails, store the raw value
| * | | | even if a write fails, store the raw valueMichael Grosser2015-11-292-4/+12
| | | | |
* | | | | Remove `_instance` suffix from command.Kasper Timm Hansen2015-12-051-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | I want to streamline the wording around `command`, and not start pondering about instances.
* | | | | Default `argv` to an empty array.Kasper Timm Hansen2015-12-051-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The `ARGV` constant in Ruby is not a string, it's an array as demonstrated by running: ``` $ ruby -e "p ARGV" => [] $ $ ruby -e "p ARGV" test/file.rb --version=2 => ["test/file.rb", "--version=2"] ```
* | | | | Spruce up `command_for`.Kasper Timm Hansen2015-12-051-4/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Ditch the instance methods local variable. * Prefer Ruby's default nil return, and remove else branch.
* | | | | `exists?` isn't for users.Kasper Timm Hansen2015-12-051-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Checking that a command exists before running it is an implementation detail of the Rails command and Rake task world right now. Eventually I'd like to get rid of `exists?`, when I've worked out another way to fall back to run the old tasks.
* | | | | Move `command_name_for` to private section.Kasper Timm Hansen2015-12-051-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | Users shouldn't have to lookup the command name for a task. Put it in the private section, so it doesn't show up in any generated documentation.
* | | | | Shrink a couple of deprecation warnings to one-linersMatthew Draper2015-12-061-18/+8
| | | | | | | | | | | | | | | | | | | | | | | | | The previous spelling seemed a bit too generous with the whitespace, and looked out of place when amongst others.
* | | | | Merge pull request #22492 from RochesterinNYC/patch-1Sean Griffin2015-12-052-3/+3
|\ \ \ \ \ | | | | | | | | | | | | Add note about serialization to update_columns documentation [ci skip]
| * | | | | Clean up and correct documentation for update_columns and update_all [ci skip]James Wen2015-12-052-3/+3
| | |/ / / | |/| | |
* | | | | Merge pull request #22500 from y-yagi/fix_warning_in_geometric_testSean Griffin2015-12-041-1/+3
|\ \ \ \ \ | | | | | | | | | | | | remove warning from postgresql geometric test
| * | | | | remove warning from postgresql geometric testyuuji.yaginuma2015-12-051-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This removes the following warning which has been out in the case of a PostgreSQL 9.3 below. ``` activerecord/test/cases/adapters/postgresql/geometric_test.rb:265: warning: instance variable @connection not initialized ```
* | | | | | Merge pull request #22457 from ccallebs/rails-commands-infrastructureKasper Timm Hansen2015-12-059-51/+144
|\ \ \ \ \ \ | |_|/ / / / |/| | | | | Add Rails command infrastructure
| * | | | | Add Rails command infrastructure and encapsulate development cachingChuck Callebs2015-12-049-51/+144
|/ / / / /
* | | | | Merge pull request #22482 from ridiculous/masterRafael França2015-12-041-4/+6
|\ \ \ \ \ | | | | | | | | | | | | Replace ActionMailer::Base.respond_to? with respond_to_missing?
| * | | | | Make ActionMailer::Base.respond_to_missing? privateRyan Buckley2015-12-031-4/+6
| | | | | |
| * | | | | Replace ActionMailer::Base#respond_to? with respond_to_missing?Ryan Buckley2015-12-021-2/+2
| | |_|/ / | |/| | |
* | | | | Merge pull request #22493 from rails/rm-fix-testsRafael França2015-12-044-14/+6
|\ \ \ \ \ | |/ / / / |/| | | | Fix the Railties tests
| * | | | Disable FileEventedUpdateChecker for nowRafael Mendonça França2015-12-041-5/+1
| | | | | | | | | | | | | | | | | | | | | | | | | Railsties tests are broken with this new update checker so we will use the old one until we have the tests fixed.
| * | | | Mac OS X use /private as directory to temp fileRafael Mendonça França2015-12-041-1/+1
| | | | | | | | | | | | | | | | | | | | Related with e62ddac05b7d827ae870898d7cd9eaf76e0730aa
| * | | | Remove test_files check from plugin checksRafael Mendonça França2015-12-041-4/+0
| | | | | | | | | | | | | | | | | | | | Related with 668c006cf33a63ac3f8a8f064c772a339341e70c.
| * | | | Remove warningsRafael Mendonça França2015-12-041-4/+4
|/ / / /
* | | | Merge pull request #22476 from claudiob/comment-premClaudio B2015-12-022-2/+7
|\ \ \ \ | |/ / / |/| | | Remove old comment about AC::Parameters>subclasses
| * | | Remove old comment about AC::Parameters>subclassesclaudiob2015-12-022-2/+7
|/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | [ci skip] Q: What happens if you initialize an AR model by passing Parameters that have not been whitelisted with `permit`? A: An `ActiveModel::ForbiddenAttributesError` is raised. I think this behavior is correct, and it's better than what used to happen, with unpermitted parameter being simply ignored.
* | | Merge pull request #22469 from merhard/fix_custom_file_loader_testRafael França2015-12-021-0/+2
|\ \ \ | | | | | | | | Fix failing test using custom file watcher
| * | | Fix failing test using custom file watcherMatthew Erhard2015-12-021-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | LoadingTest#test_does_not_reload_constants_on_development_if_custom_file_watcher_always_returns_false in railties/test/application/loading_test.rb is failing with: `NoMethodError: undefined method 'execute' for #<#<Class:0x00000002465a30>:0x00000001f79698>` The test creates an anonymous class to be used as a custom file watcher using `config.file_watcher=`. Per the Rails guides for Configuring, the class set to `config.file_watcher` “Must conform to ActiveSupport::FileUpdateChecker API”. Per the docs for ActiveSupport::FileUpdateChecker, the API depends on four methods: #initialize, #updated?, #execute, and #execute_if_updated. The custom file watcher in the failing test only implements the first two methods. This pull request adds #execute and #execute_if_updated to the custom file_watcher, conforming it to the ActiveSupport::FileUpdateChecker API, and passing the test.
* | | | Merge pull request #22471 from merhard/railties_tests_actually_fail_on_travisRafael França2015-12-021-21/+8
|\ \ \ \ | |/ / / |/| | | Revert "don't start a new process for every test file"
| * | | Revert "don't start a new process for every test file"Matthew Erhard2015-12-021-21/+8
|/ / / | | | | | | | | | | | | This reverts commit 5a0e0e72995472e315738dcea5b5a12d6e3d3489. This commit causes railties tests on TravisCI to always return a 0 status (all tests passing), even when tests are failing. Reverting for now until a new solution can be found.
* | | don't rely on the columns hash to get defaults. follow-up to #17169.Yves Senn2015-12-022-7/+25
| | | | | | | | | | | | | | | | | | This will also get the defaults from attribute definitions like: attribute :type, :string, default: "SomethingElse"
* | | add `ActiveRecord::Base.has_attribute?`Yves Senn2015-12-023-2/+27
| | | | | | | | | | | | `has_attribute?` method to check wether a given attribute has been defined.
* | | tests, pluralize singular table name.Yves Senn2015-12-021-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This solves the following error: ActiveRecord::StatementInvalid: Could not find table 'guitars' It seems that the table structure of the `Guitar` model has not been necessary until now. Due to the wrong table name the model was not correctly linked to the table.
* | | Merge pull request #17169 from kuldeepaggarwal/fix-STI-default-typeYves Senn2015-12-023-9/+47
|\ \ \ | | | | | | | | | | | | STI cast new instances to `default type` on initialize.