Sha256: bbef4b4faa0d19a25d7f0d79e3b1357f9d5f8df090a6eee875f4896d928ef0a1

Contents?: true

Size: 630 Bytes

Versions: 11

Compression:

Stored size: 630 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'
			expect(last_response).to be_ok
		end

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

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

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
tdiary-4.2.1 vendor/bundle/ruby/2.3.0/gems/tdiary-4.2.0/spec/core/rack/static_spec.rb
tdiary-4.2.0 spec/core/rack/static_spec.rb
tdiary-4.1.3 spec/core/rack/static_spec.rb
tdiary-4.1.2 spec/core/rack/static_spec.rb
tdiary-4.1.1 spec/core/rack/static_spec.rb
tdiary-4.1.0 spec/core/rack/static_spec.rb
tdiary-4.1.0.20141126 spec/core/rack/static_spec.rb
tdiary-4.0.5.1 spec/core/rack/static_spec.rb
tdiary-4.0.5 spec/core/rack/static_spec.rb
tdiary-4.0.4 spec/core/rack/static_spec.rb
tdiary-4.0.3 spec/core/rack/static_spec.rb