Sha256: 3357a82b3533b27091e04f22172a0d40cee32e3abbe0b9c99474f027823cf1ec

Contents?: true

Size: 618 Bytes

Versions: 12

Compression:

Stored size: 618 Bytes

Contents

require 'spec_helper'
require 'rack/test'
require 'tdiary/rack/static'

describe TDiary::Rack::Static do
	include Rack::Test::Methods

	describe "reserve static files" do
		let(:app) { TDiary::Rack::Static.new(
			lambda{|env| [500, {}, ['Internal Server Error']]}, 'doc')}

		it 'should return the file in static directory' do
			get '/README.md'
			last_response.should be_ok
		end

		it 'should run the app if file is not exist' do
			get '/index.rb'
			last_response.status.should be 500
		end

		it 'should run the app when post method' do
			post '/index.rb'
			last_response.status.should be 500
		end
	end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
tdiary-4.0.2.20140201 spec/core/rack/static_spec.rb
tdiary-4.0.2 spec/core/rack/static_spec.rb
tdiary-4.0.1.20131102 spec/core/rack/static_spec.rb
tdiary-4.0.1.20130929 spec/core/rack/static_spec.rb
tdiary-4.0.1.20130903 spec/core/rack/static_spec.rb
tdiary-4.0.1 spec/core/rack/static_spec.rb
tdiary-4.0.0.20130826 spec/core/rack/static_spec.rb
tdiary-4.0.0 spec/core/rack/static_spec.rb
tdiary-3.2.2.20130727 spec/core/rack/static_spec.rb
tdiary-3.2.2.20130722 spec/core/rack/static_spec.rb
tdiary-3.2.2.20130720 spec/core/rack/static_spec.rb
tdiary-3.2.2.20130617 spec/core/rack/static_spec.rb