aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test
Commit message (Collapse)AuthorAgeFilesLines
...
* Use "instance_accessor" for flash types class attributeCarlos Antonio da Silva2012-07-071-1/+0
|
* Added support add_flash_typeskennyj2012-07-072-6/+32
|
* Remove unused code.kennyj2012-07-071-4/+0
|
* Prevent conflict between mime types and Object methodsMircea Pricop2012-07-062-1/+17
| | | | | | | | | | | | | | | | | | | | | | | 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
|/
* Remove more tests related to draw external routes filesRafael Mendonça França2012-06-294-53/+1
| | | | Related with 5e7d6bba79393de0279917f93b82f3b7b176f4b5
* AS::Callbacks: deprecate monkey patch codeBogdan Gusiev2012-06-261-0/+12
| | | | | Deprecate usage of filter object with #before and #after methods as around callback
* Move number helper i18n related tests to ASCarlos Antonio da Silva2012-06-241-122/+0
| | | | | They also make more sense here since all the related logic with I18n is handled by AS::NumberHelper, and not by AV anymore.
* Refactor AV number helper tests with invalid numbersCarlos Antonio da Silva2012-06-241-44/+14
| | | | | | Just make use of the returning exception from assert_raise, instead of calling the method again with a rescue clause to test the saved exception number.
* 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)
* | Merge pull request #6428 from pinetops/resolver_concurrency_fixYehuda Katz2012-06-211-4/+4
|\ \ | | | | | | Make the Resolver template cache threadsafe
| * | Make the Resolver template cache threadsafe - closes #6404Tom Clarke2012-05-211-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | The Template cache in the Resolver can be accessed by multiple threads similtaneously in multi-threaded environments. The cache is implemented using a Hash, which isn't threadsafe in all VMs (notably JRuby). This commit extracts the cache to a new Cache class and adds mutexes to prevent concurrent access.
* | | stop subclassing stringAaron Patterson2012-06-211-1/+1
| | |
* | | 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.
* | Merge pull request #6752 from steveklabnik/fix_5680Rafael Mendonça França2012-06-162-3/+14
|\ \ | | | | | | Respect absolute paths in compute_source_path.
| * | Respect absolute paths in compute_source_path.Steve Klabnik2012-06-162-3/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When using compute_source_path to determine the full path of an asset, if our source begins with '/', we don't want to include the directory. Examples are illustrative: > compute_source_path("foo", "stylesheets", "css") => "/Users/steve/src/my_app/public/stylesheets/foo.css" > compute_source_path("/foo", "stylesheets", "css") => "/Users/steve/src/my_app/public/foo.css" Before this patch, the second example would return the same as the first. Fixes #5680.
* | | Support unicode character route in config/routes.rb.kennyj2012-06-162-2/+7
|/ /
* | adding a test for #6459Aaron Patterson2012-06-141-0/+10
| |
* | we raise a subclass of LoadError, so rescue thatAaron Patterson2012-06-141-1/+6
| |
* | Fix buildSantiago Pastorino2012-06-131-2/+2
| |
* | ActionController::Caching depends on RackDelegation and ↵Santiago Pastorino2012-06-131-0/+32
| | | | | | | | AbstractController::Callbacks
* | Merge branch 'master-sec'Aaron Patterson2012-06-121-0/+4
|\ \ | | | | | | | | | | | | * master-sec: Array parameters should not contain nil values.
| * | Array parameters should not contain nil values.Aaron Patterson2012-06-121-0/+4
| | |
* | | 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
| |
* | both string and sumbol will be interpolated as string no need to convert to_sganesh2012-06-111-5/+5
| |
* | stop `to_s`ing method namesAkira Matsuda2012-06-061-16/+16
| | | | | | | | Module#methods are Symbols in Ruby >= 1.9
* | fix meaningless test caseAkira Matsuda2012-06-061-1/+1
| | | | | | | | | | Module#instance_methods returns an Array of Symbols in Ruby >= 1.9 So this was not actually testing anything
* | accept a block in button helper.Yuki Nishijima2012-06-051-1/+5
| |
* | Allow to use mounted helpers in ActionView::TestCasePiotr Sarnacki2012-06-012-0/+20
| | | | | | | | | | Similarly to 6525002, this allows to use routes helpers for mounted helpers, but this time in ActionView::TestCase
* | Merge pull request #6588 from nbibler/polymorphic_to_modelJosé Valim2012-06-011-1/+27
| | | | | | | | Correct the use of to_model in polymorphic routing
* | 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)
* | Merge branch 'master-sec'Aaron Patterson2012-05-311-1/+6
|\ \ | | | | | | | | | | | | | | | * master-sec: Strip [nil] from parameters hash. Thanks to Ben Murphy for reporting this! predicate builder should not recurse for determining where columns. Thanks to Ben Murphy for reporting this
| * | Strip [nil] from parameters hash.Aaron Patterson2012-05-301-1/+6
| | | | | | | | | | | | | | | | | | Thanks to Ben Murphy for reporting this! CVE-2012-2660
* | | 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.
* | | Simplify link_to using content_tagCarlos Antonio da Silva2012-05-311-0/+20
| | | | | | | | | | | | Add some tests for link_to with blocks and escaping content.
* | | accept a block in button_to helperSergey Nartimov2012-05-301-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Make possible to use a block in button_to helper if button text is hard to fit into the name parameter, e.g.: <%= button_to [:make_happy, @user] do %> Make happy <strong><%= @user.name %></strong> <% end %> # => "<form method="post" action="/users/1/make_happy" class="button_to"> # <div> # <button type="submit"> # Make happy <strong>Name</strong> # </button> # </div> # </form>"
* | | no need to pass an empty block to button_to helperSergey Nartimov2012-05-301-2/+2
| | |
* | | Merge pull request #6315 from ↵José Valim2012-05-281-0/+11
|\ \ \ | | | | | | | | | | | | | | | | appfolio/moving_number_helper_methods_to_active_support Moving number helper from ActionView to Active Support
| * | | Moving NumberHelpers from ActionView to ActiveSupportAndrew Mutz2012-05-271-0/+11
| | | |
* | | | Fix sorting of helpers from different pathsPiotr Sarnacki2012-05-283-0/+40
|/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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)
* | | Add `:escape` option for `truncate`Rafael Mendonça França2012-05-261-0/+19
| | | | | | | | | | | | This options can be used to not escape the result by default.
* | | Test that the block used in truncate is escaped if it is not HTML safeRafael Mendonça França2012-05-261-12/+11
| | | | | | | | | | | | Refactoring the truncate method to not do a sort-circuit return
* | | Truncate now has the ability to receive a html option that allows it to call ↵Li Ellis Gallardo2012-05-261-8/+29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | rails helpers. This way if my text is long I don't have to do something like this: .text = truncate(@text, :length => 27) if @text.size >= 27 = link_to "continue", notes_path, ....."")