forked from xaviershay/enki
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add view spec test for pages and h() escape page_title.
- Loading branch information
1 parent
d5c72b0
commit 548218f
Showing
2 changed files
with
23 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
<% content_for(:page_title) do -%> | ||
<%= page_title(@page) -%> | ||
<%=h page_title(@page) -%> | ||
<% end -%> | ||
<%= render :partial => 'pages/page', :locals => {:page => @page} %> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
require File.dirname(__FILE__) + '/../../spec_helper' | ||
|
||
describe "/pages/show.html.erb" do | ||
include UrlHelper | ||
|
||
before(:each) do | ||
@page = mock_model(Page, | ||
:title => "A page", | ||
:body_html => "Page content!", | ||
:slug => 'a-page' | ||
) | ||
assigns[:page] = @page | ||
end | ||
|
||
after(:each) do | ||
response.should be_valid_xhtml_fragment | ||
end | ||
|
||
it "should render a page" do | ||
render "/pages/show.html.erb" | ||
end | ||
end |