aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test/controller
Commit message (Collapse)AuthorAgeFilesLines
* adding a buffered stream to the response objectAaron Patterson2012-07-291-0/+30
|
* Remove warning renaming the test classes to use the test conventionRafael Mendonça França2012-07-292-2/+2
|
* this test is not a controller test, so switch to AS::TCAaron Patterson2012-07-281-1/+1
|
* Clean up Sweeper controller accessor when an Error is raisedBrian John2012-07-201-0/+11
|
* Fix indentation.Piotr Sarnacki2012-07-111-4/+4
|
* Don't raise an error if http auth token isn't well formattedPiotr Sarnacki2012-07-111-0/+8
| | | | | | | | | | | | | | When someone sends malformed authorization header, like: Authorization: Token foobar given token should be just ignored and resource should not be authorized, instead of raising error. Before this patch controller would return 401 header only for well formed tokens, like: Authorization: Token token=foobar and would return 500 in former case.
* deprecate `describe` without a block.Aaron Patterson2012-07-093-12/+0
| | | | | minitest/spec provides `describe`, so deprecate the rails version and have people use the superclass version
* Use "instance_accessor" for flash types class attributeCarlos Antonio da Silva2012-07-071-1/+0
|
* Added support add_flash_typeskennyj2012-07-071-0/+26
|
* Remove unused code.kennyj2012-07-071-4/+0
|
* Prevent conflict between mime types and Object methodsMircea Pricop2012-07-061-1/+3
| | | | | | | | | | | | | | | | | | | | | | | Assuming the type ":touch", Collector.new was calling send(:touch), which instead of triggering method_missing and generating a new collector method, actually invoked the private method `touch` inherited from Object. By generating the method for each mime type as it is registered, the private methods on Object can never be reached by `send`, because the `Collector` will have them before `send` is called on it. To do this, a callback mechanism was added to Mime::Type This allows someone to add a callback for whenever a new mime type is registered. The callback then gets called with the new mime as a parameter. This is then used in AbstractController::Collector to generate new collector methods after each mime is registered.
* Merge branch 'master' into testcleanAaron Patterson2012-07-051-0/+5
|\ | | | | | | | | | | | | | | | | | | * master: Add documentation for inheritance_column method Use ArgumentError vs. RuntimeError, which is more precise. CSV fixtures aren't supported by default anymore, update generated test_helper.rb to reflect that fix quoting for ActiveSupport::Duration instances Add few information on the field types Add the options method to action_controller testcase.
| * Add the options method to action_controller testcase.François de Metz2012-07-041-0/+5
| | | | | | | | Signed-off-by: François de Metz <francois@stormz.me>
* | test should be testing to_param not to_s, remove Array subclassAaron Patterson2012-07-031-2/+2
|/
* AS::Callbacks: deprecate monkey patch codeBogdan Gusiev2012-06-261-0/+12
| | | | | Deprecate usage of filter object with #before and #after methods as around callback
* Merge pull request #6805 from tim-vandecasteele/uploadedfile-paramifyCarlos Antonio da Silva2012-06-231-0/+7
|\ | | | | Don't paramify ActionDispatch::Http::UploadedFile in tests
| * Don't paramify ActionDispatch::Http::UploadedFile in testsTim Vandecasteele2012-06-221-0/+7
| | | | | | | | | | | | | | | | | | | | To test uploading a file without using fixture_file_upload, a posted ActionDispatch::Http::UploadedFile should not be paramified (just like Rack::Test::UploadedFile). (Rack::Test::UploadedFile and ActionDispatch::Http::UploadedFile don't share the same API, tempfile is not accessible on Rack::Test::UploadedFile as discussed in https://github.com/brynary/rack-test/issues/30)
* | Removed warnings.Arun Agrawal2012-06-211-3/+3
|/ | | | | 1. Change in test name as already defined. 2. ambiguous first argument; put parentheses or even spaces
* Merge pull request #6777 from route/logger_in_metal_testsCarlos Antonio da Silva2012-06-191-0/+17
|\ | | | | | | Added test for case when view doesn't have logger method when using ActionController::Metal controller.
| * Added test for case when view doesn't have logger method when using ↵Dmitry Vorotilin2012-06-191-0/+17
| | | | | | | | ActionController::Metal controller.
* | Ensure that cache-control headers are mergedJames Tucker2012-06-181-0/+12
|/ | | | | | | | | | | | | | | | | | | | | | | | | | | There are several aspects to this commit, that don't well fit into broken down commits, so they are detailed here: * When a user uses response.headers['Cache-Control'] = some_value, then the documented convention in ConditionalGet is not adhered to, in this case, response.cache_control is ignored due to `return if self[CACHE_CONTROL].present?` * When a middleware sets cache-control headers that would clobber, they're converted to symbols directly, without underscores. This would lead to bugs. * Items that would live in :extras if set through expires_in, are placed directly in the @cache_control hash, and not respected in many cases (somewhat adhering to the aforementioned documentation). * Although quite useless, any directive named 'extras' would be ignored. The general convention applied is that expires_* take precedence, but no longer overwrite everything and expires_* are ALWAYS applied, even if the header is set. I am still unhappy about the contents of this commit, and the code in general. Ideally it should be refactored to no longer use :extras. I'd likely recommend expanding @cache_control into a class, and giving it the power to handle the merge in a more efficient fashion. Such a commit would be a larger change that could have additional semantic changes for other libraries unless they utilize expires_in in very standard ways.
* Support unicode character route in config/routes.rb.kennyj2012-06-161-0/+5
|
* adding a test for #6459Aaron Patterson2012-06-141-0/+10
|
* This consider_all_requests_local doesn't make senseSantiago Pastorino2012-06-121-18/+0
| | | | | This middleware is only for Public Exceptions. This follows bd8c0b8a
* Return proper format on exceptionsSantiago Pastorino2012-06-111-0/+43
|
* stop `to_s`ing method namesAkira Matsuda2012-06-061-16/+16
| | | | Module#methods are Symbols in Ruby >= 1.9
* Include routes.mounted_helpers into integration testsPiotr Sarnacki2012-06-011-0/+19
| | | | | | | | | | | | | | | In integration tests, you might want to use helpers from engines that you mounted in your application. It's not hard to add it by yourself, but it's unneeded boilerplate. mounted_helpers are now included by default. That means that given engine mounted like: mount Foo::Engine => "/foo", :as => "foo" you will be able to use paths from this engine in tests this way: foo.root_path #=> "/foo" (closes #6573)
* Extracted redirect logic from ActionController::Force::ClassMethods.force_sslJeremy Friesen2012-05-311-0/+31
| | | | | | | | | | | | | Prior to this patch the existing .force_ssl method handles both defining the filter and handling the logic for performing the redirect. With this patch the logic for redirecting to the HTTPS protocol is separated from the filter logic that determines if a redirect should occur. By separating the two levels of behavior, an instance method for ActionController (i.e. #force_ssl_redirect) is exposed and available for more granular SSL enforcement. Cleaned up indentation.
* no need to pass an empty block to button_to helperSergey Nartimov2012-05-301-2/+2
|
* Fix sorting of helpers from different pathsPiotr Sarnacki2012-05-281-0/+30
| | | | | | | | | | | | | | | | When more than one directory for helpers is provided to a controller, it should preserver the order of directories. Given 2 paths: MyController.helpers_paths = ["dir1/helpers", "dir2/helpers"] helpers from dir1 should be loaded first. Before this commit, all helpers were mixed and then sorted alphabetically, which essentially would require to rename helpers to get desired order. This is a problem especially for engines, where you would like to be able to predict accurately which engine helpers will load first. (closes #6496)
* Merge pull request #2549 from trek/RoutingErrorForMissingControllersAaron Patterson2012-05-211-0/+10
|\ | | | | When a route references a missing controller, raise ActionController::RoutingError with clearer message
| * When a route references a missing controller, raise ↵Trek Glowacki2011-08-161-0/+10
| | | | | | | | ActionController::RoutingError with a clearer message
* | Escape the extension when normalizing the action cache path.Andrew White2012-05-201-1/+30
| | | | | | | | | | | | | | | | | | Although no recognized formats use non-ASCII characters, sometimes they can be included in the :format parameter because of invalid URLS. To prevent encoding incompatibility errors we need to escape them before passing the path to URI.unescape. Closes #4379
* | Raise Assertion instead of RoutingError for routing assertion failures.David Chelimsky2012-05-201-5/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | Before this change, assert_recognizes, assert_generates, and assert_routing raised ActionController::RoutingError when they failed to recognize the route. This commit changes them to raise Assertion instead. This aligns with convention for logical failures, and supports reporting tools that care about the difference between logical failures and errors e.g. the summary at the end of a test run. - Fixes #5899
* | Show in log correct wrapped keysDmitry Vorotilin2012-05-201-0/+8
| |
* | mispelling errors in render_text_test.rb and sqlite_specific_schemaangelo giovanni capilleri2012-05-121-2/+2
| |
* | Refactor the handling of default_url_options in integration testsAndrew White2012-05-101-0/+80
| | | | | | | | | | | | | | | | | | | | | | | | This commit improves the handling of default_url_options in integration tests by making behave closer to how a real application operates. Specifically the following issues have been addressed: * Options specified in routes.rb are used (fixes #546) * Options specified in controllers are used * Request parameters are recalled correctly * Tests can override default_url_options directly
* | Add failing test re #3436 which demonstrates content_type is not respected ↵Kunal Shah2012-05-081-0/+21
| | | | | | | | when using the :head method/shortcut
* | Merge pull request #5368 from andhapp/remove-max-staleJosé Valim2012-05-071-4/+4
|\ \ | | | | | | Minor test improvement
| * | Removed max-stale from the tests since it's a request cache-control ↵Anuj Dutta2012-03-101-4/+4
| | | | | | | | | | | | directive, just for clarity sake.
* | | added an integration test that checks ActionController::UnknownFormat ↵Steven Soroka2012-05-061-0/+9
| | | | | | | | | | | | renders 406 :not_acceptable
* | | Raise a rescuable exception when Rails doesn't know what to do with the ↵Steven Soroka2012-05-061-13/+19
| | | | | | | | | | | | format, rather than responding with a head :not_acceptable (406)
* | | Merge pull request #4445 from nragaz/role_based_params_wrappingJosé Valim2012-05-041-2/+15
| | | | | | | | | | | | specify a role for identifying accessible attributes when wrapping params
* | | Improve assert_template layout checkingAlexey Vakhov2012-05-041-0/+15
| | |
* | | Fix assert_template :layout => nil assertionAlexey Vakhov2012-05-041-0/+12
| | |
* | | Fix assert_template assertion with :layout optionAlexey Vakhov2012-05-041-0/+10
| | |
* | | Force given path to http methods in mapper to skip canonical action checkingCarlos Antonio da Silva2012-05-041-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This fixes the following scenario: resources :contacts do post 'new', action: 'new', on: :collection, as: :new end Where the /new path is not generated because it's considered a canonical action, part of the normal resource actions: new_contacts POST /contacts(.:format) contacts#new Fixes #2999
* | | Merge pull request #6148 from twinturbo/head-fixJosé Valim2012-05-031-0/+66
|\ \ \ | | | | | | | | Make ActionController#head pass rack-link
| * | | Remove content-length as welltwinturbo2012-05-031-0/+6
| | | |
| * | | Make ActionController#head pass rack-linktwinturbo2012-05-031-0/+60
| | | |