Sha256: 8a3c4a5fe9646def321d6dc8e32fe406eecbd9677141c6e5bb28a82e4f83c5ba
Contents?: true
Size: 1.59 KB
Versions: 1
Compression:
Stored size: 1.59 KB
Contents
ENV['VITREOUS_FOLDER'] = File.expand_path "#{File.dirname(__FILE__)}/fixtures/vitreous_folder" ENV['RACK_ENV'] = 'test' require File.expand_path "#{File.dirname(__FILE__)}/../lib/vitreous_standalone.rb" require 'rack/test' require 'test/unit' require 'mocha' FIXTURES_PATH = "#{File.dirname(__FILE__)}/fixtures" class VitreousStandaloneTest < Test::Unit::TestCase include Rack::Test::Methods def app Vitreous::Standalone::App.new end def test_show_root get '/' assert_equal File.read( "#{FIXTURES_PATH}/responses/show.txt" ), last_response.body assert_equal 200, last_response.status end def test_show_collection get '/folder' assert_equal File.read( "#{FIXTURES_PATH}/responses/collection.txt" ), last_response.body assert_equal 200, last_response.status end def test_show_element get '/folder/file' assert_equal File.read( "#{FIXTURES_PATH}/responses/element.txt" ), last_response.body assert_equal 200, last_response.status end def test_404 get '/not_exists' assert_equal 404, last_response.status end def test_assets get '/assets/nyc.png' assert_equal 'image/png', last_response.content_type assert_equal 3728, last_response.content_length end def test_file get "#{Vitreous::Share::LocalStructure.base_uri}/folder/file.jpg" assert_equal 'image/jpeg', last_response.content_type assert_equal 750, last_response.content_length end def test_structure get '/structure' assert_equal 'application/json', last_response.content_type assert_equal 995, last_response.content_length end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
vitreous_standalone-0.0.19 | test/vitreous_standalone_test.rb |