1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00
Commit graph

25 commits

Author SHA1 Message Date
kennyj
db0499a6b6 Re-remove deprecated API. 2013-06-28 01:42:07 +09:00
Rafael Mendonça França
6a4ff5cc09 Revert "Add the options method to action_controller testcase."
This reverts commit 0303c2325f.

Conflicts:
	actionpack/lib/action_controller/test_case.rb

REASON: It will conflict with a lot of test cases. Better to call
`process` directly since this is a very uncommon HTTP method.

Fixes #10638.
2013-05-16 11:10:59 -03:00
Mack Earnhardt
c23f3aa7c0 Fix rake test warnings in actionpack 2013-03-17 12:16:42 -04:00
Yves Senn
41a14dcd10 Http::Headers directly modifies the passed environment.
The env hash passed to `Http::Headers#new` must be in env format.
Also be aware that the passed hash is modified directly.

docs and test-cases for setting headers/env in functional tests.

Follow up to #9700.
2013-03-15 10:13:49 +01:00
Andrew White
f1d8f2af72 Change the behavior of route defaults
This commit changes route defaults so that explicit defaults are no
longer required where the key is not part of the path. For example:

  resources :posts, bucket_type: 'posts'

will be required whenever constructing the url from a hash such as a
functional test or using url_for directly. However using the explicit
form alters the behavior so it's not required:

  resources :projects, defaults: { bucket_type: 'projects' }

This changes existing behavior slightly in that any routes which
only differ in their defaults will match the first route rather
than the closest match.

Closes #8814
2013-01-15 17:22:25 +00:00
Yves Senn
947e1d5e85 deprecate assert_blank and assert_present.
They don't add any benefits over `assert object.blank?`
and `assert object.present?`
2013-01-05 18:04:52 +01:00
Ben Woosley
8b104e2f0c Use File.join to better integrate fixture_path in fixture_file_upload. 2012-11-26 17:50:57 -06:00
Aaron Patterson
a7826bd8b7 Merge branch 'master' into testclean
* master:
  Add documentation for inheritance_column method
  Use ArgumentError vs. RuntimeError, which is more precise.
  CSV fixtures aren't supported by default anymore, update generated test_helper.rb to reflect that
  fix quoting for ActiveSupport::Duration instances
  Add few information on the field types
  Add the options method to action_controller testcase.
2012-07-05 14:03:57 -07:00
François de Metz
0303c2325f Add the options method to action_controller testcase.
Signed-off-by: François de Metz <francois@stormz.me>
2012-07-04 15:00:00 +02:00
Aaron Patterson
b5442b5a3a test should be testing to_param not to_s, remove Array subclass 2012-07-03 16:35:07 -07:00
Tim Vandecasteele
8471edc672 Don't paramify ActionDispatch::Http::UploadedFile in tests
To test uploading a file without using fixture_file_upload, a posted
ActionDispatch::Http::UploadedFile should not be paramified (just like
Rack::Test::UploadedFile).
(Rack::Test::UploadedFile and ActionDispatch::Http::UploadedFile don't
share the same API, tempfile is not accessible on
Rack::Test::UploadedFile as discussed in
https://github.com/brynary/rack-test/issues/30)
2012-06-22 09:27:41 +02:00
Andrew White
1c7bcde92d Add failing test case for #6053 2012-04-29 20:20:59 +01:00
Andrew White
7a80b69e00 Don't convert params if the request isn't HTML - fixes #5341 2012-04-29 10:15:54 +01:00
Andrew White
5c18bdca32 Merge session arg with existing session instead of overwriting
This may break existing tests that are asserting the whole session contents
but should not break existing tests that are asserting individual keys - e.g:

class SomeControllerTest < ActionController::TestCase
  setup do
    session['user_id'] = 1
  end

  test "some test" do
    get :some_action, nil, { 'another_var' => 2 }

    # This assertion will now fail
    assert_equal({ 'another_var' => 2 }, session)

    # This assertion will still pass
    assert_equal 2, session['another_var]
  end
end

Fixes #1529.
2012-04-28 22:36:16 +01:00
Jose and Yehuda
56cdc81c08 Remove default match without specified method
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
2012-04-24 22:52:26 -05:00
Will Bryant
185c3dbc6a assigns(:foo) should not convert @foo's keys to strings if it happens to be a hash 2012-02-18 23:41:07 +13:00
ganesh
b314524128 replacing the orderhash with hash for ruby-1.9 2012-02-09 15:53:06 +05:30
Carlos Antonio da Silva
562a12df29 Rename test class and fix tests to keep consistency
Based on 50d23bc2bd.
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
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
4d073df43d Revert "remove deprecated API"
This reverts commit f53c247d10.
2012-01-05 14:52:49 -08:00
Aaron Patterson
f53c247d10 remove deprecated API 2012-01-05 14:46:34 -08:00
Nick Sutterer
50d23bc2bd moving test_test.rb to test_case_test.rb for consistency. 2012-01-03 11:50:03 +01:00
Renamed from actionpack/test/controller/test_test.rb (Browse further)