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

use Ruby for mocking

This commit is contained in:
Aaron Patterson 2014-06-12 09:19:49 -07:00
parent 46139d33c0
commit caf1bfccc6

View file

@ -95,7 +95,7 @@ module AbstractController
end end
def test_subdomain_may_be_object def test_subdomain_may_be_object
model = mock(:to_param => 'api') model = Class.new { def self.to_param; 'api'; end }
add_host! add_host!
assert_equal('http://api.basecamphq.com/c/a/i', assert_equal('http://api.basecamphq.com/c/a/i',
W.new.url_for(:subdomain => model, :controller => 'c', :action => 'a', :id => 'i') W.new.url_for(:subdomain => model, :controller => 'c', :action => 'a', :id => 'i')