Sha256: 7700cd24b479c8289913cd6117a0f4f95a24eede118fa1cd6a469bbd9562ff00

Contents?: true

Size: 1.03 KB

Versions: 14

Compression:

Stored size: 1.03 KB

Contents

require "#{File.dirname(__FILE__)}/../test_helper"
require 'open-uri'

# Start the server

class ServerTest < ActiveSupport::TestCase

  PORT = 43040
  URL = "http://localhost:#{PORT}/"

  def setup
    @pid = Process.fork do
       Dir.chdir RAILS_ROOT do
         # print "S"
         exec("script/server -p #{PORT} &> #{LOG}")
       end
     end
     sleep(5)
  end
  
  def teardown
    # Process.kill(9, @pid) doesn't work because Mongrel has double-forked itself away
    `ps awx | grep #{PORT} | grep -v grep | awk '{print $1}'`.split("\n").each do |pid|
      system("kill -9 #{pid}")
      # print "K"
    end
    sleep(2)
    @pid = nil
  end
  
  def test_association_reloading
    assert_match(/Bones: index/, open(URL + 'bones').read)
    assert_match(/Bones: index/, open(URL + 'bones').read)
    assert_match(/Bones: index/, open(URL + 'bones').read)
    assert_match(/Bones: index/, open(URL + 'bones').read)
  end
  
  def test_verify_autoload_gets_invoked_in_console
    # XXX Probably can use script/runner to test this
  end
  
end

Version data entries

14 entries across 14 versions & 3 rubygems

Version Path
radiant-tags-extension-1.6.10 vendor/plugins/has_many_polymorphs/test/integration/server_test.rb
johnsbrn-has_many_polymorphs-2.13.4 test/integration/server_test.rb
radiant-tags-extension-1.6.9 vendor/plugins/has_many_polymorphs/test/integration/server_test.rb
radiant-tags-extension-1.6.8 vendor/plugins/has_many_polymorphs/test/integration/server_test.rb
radiant-tags-extension-1.6.7 vendor/plugins/has_many_polymorphs/test/integration/server_test.rb
radiant-tags-extension-1.6.6 vendor/plugins/has_many_polymorphs/test/integration/server_test.rb
radiant-tags-extension-1.6.5 vendor/plugins/has_many_polymorphs/test/integration/server_test.rb
radiant-tags-extension-1.6.4 vendor/plugins/has_many_polymorphs/test/integration/server_test.rb
radiant-tags-extension-1.6.3 vendor/plugins/has_many_polymorphs/test/integration/server_test.rb
radiant-tags-extension-1.6.2 vendor/plugins/has_many_polymorphs/test/integration/server_test.rb
radiant-tags-extension-1.6.1 vendor/plugins/has_many_polymorphs/test/integration/server_test.rb
radiant-tags-extension-1.6.0 vendor/plugins/has_many_polymorphs/test/integration/server_test.rb
radiant-tags-extension-1.5.1 vendor/plugins/has_many_polymorphs/test/integration/server_test.rb
has_many_polymorphs-2.2 test/integration/server_test.rb