Sha256: 83369c78245de2b406a0745eca43eb6633faf060dce15febfbd9e1b3e320d5fc

Contents?: true

Size: 1.15 KB

Versions: 42

Compression:

Stored size: 1.15 KB

Contents

shared_examples_for "HelloWorld Rack application" do
	it "is possible to fetch static assets" do
		get('/rack.jpg').should == @stub.public_file('rack.jpg')
	end
	
	it "is possible to GET a regular Rack page" do
		get('/').should =~ /hello/
	end
	
	it "supports responses with the 'chunked' transfer encoding" do
		get('/chunked').should ==
			"chunk1\n" +
			"chunk2\n" +
			"chunk3\n"
	end
	
	it "supports restarting via restart.txt" do
		get('/').should =~ /hello/
		File.write("#{@stub.app_root}/config.ru", %q{
			app = lambda do |env|
				[200, { "Content-Type" => "text/html" }, "changed"]
			end
			run app
		})
		File.new("#{@stub.app_root}/tmp/restart.txt", "w").close
		File.utime(2, 2, "#{@stub.app_root}/tmp/restart.txt")
		get('/').should == "changed"
	end
	
	if Process.uid == 0
		it "runs as an unprivileged user" do
			File.prepend("#{@stub.app_root}/config.ru", %q{
				File.new('foo.txt', 'w').close
			})
			File.new("#{@stub.app_root}/tmp/restart.txt", "w").close
			File.utime(1, 1, "#{@stub.app_root}/tmp/restart.txt")
			get('/')
			stat = File.stat("#{@stub.app_root}/foo.txt")
			stat.uid.should_not == 0
			stat.gid.should_not == 0
		end
	end
end

Version data entries

42 entries across 42 versions & 2 rubygems

Version Path
passenger-4.0.30 test/integration_tests/hello_world_rack_spec.rb
passenger-4.0.29 test/integration_tests/hello_world_rack_spec.rb
passenger-4.0.28 test/integration_tests/hello_world_rack_spec.rb
passenger-4.0.27 test/integration_tests/hello_world_rack_spec.rb
passenger-4.0.26 test/integration_tests/hello_world_rack_spec.rb
passenger-4.0.25 test/integration_tests/hello_world_rack_spec.rb
passenger-4.0.24 test/integration_tests/hello_world_rack_spec.rb
passenger-4.0.23 test/integration_tests/hello_world_rack_spec.rb
passenger-4.0.21 test/integration_tests/hello_world_rack_spec.rb
passenger-4.0.20 test/integration_tests/hello_world_rack_spec.rb
passenger-4.0.19 test/integration_tests/hello_world_rack_spec.rb
passenger-4.0.18 test/integration_tests/hello_world_rack_spec.rb
passenger-4.0.17 test/integration_tests/hello_world_rack_spec.rb
passenger-4.0.16 test/integration_tests/hello_world_rack_spec.rb
passenger-4.0.14 test/integration_tests/hello_world_rack_spec.rb
passenger-4.0.13 test/integration_tests/hello_world_rack_spec.rb
passenger-4.0.10 test/integration_tests/hello_world_rack_spec.rb
passenger-4.0.8 test/integration_tests/hello_world_rack_spec.rb
passenger-4.0.7 test/integration_tests/hello_world_rack_spec.rb
passenger-4.0.6 test/integration_tests/hello_world_rack_spec.rb