aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack
Commit message (Collapse)AuthorAgeFilesLines
...
* | Refactor so all drivers use Puma by defaulteileencodes2017-02-205-43/+107
| | | | | | | | | | | | | | | | | | 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-206-2/+81
| | | | | | | | | | | | | | | | | | 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-2010-144/+154
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 documentation for system testseileencodes2017-02-209-7/+173
| | | | | | | | | | | | | | | | | | | | * Document Rails::SystemTestCase * Document setting drivers with the configration options * Document using the getter/setter for driver adapters * Document the CapybaraRackTestDriver and defaults * Document the CapybaraSeleniumDriver and defaults * Document custom assertions provided by System Testing * Document custom form helpers provided by System Testing
* | Add tests for system testingeileencodes2017-02-205-0/+105
| | | | | | | | | | | | | | | | | | | | * 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
* | Fix Railtie to pass class when setting optionseileencodes2017-02-203-8/+12
| | | | | | | | | | | | | | | | | | This will clean up the railtie quite a bit, rather than passing a set of hash keys call the new class directly like we do with ActiveJob. Only call driver once when tests start rather than in every single test setup. This is more performant, and the other way was creating unnecessary calls.
* | Move SystemTesting::Base into SystemTestCaseeileencodes2017-02-202-13/+6
| | | | | | | | | | There's no real benefit to the using the `Base` class here because `SystemTestCase` is already a very small class.
* | Refactor to not include `capybara/rails`eileencodes2017-02-201-2/+13
| | | | | | | | | | | | | | Rails itself is not a Rails application so instead of including `capybara/rails` we should use the code in there to set up the test. The only reason capybara needs to include capybara/rails in the first place is because Rails didn't yet support it.
* | Refactor driver adapter getter/settereileencodes2017-02-202-5/+10
| | | | | | | | | | | | This makes it easier to ask the system test what driver adapter it is currently using, and makes it easier to change that setting when necessary.
* | Inherit from ActionDispatch::IntegrationTesteileencodes2017-02-201-2/+1
| | | | | | | | | | | | | | Integration tests already handle all the fancy url mapping we need to do so inherting from that allows us to not need to reinvent the wheel in terms of loading up the route handling required to use `visit users_path` over `visit /users`.
* | Add test assertion helperseileencodes2017-02-203-0/+34
| | | | | | | | | | Adds assertions that are not part of Capybara but may be useful to Rails users writing system tests.
* | Add configuration option for driver adaptereileencodes2017-02-203-4/+18
| | | | | | | | | | This allows any application to change the driver adapter based on the config settings in the test env.
* | Add ForHelper's for system testseileencodes2017-02-203-0/+39
| | | | | | | | | | These FormHelpers are selectors that aren't a capybara default but are considered useful for Rails applications.
* | Add configurable selenium driver for capybaraeileencodes2017-02-202-0/+80
| | | | | | | | | | | | | | This is not yet configurable but is the minimum required to make Capybara work with the Selenium driver. A lot of this will change as the tests get fleshed out and the initialization requirements will eventually be configurable via the application.
* | Add ability to run system tests via Capybaraeileencodes2017-02-206-0/+79
| | | | | | | | | | | | Capybara defaults to Rack Test for it's driver and works out of the box but this adds the headers and allows for future configurable adapters for system testing.
* | Add skeleton for Rails::SystemTestCaseeileencodes2017-02-201-0/+5
|/ | | | | | | This skelton is the bare minimum to get system tests to actually run in an application. This of course doesn't yet actually run a test but it is enough for `bin/rails test:system` to attempt to run files in `test/system` that inherit from `Rails::SystemTestCase`.
* Set correct "routes" in tests casesbogdanvlviv2017-02-201-3/+3
|
* Unfreeze interpolated string because it's useless.Stan Lo2017-02-191-1/+1
|
* Merge pull request #27926 from st0012/freeze-cache-instrument-nameRafael França2017-02-132-2/+2
|\ | | | | Freeze fragment cache related instrument name.
| * Freeze fragment cache related instrument name.Stan Lo2017-02-072-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | ActionMailer::Base#instrument_name and ActionController::Base#instrument_name will be frequently called once caching is enabled. So it's better to freeze them instead of create new string on every call. Also, the instrument name in #instrument_fragment_cache will usually be "write_fragment.action_controller" or "read_fragment.action_controller". So freezing them might also gain some performance improvement. We have done something like this in other places: https://github.com/rails/rails/blob/master/actionview/lib/action_view/template.rb#L348
* | Remove unused requireRyuta Kamizono2017-02-122-3/+0
| | | | | | | | | | | | These files are not using `strip_heredoc`. Closes #27976
* | Removed the `attribute_accessors` required file:Edouard CHIN2017-02-121-1/+0
| | | | | | | | - This file is no more needed, the call to `cattr_reader` were removed in https://github.com/rails/rails/commit/9e2948e750fa3f641f20adad4b4ecae89b35faa7#diff-c5146df11f35304765e9ceebed108f57L60 and https://github.com/rails/rails/commit/1fe0a1b5ebebb1372968606b85ce08b93bc145c8#diff-c5146df11f35304765e9ceebed108f57L99
* | Add `Style/EmptyLinesAroundMethodBody` in `.rubocop.yml` and remove extra ↵Ryuta Kamizono2017-02-123-3/+0
|/ | | | empty lines
* Correct spellingBenjamin Fleischer2017-02-055-5/+5
| | | | | | | ``` 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-316-162/+57
|
* Merge pull request #27647 from Shopify/fully-eagerload-journeyRafael França2017-01-304-0/+28
|\ | | | | Fully initialize routes before the first request is handled
| * Fully initialize routes before the first request is handledJean Boussier2017-01-184-0/+28
| | | | | | | | | | | | | | | | | | | | | | | | `AD::Journey::GTG::Simulator` is lazily built the first time `Journey::Router#find_routes` is invoked, which happens when the first request is served. On large applications with many routes, building the simulator can take several hundred milliseconds (~700ms for us). Triggering this initialization during the boot process reduces the impact of deploys on the application response time.
* | Change ActionView ERB Handler from Erubis to ErubiJeremy Evans2017-01-251-2/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Erubi offers the following advantages for Rails: * Works with ruby's --enable-frozen-string-literal option * Has 88% smaller memory footprint * Does no freedom patching (Erubis adds a method to Kernel) * Has simpler internals (1 file, <150 lines of code) * Has an open development model (Erubis doesn't have a public source control repository or bug tracker) * Is not dead (Erubis hasn't been updated since 2011) Erubi is a simplified fork of Erubis that contains just the parts that are generally needed (which includes the parts that Rails uses). The only intentional difference in behavior is that it does not include support for <%=== tags for debug output. That could be added to the ActionView ERB handler if it is desired. The Erubis template handler remains in a deprecated state so that code that accesses it directly does not break. It can be removed after Rails 5.1.
* | Delete PATH_INFO after each controller test requestDominic Cleal2017-01-232-0/+15
| | | | | | | | | | | | | | | | | | | | 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
* | Add examples for behaviour about redirection with and without options. Fixes ↵Vipul A M2017-01-211-0/+8
| | | | | | | | #27715 [ci skip] (#27730)
* | 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-162-8/+1
| | | | | | | | | | | | [26dd9b26ab7317f94fd285245879e888344143b2] as it broke Parameters#to_h on at least fields_for-style nested params.
* | | Add missing requireDavid Heinemeier Hansson2017-01-161-0/+1
|/ / | | | | | | This was preventing the test suite from being run in isolation
* | `respond_to_missing?` should fallback to `super` where method_missing could ↵Akira Matsuda2017-01-151-1/+1
| | | | | | | | call `super`
* | Small spelling errorLachlan Priest2017-01-141-4/+4
| | | | | | existing_acrnoyms -> existing_acronyms
* | AC::ParamsWrapper::Options needs anonymous superclassAkira Matsuda2017-01-131-1/+1
| | | | | | | | | | | | it has some methods that override the accessors and calls the original accessors via `super` this partially reverts 9360b6be63b7a452535699bcf6ae853df7f5eea7
* | class Foo < Struct.new(:x) creates an extra unneeded anonymous classAkira Matsuda2017-01-133-4/+4
| | | | | | | | because Struct.new returns a Class, we just can give it a name and use it directly without inheriting from it
* | fix method name in `Renderer` doc [ci skip]yuuji.yaginuma2017-01-121-1/+2
| | | | | | | | `ActionController::Renderer.defaults` was removed in 2db7304
* | Reduce string objects by using \ instead of + or << for concatenating stringsAkira Matsuda2017-01-126-9/+9
| | | | | | | | (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-112-11/+3
| | | | | | | | | | | | | | | | | | | | | This reverts commit 5eff7a9ca7bb2ee7f16db1ab4d11cebe28757ba5, reversing changes made to 5f03172f54a58a57a48a3121562beb2cef866cbe. Reason: It caused a regression. The test case is on the PR.