Commit Graph

79 Commits

Author SHA1 Message Date
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
Prem Sichanugrist
617e94658d Make sure that Rails doesn't resent session_id cookie over and over again if it's already there [#2485 state:resolved]
This apply to only Active Record store and Memcached store, as they both store only the session_id, which will be unchanged, in the cookie.

Signed-off-by: José Valim <jose.valim@gmail.com>
2010-06-25 09:41:52 +02:00
José Valim
6788db824a Move Rails::LogSubscriber to ActiveSupport::LogSubscriber, allowing frameworks like ActiveRecord and ActiveResource to log outsude Rails::Application [#4816 state:resolved] 2010-06-24 13:23:43 +02:00
Michael Lovitt
49f52c3d91 Sessions should not be created until written to and session data should be destroyed on reset.
[#4938]

Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
2010-06-23 11:56:35 -07:00
Andrew White
ed3f042e99 Make polymorphic_url and scaffolding work with uncountable resources [#3930 state:resolved]
Signed-off-by: José Valim <jose.valim@gmail.com>
2010-06-20 00:15:41 +02:00
José Valim
c536835957 Cut the fat and make session stores rely on request.cookie_jar and change set_session semantics to return the cookie value instead of a boolean. 2010-05-18 03:18:23 +02:00
Joshua Peek
cdf8c35ffd Consistent routing language 2010-03-30 14:05:42 -05:00
Carlhuda
d78e3fe73f Fix failing Action Pack tests 2010-03-02 14:41:12 -08:00
Carlhuda
5797575bac Stop setting UrlFor using SharedTestHelpers 2010-02-26 15:40:36 -08:00
Carlhuda
98f77e0827 Rename named_url_helpers to url_helpers and url_helpers to url_for 2010-02-26 15:04:50 -08:00
Carlhuda
a278f23310 Fix all of AP's tests with the non global router 2010-02-25 17:53:01 -08:00
Carlhuda
24ab5665b2 Revert "Fix test load paths for those not using bundler"
This reverts commit eec2d301d4ce9df9c71c1a5aa63053eb970b6818.

This commit broke tests. You cannot have a file called "bundler" on the load path.
2010-02-23 17:31:17 -08:00
Martin Schürrer
6bc24d40d5 Use ActionDispatch::Routing everywhere 2010-02-21 13:43:51 -08:00
José Valim
3f948a0e29 Merge master. 2010-02-17 00:48:04 +01:00
Prem Sichanugrist
f0523f72b4 Rename Rails::Subscriber to Rails::LogSubscriber 2010-02-16 22:36:15 +01:00
Joshua Peek
eec2d301d4 Fix test load paths for those not using bundler 2010-02-15 10:20:11 -06:00
José Valim
378464a2e4 Default to sync instrumentation. 2010-01-21 13:09:12 +01:00
José Valim
a8e25a518a Move parameters to the top on logging. 2010-01-19 15:35:24 +01:00
José Valim
27d9836ad3 Add ActionDispatch::Railties::Subscriber and finish tidying up the logging. 2010-01-17 12:43:17 +01:00
José Valim
f921ad5c97 Tidy up ActiveRecord and Views runtime information on process action logger. 2010-01-14 01:07:03 +01:00
José Valim
01839834fd ControllerRuntime tests also use Rails::Subscriber::TestHelper. 2010-01-13 01:19:24 +01:00
José Valim
f149eb19d4 From now on, parameters defined in default_url_options can be absent from named routes.
This allows the following setup to work:

  # app/controllers/application_controller.rb
  class ApplicationController
    def default_url_options(options=nil)
      { :locale => I18n.locale }
    end
  end

  # From your views and controllers:
  I18n.locale                 #=> :en
  users_url                   #=> "/en/users"
  users_url(:pl)              #=> "/pl/users"
  user_url(1)                 #=> "/en/users/1"
  user_url(:pl, 1)            #=> "/pl/users/1"
  user_url(1, :locale => :pl) #=> "/pl/users/1"

If you provide all expected parameters, it still works as previously.
But if any parameter is missing, it tries to assign all possible ones
with the hash returned in default_url_options or the one passed straight
to the named route method.

Beware that default_url_options in ApplicationController is not shared
with ActionMailer, so you are required to always give the locale in your
email views.
2010-01-07 15:34:14 +01:00
José Valim
f2d276fefd Ensure no notification is on the queue before running notifications related tests. 2010-01-03 23:39:09 +01:00
José Valim
6fbe9ef2ff Use namespaces in notifications. 2010-01-03 20:39:42 +01:00
Jeremy Kemper
c4c2502df8 Fix controller runtime test 2009-12-30 22:15:02 -08:00
José Valim
4ecdf24bde Kick AR logging back to life and move ControllerRuntime inside ActiveRecord::Rails. 2009-12-30 13:07:48 +01:00
Joshua Peek
2be5e088d2 Use new routing dsl in tests 2009-12-08 16:52:26 -06:00
José Valim
427a7385eb Make polymorphic_url work with symbols again and refactor it [#1384 status:resolved]
Signed-off-by: Joshua Peek <josh@joshpeek.com>
2009-10-28 14:13:48 -05:00
Joshua Peek
84e94551f6 Add custom "with_routing" to internal tests to fix reseting session after using
with_routing. This only affects our internal AP tests.
2009-10-03 20:45:49 -05:00
Joshua Peek
acfeec5151 Allow integration test rack app to be set with "@app" ivar instead of using open_session 2009-09-26 20:51:05 -05:00
Joshua Peek
0c638b3406 Clean up session integration tests so they don't reference AC::Dispatcher 2009-09-26 12:56:53 -05:00
Joshua Peek
314e18aba2 Need to reset session for AR session tests after altering the route set 2009-09-06 23:09:47 -05:00
Joshua Peek
ba5995dcd9 Reset session in integration tests after changing routes to reload the middleware stack 2009-08-27 12:43:26 -05:00
Niklas Holmgren
c284412b14 Polymorphic routes generates collection URL from model class [#1089 state:resolved]
Signed-off-by: Dan Pickett <dpickett@enlightsolutions.com>
Signed-off-by: Pratik Naik <pratiknaik@gmail.com>
2009-08-08 17:00:29 +01:00
José Valim
7034272354 Add destroyed? to ActiveRecord, include tests for polymorphic urls for destroyed objects and refactor mime responds tests and documentation. 2009-08-07 17:16:16 +02:00
Joshua Peek
92c00d7586 AMo conversion helper 2009-07-21 00:51:57 -05:00
Yehuda Katz
5ffaaa71d1 Define ActiveModel API Compliance
- Define to_model on AR
  - Define to_model on ActiveModel::APICompliant
  - Update test fixtures to be API Compliant
  - Start using to_model in AP
2009-07-20 00:27:04 +09:00
=?utf-8?q?Mislav=20Marohni=C4=87?=
21cd4c0e93 Fix polymorphic_path doesn't modify options hash [#2099 state:resolved]
Signed-off-by: Pratik Naik <pratiknaik@gmail.com>
2009-06-21 17:53:07 +01:00
Joshua Peek
1c4d28ba31 Move model naming into ActiveModel 2009-06-17 10:37:39 -05:00
Joshua Peek
a1140a1031 Revert "Only save the session if we're actually writing to it [#2703 state:resolved]"
This reverts commit dd98280e38d640f5724887cf8a715b79f0439d2d.
2009-05-30 09:36:08 -05:00
Johan Sörensen
dd98280e38 Only save the session if we're actually writing to it [#2703 state:resolved]
Signed-off-by: Joshua Peek <josh@joshpeek.com>
2009-05-28 09:35:17 -05:00
Joshua Peek
01d7acd11d Fix reset_session with ActiveRecord store [#2200 state:resolved] 2009-05-17 14:42:36 -05:00
Yehuda Katz + Carl Lerche
b6bac73b28 Merge commit 'origin/master'
Conflicts:
	actionpack/lib/action_controller/abstract/base.rb
	actionpack/lib/action_controller/routing.rb
2009-05-14 17:38:30 -07:00
Jeremy Kemper
e44cd41620 Make it clearer that session is nil 2009-04-26 23:59:17 -07:00
Mike Gunderloy
398b07e655 Remove excess mocking from polymorphic_url tests [#2330 state:resolved]
Signed-off-by: Pratik Naik <pratiknaik@gmail.com>
2009-04-21 14:32:52 +01:00
Luca Guidi
42cdc7571d Ensure SqlBypass use ActiveRecord::Base connection
Signed-off-by: Michael Koziarski <michael@koziarski.com>
[#https://rails.lighthouseapp.com/attachments/106066/0001-Ensure-SqlBypass-use-ActiveRecord-Base-connection.patch state:committed]
2009-04-05 21:00:50 +12:00
Joshua Peek
224a534400 reset_session should force a new session id to be generated [#2173] 2009-03-09 22:46:03 -05:00
Joshua Peek
9b1b88f09c Fixed reset_session for ActiveRecord session store [#2108 state:resolved] 2009-03-03 13:07:03 -06:00
Jeremy Kemper
57cca81cae Don't depend on project.developers ordering 2009-02-21 21:17:17 -08:00
Joshua Peek
ed70830713 Switch to Rack based session stores. 2008-12-15 16:33:31 -06:00