Commit Graph

143 Commits

Author SHA1 Message Date
Greg Ose
198aa6ef99 Update tests to load flash from session value 2014-04-28 15:07:52 -05:00
Santiago Pastorino
a5d8c95a7c Changes the usage of Object#returning with Object#tap
Signed-off-by: José Valim <jose.valim@gmail.com>
2010-07-25 22:49:06 +02:00
Eloy Duran
cddd4746f9 Rewrote ActionView::TestCase.
The test case now mimicks the template environment more closely, so it's
possible to use render, load helper dependencies.

This also fixes assert_select, and similar assertions. Because view tests
and helpers generally don't render full templates assert_select looks
first in rendered and then in output_buffer to find the rendered output.
2009-09-25 15:51:27 +02:00
Doug McInnes
dc69d9308a Fix for TestResponse.cookies returning cookies unescaped [#1867 state:resolved]
Signed-off-by: David Heinemeier Hansson <david@loudthinking.com>
2009-04-07 13:22:21 -05:00
Kenny Ortmann
ace154d067 added tests for session options being defaulted correctly to rack defaults [#2403 state:resolved]
Signed-off-by: Joshua Peek <josh@joshpeek.com>
2009-04-07 11:08:04 -05:00
Ryan Angilly
651611999d adding session_options initialization and test [#2303 state:resolved]
Signed-off-by: Joshua Peek <josh@joshpeek.com>
2009-03-24 10:53:29 -05:00
Peter Marklund
daffa5cbdd Reset request_parameters in TestRequest#recycle! to avoid multiple posts clobbering each other [#2271 state:resolved]
Signed-off-by: Joshua Peek <josh@joshpeek.com>
2009-03-24 10:53:07 -05:00
Joshua Peek
2277fbedbe Temporarily bundle Rack 1.0 prerelease for testing 2009-02-07 00:08:28 -06:00
Scott Taylor
2dedb5b03a Controller, response, and request should all refer to same session, even after a call to session_reset [#1823 state:resolved]
Signed-off-by: Joshua Peek <josh@joshpeek.com>
2009-01-29 19:39:48 -06:00
Joshua Peek
f17c87665e Fixed deprecated methods on TestSession [#1801 state:resolved] 2009-01-27 12:28:05 -06:00
Pratik Naik
57b156b338 Dont use Memoizable for ActionController::Request 2009-01-27 17:26:37 +00:00
Pratik Naik
5339f813be Change Object#try to raise NoMethodError on private methods and always return nil when Object is nil [Pratik Naik, Lawrence Pit] 2009-01-13 03:28:32 +00:00
Jeremy Kemper
35fa007313 Include process methods in ActionController::TestCase only. No need to alias_method_chain :process either. 2009-01-07 14:49:05 -08:00
Pratik Naik
fec0ea9d6d Request#env['SERVER_NAME'] does not contain port number 2008-12-28 17:07:13 +00:00
Pratik Naik
6e2a771661 Undry ActionController::TestCase#<HTTP_METHODS> for better documentation 2008-12-25 17:54:44 +00:00
Pratik Naik
e898f82a74 Move request parsing related code to ActionController::RequestParser 2008-12-25 03:51:04 +00:00
Pratik Naik
b5ecfe78f9 Use Rack::MockRequest for TestRequest 2008-12-23 00:30:32 +00:00
Joshua Peek
3b317b7100 Switch to Rack::Response#set_cookie instead of using CGI::Cookie to build cookie headers 2008-12-20 21:25:47 -06:00
Joshua Peek
fda62ecf70 Rename AbstractResponse to Response and inheirt from Rack::Response 2008-12-19 17:15:22 -06:00
Joshua Peek
a14bbd7a85 Process CGI 'cookie' header into 'Set-Cookie' for all responses.
This mostly affects response.headers['cookie'] for test requests. Use response.cookies instead.
2008-12-19 16:49:06 -06:00
Joshua Peek
3da1b94d07 Use status response accessor instead of the 'Status' header 2008-12-19 15:05:51 -06:00
Joshua Peek
7c09050999 Lazy load flash access 2008-12-16 01:00:48 -06:00
Seth Fitzsimmons
4966076d35 Use Mime::JS in place of explicit 'text/javascript' [#1573 state:resolved]
Signed-off-by: Joshua Peek <josh@joshpeek.com>
2008-12-15 12:18:45 -06:00
mark
49306ccacf Add :partial option to assert_template [#1550 state:resolved]
Signed-off-by: Joshua Peek <josh@joshpeek.com>
2008-12-11 11:06:35 -06:00
Lance Ivy
cd1a9ed991 Add TestResponse#client_error? to check for 4xx status codes [#851 state:resolved]
Signed-off-by: Joshua Peek <josh@joshpeek.com>
2008-11-22 13:10:12 -06:00
Jeremy Kemper
ebdbd854a9 Fix straggling references to Test::Unit::TestCase 2008-11-20 13:47:36 -08:00
Jeremy Kemper
eeea1a26ec Merge branch 'master' into testing 2008-11-15 12:21:04 -08:00
Jeff Cohen
fbbcd6f29a Changed request forgery protection to only worry about HTML-formatted content requests.
Signed-off-by: Michael Koziarski <michael@koziarski.com>
2008-11-13 11:23:21 +01:00
Jeremy Kemper
c82e8e1f48 Move controller assertions from base TestCase to AC:: and AV::TestCase 2008-11-07 15:42:34 -05:00
Jeremy Kemper
d355921709 Remove controller assertions from Test::Unit::TestCase. Use ActionController::TestCase. 2008-11-07 13:27:06 -05:00
Joshua Peek
ac50ee0edf Track rendered templates in stack so the current template can always be accessed. Added ActionView::Base#template to access the template object. 2008-10-28 11:06:08 -05:00
David Heinemeier Hansson
18542c9e00 Dont try to auto-set the etag based on the body if any freshness headers have already been set [DHH/José Valim] 2008-10-21 16:58:12 +02:00
Jeremy Kemper
a1eb4e11c2 Get rid of 'Object#send!'. It was originally added because it's in Ruby 1.9, but it has since been removed from 1.9.
Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>

Conflicts:

	actionpack/test/controller/layout_test.rb
2008-08-31 13:20:15 -07:00
Joshua Peek
8eec694598 Prefix ActionView::Base private methods with an underscore 2008-08-31 10:50:43 -05:00
Pratik Naik
a59a3db1f3 Move copying ivar logic from ActionController::Base to ActionView::Base 2008-08-31 03:48:09 +01:00
Tim Haines
82778351a8 Add TestUploadFile.content_type= to match Request.UploadedFile
[#920 state:resolved]

Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
2008-08-27 18:50:29 -07:00
Joshua Peek
f245658495 Use Response status accessor instead of the Status header 2008-08-17 19:13:49 -05:00
Jeremy Kemper
c7e09a8fb2 TestRequest#recycle! uses unmemoize_all to reset cached request method, accepts, etc. 2008-08-13 17:26:27 -07:00
Jeremy Kemper
ba2d61dd81 Update tests for request memoization 2008-08-08 02:31:12 -07:00
Jeremy Kemper
b7529ed1cc Simplifying usage of ETags and Last-Modified and conditional GET requests 2008-08-07 23:43:12 -07:00
Pratik Naik
6e75455125 Merge docrails changes 2008-07-28 12:33:24 +01:00
Joshua Peek
cd63015570 All 2xx requests are considered successful [#217 state:resolved] 2008-07-16 19:49:46 -05:00
Pratik Naik
0432d15164 Merge with docrails. 2008-07-16 13:01:23 +01:00
Joshua Peek
e0fef66149 Made ActionView::Base#first_render a little more private. And added _last_render to track the most recent render. Will fix #609 as a side effect. [#609 state:resolved] 2008-07-13 13:26:48 -05:00
Joshua Peek
73b34e9f75 Refactor template preloading. New abstractions include Renderable mixins and a refactored Template class. 2008-07-12 14:33:46 -05:00
Michael Koziarski
db58391079 Remove old broken follow_redirect from functional tests. Still works in integration tests.
The follow_redirect in functional tests only worked if you used redirect_to :id=>foo, :action=>bar, rather than named routes.
2008-07-04 10:41:40 +03:00
Pratik Naik
98dc582742 Merge docrails.
Signed-off-by: Pratik Naik <pratiknaik@gmail.com>
2008-05-25 12:29:00 +01:00
Jeremy Kemper
b43309328a Ruby 1.9 compat: ensure binary encoding for post body parsing 2008-05-19 16:24:26 -07:00
Xavier Noria
64092de257 Improve documentation coverage and markup
Signed-off-by: Pratik Naik <pratiknaik@gmail.com>
2008-05-02 14:45:23 +01:00
Jeremy Kemper
9e1d91c24b TestSession supports indifferent access. Closes #7372.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8782 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2008-02-02 05:32:44 +00:00