aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test/controller/action_pack_assertions_test.rb
Commit message (Collapse)AuthorAgeFilesLines
* Revert ensure external redirects are explicitly allowedGannon McGibbon2019-01-221-3/+3
|
* Ensure external redirects are explicitly allowedGannon McGibbon2019-01-171-3/+3
| | | | Add `fallback_location` and `allow_other_host` options to `redirect_to`.
* Enable `Style/RedundantBegin` cop to avoid newly adding redundant begin blockRyuta Kamizono2018-12-211-10/+8
| | | | | | | | | | Currently we sometimes find a redundant begin block in code review (e.g. https://github.com/rails/rails/pull/33604#discussion_r209784205). I'd like to enable `Style/RedundantBegin` cop to avoid that, since rescue/else/ensure are allowed inside do/end blocks in Ruby 2.5 (https://bugs.ruby-lang.org/issues/12906), so we'd probably meets with that situation than before.
* warning: ambiguous first argument; put parentheses or a space even after `/' ↵utilum2018-04-201-1/+1
| | | | operator
* Replace `assert !` with `assert_not`Daniel Colson2018-04-191-3/+3
| | | | | This autocorrects the violations after adding a custom cop in 3305c78dcd.
* Use assert_empty and assert_not_emptyDaniel Colson2018-01-251-3/+3
|
* Use assert_predicate and assert_not_predicateDaniel Colson2018-01-251-15/+15
|
* 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
|
* Define path with __dir__bogdanvlviv2017-05-231-1/+1
| | | | | | ".. with __dir__ we can restore order in the Universe." - by @fxn Related to 5b8738c2df003a96f0e490c43559747618d10f5f
* fix with_routing when testing api only controllersJulia López2016-12-291-0/+24
|
* Add three new rubocop rulesRafael Mendonça França2016-08-161-1/+1
| | | | | | | | Style/SpaceBeforeBlockBraces Style/SpaceInsideBlockBraces Style/SpaceInsideHashLiteralBraces Fix all violations in the repository.
* applies remaining conventions across the projectXavier Noria2016-08-061-2/+0
|
* modernizes hash syntax in actionpackXavier Noria2016-08-061-25/+25
|
* applies new string literal convention in actionpack/testXavier Noria2016-08-061-52/+52
| | | | | The current code base is not uniform. After some discussion, we have chosen to go with double quotes by default.
* Deprecate :controller and :action path parametersAndrew White2016-03-011-4/+16
| | | | | | | | Allowing :controller and :action values to be specified via the path in config/routes.rb has been an underlying cause of a number of issues in Rails that have resulted in security releases. In light of this it's better that controllers and actions are explicitly whitelisted rather than trying to blacklist or sanitize 'bad' values.
* 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
* Stop using deprecated `render :text` in testPrem Sichanugrist2015-07-171-9/+9
| | | | | | | | | This will silence deprecation warnings. Most of the test can be changed from `render :text` to render `:plain` or `render :body` right away. However, there are some tests that needed to be fixed by hand as they actually assert the default Content-Type returned from `render :body`.
* only call methods that are on the superclassAaron Patterson2015-07-141-2/+2
| | | | | | We want to treat the response object as if it's a real response object (not a test object), so we should only call methods that are on the superclass.
* only have one TestResponse classAaron Patterson2015-07-131-1/+1
|
* Remove `assigns` and `assert_template`.Guo Xiang Tan2015-05-301-209/+0
|
* Deprecate `:nothing` option for render methodMehmet Emin İNAÇ2015-05-281-1/+1
| | | | `head` method works similar to `render` method with `:nothing` option
* Switch to kwargs in ActionController::TestCase and ActionDispatch::IntegrationKir Shatrov2015-01-291-1/+3
| | | | | | | | Non-kwargs requests are deprecated now. Guides are updated as well. `post url, nil, nil, { a: 'b' }` doesn't make sense. `post url, params: { y: x }, session: { a: 'b' }` would be an explicit way to do the same
* adding that assert_template with :layout will raise ArgumentError for ↵Carsten Wirth2014-12-161-0/+7
| | | | unknown layout type
* Expectations firstAkira Matsuda2014-08-181-7/+7
|
* Merge branch 'master' into loofahRafael Mendonça França2014-08-171-0/+23
|\ | | | | | | | | Conflicts: actionpack/CHANGELOG.md
| * Fix assert_template for files.Guo Xiang Tan2014-08-141-0/+23
| | | | | | | | | | The test was not failing for `assert_template file: nil` when a file has been rendered.
* | Removed require's for html-scanner.Timm2014-06-161-1/+0
| |
* | Removed tag.rb since it has been deprecated.Timm2014-06-151-5/+0
|/
* Prefer assert_raise instead of flunk + rescue to test for exceptionsCarlos Antonio da Silva2013-12-191-10/+6
| | | | | | Change most tests to make use of assert_raise returning the raised exception rather than relying on a combination of flunk + rescue to check for exception types/messages.
* Fix incorrect assert_redirected_to failure messageDerek Prior2013-09-191-0/+18
| | | | | | | | | | | | | | | In some instances, `assert_redirected_to` assertion was returning an incorrect and misleading failure message when the assertion failed. This was due to a disconnect in how the assertion computes the redirect string for the failure message and how `redirect_to` computes the string that is actually used for redirection. I made the `_compute_redirect_to_loaction` method used by `redirect_to` public and call that from the method `assert_redirect_to` uses to calculate the URL. The reveals a new test failure due to the regex used by `_compute_redirect_to_location` allow `_` in the URL scheme.
* Fix warningsCarlos Antonio da Silva2013-03-071-2/+2
|
* Allow use of assert_template with the :file option.Justin Coyne2013-03-011-0/+35
| | | | This worked in Rails 3.2, but was a regression in 4.0.0.beta1
* deprecate `assert_blank` and `assert_present`.Yves Senn2013-01-051-1/+1
| | | | | They don't add any benefits over `assert object.blank?` and `assert object.present?`
* assert_template: validating option keysRoberto Soares2012-11-251-0/+6
|
* `assert_template` fails with empty string.Roberto Soares2012-11-231-0/+7
|
* `assert_template` fails with empty string when a template has been renderedRoberto Soares2012-11-231-0/+7
| | | | | | | | For instance, it prevents false positive in this case: file = nil get :index assert_template("#{file}")
* `assert_template` no more passing with what ever string that matches.Hugo Roque2012-09-291-0/+22
| | | | | | | | | | | | | | | | | | | | | | | Given Im rendering an template `/layout/hello.html.erb`, assert_template was passing with any string that matches. This behavior allowed false passing like: assert_template "layout" assert_template "out/hello" Now the passing possibilities are: assert_template "layout/hello" assert_template "hello" fixing assert_template bug when template matches expected, but not ends with Cherry Pick Merge: Fixes issue #3849 assert_template false positive taking redundant test off prevening incorrect assert_template when rendering with repeated names in path updating CHANGELOG with bugfix: assert_template false passing
* Move action_controller/vendor/html-scanner to action_viewPiotr Sarnacki2012-08-281-1/+1
| | | | | | This is another step in moving Action View's dependencies in Action Pack to Action View itself. Also, HtmlScanner seems to be better suited for views rather than controllers.
* Improve assert_template layout checkingAlexey Vakhov2012-05-041-0/+15
|
* Fix assert_template :layout => nil assertionAlexey Vakhov2012-05-041-0/+12
|
* Fix assert_template assertion with :layout optionAlexey Vakhov2012-05-041-0/+10
|
* Allows assert_redirected_to to accept a regular expressionAndy Lindeman2012-05-031-0/+4
|
* Remove default match without specified methodJose and Yehuda2012-04-241-10/+10
| | | | | | | | | | | | | | | | In the current router DSL, using the +match+ DSL method will match all verbs for the path to the specified endpoint. In the vast majority of cases, people are currently using +match+ when they actually mean +get+. This introduces security implications. This commit disallows calling +match+ without an HTTP verb constraint by default. To explicitly match all verbs, this commit also adds a :via => :all option to +match+. Closes #5964
* Remove deprecation warning from test related to old process apiCarlos Antonio da Silva2012-01-061-1/+1
|
* Revert "remove deprecated API"Aaron Patterson2012-01-051-1/+1
| | | | This reverts commit f53c247d10acbaacb0d61824cfce888c4b0520d2.
* remove deprecated APIAaron Patterson2012-01-051-1/+1
|
* Clean up routes inclusion and add some comments for the next soul that ↵José Valim2012-01-031-14/+0
| | | | decides to adventure on this code.