Sha256: 46ed6eb334a46c5a8fefb7f5720518067ecf341566e54626c5e1659180472525

Contents?: true

Size: 924 Bytes

Versions: 3

Compression:

Stored size: 924 Bytes

Contents

require File.expand_path(File.dirname(__FILE__) + '/spec_helper')

describe "SmokeRack" do
  include Rack::Test::Methods

  def app
    Smoke::Rack
  end
    
  it "renders the index" do
    get '/smoke'
    last_response.should be_ok
  end
  
  it "should list the sources" do
    get '/smoke'
    last_response.body.should include "<a href=\"/smoke/github\">github</a>"
  end
  
  describe "github source" do
    it "should be okay" do
      get '/smoke/github'
      last_response.should be_ok
    end
    
    describe "formats" do
      %w(json yaml xml).each do |format|
        it "should be okay serving #{format}" do
          get "/smoke/github.#{format}"
          last_response.should be_ok
        end
        
        it "should serve using the correct content_type" do
          get "/smoke/github.#{format}"
          last_response.content_type.should include(format)
        end
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
smoke-rack-0.0.3 spec/smoke-rack_spec.rb
smoke-rack-0.0.2 spec/smoke-rack_spec.rb
smoke-rack-0.0.1 spec/smoke-rack_spec.rb