add very basic lorem test

This commit is contained in:
Thomas Reynolds 2011-12-01 08:43:26 -08:00
parent 6582a2f75a
commit 51a00c4174
4 changed files with 22 additions and 0 deletions

View file

@ -0,0 +1,5 @@
Feature: Lorem generating helper
Scenario: Lorem Helper
Given the Server is running at "test-app"
Then going to "/lorem.html" should not raise an exception

View file

@ -21,6 +21,7 @@ with_layout :content_for do
end
with_layout false do
page "/lorem.html"
page "/markdown.html"
page "/relative_image.html"
page "/inline-css.html"

View file

@ -0,0 +1,12 @@
<%= lorem.word %>
<%= lorem.words(5) %>
<%= lorem.sentence %>
<%= lorem.sentences(2) %>
<%= lorem.paragraph %>
<%= lorem.paragraphs(2) %>
<%= lorem.date %>
<%= lorem.name %>
<%= lorem.first_name %>
<%= lorem.last_name %>
<%= lorem.email %>
<%= lorem.image(100) %>

View file

@ -44,6 +44,10 @@ When /^I go to "([^\"]*)"$/ do |url|
@browser.get(url)
end
Then /^going to "([^\"]*)" should not raise an exception$/ do |url|
lambda { @browser.get(url) }.should_not raise_exception
end
Then /^I should see "([^\"]*)"$/ do |expected|
@browser.last_response.body.should include(expected)
end