Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Fix failing test

  • Loading branch information...
commit 5243dafe272d27ded744d290fc11f514722402a1 1 parent 2062890
@judofyr judofyr authored
View
3  lib/camping-unabridged.rb
@@ -756,8 +756,9 @@ module Views; include X, Helpers end
# Models cannot be referred to in Views at this time.
module Models
autoload :Base,'camping/ar'
+ Helpers.send(:include, X, self)
end
-
+
autoload :Mab, 'camping/mab'
autoload :Template, 'camping/template'
C
View
5 lib/camping.rb
@@ -50,5 +50,6 @@ def method_missing m,c,*a;X.M;h=Hash===a[-1]?a.pop: {};e=H[Rack::MockRequest.
env_for('',h.delete(:env)||{})];k=X.const_get(c).new(e,m.to_s);h.each{|i,v|k.
send"#{i}=",v};k.service(*a) end;def use*a,&b;m=a.shift.new(method(:call),*a,&b)
meta_def(:call){|e|m.call(e)}end;def options;O end;def set k,v;O[k]=v end end
-module Views;include X,Helpers end;module Models;autoload:Base,'camping/ar' end
-autoload:Mab,'camping/mab';autoload:Template,'camping/template';C end
+module Views;include X,Helpers end;module Models;autoload:Base,'camping/ar'
+Helpers.send:include,X,self end;autoload:Mab,'camping/mab'
+autoload:Template,'camping/template';C end
View
4 test/app_helpers.rb
@@ -36,10 +36,12 @@ def get
end
class Helpers::Test < TestCase
- def test_inline
+ def test_models
get '/'
assert_body "Bob"
+ end
+ def test_controllers
get '/users'
assert_body "/"
end
Please sign in to comment.
Something went wrong with that request. Please try again.