- 07 8月, 2016 4 次提交
-
-
由 David Chen 提交于
In integration test when specify the "Accept" header with "xhr: true" option, the Accept header is overridden with a default xhr Accept header. The issue only affects HTTP header "Accept" but not CGI variable "HTTP_ACCEPT". For example: get '/page', headers: { 'Accept' => 'application/json' }, xhr: true # This is WRONG! And the response.content_type is also affected. # It should be "application/json" assert_equal "text/javascript, text/html, ...", request.accept assert_equal 'text/html', response.content_type The issue is in `ActionDispatch::Integration::RequestHelpers`. When setting "xhr: true" the helper sets a default HTTP_ACCEPT if blank. But the code doesn't consider supporting both HTTP header style and CGI variable style. For detail see this GitHub issue: https://github.com/rails/rails/issues/25859
-
由 Xavier Noria 提交于
-
由 Xavier Noria 提交于
-
由 Xavier Noria 提交于
The current code base is not uniform. After some discussion, we have chosen to go with double quotes by default.
-
- 06 8月, 2016 1 次提交
-
-
由 eileencodes 提交于
When a `GET` request is sent `as: :json` in an integration test the test should use Rack's method override to change to a post request so the paramters are included in the postdata. Otherwise it will not encode the parameters correctly for the integration test. Because integration test sets up it's own middleware, `Rack::MethodOverride` needs to be included in the integration tests as well. `headers ||= {}` was moved so that headers are never nil. They should default to a hash. Fixes #26033 [Eileen M. Uchitelle & Aaron Patterson]
-
- 27 7月, 2016 2 次提交
-
-
由 Santiago Pastorino 提交于
-
由 Santiago Pastorino 提交于
Fixes #25926
-
- 11 7月, 2016 1 次提交
-
-
由 Kasper Timm Hansen 提交于
Previously we'd only assign a response parser when a request came through Action Dispatch integration tests. This made calls to `parsed_body` when a TestResponse was manually instantiated — though own doing or perhaps from a framework — unintentionally blow up because no parser was set at that time. The response can lookup a parser entirely through its own ivars. Extract request encoder to its own file and assume that a viable content type is present at TestResponse instantiation. Since the default response parser is a no-op, making `parsed_body` equal to `body`, no exceptions will be thrown.
-
- 02 7月, 2016 3 次提交
-
-
由 Kasper Timm Hansen 提交于
-
由 Kasper Timm Hansen 提交于
Felt that += overwriting the path variable was a little too hidden. Make the outcomes easier to spot with an if-else branch.
-
由 Volmer 提交于
When running tests with `--enable-frozen-string-literal` or `# frozen_string_literal: true`, it's currently attempted to mutate the path string in order to append the format, causing a `RuntimeError`. ```ruby get '/posts', as: :json ``` ``` RuntimeError: can't modify frozen String ``` This commit fixes the problem by replacing the mutation with a concatenation, returning a new string.
-
- 25 6月, 2016 3 次提交
-
-
由 Kasper Timm Hansen 提交于
Then just yield the location for the place where we need some extra processing.
-
由 Kasper Timm Hansen 提交于
`if !var.nil?` is the same as just `if var`
-
由 yuuji.yaginuma 提交于
Currently, if path is a relative path, add format without the discrimination of the query. Therefore, if there is a query, format at end of the query would been added, format was not be specified correctly. This fix add format to end of path rather than query.
-
- 27 5月, 2016 1 次提交
-
-
由 yuuji.yaginuma 提交于
Follow up to #21671
-
- 24 4月, 2016 1 次提交
-
-
由 Prathamesh Sonpatki 提交于
- Followup of https://github.com/rails/rails/issues/18693. - I think we missed deprecating `request_via_redirect` in that pull request. - Originally requested by DHH here https://github.com/rails/rails/issues/18333.
-
- 12 4月, 2016 1 次提交
-
-
由 Vipul A M 提交于
- we are ending sentences properly - fixing of space issues - fixed continuity issues in some sentences. Reverts https://github.com/rails/rails/commit/8fc97d198ef31c1d7a4b9b849b96fc08a667fb02 . This change reverts making sure we add '.' at end of deprecation sentences. This is to keep sentences within Rails itself consistent and with a '.' at the end.
-
- 08 3月, 2016 1 次提交
-
-
由 Scott Bronson 提交于
Similar to 176fbfd6, this makes it possible for other test frameworks to hook into Rails integration test facilities.
-
- 07 3月, 2016 1 次提交
-
-
由 yui-knk 提交于
After 9d378747 `ActionDispatch::IntegrationTest` class is loaded and defined in all Rails environments, not only test but also production. This is not-intended loading of a class which is only used in test environment. To prevent not-intended loading, add `ActiveSupport.run_load_hooks` to `ActionDispatch::IntegrationTest` with `action_dispatch_integration_test` name and use it in `ActionMailer`.
-
- 03 3月, 2016 1 次提交
-
-
This reverts changes made to integration tests in PR #23807. The issue happens when using capybara with a driver that needs to start a server in a separate thread like (poltergeist, selenium, etc). Both threads the capybara server one and the test thread end running syncronize over the interlock.
-
- 01 3月, 2016 1 次提交
-
-
由 Matthew Draper 提交于
These should allow external code to run blocks of user code to do "work", at a similar unit size to a web request, without needing to get intimate with ActionDipatch.
-
- 13 2月, 2016 1 次提交
-
-
由 Kasper Timm Hansen 提交于
Yesterday, when improving how `parsed_body` extracted a parser I wrote 77bbf1e9. Then I thought that was too many changes in one commit and broke it up locally... or so I thought. When pushed the extra commits removed the changes! Wups! In shame, lob those changes together here: * 3b94c38a which meant to fix the CHANGELOG syntax error. * 5007df5e which meant to mention `parsed_body` in the docs. * 036a7a03 which meant to memoize the `parsed_body`.
-
- 12 2月, 2016 2 次提交
-
-
由 Kasper Timm Hansen 提交于
Little easier to understand when you know the method that's used.
-
由 Kasper Timm Hansen 提交于
We're not guaranteed to have a `RequestEncoder` to assign on `get` requests because we aren't extracting the parser from the response content type. Until now.
-
- 11 2月, 2016 1 次提交
-
-
由 Kasper Timm Hansen 提交于
When testing: ```ruby post articles_path, params: { article: { title: 'Ahoy!' } }, as: :json ``` It's common to want to make assertions on the response body. Perhaps the server responded with JSON, so you write `JSON.parse(response.body)`. But that gets tedious real quick. Instead add `parsed_body` which will automatically parse the reponse body as what the last request was encoded `as`.
-
- 03 2月, 2016 1 次提交
-
-
由 Sean Griffin 提交于
Prototype, you have served us well. But you are no longer how we make an XMLHttpRequest. RIP
-
- 05 1月, 2016 1 次提交
-
-
由 Kasper Timm Hansen 提交于
Turns ``` post articles_path(format: :json), params: { article: { name: 'Ahoy!' } }.to_json, headers: { 'Content-Type' => 'application/json' } ``` into ``` post articles_path, params: { article: { name: 'Ahoy!' } }, as: :json ```
-
- 07 12月, 2015 1 次提交
-
-
由 eileencodes 提交于
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.
-
- 28 10月, 2015 1 次提交
-
-
由 Gaurav Sharma 提交于
`skip_filter`, `skip_action_callback` may both are deprecated in Rails 5.1 so waring msg should be specific.
-
- 07 10月, 2015 1 次提交
-
-
由 Jeremy Daer 提交于
Rails 4.x and earlier didn't support `Mime::Type[:FOO]`, so libraries that support multiple Rails versions would've had to feature-detect whether to use `Mime::Type[:FOO]` or `Mime::FOO`. `Mime[:foo]` has been around for ages to look up registered MIME types by symbol / extension, though, so libraries and plugins can safely switch to that without breaking backward- or forward-compatibility. Note: `Mime::ALL` isn't a real MIME type and isn't registered for lookup by type or extension, so it's not available as `Mime[:all]`. We use it internally as a wildcard for `respond_to` negotiation. If you use this internal constant, continue to reference it with `Mime::ALL`. Ref. efc6dd55
-
- 22 9月, 2015 1 次提交
-
-
由 Aaron Patterson 提交于
We should be asking the mime type method for the mime objects rather than via const lookup
-
- 22 8月, 2015 1 次提交
-
-
由 Aaron Patterson 提交于
-
- 08 8月, 2015 1 次提交
-
-
由 Aaron Patterson 提交于
Actions are processed through `dispatch`, so they should have the request set on them before any user land code can be executed. Lets stop setting _env on the controller, and give access to it through the `env` method.
-
- 07 8月, 2015 1 次提交
-
-
由 Michael Grosser 提交于
- webservers do not do it - it makes redirect urls ugly when request.host is used for redirection
-
- 28 7月, 2015 1 次提交
-
-
由 Robin Dupret 提交于
-
- 01 6月, 2015 1 次提交
-
-
由 eileencodes 提交于
It's better to use Ruby methods when possible over methods defined by Active Support because then it does not need to rely on any dependencies.
-
- 30 5月, 2015 1 次提交
-
-
由 Guo Xiang Tan 提交于
-
- 18 5月, 2015 1 次提交
-
-
由 Roque Pinel 提交于
Based on #19976 and #18305.
-
- 02 5月, 2015 1 次提交
-
-
由 eileencodes 提交于
`*args` is not required here and should be avoided when not necessary because `*args` are slower than `args` and create unnecessary array allocations.
-
- 18 4月, 2015 1 次提交
-
-
由 Prem Sichanugrist 提交于
This method is being used in `#xml_http_request`, but was not properly required. This causes `NoMethodError` on projects that are doing integration test.
-