semi working
This commit is contained in:
parent
f407bc7a8f
commit
b359152757
@ -3,7 +3,7 @@ module Locomotive
|
||||
module Drops
|
||||
class CurrentUser < Base
|
||||
def logged_in?
|
||||
false
|
||||
_source.present?
|
||||
end
|
||||
end
|
||||
end
|
||||
|
@ -69,7 +69,7 @@ module Locomotive
|
||||
'url' => request.url,
|
||||
'now' => Time.now.utc,
|
||||
'today' => Date.today,
|
||||
'current_user' => Locomotive::Liquid::Drops::CurrentUser.new
|
||||
'current_user' => Locomotive::Liquid::Drops::CurrentUser.new(current_user)
|
||||
}
|
||||
|
||||
assigns.merge!(Locomotive.config.context_assign_extensions)
|
||||
|
@ -21,6 +21,12 @@ describe Locomotive::Liquid::Drops::CurrentUser do
|
||||
@controller.expects(:render).with(:text => "false", :layout => false, :status => :ok).returns(true)
|
||||
@controller.send(:render_locomotive_page)
|
||||
end
|
||||
it 'returns true when there is a user logged in' do
|
||||
@page.raw_template = '{{ current_user.logged_in? }}'
|
||||
@page.send(:serialize_template)
|
||||
@controller.expects(:render).with(:text => "true", :layout => false, :status => :ok).returns(true)
|
||||
@controller.send(:render_locomotive_page)
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user