josevalim-inherited_resources 0.7.2 → 0.7.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/README CHANGED
@@ -1,6 +1,6 @@
1
1
  Inherited Resources
2
2
  License: MIT
3
- Version: 0.7.2
3
+ Version: 0.7.3
4
4
 
5
5
  You can also read this README in pretty html at the GitHub project Wiki page:
6
6
 
@@ -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
- ActiveSupport::Deprecation.warn "#{action_name}!(redirect_url) is deprecated. " <<
306
- "Use #{action_name}!{ redirect_url } instead."
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
 
@@ -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
@@ -4,6 +4,7 @@ require 'ruby-debug'
4
4
  require 'mocha'
5
5
 
6
6
  ENV["RAILS_ENV"] = "test"
7
+ RAILS_ROOT = "anywhere"
7
8
 
8
9
  require 'active_support'
9
10
  require 'action_controller'
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: josevalim-inherited_resources
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.2
4
+ version: 0.7.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - "Jos\xC3\xA9 Valim"