Carlos Antonio da Silva
1b4edd173d
Use performed? instead of checking for response_body
...
* Check for performed? instead of response_body
* Change performed? to return a boolean
* Refactor AC::Metal#response_body= to reuse variable
2012-01-19 18:25:52 -02:00
José Valim
e2cc653876
Do not deprecate performed.
2012-01-19 19:52:10 +01:00
prasath
bedb66eb04
Refactored class methods on address render test
2012-01-19 02:34:50 +05:30
Chad Jolly
7ce85e210e
Exclude rack.request.form_vars from request.filtered_env
2012-01-18 19:42:31 +01:00
Rafael Mendonça França
5a6ea53514
ActionView now has its own logger
2012-01-18 14:30:33 -03:00
Carlos Antonio da Silva
56089ca986
Refactor FormBuilder arguments and default config
...
* Do not reopen AV::Base to define default form builder
Inside the load hook we are already in AV::Base context.
* Do not pass the given block to the form builder
The block is evaluated in fields_for context using capture, with the
builder as argument. This means we do not need to give the block to the
FormBuilder itself.
2012-01-18 10:22:03 -02:00
Carlos Antonio da Silva
e5e9a4cc76
Bring back rendering templates that start with / in nested structures
2012-01-17 10:04:39 -02:00
Carlos Antonio da Silva
cb650a50bf
Remove deprecated default_charset= from AC::Base
...
This should be set globally as a configuration, using
`config.action_dispatch.default_charset` instead
2012-01-17 10:04:39 -02:00
Carlos Antonio da Silva
67c96ab024
Move render_to_body logic to return a spaced string to AC::Rendering
...
This seems to be required only when calling render :partial with an
empty collection from a controller. This call happens to return no
content, letting the response body empty, which means to Rails that it
should go on and try to find a template to render based on the current
action name, thus failing hard.
Although tests keep all green, we need to check a better way to fix
this.
2012-01-17 10:04:38 -02:00
Carlos Antonio da Silva
a977b2588e
Remove method missing handling when action is not found, use action missing instead
...
Do not create a method_missing method to handle not found actions, use
the action_missing method provided by Rails instead.
2012-01-17 10:04:38 -02:00
Carlos Antonio da Silva
562a12df29
Rename test class and fix tests to keep consistency
...
Based on 50d23bc2bd3653b3c66e480c22ae97c5f7fd7f62.
2012-01-17 10:04:38 -02:00
Carlos Antonio da Silva
bb33e88833
Remove deprecated logic to render templates starting with /
...
render :template => "/foo/bar"
2012-01-17 10:04:38 -02:00
Carlos Antonio da Silva
71566c3573
Remove rescue_action from compatibility module and tests
2012-01-17 10:04:37 -02:00
Carlos Antonio da Silva
1ae9e60b8a
Remove other old compatibility constants
2012-01-17 10:04:37 -02:00
Carlos Antonio da Silva
bc50cb31d6
Remove old compatibility methods not being used
2012-01-17 10:04:37 -02:00
Marcin Bunsch and Przemek Dąbek
321dae5dcc
When force redirecting to SSL, make sure that the session is kept. As we're moving from a non-secure to secure environment, it's safe
2012-01-12 20:31:23 +01:00
Rafael Mendonça França
3f38d8442e
AC:TestCase::Behavior#head only accepts parameters as second argument
2012-01-10 02:01:10 -03:00
Rafael Mendonça França
f2494b536b
Whitespaces ✂️
2012-01-10 02:01:10 -03:00
Rafael Mendonça França
30f9af9c09
Fix ActionController::TestCase::Behavior.head
2012-01-10 02:00:20 -03:00
Aaron Patterson
d8516d702c
Merge pull request #4371 from rafaelfranca/test_unit_cleanup
...
Test unit cleanup
2012-01-09 09:34:36 -08:00
Sergey Nartimov
7d862359d0
get rid of using instance_variable_names method from AS
...
- instance_variables return symbols in 1.9
- there is instance_variable_defined? method
2012-01-07 14:44:47 +03:00
Rafael Mendonça França
5a740b8386
Test constant is not defined anymore
2012-01-06 22:51:45 -03:00
Carlos Antonio da Silva
68367fd570
Remove deprecation warning from test related to old process api
2012-01-06 09:25:40 -02:00
Aaron Patterson
fd918fe5ed
AP tests should inherit from AS::TestCase
2012-01-05 17:05:44 -08:00
Aaron Patterson
4d073df43d
Revert "remove deprecated API"
...
This reverts commit f53c247d10acbaacb0d61824cfce888c4b0520d2.
2012-01-05 14:52:49 -08:00
Aaron Patterson
f53c247d10
remove deprecated API
2012-01-05 14:46:34 -08:00
Karunakar (Ruby)
0023643522
Moved all the logger methods to active support logger
...
minor
2012-01-06 00:38:46 +05:30
José Valim
49b6b4994e
Clean up routes inclusion and add some comments for the next soul that decides to adventure on this code.
2012-01-03 20:09:11 +01:00
Nick Sutterer
50d23bc2bd
moving test_test.rb to test_case_test.rb for consistency.
2012-01-03 11:50:03 +01:00
Nick Sutterer
5b9708840f
allow sending documents in AC::TestCase#post and friends.
2012-01-03 11:43:54 +01:00
Sergey Nartimov
0f2f8003d2
remove ActiveSupport::Base64 in favor of ::Base64
2012-01-02 22:48:15 +03:00
Vishnu Atrai
8fbb44787e
remove more conditions for Fiber available in ruby19
2011-12-31 01:22:40 +05:30
Aaron Patterson
5681f79f64
be explicit about where helpers are installed
2011-12-30 10:02:49 -08:00
Aaron Patterson
bdfd11e6da
mutations on the underlying hash should also mutate the discard set
2011-12-28 18:33:44 -08:00
Aaron Patterson
ffad4927b1
mutations can't be done without the consent of our proxy object. This
...
is one benefit of choosing composition over inheritance.
2011-12-28 18:21:35 -08:00
Santiago Pastorino
eeb7736860
Merge pull request #4150 from Karunakar/new_PR
...
change Log
2011-12-26 05:20:15 -08:00
Sergey Nartimov
1e9e88fcd3
remove checks for encodings availability
2011-12-25 14:34:58 +03:00
José Valim
58f69ba085
Remove Rescue middleware that was never used by Rails.
2011-12-24 11:28:05 +01:00
José Valim
39081f1660
Provide a class optin for page_cache_compression.
2011-12-24 09:54:29 +01:00
Andrey A.I. Sitnik
7b1ac55f50
Gzip files on page caching
...
Signed-off-by: José Valim <jose.valim@gmail.com>
2011-12-24 09:42:34 +01:00
Karunakar (Ruby)
131c9ba9d0
Moving to logger methods to ActiveSupport Logger
2011-12-24 00:17:21 +05:30
Aaron Patterson
ead2593a54
adding an integration test for splat regexp substitutions. fixes #4138
2011-12-22 18:52:42 -07:00
Aaron Patterson
4ee537a8a2
Adding an integration test. Fixes #4136
2011-12-22 18:04:22 -07:00
Aaron Patterson
3f92e5e407
rack bodies should be a list
2011-12-22 13:09:43 -07:00
Aaron Patterson
de6e92fe53
refactoring routing tests
2011-12-22 12:53:14 -07:00
Aaron Patterson
44ff03bb2e
adding integration test for journey #7
2011-12-21 13:56:20 -07:00
Aaron Patterson
52c214f7a3
caches should not be global, so no need to clear in the teardown
2011-12-21 10:43:54 -07:00
José Valim
618cb44291
Merge pull request #4079 from drogus/http_digest_issue
...
Fix http digest authentication when url ends with `/` or `?`
2011-12-21 05:14:26 -08:00
Rahul P. Chaudhari
b74f5b7398
Remove unused conditions for 1.9
2011-12-21 13:34:54 +05:30
Piotr Sarnacki
3131a93797
Fix http digest authentication with trailing '/' or '?' ( fixes #4038 and #3228 )
2011-12-21 00:02:58 +01:00
Jarrod Carlson
53c1ae99f5
Added failing test to demonstrate digest authentication failure
2011-12-20 18:03:49 +01:00
José Valim
6c57177f2c
Remove deprecation warnings from Action Pack.
2011-12-20 15:12:38 +01:00
lest
c3c1ff40fc
remove warnings about @variable_for_layout
2011-12-20 15:53:24 +03:00
Aaron Patterson
9d0789c415
adding tests for #4029
2011-12-19 13:34:54 -08:00
Arun Agrawal
23334be5b8
warning removed "warning: instance variable @variable_for_layout not initialized"
2011-12-17 12:00:57 +05:30
José Valim
654df86b7b
Show detailed exceptions no longer returns true if the request is local in production.
2011-12-16 10:45:59 +01:00
José Valim
deef8dd682
Extract the rendering of public exceptions pages into a Rack app.
2011-12-16 10:45:59 +01:00
José Valim
d142572567
Get rid of the close checks since we cannot reliably close the session anyway.
2011-12-16 10:45:59 +01:00
Xavier Noria
5e0dec5e10
it's -> its
2011-12-15 12:57:33 -08:00
José Valim
26e7400cc5
Fix diagnostics page for routing errors.
2011-12-15 19:43:49 +01:00
choonkeat
5f67cfeda1
Fix url_for options[:subdomain] to allow objects as values
...
* e.g. blog_url(subdomain: current_user) instead of blog_url(subdomain: current_user.to_param)
2011-12-14 22:43:42 +08:00
José Valim
d4d99bbc87
Fix another regression related to the layout optimization.
2011-12-08 22:56:50 +01:00
José Valim
ebd71fd0e3
Fix a regression and also fix broken test.
2011-12-08 21:00:34 +01:00
kennyj
3ade2f8e89
Fix warning for params_wrapper_test.
2011-12-08 23:09:09 +09:00
Jean-Francois Turcot
d5526218e4
ParamsWrapper only wrap the accessible attributes when they were set
2011-12-07 22:50:01 -05:00
Prem Sichanugrist
0460b3a469
Fix bug in assert_template when using only :layout
option
...
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.
2011-12-06 21:15:27 -05:00
Thomas von Deyen
0da31a1839
Allowing string as url argument for expire_action
2011-12-06 13:05:15 +01:00
José Valim
f6cc4fd7a2
Merge pull request #3861 from andyjeffries/master
...
Named Routes shouldn't override existing ones (currently route recognition goes with the earliest match, named routes use the latest match)
2011-12-05 08:48:25 -08:00
lest
1f0e21ce30
use classify in ParamsWrapper to derive model name from controller name
2011-12-05 19:15:36 +03:00
Andy Jeffries
71d769e3b5
Named Routes shouldn't override existing ones (currently route recognition goes with the earliest match, named routes use the latest match)
2011-12-05 15:41:38 +00:00
Overbryd
e31c4ace97
Fix for redirect_to to respect urls with a network path reference like "//asset.host.com/resources/1235" see issue #3856
2011-12-05 11:19:48 +01:00
José Valim
07f90f6bec
Merge branch 'exceptions' with the following features:
...
* A Railtie API for registering new exceptions and their respective status code (check Active Record railtie for an example)
* Extraction of ShowExceptions middleware logging and debugging features into a middleware called DebugExceptions
Conflicts:
actionpack/CHANGELOG.md
2011-12-01 21:18:47 +01:00
José Valim
750bb5c865
Split ShowExceptions responsibilities in two middlewares.
2011-12-01 20:46:18 +01:00
David Heinemeier Hansson
83d29a283c
Revert "Added ActiveRecord::Base#last_modified to work with the new fresh_when/stale? conditional get methods from Action Pack"
...
Needless indirection with no added value.
This reverts commit 535853e83b9092078035a5abb2aa242fba815c05.
2011-12-01 20:45:47 +01:00
David Heinemeier Hansson
535853e83b
Added ActiveRecord::Base#last_modified to work with the new fresh_when/stale? conditional get methods from Action Pack
2011-12-01 19:47:14 +01:00
David Heinemeier Hansson
218c272938
Allow fresh_when/stale? to take a record instead of an options hash [DHH]
2011-12-01 19:16:10 +01:00
Olli Jokinen
b4e1903d23
Merge remote-tracking branch 'upstream/master'
2011-12-01 15:32:59 +02:00
lest
565d92f578
fix method redefined warnings in tests
2011-11-30 18:57:12 +03:00
José Valim
38ab982cff
Log 'Filter chain halted as CALLBACKNAME rendered or redirected' every time a before callback halts.
2011-11-30 09:53:09 +01:00
karevn
9b654d4713
Fix: when using subdomains and constraints, request params were not passed to constraints callback
2011-11-28 00:55:50 +06:00
José Valim
0a4035b12a
Revert the serializers API as other alternatives are now also under discussion
2011-11-25 19:29:39 +00:00
José Valim
fcacc6986a
Merge branch 'serializers'
...
This implements the ActiveModel::Serializer object. Includes code, tests, generators and guides.
From José and Yehuda with love.
Conflicts:
railties/CHANGELOG.md
2011-11-25 09:59:35 +00:00
José Valim
7fcc8c0a1f
Rely solely on active_model_serializer and remove the fancy constant lookup.
2011-11-23 23:45:27 +00:00
José Valim
e62de52aa3
Merge branch 'master' into serializers
2011-11-23 20:43:06 +00:00
kennyj
453f5534b4
Warnings removed. (ambiguous first argument)
2011-11-24 00:10:34 +09:00
lest
5bcd119b8d
move show_detailed_exceptions? to Rescue module
2011-11-22 13:34:13 +03:00
lest
c6d6b28bb4
refactor show exceptions tests
2011-11-22 11:38:55 +03:00
José Valim
d2cfa982fd
Merge pull request #3581 from amatsuda/metal_response_body_19
...
AC::Metal#response_body= stores different value in Ruby 1.8 and 1.9
2011-11-10 00:49:14 -08:00
Akira Matsuda
be7ab83b64
A test case to ensure that AC::Metal#response_body= always wraps the given value in an Array in both Ruby 1.8 and 1.9 (refs #3581 )
2011-11-10 10:54:56 +09:00
Bradford Folkens
bd559b0068
Fix trouble using :subdomain in development environment when using numeric addresses.
...
See-also pull request #3561 from 3-1-stable
Otherwise the following occurs:
TypeError: can't convert nil into String
/Users/bfolkens/dev/bfolkens-rails-core/actionpack/lib/action_dispatch/http/url.rb:75:in host_or_subdomain_and_domain'
/Users/bfolkens/dev/bfolkens-rails-core/actionpack/lib/action_dispatch/http/url.rb:37:in url_for'
/Users/bfolkens/dev/bfolkens-rails-core/actionpack/lib/action_dispatch/routing/url_for.rb:147:in test_subdomain_may_be_accepted_with_numeric_host'
/Users/bfolkens/dev/bfolkens-rails-core/activesupport/lib/active_support/testing/setup_and_teardown.rb:67:in run'
/Users/bfolkens/dev/bfolkens-rails-core/activesupport/lib/active_support/callbacks.rb:426:in send'
/Users/bfolkens/dev/bfolkens-rails-core/activesupport/lib/active_support/callbacks.rb:81:in run'
2011-11-08 07:52:35 -06:00
Christopher Meiklejohn
6cbe4223a7
Ensure that the format isn't applied twice to the cache key, else it becomes impossible to target with expire_action.
2011-10-31 15:10:07 -04:00
arvida
bb4a79370a
Added test for setting of HTTP Date header when calling #expires_in
2011-10-31 10:24:03 +01:00
José Valim
80768b739e
Responders now return 204 No Content for API requests without a response body (as in the new scaffold)
2011-10-26 09:31:56 +02:00
Arun Agrawal
244dcfea47
ActionPack test fix for RBX
2011-10-24 14:11:20 +05:30
Jose and Yehuda
8ff7693a8d
Initial commit of serializer support
2011-10-15 18:40:37 +02:00
Jeremy Kemper
bceec4c3c3
/ is allowed in URI fragments
2011-10-13 21:41:30 -07:00
Santiago Pastorino
8f11d53506
Merge pull request #2219 from kommen/fix_fragment_caching_squashed
...
Fix fragment caching (squashed commits)
2011-10-13 13:36:20 -07:00
Alexey Vakhov
50d262f52a
Support symbol and string actions in AC#respond_to options
2011-10-11 12:48:03 +04:00
Denis Odorcic
a0a68ecbb2
JSON responder should return errors with :error root
2011-10-10 01:42:12 -04:00
Ben Scheirman
d68f27e9b1
accept optional :host parameter to force_ssl
2011-10-08 18:38:02 -05:00
Kamil Sobieraj
de942e5534
:subdomain can now be specified with a value of false in url_for, allowing for subdomain(s) removal from the host during link generation. Closes #2025
2011-10-04 09:16:34 +01:00
Alexey Vakhov
8e946daf69
normalize arg for AC::TestCase tests class method
2011-10-03 12:12:07 +04:00
José Valim
6e8fe1bf02
TestCase should respect the view_assigns API instead of pulling variables on its own.
2011-10-02 11:29:13 +02:00
Santiago Pastorino
3de95fd930
Revert "Make process reuse the env var passed as argument"
...
This reverts commit 0e4748cd415660eb91e63d50aa15cdd027c612dd.
2011-09-24 17:19:42 -03:00
José Valim
43d27e9105
Deprecate passing the template handler in the template name.
...
For example, calling hello.erb is now deprecated. Since Rails 3.0
passing the handler had no effect whatsover. This commit simply
deprecates such cases so we can clean up the code in later releases.
2011-09-22 15:37:38 +02:00
José Valim
119e9e2daf
Get rid of update_details in favor of passing details to find_template.
2011-09-22 15:03:05 +02:00
Aaron Patterson
a08bee7841
all routes can be stored in the Journey Routes object
2011-09-12 16:50:48 -07:00
Mike Dillon
dbef311819
Use ensure instead of rescue
2011-09-10 11:01:22 -07:00
Mike Dillon
538fb18dea
Add test for warning and CHANGELOG entry
2011-09-10 09:51:55 -07:00
Aaron Patterson
ac1a363c6e
Pull up a method we only use once.
2011-09-08 16:04:57 -07:00
Aaron Patterson
41a085ebc9
Conditions must never be equal
2011-09-08 16:04:57 -07:00
Jon Leighton
16f1ce41d5
Merge pull request #2499 from akaspick/assert_select_email_fix
...
Fix assert_select_email to work on non-multipart emails as well as converting the Mail::Body to a string to prevent errors.
2011-09-07 05:51:31 -07:00
Aaron Patterson
f6ced69a11
Eliminate newlines in basic auth. fixes #2882
2011-09-06 17:25:20 -07:00
Santiago Pastorino
a1fa756e17
* is not allowed in windows file names. Closes #2574 #2847
2011-09-04 17:44:48 -03:00
Andrew White
ebea387e4b
Add failing test case for #2654
2011-08-23 15:33:59 +01:00
Andrew White
14cf4b2e35
Don't modify params in place - fixes #2624
2011-08-23 11:07:37 +01:00
Aaron Patterson
5f94b93279
Properly escape glob characters.
2011-08-16 15:28:27 -07:00
Trek Glowacki
dde5b8737b
When a route references a missing controller, raise ActionController::RoutingError with a clearer message
2011-08-16 16:27:07 -04:00
Jon Leighton
8e23615245
Use lazy load hooks to set parameter wrapping configuration. This means that it doesn't force Action Controller / Active Record to load, but it doesn't fail if they have already loaded. Thanks @josevalim for the hint.
2011-08-16 19:14:20 +01:00
Jon Leighton
6c5f67cac1
Don't refer to ActionController::Base in the wrap_parameters initializer - use config object instead. Cuts about 15% off the load time. ( #734 )
2011-08-16 00:59:59 +01:00
Franck Verrot
75dd33a0ae
Methods like status and location are interfering with redirect_to [ Closes #2511 ]
2011-08-14 19:00:30 +02:00
Aaron Patterson
943a37348a
moving test_generate to an integration test with one assert per test
2011-08-12 15:55:00 -07:00
Andrew Kaspick
60d358b233
fix assert_select_email to work on non-multipart emails as well as converting the Mail::Body to a string to prevent errors.
2011-08-11 17:49:31 -05:00
thoefer
860202e8b2
Fix the issue where default_url_options is being cached on test cases. Closes #1872 . Closes #2031 .
...
Signed-off-by: José Valim <jose.valim@gmail.com>
2011-08-01 11:49:24 +02:00
Santiago Pastorino
d701b3fa47
Merge pull request #2379 from arunagw/extra_require_removal
...
Removing extra requires from the test. Already loaded in abstract_unit.
2011-07-31 11:50:52 -07:00
Arun Agrawal
ec7457ed2a
Removing extra requires from the test. Already loaded in abstract_unit.
2011-07-31 23:36:21 +05:30
Vishnu Atrai
070513016f
remove extra require for 'active_support/dependencies' as it is required in abstract_unit.rb
2011-07-31 23:12:28 +05:30
thedarkone
4d4d2179f6
There is no need to be destructive with the passed-in options.
...
This fixes a bug that is caused by Resource/SingletonResource mangling resource options when using inline "multi"-resource declarations.
2011-07-28 20:00:48 +02:00
Olli Jokinen
fae9ad9c71
fixed test case test_render_json_with_callback to use content_type application/javascript
2011-07-28 15:39:04 +03:00
Gaston Ramos
dc1b0fd957
- added ActionView::PartialRenderer#merge_path_into_partial(path, partial)
...
fix issues/1951
2011-07-24 00:54:58 -03:00
Gaston Ramos
7621d131d2
- added test case for issue:
...
https://github.com/rails/rails/issues/1951
Namespaced model partial_path is wrong in namespaced controllers
2011-07-24 00:54:45 -03:00
Jesse Storimer
ac81af40c0
Ensure that status codes are logged properly
...
Needed to move AC::Metal::Instrumentation before AM::Metal::Rescue
so that status codes rendered from rescue_from blocks are logged
properly.
2011-07-18 13:42:07 -04:00
José Valim
7da88c5b29
Remove stream at the class level.
...
This is because only template rendering works with streaming.
Setting it at the class level was also changing the behavior
of JSON and XML responses, closes #1337 .
2011-07-06 20:24:30 -03:00
Damien Mathieu
ac15bcebf2
provide a more explicit message when using url_for with nil
...
This fixes the problem of having a non-explicit message when the :location option is not provided in respond_with.
2011-07-02 18:53:54 +02:00
José Valim
9c9ec2172e
Make sure respond_with with :js tries to render a template in all cases
2011-06-30 11:47:36 -03:00
Esad Hajdarevic
2a61d47b55
Make send_file guess content-type from file extension, if type wasn't supplied (Issue #1847 ). Update tests & documentation.
2011-06-28 06:58:28 +02:00
David Chelimsky
a7af1e0051
Get the fixture_path from self.class instead of ActiveSupport::TestCase.
...
This allows test classes that are not subclasses of
ActiveSupport::TestCase (like those in rspec-rails) to interact with
with this variable without having to reference ActiveSupport::TestCase.
2011-06-25 13:59:49 -05:00
Jeroen Jacobs
93ff522120
Tests only after filters in cache sweepers
2011-06-22 18:00:46 +02:00
Neeraj Singh
f3c9f32664
remove meaningless assert true
2011-06-11 03:11:06 -04:00
Neeraj Singh
6688b6393a
expected message should come first
2011-06-11 03:11:06 -04:00
Neeraj Singh
5da89af6f6
try not to use assert_blank when nil will would
...
be considered as failure
Test for specific value to the extent possible
2011-06-11 03:11:05 -04:00
Neeraj Singh
06d772c0ce
add missing ensure
2011-06-10 02:48:44 -04:00
Neeraj Singh
fdbe8eb08c
replaced and with && as per coding guidelines
2011-06-10 02:27:57 -04:00
Neeraj Singh
49d032929b
The test name is misleading. It says
...
test_should_cache_with_trailing_slash_on_url
A trailing slash is removed when a page is cached.
What the test meant to say was : a url with trailing slash
should be cached and the cached page should not have any
trailing slash.
This patch clarifies the name a bit.
2011-06-10 02:24:37 -04:00
Neeraj Singh
fa5b34ed22
remove unused user_controller from test
2011-06-08 22:49:38 -04:00
Andrew White
d4658d86fe
Refactor ActionController::TestCase cookies
...
Assigning cookies for test cases should now use cookies[], e.g:
cookies[:email] = 'user@example.com'
get :index
assert_equal 'user@example.com', cookies[:email]
To clear the cookies, use clear, e.g:
cookies.clear
get :index
assert_nil cookies[:email]
We now no longer write out HTTP_COOKIE and the cookie jar is
persistent between requests so if you need to manipulate the environment
for your test you need to do it before the cookie jar is created.
2011-06-04 07:09:11 +01:00
Damien Mathieu
8a0ffa7c95
fix creating an empty route on 1.8. Closes #1210
2011-06-01 15:51:36 +02:00
Lee Reilly
4f234bfd79
Corrected some typos and American vs. Queen's English issues
2011-05-29 12:40:24 -07:00
José Valim
a46b03e728
Merge pull request #1203 from dchelimsky/stringify-parameter-values-in-tests
...
Stringify param values in controller tests.
2011-05-28 12:43:13 -07:00
dmathieu
16571f9c42
don't raise an exception if the format isn't recognized
...
Fixed while traveling to heuruko
2011-05-26 11:18:30 +02:00
Josh Kalderimis
d182b6ee9c
removed deprecated methods, and related tests, from ActionPack
2011-05-24 23:38:59 +02:00
Jon Leighton
d411c85a65
Replace references to ActiveSupport::SecureRandom with just SecureRandom, and require 'securerandom' from the stdlib when active support is required.
2011-05-23 20:25:44 +01:00
wycats
7b9f3eb10b
Always initialize @title in caching test to avoid uninitialized instance variable warning
2011-05-22 23:14:52 -07:00
David Chelimsky
9277e72a3c
Stringify param values in controller tests.
...
This reduces false positives that come from using ints in params in
tests, which do not get converted to strings in the tests. In
implementations going through rack, they do get converted to strings.
- David Chelimsky and Sam Umbach
2011-05-22 02:47:54 -04:00
Josh Kalderimis
968596fa7f
renamed the wrap_parameters :only and :except options to :include and :exclude to make it consistent with controller filters
2011-05-19 10:33:25 -04:00
David Chelimsky
13950a8cc9
add more robust test for wrapping params with anonymous class
2011-05-17 06:57:14 -04:00
David Chelimsky
14d5e3e459
better test name
2011-05-17 06:56:53 -04:00
David Chelimsky
29e8ca3698
add failing test for https://github.com/rails/rails/issues/1089
2011-05-17 06:56:46 -04:00
Prem Sichanugrist
d77b306b63
Make ParamsWrapper calling newly introduced Model.attribute_names
instead of .column_names
2011-05-15 19:07:44 -04:00
Prem Sichanugrist
3bed43c6a5
Do not try to call column_names
on the abstract class.
...
Normally the table for abstract class won't be existed, so we should not trying to call `#column_names` on it.
2011-05-15 00:41:20 -04:00
David Lee
8366cabd65
Test csrf token param name customization
2011-05-10 18:24:14 -07:00
José Valim
a87894ae57
Get around weird missing constant error caused by AS instead of simply raising NameError, closes #477 .
2011-05-11 00:08:43 +02:00
José Valim
9c2c25c1a1
Revert to old semantics, use available_action? instead of action_method?.
2011-05-06 18:44:18 +02:00
Nick Sutterer
65ceccb0ba
controller's prefixes are now added to LookupContext.
2011-05-03 23:41:38 +02:00
Vijay Dev
f490a81443
Fix typos in test method names
2011-05-03 23:35:01 +05:30
Josh Kalderimis
275529446e
raise an error if the old router draw method is used, along with a message advising them to either upgrade their routes or add rails_legacy_mapper to their Gemfile
2011-05-03 16:07:25 +02:00
Prem Sichanugrist
31f412fc97
Fix broken params_wrapper_test on 1.8.7 💣
...
I have to keep in mind that 1.8.7 does *not* preserve the hash order.
Guys, let's move to use 1.9.2 in production!
2011-05-03 16:51:19 +07:00
José Valim
a55f2de0c5
Improve performance for filtered parameters and add tests.
2011-05-03 01:04:57 +02:00
José Valim
4bddc06e83
Move most processing to load time for performance and improve test suite.
2011-05-03 01:04:57 +02:00
Prem Sichanugrist
8c9e4d5202
Add ActionController::ParamsWrapper
to wrap parameters into a nested hash
...
This will allow us to do a rootless JSON/XML request to server.
2011-05-03 03:21:43 +07:00
José Valim
13df194c00
Tidy up pending TODOs after discussion with Mr. Gatoz (@wycats).
2011-05-01 19:39:57 +02:00
José Valim
46611a995d
log errors when an exception happens when streaming.
2011-05-01 13:40:14 +02:00
José Valim
6960a230fa
Add a test for rendering from the controller context.
2011-05-01 13:40:14 +02:00
misfo
9f6cafd5fd
prevent errors when passing a frozen string as a param to ActionController::TestCase#process
...
since ActionDispatch::Http::Parameters#encode_params will force encoding on all params strings (when using an encoding aware Ruby), dup all strings passed into process. This prevents modification of params passed in and, more importantly, doesn't barf when a frozen string is passed
thanks and high fives to kinsteronline
2011-04-28 04:07:57 +08:00
David Chelimsky
8d00dfca7f
rename test case to better describe use case
...
Signed-off-by: José Valim <jose.valim@gmail.com>
2011-04-25 09:31:48 +02:00
Florent Piteau
89ed9fbd19
Don't reuse a closed flash when using now
2011-04-20 04:32:26 +08:00
José Valim
069e9b004f
Do not stream on HTTP/1.0.
2011-04-19 15:04:28 +02:00
José Valim
b398520c14
Output a redirect to the 500 page if something happens when streaming.
...
Currently, we output:
"><script type="text/javascript">window.location = "/500.html"</script></html>
2011-04-19 12:26:11 +02:00
José Valim
6380f1a9f4
Be sure to not store the closed flash in the session.
2011-04-19 10:34:17 +02:00
José Valim
3b0f917b1d
Test explicit skip.
2011-04-18 14:27:49 +02:00
José Valim
07fde1a3d3
Just define the controller if fibers are defined.
2011-04-18 14:27:49 +02:00
José Valim
389d15ef13
Body... wanna *stream* my body? Body... such a thrill my body!
...
Added stream as class level method to make it explicit when to stream.
Render also accepts :stream as option.
2011-04-18 08:55:41 +02:00
Aaron Patterson
c630750fa5
switch to using comments to comment things
2011-04-15 14:13:46 -07:00
José Valim
d6bd606bdd
render :once, YAGNI.
2011-04-15 21:11:54 +02:00
David Chelimsky
a26d407f63
ActionView::PathSet# accepts String or Array
...
- Closes #6692
Signed-off-by: José Valim <jose.valim@gmail.com>
2011-04-13 21:45:51 +02:00
Prem Sichanugrist
733bfa63f5
Remove #among?
from Active Support
...
After a long list of discussion about the performance problem from using varargs and the reason that we can't find a great pair for it, it would be best to remove support for it for now.
It will come back if we can find a good pair for it. For now, Bon Voyage, `#among?`.
2011-04-13 20:25:28 +08:00
Xavier Noria
5850f16935
removes the RJS template handler
2011-04-13 13:23:18 +02:00
Xavier Noria
eea66892c8
removes support for render :update
2011-04-13 13:23:17 +02:00
Xavier Noria
b878757c50
removes assert_select_rjs
2011-04-13 13:23:16 +02:00
David Heinemeier Hansson
d1575ae1b9
Change Object#either? to Object#among? -- thanks to @jamesarosen for the suggestion!
2011-04-12 00:23:07 +02:00
Prem Sichanugrist
a9f3c9da01
Using Object#in? and Object#either? in various places
...
There're a lot of places in Rails source code which make a lot of sense to switching to Object#in? or Object#either? instead of using [].include?.
2011-04-11 03:17:09 +08:00
James Robinson
2cdc1f0cd5
Make csrf_meta_tags use the tag helper
...
Improved formatting of csrf_helper and improved test coverage
2011-04-08 02:21:08 +02:00
Aaron Patterson
1e90229e04
many args does not make sense with the current implementation because of how use
works
2011-04-06 18:13:16 -07:00
Aaron Patterson
32f876786a
getting the flash hash under test
2011-04-06 18:01:03 -07:00
Aaron Patterson
76c2ea7882
favor composition over inheritance, have FlashHash delegate to a Hash
2011-04-06 17:26:55 -07:00
Santiago Pastorino
0e4748cd41
Make process reuse the env var passed as argument
2011-04-06 16:37:55 -03:00
Santiago Pastorino
d7a5638dfb
raise if someone tries to modify the flash when it was already streamed back to the client or converted to HTTP headers
2011-04-05 10:41:34 -03:00
Santiago Pastorino
cc58fe79ac
Implicit actions named not_implemented can be rendered
2011-04-02 23:47:50 -03:00
Josh Kalderimis
b45302d767
pass respond_with options to controller render when using a template for api navigation
...
Signed-off-by: José Valim <jose.valim@gmail.com>
2011-03-31 18:53:36 +02:00
Josh Kalderimis
48404a751d
only try to display an api template in responders if the request is a get or there are no errors
...
Signed-off-by: José Valim <jose.valim@gmail.com>
2011-03-31 18:53:27 +02:00