-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Rakefile : Clean the generated test.log in test/, new test task.
* lib/camping[-unabridged].rb : Fixes #102. The layout wasn't captured in Mab. * test/test_xhtml_trans.rb : The test case for #102. You'll need mosquito to be able to run it.
- Loading branch information
Jonas Pfenniger
committed
Oct 24, 2006
1 parent
50023ad
commit ae02dd3
Showing
4 changed files
with
68 additions
and
5 deletions.
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
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
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
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,55 @@ | ||
require 'mosquito' | ||
|
||
Camping.goes :XhtmlTrans | ||
|
||
module XhtmlTrans | ||
module Controllers | ||
class WithLayout < R '/with_layout' | ||
def get | ||
render :with_layout | ||
end | ||
end | ||
|
||
class WithoutLayout < R '/without_layout' | ||
def get | ||
render :_without_layout | ||
end | ||
end | ||
end | ||
|
||
module Views | ||
def layout | ||
xhtml_transitional do | ||
head do title "title" end | ||
body do capture { yield } end | ||
end | ||
end | ||
|
||
def with_layout | ||
h1 "With layout" | ||
end | ||
|
||
def _without_layout | ||
xhtml_transitional do | ||
head do title "title" end | ||
body do h1 "Without layout" end | ||
end | ||
end | ||
end | ||
end | ||
|
||
class XhtmlTransTest < Camping::FunctionalTest | ||
def test_with_layout | ||
get '/with_layout' | ||
|
||
assert(@response.body =~ /DOCTYPE/, "No doctype defined") | ||
end | ||
|
||
def test_without_layout | ||
get '/without_layout' | ||
|
||
assert(@response.body =~ /DOCTYPE/, "No doctype defined") | ||
end | ||
|
||
end | ||
|