Adds the features/uri-features test directory, testing sub-uri deployment. These tests uses script/server since much of this code is about configuring the server. They are not run by "rake cucumber", to run them use "bundle exec rake cucumber features/uri-test". Tests requires a working app_config.yml setup with pod_url = "http://localhost:3000/diaspora" Patches cucumber.yml to always load step definitions from features/**, see http://thoughtsincomputation.com/posts/cucumber-step-definitions-and-autorequire-hell
33 lines
922 B
Ruby
33 lines
922 B
Ruby
Given /^configuration parameter (\w+) is ([^ ]+)$/ do |key, value|
|
|
require Rails.root.join('config', "initializers", "_load_app_config.rb")
|
|
app_value = AppConfig[ key.to_sym]
|
|
assert_equal value, app_value,
|
|
"You must set #{key} to #{value} and kill running server"
|
|
end
|
|
|
|
When /^I visit url ([^ ]+)$/ do |url|
|
|
visit( url)
|
|
end
|
|
|
|
Then /^I should find '([^']*)' in ([^ ]+)$/ do |pattern,file|
|
|
found = %x!fgrep -o #{pattern} #{file}!
|
|
assert_equal pattern, found.chomp, "Can't find pattern in #{file}"
|
|
end
|
|
|
|
Then /^I should match '([^']*)' in ([^ ]+)$/ do |pattern,file|
|
|
found = `egrep -o '#{pattern}' #{file}`
|
|
assert_match /#{pattern}/, found.chomp, "Can't find #{pattern} in #{file}"
|
|
end
|
|
|
|
When /^I retrieve ([^ ]+) into ([^ ]+)$/ do |url,file|
|
|
system( "wget -q -O #{file} #{url}")
|
|
end
|
|
|
|
Then /^a page\-asset should be ([^ ]+)$/ do |asset_path|
|
|
page.has_content?(asset_path)
|
|
end
|
|
|
|
|
|
|
|
|
|
|