aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test/controller/action_pack_assertions_test.rb
Commit message (Collapse)AuthorAgeFilesLines
* 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.
* be explicit about where helpers are installedAaron Patterson2011-12-301-1/+1
|
* warning removed "warning: instance variable @variable_for_layout not ↵Arun Agrawal2011-12-171-0/+1
| | | | initialized"
* Fix bug in assert_template when using only `:layout` optionPrem Sichanugrist2011-12-061-0/+16
| | | | | | | | | | Currently if you're do this: assert_template :layout => "foo" Regardless of what layout you were using, the test will always pass. This was broken since the introduction of :layout option in [d9375f3f]. We have a lot of test cases in actionpack/test/controller/layout_test.rb that use this feature. This will make sure that those test cases are not true negative.
* remove unused user_controller from testNeeraj Singh2011-06-081-3/+0
|
* fix warning during test executionNeeraj Singh2010-11-171-1/+1
| | | | | | [#5997 state:resolved] Signed-off-by: Santiago Pastorino <santiago@wyeworks.com>
* make sure we are only doing sanity checking against regular expressionsAaron Patterson2010-11-151-0/+8
|
* Reset assert_template instance variables between requests [#5832 state:resolved]Andrew White2010-10-181-0/+8
|
* _ is not a valid scheme name character, \w includes it and also is redundant ↵Emilio Tagua2010-09-291-0/+7
| | | | | | with \d. 'The scheme name consists of a letter followed by any combination of letters, digits, and the plus ("+"), period ("."), or hyphen ("-") characters; and is terminated by a colon (":").'
* Use instance_variable_defined? instead instance_variable_get in tests.Emilio Tagua2010-09-281-2/+2
|
* Use parentheses when using assert_match followed by a regexp to avoid warnings.Emilio Tagua2010-09-271-1/+1
|
* Cleanup Action Dispatch assertions testsCarlos Antonio da Silva2010-09-061-108/+37
| | | | Signed-off-by: José Valim <jose.valim@gmail.com>
* Cleanup deprecations in Action DispatchCarlos Antonio da Silva2010-09-061-21/+6
| | | | Signed-off-by: José Valim <jose.valim@gmail.com>
* Removed deprecated RouteSet API, still many tests failPiotr Sarnacki2010-09-051-11/+8
|
* Remove assert_valid. It was already deprecated on Rails 2.3.José Valim2010-07-191-15/+0
|
* move assert_template tests to their own test case [#4501 state:resolved]David Chelimsky2010-05-031-41/+46
| | | | Signed-off-by: José Valim <jose.valim@gmail.com>
* Eliminate false positives when passing symbols to assert_templateDavid Chelimsky2010-05-031-4/+25
| | | | Signed-off-by: José Valim <jose.valim@gmail.com>
* Modify assert_template to use notifications. Also, remove ↵Carlhuda2010-03-171-3/+5
| | | | ActionController::Base#template since it is no longer needed.