Permalink
Browse files

Make all tests pass on PageContextSpec

  • Loading branch information...
1 parent d8c62b2 commit aaeef1761188941da3fbef7ef19c75d935f12b59 @jomz jomz committed Feb 8, 2014
Showing with 6 additions and 3 deletions.
  1. +6 −3 spec/models/page_context_spec.rb
@@ -17,22 +17,25 @@
end
it 'should give tags access to the request' do
+ @page.save!
+ another = FactoryGirl.create(:published_page, :parent_id => @page.id, :title => 'Another')
@context.define_tag("if_request") { |tag| tag.expand if tag.locals.page.request }
parse('<r:if_request>tada!</r:if_request>').should match(/^$/)
@page.request = ActionDispatch::TestRequest.new
- parse('<r:if_request>tada!</r:if_request>').should include("tada!")
- parse('<r:find url="/another/"><r:if_request>tada!</r:if_request></r:find>').should include("tada!")
+ parse('<r:if_request>tada!</r:if_request>').should include("tada!")
+ parse('<r:find path="/another/"><r:if_request>tada!</r:if_request></r:find>').should include("tada!")
end
it 'should give tags access to the response' do
@page.save!
+ another = FactoryGirl.create(:published_page, :parent_id => @page.id, :title => 'Another')
@context.define_tag("if_response") { |tag| tag.expand if tag.locals.page.response }
parse('<r:if_response>tada!</r:if_response>').should match(/^$/)
@page.response = ActionDispatch::TestRequest.new
parse('<r:if_response>tada!</r:if_response>').should include("tada!")
- parse('<r:find url="/another/"><r:if_response>tada!</r:if_response></r:find>').should include("tada!")
+ parse('<r:find path="/another/"><r:if_response>tada!</r:if_response></r:find>').should include("tada!")
end
private

0 comments on commit aaeef17

Please sign in to comment.