aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_dispatch/testing/assertions.rb
Commit message (Collapse)AuthorAgeFilesLines
* Change `ActionDispatch::Response#content_type` returning Content-Type header ↵yuuji.yaginuma2019-06-011-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | as it is Since #35709, `Response#conten_type` returns only MIME type correctly. It is a documented behavior that this method only returns MIME type, so this change seems appropriate. https://github.com/rails/rails/blob/39de7fac0507070e3c5f8b33fbad6fced84d97ed/actionpack/lib/action_dispatch/http/response.rb#L245-L249 But unfortunately, some users expect this method to return all Content-Type that does not contain charset. This seems to be breaking changes. We can change this behavior with the deprecate cycle. But, in that case, a method needs that include Content-Type with additional parameters. And that method name is probably the `content_type` seems to properly. So I changed the new behavior to more appropriate `media_type` method. And `Response#content_type` changed (as the method name) to return Content-Type header as it is. Fixes #35709. [Rafael Mendonça França & Yuuji Yaginuma ]
* Use frozen string literal in actionpack/Kir Shatrov2017-07-291-0/+2
|
* Revert "Merge pull request #29540 from kirs/rubocop-frozen-string"Matthew Draper2017-07-021-1/+0
| | | | | This reverts commit 3420a14590c0e6915d8b6c242887f74adb4120f9, reversing changes made to afb66a5a598ce4ac74ad84b125a5abf046dcf5aa.
* Enforce frozen string in RubocopKir Shatrov2017-07-011-0/+1
|
* String#end_with? should be faster than Regexp hereAkira Matsuda2017-01-051-1/+1
|
* applies new string literal convention in actionpack/libXavier Noria2016-08-061-3/+3
| | | | | The current code base is not uniform. After some discussion, we have chosen to go with double quotes by default.
* Use sufficient a regexp anchor to check `@response.content_type.to_s`yui-knk2015-10-221-1/+1
| | | | | | This commit follows up of ea9bc06c9a47b839d5e2db94ba6bf7e29c8f0ae9. To check `@response.content_type.to_s` is ended with `"xml"`, to use `\z` is sufficient.
* Merge pull request #20715 from simsalabim/feature/parse-rss-atom-as-xmlSean Griffin2015-10-201-1/+1
| | | | parse RSS/ATOM responses as XML, not HTML
* Use `Mime[:foo]` instead of `Mime::Type[:FOO]` for back compatJeremy Daer2015-10-061-1/+1
| | | | | | | | | | | | | | | | | 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. efc6dd550ee49e7e443f9d72785caa0f240def53
* stop calling deprecated methodsAaron Patterson2015-09-211-1/+1
| | | | | We should be asking the mime type method for the mime objects rather than via const lookup
* Compare content_type with Mime::XML instead of regexpBoris Peterbarg2015-03-161-1/+1
| | | | | Regexp is broken for both content types including charsets and for integration tests, where the content_type is a Mime::Type and not String
* Make sure assert_select can assert body tagRafael Mendonça França2014-11-181-1/+1
| | | | | | | | | This reverts commit f93df52845766216f0fe36a4586f8abad505cac4, reversing changes made to a455e3f4e9dbfb9630d47878e1239bc424fb7d13. Conflicts: actionpack/lib/action_controller/test_case.rb actionview/lib/action_view/test_case.rb
* Parse HTML as document fragment.Kasper Timm Hansen2014-09-291-1/+1
| | | | This is to match the changes in Rails Dom Testing rails/rails-dom-testing#20.
* We don't need loofah for the assertionsRafael Mendonça França2014-07-151-3/+2
| | | | We can just use nokogiri
* Moved html_document to ActionDispatch::Assertions. Included the ↵Timm2014-06-161-1/+12
| | | | Rails::Dom::Testing::Assertions there as well.
* Moved Dom and Selector assertions from ActionDispatch to ActionView.Timm2014-06-161-4/+0
|
* Removed tag.rb since it has been deprecated.Timm2014-06-151-2/+0
|
* Restructure TemplateAssertions-related code to eliminate circular requires.wycats2011-05-221-7/+6
| | | Also, no need to include dependencies in AS::Concerns inside included blocks.
* Remove assert_valid. It was already deprecated on Rails 2.3.José Valim2010-07-191-2/+0
|
* Fixed AD assertion autoloads [#3470 state:resolved]Joshua Peek2009-11-091-3/+16
|
* Move generic assertions into ActionDispatchJoshua Peek2009-04-301-0/+8