Commit Graph

175 Commits

Author SHA1 Message Date
Rafael Mendonça França
546497d027 Extract common controllers to abstract_unit 2012-08-13 21:43:18 -03:00
Aaron Patterson
c63d17c2be push drawing once to it's own module 2012-08-09 14:50:27 -07:00
Aaron Patterson
1e8c0a29d0 refactor the before_setup hooks to a module 2012-08-09 14:50:26 -07:00
Aaron Patterson
0b29c7bb7b switch callbacks to minitest hooks 2012-08-09 14:50:26 -07:00
Bogdan Gusiev
d89161e7cc Renamed _path_segments to _recall 2012-08-04 14:55:00 +03:00
Santiago Pastorino
449039a86d Remove ActionDispatch::Head middleware in favor of Rack::Head
Closes #7110 there's more work to do on rack-cache issue 69
2012-07-23 14:34:13 -03:00
Piotr Sarnacki
60b4290f1b Allow to use mounted helpers in ActionView::TestCase
Similarly to 6525002, this allows to use routes helpers for mounted
helpers, but this time in ActionView::TestCase
2012-06-01 17:45:06 +02:00
Santiago Pastorino
36dd1857dc Remove useless load path modifications 2012-05-11 19:00:35 -03: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
José Valim
6db930cb5b Remove --http. 2012-03-14 22:30:01 +01:00
Santiago Pastorino
4c16791f35 Add ActionController::HTTP
More info http://edgeguides.rubyonrails.org/api_app.html

[Carlos Antonio da Silva & Santiago Pastorino]
2012-03-14 12:46:23 -03:00
Aaron Patterson
bce3b5cb72 moved the get testing method to a module 2012-01-23 10:18:36 -08:00
Aaron Patterson
b15d2c0708 require minitest rather than test/unit 2012-01-06 15:50:47 -08:00
Rafael Mendonça França
2ed17977ac Change more Array.wrap to Kernel#Array 2012-01-05 17:57:56 -03:00
Sergey Nartimov
5ca86ac8f9 deprecate String#encoding_aware? and remove its usage 2011-12-24 15:57:54 +03: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
750bb5c865 Split ShowExceptions responsibilities in two middlewares. 2011-12-01 20:46:18 +01:00
lest
565d92f578 fix method redefined warnings in tests 2011-11-30 18:57:12 +03:00
lest
a985309abc fix warning in tests when using render_erb helper 2011-11-30 18:05:23 +03:00
lest
e975fe710a test helpers in erb using erb 2011-11-30 17:38:09 +03:00
lest
cd9d28d6fd middlewares should use logger from env 2011-11-25 13:09:46 +03:00
Santiago Pastorino
e5f2b0d75f Revert "Merge pull request #2647 from dmathieu/no_rescue"
This reverts commit 125b1b0b9180ec8f0135da185e77250d2b8a4bea.
2011-08-30 20:52:08 -03:00
Damien Mathieu
13dd7758ce remove useless rescue
params is a method, defined in every controller, which always returns a hash.
If it raises a NoMethodError, it means there's a bug somewhere else, which we want to know about.
2011-08-24 09:52:00 +02:00
Prem Sichanugrist
1bbc51e5a7 Fix failing test on uninitialized Rails.config.assets.prefix
This was introduced in [2684f17a17e4f97bdb89d20b4cd08585235263a2] 💣
2011-06-08 02:30:50 -04:00
Arun Agrawal
531095e64e We don't need to load version any more as Sprockets.beta8 is included. 2011-05-23 07:09:09 +05:30
Prem Sichanugrist
90f028a4dc Make sure that we're able to run Action Pack test standalone.
Sprocket was trying to look for these two things:

* `Rails::VERSION::STRING`
* `.initializer(str)` in `Rails::Engine`

