test sitemap removal

This commit is contained in:
Thomas Reynolds 2011-12-31 12:56:17 -08:00
parent e496d228b0
commit aee8e32524
2 changed files with 22 additions and 3 deletions

View file

@ -16,3 +16,14 @@ Feature: Preview Changes
When I go to "/content.html"
Then I should see "Hola Mundo"
Scenario: A template is removed during preview
Given the Server is running at "preview-app"
And the file "source/a-page.html.erb" has the contents
"""
Hello World
"""
When I go to "/a-page.html"
Then I should see "Hello World"
And the file "source/a-page.html.erb" is removed
When I go to "/a-page.html"
Then I should see "File Not Found"

View file

@ -5,11 +5,19 @@ Given /^a project at "([^\"]*)"$/ do |dirname|
end
Then /^the file "([^\"]*)" has the contents$/ do |path, contents|
file_path = File.expand_path(path, @target)
File.open(file_path, 'w') { |f| f.write(contents) }
write_file(path, contents)
step %Q{the file "#{path}" did change}
end
Then /^the file "([^\"]*)" is removed$/ do |path|
step %Q{I remove the file "#{path}"}
step %Q{the file "#{path}" did delete}
end
Then /^the file "([^\"]*)" did change$/ do |path|
@server_inst.file_did_change(path)
end
Then /^the file "([^\"]*)" did delete$/ do |path|
@server_inst.file_did_delete(path)
end