Commit Graph

2828 Commits

Author SHA1 Message Date
Santiago Pastorino
1d3618a9b4 remove warning: assigned but unused variable 2011-06-08 00:26:09 -03:00
Piotr Sarnacki
a6c5cc2377 Added missing assert to test checking form with namespaced isolated model and fixed helpers to work correctly in such case 2011-06-07 02:40:41 +02:00
Xavier Noria
5e21247131 Merge branch 'master' of git://github.com/lifo/docrails
Conflicts:
	activerecord/RUNNING_UNIT_TESTS
2011-06-06 22:23:30 +02:00
Guillermo Iguaran
c2c8ef57d6 Remove trailing white-spaces 2011-06-05 10:34:40 -05:00
Andrew White
e864ff7259 Add backward compatibility for testing cookies
This commit restores the ability to assign cookies for testing via
@request.env['HTTP_COOKIE'] and @request.cookies, e.g:

    @request.env['HTTP_COOKIE'] = 'user_name=david'
    get :index
    assert_equal 'david', cookies[:user_name]

and

    @request.cookies[:user_name] = 'david'
    get :index
    assert_equal 'david', cookies[:user_name]

Assigning via cookies[] is the preferred method and will take precedence
over the other two methods. This is so that cookies set in controller
actions have precedence and are carried over between calls to get, post, etc.
2011-06-05 12:34:27 +01:00
Vijay Dev
fc9ff8cf41 some grammatical corrections 2011-06-04 20:12:25 +05:30
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
Guillermo Iguaran
529d2deb5e Removing trailing white-spaces 2011-05-31 20:55:50 -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
José Valim
ec08bfc035 Merge pull request #1324 from dmathieu/no_error_on_invalid_format
Don't raise an exception if the format isn't recognized
2011-05-26 02:29:23 -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
Xavier Noria
00e1d0832e Merge branch 'master' of git://github.com/lifo/docrails
Conflicts:
	actionmailer/lib/action_mailer/base.rb
	activesupport/lib/active_support/core_ext/kernel/requires.rb
2011-05-25 22:48:47 +02:00
Dmytrii Nagirniak
8f003de2c7 fix minor spelling mistakes in comments 2011-05-23 22:40:29 -07:00
Sebastian Martinez
fcdb5dc557 Remove extra white spaces on ActionPack docs. 2011-05-23 20:22:33 -03: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
David Chelimsky
3f0c71c852 use to_param (and change method to name accordingly)
- exclude Rack::Test::UploadedFile to pass existing tests. Are there any
  other types we're missing?
2011-05-22 08:13:22 -04: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
José Valim
760dec17be Use anonymous? that works on both Ruby 1.8 and 1.9. 2011-05-17 14:51:44 -04:00
David Chelimsky
13950a8cc9 add more robust test for wrapping params with anonymous class 2011-05-17 06:57:14 -04:00
Andy Lindeman
ee82e1c301 Add fix for error when an anonymous controller subclasses ApplicationController 2011-05-17 06:57:04 -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
Xavier Noria
d491130236 Merge branch 'master' of git://github.com/lifo/docrails
Conflicts:
	actionpack/lib/action_view/helpers/date_helper.rb
	railties/lib/rails/generators/rails/app/templates/config/initializers/wrap_parameters.rb.tt
2011-05-14 11:21:27 +02:00
Xavier Noria
e5524d538c minor edits after going through what's new in docrails 2011-05-14 11:15:43 +02:00
Nick Sutterer
e1ceae576e added an example for AC::UrlFor usage to make usage simpler. 2011-05-12 09:58:26 +02:00
Nick Sutterer
e3b3f416b5 added docs for AbC::UrlFor and AC::UrlFor. 2011-05-12 09:31:36 +02: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
59705deeaf Warn if we cannot verify CSRF token authenticity 2011-05-09 17:23:41 +02:00
José Valim
0e886fe10e Merge pull request #280 from jballanc/frozen-string-strip-tags
Stripping tags from a frozen string
2011-05-07 03:44:19 -07:00
José Valim
c515f64f72 Use .ref instead of .to_sym. 2011-05-07 02:22:17 +02:00
José Valim
9c2c25c1a1 Revert to old semantics, use available_action? instead of action_method?. 2011-05-06 18:44:18 +02:00
José Valim
d42bb68430 More updates to ivars list. 2011-05-06 14:57:25 +02:00
José Valim
894bdbd53d Move variables to underscore format, update protected instance variables list. 2011-05-06 14:57:25 +02:00
José Valim
785ee65ddf Ensure params wrapper settings are not inherited and calculated each time. 2011-05-06 07:11:06 +02:00
José Valim
ffe731c922 Update respond_with docs to deal better with collections. 2011-05-05 03:01:15 -07:00
José Valim
35d0d82ae3 More performance optimizations. 2011-05-03 01:37:01 +02:00
José Valim
a55f2de0c5 Improve performance for filtered parameters and add tests. 2011-05-03 01:04:57 +02:00
José Valim
1afb56f481 Instrumentation should have callbacks. 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
José Valim
3cca86641e Update CHANGELOG. 2011-05-03 01:04:57 +02:00
Sebastian Martinez
c894fff60a Fix ParamsWrapper docs errors 2011-05-02 19:07:48 -03:00
David Heinemeier Hansson
79a9bebcbf Merge pull request #359 from sikachu/params_wrapper.
Add `ActionController::ParamsWrapper` to wrap JSON parameters into a nested parameters.
2011-05-02 14:08:44 -07: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
Xavier Noria
2db538c8a8 made a copy-edit pass on the streaming RDoc 2011-05-02 01:26:53 +02:00
José Valim
8dbee3aba6 Streaming docs. 2011-05-01 14:50:42 +02:00
José Valim
b735761385 Introduce view renderer. 2011-05-01 13:40:13 +02:00
Dan Pickett
1efaed5af1 Merge branch 'master' of github.com:lifo/docrails 2011-04-29 19:18:10 -04: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
Piotr Sarnacki
d4bea35f1a Make ActionController::Base.modules_for_helpers and ActionController::Base.all_helpers_from_path public methods 2011-04-25 15:02:41 +02:00