This commit added require to version.rb into Abstract Unit, and mocking the `Rails::Engine.initializer` in `sprockets_helper_test.rb`
2011-05-22 19:02:54 -04:00
Aaron Patterson
938243feb9 do not require ruby-debug automatically. please require it if you have declared it as a dependency 2010-11-19 16:26:09 -08:00
Andrew White
2d5a12a50b Don't write out secure cookies unless the request is secure 2010-10-25 16:36:35 +01:00
Aaron Patterson
ffbcb84c21 removing more duplicate code 2010-10-01 18:05:59 -07:00
Aaron Patterson
44f85678e9 delete repeated code 2010-10-01 18:01:34 -07:00
Carlos Antonio da Silva
7fc1edd790 Remove deprecated stuff in ActionController
This removes all deprecated classes in ActionController related to
Routing, Abstract Request/Response and Integration/IntegrationTest.
All tests and docs were changed to ActionDispatch instead of ActionController.
2010-09-26 02:13:45 +08:00
Carlos Antonio da Silva
ff3f55ee58 There is no need to open AC::Base three times to setup tests. 2010-09-26 02:13:44 +08:00
Łukasz Strzałkowski
aac390204a Revert "Extended default route for match in tests - now it matches controller, action, id and format if given."
This reverts commit 05e9d0df0dea68ca4655aa8723c3ee69049fac78.
2010-09-05 13:44:36 +02:00
Łukasz Strzałkowski
7ff8a2040e Extended default route for match in tests - now it matches controller, action, id and format if given.
This fixes url_for tests
2010-09-05 13:44:36 +02:00
Piotr Sarnacki
b3eb26a161 Removed deprecated RouteSet API, still many tests fail 2010-09-05 13:44:36 +02:00
Santiago Pastorino
8d1ee434da Silence warnings for Encoding.default_external= and Encoding.default_internal= 2010-08-22 18:43:31 -03:00
Santiago Pastorino
1d888d465b Move encoding settings for testing purposes to abstract_unit file 2010-08-21 22:37:53 -03:00
Santiago Pastorino
b451de0d6d Deletes trailing whitespaces (over text files only find * -type f -exec sed 's/[ \t]*$//' -i {} \;) 2010-08-14 04:12:33 -03:00
José Valim
9e6e648732 Fix routes with :controller segment when namespaced [#5034 state:resolved] 2010-07-02 19:13:00 +02:00
Piotr Sarnacki
f7ba614c2d Unify routes naming by renaming router to routes
Signed-off-by: José Valim <jose.valim@gmail.com>
2010-07-02 01:51:03 +02:00
José Valim
6d04fa6dc4 Deprecate the old router DSL. Since it is still used intensively across ActionPack test suite, patches that translates Rails internal tests to the new router DSL are welcome (note though that a few tests shouldn't be translated since they are testing exactly the old mapper API, like the ones in actionpack/test/controller/resource_test.rb and actionpack/test/controller/routing_test.rb) 2010-06-28 12:23:41 +02:00
Santiago Pastorino
824da60ae8 Move Rails module to abstract_unit to make test in isolation work
Signed-off-by: José Valim <jose.valim@gmail.com>
2010-06-28 01:26:07 +02:00
Michael Lovitt
ebee77a28a Fixed that an ArgumentError is thrown when request.session_options[:id] is read in the following scenario: when the cookie store is used, and the session contains a serialized object of an unloaded class, and no session data accesses have occurred yet. Pushed the stale_session_check responsibility out of the SessionHash and down into the session store, closer to where the deserialization actually occurs. Added some test coverage for this case and others related to deserialization of unloaded types.
[#4938]

Signed-off-by: José Valim <jose.valim@gmail.com>
2010-06-27 22:39:06 +02:00
Neeraj Singh
db23a95a61 cache_sweeper yields blank output
[#3914 state:open]

Signed-off-by: José Valim <jose.valim@gmail.com>
2010-06-08 23:20:04 +02:00
José Valim
25f7c030e4 Simplify cookie_store by simply relying on cookies.signed. 2010-05-18 02:05:20 +02:00
wycats
80b60671f7 Revert "Moved encoding work in progress to a feature branch."
This reverts commit ade756fe42423033bae8e5aea8f58782f7a6c517.
2010-05-17 19:41:54 +04:00
Jeremy Kemper
ade756fe42 Moved encoding work in progress to a feature branch.
This reverts commits af0d1a88157942c6e6398dbf73891cff1e152405 and 64d109e3539ad600f58536d3ecabd2f87b67fd1c.
2010-05-16 13:55:29 -07:00
wycats
64d109e353 Significantly improved internal encoding heuristics and support.
* Default Encoding.default_internal to UTF-8
* Eliminated the use of file-wide magic comments to coerce code evaluated inside the file
* Read templates as BINARY, use default_external or template-wide magic comments
  inside the Template to set the initial encoding
  * This means that template handlers in Ruby 1.9 will receive Strings encoded
    in default_internal (UTF-8 by default)
* Create a better Exception for encoding issues, and use it when the template
  source has bytes that are not compatible with the specified encoding
* Allow template handlers to opt-into handling BINARY. If they do so, they
  need to do some of their own manual encoding work
* Added a "Configuration Gotchas" section to the intro Rails Guide instructing
  users to use UTF-8 for everything
* Use config.encoding= in Ruby 1.8, and raise if a value that is an invalid
  $KCODE value is used

Also:
* Fixed a few tests that were assert() rather than assert_equal() and
  were caught by Minitest requiring a String for the message
* Fixed a test where an assert_select was misformed, also caught by
  Minitest being more restrictive
* Fixed a test where a Rack response was returning a String rather
  than an Enumerable
2010-05-16 22:44:43 +04:00
David Chelimsky
91125f9927 move FixtureResolver to a file that is accessible outside Rails' own tests
[#4522 state:resolved]

Signed-off-by: José Valim <jose.valim@gmail.com>
2010-05-02 22:45:54 +02:00
Santiago Pastorino
ed0ca5db9e Add a test for assert_recognizes on ActionDispatch::IntegrationTest [#4390 state:committed]
Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
2010-04-24 15:43:12 -07:00