2012-03-19 16:00:48 +01:00
|
|
|
Given /^a template that looks like$/ do |template|
|
|
|
|
|
steps %{
|
|
|
|
|
Given a file named "template.txt" with:
|
|
|
|
|
"""
|
|
|
|
|
#{template}
|
|
|
|
|
"""
|
|
|
|
|
}
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
When /^I execute the script$/ do
|
|
|
|
|
step "I cd to \"../..\""
|
|
|
|
|
|
|
|
|
|
context_id = @current_user.contexts.first.id
|
2012-05-12 13:37:36 +02:00
|
|
|
port = Capybara.current_session.driver.rack_server.port
|
2012-03-19 16:00:48 +01:00
|
|
|
|
|
|
|
|
# assumes there is a context with id=1
|
|
|
|
|
cli = "ruby doc/tracks_template_cli.rb -c #{context_id} -f tmp/aruba/template.txt"
|
|
|
|
|
|
2012-05-12 13:37:36 +02:00
|
|
|
set_env('GTD_LOGIN','testuser')
|
|
|
|
|
set_env('GTD_PASSWORD', 'secret')
|
|
|
|
|
set_env('GTD_TODOS_URL', 'http://localhost:#{port}/todos.xml')
|
|
|
|
|
set_env('GTD_PROJECTS_URL', "http://localhost:#{port}/projects.xml")
|
|
|
|
|
set_env('GTD_CONTEXT_URL_PREFIX', "http://localhost:#{port}/contexts/")
|
|
|
|
|
set_env("GTD_CONTEXT_URL","http://localhost:#{port}/contexts.xml")
|
|
|
|
|
|
|
|
|
|
step "I run `#{cli}`"
|
2012-03-19 16:00:48 +01:00
|
|
|
end
|