Sha256: ca4c5735952bbf66eb356ff46354bf26c12495c1c6a3817a44861dc09e42cb36

Contents?: true

Size: 962 Bytes

Versions: 60

Compression:

Stored size: 962 Bytes

Contents

require 'spec_helper'

describe FbGraph::Debugger::RequestFilter do
  let(:resource_endpoint) { 'https://graph.facebook.com/matake' }
  let(:request) { HTTP::Message.new_request(:get, URI.parse(resource_endpoint)) }
  let(:response) { HTTP::Message.new_response({:hello => 'world'}.to_json) }
  let(:request_filter) { FbGraph::Debugger::RequestFilter.new }

  describe '#filter_request' do
    it 'should log request' do
      FbGraph.logger.should_receive(:info).with(
        "======= [FbGraph] API REQUEST STARTED =======\n" +
        request.dump
      )
      request_filter.filter_request(request)
    end
  end

  describe '#filter_response' do
    it 'should log response' do
      FbGraph.logger.should_receive(:info).with(
        "--------------------------------------------------\n" +
        response.dump +
        "\n======= [FbGraph] API REQUEST FINISHED ======="
      )
      request_filter.filter_response(request, response)
    end
  end
end

Version data entries

60 entries across 60 versions & 1 rubygems

Version Path
fb_graph-2.2.1 spec/fb_graph/debugger_spec.rb
fb_graph-2.2.0 spec/fb_graph/debugger_spec.rb
fb_graph-2.2.0.beta spec/fb_graph/debugger_spec.rb
fb_graph-2.2.0.alpha2 spec/fb_graph/debugger_spec.rb
fb_graph-2.2.0.alpha spec/fb_graph/debugger_spec.rb
fb_graph-2.1.13 spec/fb_graph/debugger_spec.rb
fb_graph-2.1.12 spec/fb_graph/debugger_spec.rb
fb_graph-2.1.11 spec/fb_graph/debugger_spec.rb
fb_graph-2.1.10 spec/fb_graph/debugger_spec.rb
fb_graph-2.1.9 spec/fb_graph/debugger_spec.rb
fb_graph-2.1.8 spec/fb_graph/debugger_spec.rb
fb_graph-2.1.7 spec/fb_graph/debugger_spec.rb
fb_graph-2.1.6 spec/fb_graph/debugger_spec.rb
fb_graph-2.1.5 spec/fb_graph/debugger_spec.rb
fb_graph-2.1.4 spec/fb_graph/debugger_spec.rb
fb_graph-2.1.3 spec/fb_graph/debugger_spec.rb
fb_graph-2.1.2 spec/fb_graph/debugger_spec.rb
fb_graph-2.1.1 spec/fb_graph/debugger_spec.rb
fb_graph-2.1.0 spec/fb_graph/debugger_spec.rb
fb_graph-2.1.0.alpha spec/fb_graph/debugger_spec.rb