File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ require 'spec_helper'
2+ require 'ronin/web/server/helpers'
3+
4+ require 'sinatra/base'
5+
6+ describe Ronin ::Web ::Server ::Helpers do
7+ module TestHelpersMixin
8+ class TestApp < Sinatra ::Base
9+ include Ronin ::Web ::Server ::Helpers
10+ end
11+ end
12+
13+ subject { TestHelpersMixin ::TestApp . new . helpers }
14+
15+ describe "#mime_type_for" do
16+ it "must return the MIME Type for the given path's file extension" do
17+ expect ( subject . mime_type_for ( 'file.xml' ) ) . to eq ( 'application/xml' )
18+ end
19+ end
20+
21+ describe "#content_type_for" do
22+ before do
23+ subject . response = Sinatra ::Response . new
24+ end
25+
26+ it "must return the Content-Type for the given path's file extension" do
27+ subject . content_type_for ( 'file.xml' )
28+
29+ expect ( subject . response [ 'Content-Type' ] ) . to eq ( 'application/xml;charset=utf-8' )
30+ end
31+ end
32+ end
You can’t perform that action at this time.
0 commit comments