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.6.1 spec/fb_graph/debugger_spec.rb
fb_graph-2.6.0 spec/fb_graph/debugger_spec.rb
fb_graph-2.5.9 spec/fb_graph/debugger_spec.rb
fb_graph-2.5.8 spec/fb_graph/debugger_spec.rb
fb_graph-2.5.7 spec/fb_graph/debugger_spec.rb
fb_graph-2.5.6 spec/fb_graph/debugger_spec.rb
fb_graph-2.5.5 spec/fb_graph/debugger_spec.rb
fb_graph-2.5.4 spec/fb_graph/debugger_spec.rb
fb_graph-2.5.3 spec/fb_graph/debugger_spec.rb
fb_graph-2.5.2 spec/fb_graph/debugger_spec.rb
fb_graph-2.5.1 spec/fb_graph/debugger_spec.rb
fb_graph-2.5.0 spec/fb_graph/debugger_spec.rb
fb_graph-2.4.20 spec/fb_graph/debugger_spec.rb
fb_graph-2.4.19 spec/fb_graph/debugger_spec.rb
fb_graph-2.4.18 spec/fb_graph/debugger_spec.rb
fb_graph-2.4.17 spec/fb_graph/debugger_spec.rb
fb_graph-2.4.16 spec/fb_graph/debugger_spec.rb
fb_graph-2.4.15 spec/fb_graph/debugger_spec.rb
fb_graph-2.4.14 spec/fb_graph/debugger_spec.rb
fb_graph-2.4.13 spec/fb_graph/debugger_spec.rb