josevalim-inherited_resources 0.7.2 → 0.7.3
Sign up to get free protection for your applications and to get access to all the features.
- data/README +1 -1
- data/lib/inherited_resources/base_helpers.rb +3 -2
- data/test/redirect_to_test.rb +3 -3
- data/test/test_helper.rb +1 -0
- metadata +1 -1
data/README
CHANGED
@@ -302,8 +302,9 @@ module InheritedResources
|
|
302
302
|
#
|
303
303
|
def parse_redirect_url(redirect_url, default_url, block) #:nodoc:
|
304
304
|
if redirect_url
|
305
|
-
|
306
|
-
|
305
|
+
line = caller.detect{|l| l =~ Regexp.new(Regexp.escape(RAILS_ROOT)) }
|
306
|
+
ActiveSupport::Deprecation.warn("#{action_name}!(redirect_url) is deprecated. " <<
|
307
|
+
"Use #{action_name}!{ redirect_url } instead.", [line])
|
307
308
|
return redirect_url
|
308
309
|
end
|
309
310
|
|
data/test/redirect_to_test.rb
CHANGED
@@ -23,7 +23,7 @@ class RedirectToWithArgumentTest < ActionController::TestCase
|
|
23
23
|
tests SuperMachinesController
|
24
24
|
|
25
25
|
def test_redirect_to_the_given_url_on_create
|
26
|
-
ActiveSupport::Deprecation.expects(:warn).with('create!(redirect_url) is deprecated. Use create!{ redirect_url } instead.')
|
26
|
+
ActiveSupport::Deprecation.expects(:warn).with('create!(redirect_url) is deprecated. Use create!{ redirect_url } instead.', [nil])
|
27
27
|
SuperMachine.stubs(:new).returns(mock_machine(:save => true))
|
28
28
|
@controller.expects(:resource_url).times(0)
|
29
29
|
post :create
|
@@ -31,7 +31,7 @@ class RedirectToWithArgumentTest < ActionController::TestCase
|
|
31
31
|
end
|
32
32
|
|
33
33
|
def test_redirect_to_the_given_url_on_update
|
34
|
-
ActiveSupport::Deprecation.expects(:warn).with('update!(redirect_url) is deprecated. Use update!{ redirect_url } instead.')
|
34
|
+
ActiveSupport::Deprecation.expects(:warn).with('update!(redirect_url) is deprecated. Use update!{ redirect_url } instead.', [nil])
|
35
35
|
SuperMachine.stubs(:find).returns(mock_machine(:update_attributes => true))
|
36
36
|
@controller.expects(:resource_url).times(0)
|
37
37
|
put :update
|
@@ -39,7 +39,7 @@ class RedirectToWithArgumentTest < ActionController::TestCase
|
|
39
39
|
end
|
40
40
|
|
41
41
|
def test_redirect_to_the_given_url_on_destroy
|
42
|
-
ActiveSupport::Deprecation.expects(:warn).with('destroy!(redirect_url) is deprecated. Use destroy!{ redirect_url } instead.')
|
42
|
+
ActiveSupport::Deprecation.expects(:warn).with('destroy!(redirect_url) is deprecated. Use destroy!{ redirect_url } instead.', [nil])
|
43
43
|
SuperMachine.stubs(:find).returns(mock_machine(:destroy => true))
|
44
44
|
@controller.expects(:collection_url).times(0)
|
45
45
|
delete :destroy
|
data/test/test_helper.rb
CHANGED