aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test
Commit message (Collapse)AuthorAgeFilesLines
...
| * | | Fix screenshot helper to provide correct file nameeileencodes2017-02-201-1/+9
| | | | | | | | | | | | | | | | | | | | We only want the file name to include the word `failures` if it failed, not any time the user wants to take a screenshot during a test run.
| * | | Move and rename system testseileencodes2017-02-205-0/+60
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Move system tests back into Action Pack * Rename `ActionSystemTest` to `ActionDispatch::SystemTestCase` * Remove private base module and only make file for public `SystemTestCase` class, name private module `SystemTesting` * Rename `ActionSystemTestCase` to `ApplicationSystemTestCase` * Update corresponding documentation and guides * Delete old `ActionSystemTest` files
| * | | Turn system testing into it's own gem and renameeileencodes2017-02-205-131/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-204-6/+6
| | | | | | | | | | | | | | | | Rubocop / code climate don't like single quotes and prefer doubles.
| * | | Refactor so all drivers use Puma by defaulteileencodes2017-02-201-3/+32
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Puma is the default webserver of Rails. Because of this it doesn't make sense to run tests in Webkit if the default server is Puma. Here I've refactored the webserver to be it's own standalone module so it can be shared between Rails' selenium default driver and Capybara's defaut drivers.
| * | | Add support for screenshotseileencodes2017-02-201-0/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This change adds support, tests, and documentation for the screenshot helper. If taking screenshots is supported by the driver (for example Rack Test doesn't support screenshots) then a screenshot will be taken if the test fails.
| * | | Reconfigure how the drivers workeileencodes2017-02-204-42/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This removes the useless Rack Test Driver that Rails was providing and moves to a shim like approach for default adapters. If someone wants to use one of the default Capybara Drivers then we will initialize a new `CapybaraDriver` that simply sets the default driver. Rails though is much more opinionated than Capybara and to make system testing a "works out of the box" framework in Rails we have the `RailsSeleniumDriver`. This driver sets defaults that Rails deems important for selenium testing. The purpose of this is to simply add a test and it just works.
| * | | Add tests for system testingeileencodes2017-02-204-0/+104
| |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | * Adds test case test * Adds driver adapter test * Adds tests for capybara seleium driver (testing the settings not actually opening the browser to test capybara w/ selenium because that would so so so slow) * Adds tests for rack test driver * Adds tests for generators
| * | Set correct "routes" in tests casesbogdanvlviv2017-02-201-3/+3
| | |
* | | Fixes CodeClimate warningsLeonel Galan2017-02-131-2/+2
| | |
* | | Use of ParameterFilter no longer forces `request.filtered_parameters' class ↵Leonel Galan2017-02-131-0/+13
|/ / | | | | | | | | | | | | | | | | | | to be Hash - Fixes issue described on #27944 - `filtered_query_string` used an Array representation of what semantically is a key value pair: better suited for a Hash. Without this change `filtered_params = original_params.class.new` returns an Array with unintended consequences.
* | Add `Style/EmptyLinesAroundMethodBody` in `.rubocop.yml` and remove extra ↵Ryuta Kamizono2017-02-123-3/+0
| | | | | | | | empty lines
* | Correct spellingBenjamin Fleischer2017-02-054-4/+4
| | | | | | | | | | | | | | ``` go get -u github.com/client9/misspell/cmd/misspell misspell -w -error -source=text . ```
* | Properly escape test namesAkira Matsuda2017-02-021-3/+3
| | | | | | | | since the test names become Regexp filters, non-escaped test names cause RegexpError on isolated test via bin/test
* | Remove deprecated callbacks from ActionDispatch middlewaresRafael Mendonça França2017-01-312-101/+46
| |
* | Delete PATH_INFO after each controller test requestDominic Cleal2017-01-231-0/+14
| | | | | | | | | | | | | | | | | | | | Prevents PATH_INFO from being used to infer the request format in later test requests when no explicit format is given. As the request PATH_INFO may be set before a request, it can't be deleted during pre-request scrubbing. Fixes #27774
* | Use ActionDispatch::IntegrationTest http helper methodsAndrew White2017-01-181-45/+41
| | | | | | | | | | | | | | | | Mixing Rack::Test::Methods into ActionDispatch::IntegrationTest seems to trigger Ruby bug 13107[1]. By using our methods instead of rack-test we shouldn't trigger the bug in Forwardable. [1]: https://bugs.ruby-lang.org/issues/13107
* | :warning: "Use assert_nil if expecting nil. This will fail in MT6."Akira Matsuda2017-01-181-1/+5
| |
* | :warning: "Use assert_nil if expecting nil. This will fail in MT6."Akira Matsuda2017-01-182-10/+22
| | | | | | | | | | | | These are followups for 307065f959f2b34bdad16487bae906eb3bfeaf28, but TBH I'm personally not very much confortable with this style. Maybe we could override assert_equal in our test_helper not to warn?
* | Fix all rubocop violationsRafael Mendonça França2017-01-171-1/+1
| |
* | Don't pollute Object with rubinius_skip and jruby_skipAkira Matsuda2017-01-171-9/+9
| | | | | | | | we call them only in the tests
* | Merge pull request #27692 from y-yagi/make_render_work_with_ac_paramsEileen M. Uchitelle2017-01-161-1/+0
|\ \ | | | | | | make `render` work with AC::Params
| * | make `render` work with AC::Paramsyuuji.yaginuma2017-01-151-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | In 4.2, since AC::Params inherited `Hash`, processing in the case of `Hash` was done. But in 5.x, since AC::Params does not inherit `Hash`, need to add care for AC::Params. Related to 00285e7cf75c96553719072a27c27e4ab7d25b40
* | | Added test to ensure that we dont break #to_h again when trying to restore ↵David Heinemeier Hansson2017-01-161-0/+5
| | | | | | | | | | | | the speed-up from 26dd9b26ab7317f94fd285245879e888344143b2 (cc: @fxn)
* | | Revert "significant speedup of AC::Parameters#permit" ↵David Heinemeier Hansson2017-01-161-5/+0
|/ / | | | | | | [26dd9b26ab7317f94fd285245879e888344143b2] as it broke Parameters#to_h on at least fields_for-style nested params.
* | Small spelling errorLachlan Priest2017-01-141-4/+4
| | | | | | existing_acrnoyms -> existing_acronyms
* | class Foo < Struct.new(:x) creates an extra unneeded anonymous classAkira Matsuda2017-01-131-2/+2
| | | | | | | | because Struct.new returns a Class, we just can give it a name and use it directly without inheriting from it
* | Reduce string objects by using \ instead of + or << for concatenating stringsAkira Matsuda2017-01-122-2/+2
| | | | | | | | (I personally prefer writing one string in one line no matter how long it is, though)
* | Merge pull request #27610 from Envek/fix_and_speed_up_duration_parsingAndrew White2017-01-121-1/+1
|\ \ | | | | | | Fix inconsistent parsing of Durations with both months and years
| * | Fix inconsistent results when parsing large durations and constructing ↵Andrey Novikov2017-01-091-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | durations from code ActiveSupport::Duration.parse('P3Y') == 3.years # It should be true Duration parsing made independent from any moment of time: Fixed length in seconds is assigned to each duration part during parsing. Changed duration of months and years in seconds to more accurate and logical: 1. The value of 365.2425 days in Gregorian year is more accurate as it accounts for every 400th non-leap year. 2. Month's length is bound to year's duration, which makes sensible comparisons like `12.months == 1.year` to be `true` and nonsensical ones like `30.days == 1.month` to be `false`. Calculations on times and dates with durations shouldn't be affected as duration's numeric value isn't used in calculations, only parts are used. Methods on `Numeric` like `2.days` now use these predefined durations to avoid duplicating of duration constants through the codebase and eliminate creation of intermediate durations.
* | | Revert "Merge pull request #27586 from maclover7/jm-fix-27584"Rafael Mendonça França2017-01-111-9/+0
| | | | | | | | | | | | | | | | | | | | | This reverts commit 5eff7a9ca7bb2ee7f16db1ab4d11cebe28757ba5, reversing changes made to 5f03172f54a58a57a48a3121562beb2cef866cbe. Reason: It caused a regression. The test case is on the PR.
* | | Use Encoding::UTF_8 constant for default_{internal,external} in the testsAkira Matsuda2017-01-111-2/+2
|/ /
* | Update `cookies` helper on all HTTP requestsJon Moss2017-01-051-0/+9
| | | | | | | | | | | | | | | | | | Regression introduced by ae29142142324545a328948e059e8b8118fd7a33 / 8363b879fe759f0645179f4521cc64795efbee6e. Previously, cookies were only updated on `GET` requests. Now we will update the helper for all requests, as part of `process`. Added regression tests for all available HTTP method helpers in `ActionController::TestCase`.
* | `self.` is not needed when calling its own instance methodAkira Matsuda2017-01-053-4/+4
| | | | | | | | Actually, private methods cannot be called with `self.`, so it's not just redundant, it's a bad habit in Ruby
* | Fix style guide violationsRafael Mendonça França2017-01-051-3/+3
| |
* | fix with_routing when testing api only controllersJulia López2016-12-291-0/+24
| |
* | Use `next` instead of `break`; avoid terminating whole loopJon Moss2016-12-291-0/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | We want to avoid terminating the whole loop here, because it will cause parameters that should be removed to not be removed, since we are terminating early. In this specific case, `param2` is processed before `param1` due to the reversing of `route.parts`, and since `param2` fails the check on this line, it would previously cause the whole loop to fail, and `param1` would still be in `parameterized_parts`. Now, we are simply calling `next`, which is the intended behavior. Introduced by 8ca8a2d773b942c4ea76baabe2df502a339d05b1. Fixes #27454.
* | Fix Rubocop violations and fix documentation visibilityRafael Mendonça França2016-12-282-2/+2
| | | | | | | | | | | | Some methods were added to public API in 5b14129d8d4ad302b4e11df6bd5c7891b75f393c and they should be not part of the public API.
* | Optimize Journey::Route#scoreBen Hughes2016-12-281-1/+1
| | | | | | | | | | | | | | | | Scoring routes based on constraints repeated many type conversions that could be performed in the outer loop. Determinations of score and fitness also used Array operations that required allocations. Against my benchmark with a large routeset, this reduced object allocations by over 30x and wall time by over 3x.
* | assert_equal takes expectation firstAkira Matsuda2016-12-262-3/+3
| |
* | "Use assert_nil if expecting nil from ...:in `...'. This will fail in ↵Akira Matsuda2016-12-251-2/+1
| | | | | | | | minitest 6."
* | "Use assert_nil if expecting nil from ...:in `...'. This will fail in MT6."Akira Matsuda2016-12-251-4/+4
| |
* | "Use assert_nil if expecting nil. This will fail in minitest 6."Akira Matsuda2016-12-2515-40/+40
| |
* | Privatize unneededly protected methods in Action Pack testsAkira Matsuda2016-12-2310-22/+20
| |
* | Document and update API for `skip_parameter_encoding`Aaron Patterson2016-12-211-31/+8
| | | | | | | | | | | | | | | | This commit changes `parameter_encoding` to `skip_parameter_encoding`. `skip_parameter_encoding` will set encoding on all parameters to ASCII-8BIT for a given action on a particular controller. This allows the controller to handle data when the encoding of that data is unknown, for example file systems or truly binary parameters.
* | Merge pull request #27414 from matthewd/fix-xml-vs-html-assertionMatthew Draper2016-12-211-12/+12
|\ \ | | | | | | Revise the "XML is not HTML" test
| * | Revise the "XML is not HTML" testMatthew Draper2016-12-201-12/+12
| | | | | | | | | | | | | | | | | | It was depending on a side-effect of the old html-scanner, so was no longer proving what it intended to. Instead, assert more directly about the resulting observable difference.
* | | Merge pull request #27408 from matthewd/charset-fixMatthew Draper2016-12-201-1/+8
|\ \ \ | | | | | | | | Only default the response charset when it is first set
| * | | Only default the response charset when it is first setMatthew Draper2016-12-201-1/+8
| |/ / | | | | | | | | | | | | If it is explicitly cleared (e.g., response.sending_file = true), then we should not try to set it again.
* / / Do not clear HTTP_COOKIES header after requestJon Moss2016-12-111-0/+10
|/ /