test/test_citrin.rb in citrin-0.0.5 vs test/test_citrin.rb in citrin-0.0.6

- old
+ new

@@ -1,13 +1,23 @@ $LOAD_PATH.unshift(File.dirname(__FILE__)) require 'helper' require 'citrin/cli' class TestCitrin < Test::Unit::TestCase + + def setup + @appname = "citest" + end + + def cleanup + `rm /etc/apache2/sites-enabled/prod.#{@appname}.conf` + end + should "create webserver config" do - appname = "citest" - Citrin::CLI.start("create_webserver", appname) - assert File.exists?("/etc/apache2/sites-enabled/prod.#{appname}.conf") - statuscode = `curl -sL -w "%{http_code}" "#{appname}.$(hostname).citrin.ch" -o /dev/null` - assert_equal "404", statuscode + Citrin::CLI.start("create_webserver", @appname) + assert File.exists?("/etc/apache2/sites-enabled/prod.#{@appname}.conf") + `cd /var/www/rails_apps/prod/ && rails new #{@appname}` + statuscode = `curl -sL -w "%{http_code}" "#{@appname}.$(hostname).citrin.ch" -o /dev/null` + assert_equal "200", statuscode + cleanup end end