Skip to content
Browse files

Fix failing test

  • Loading branch information...
1 parent 2062890 commit 5243dafe272d27ded744d290fc11f514722402a1 @judofyr judofyr committed Oct 5, 2011
Showing with 8 additions and 4 deletions.
  1. +2 −1 lib/camping-unabridged.rb
  2. +3 −2 lib/camping.rb
  3. +3 −1 test/app_helpers.rb
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

0 comments on commit 5243daf

Please sign in to comment.
Something went wrong with that request. Please try again.