Sha256: d83b1927afa000fc766bafc95bc19a1e378b1f8238ad908e9f4caf5d1e5fc941

Contents?: true

Size: 1.2 KB

Versions: 8

Compression:

Stored size: 1.2 KB

Contents

require 'spec_helper'

describe YogiBerra::Data do
  before(:each) do
    YogiBerra::Logger.stub(:log)
    YogiBerra::Catcher.load_db_settings("#{SPEC_FOLDER}/fixtures/test.yml")
  end

  it "should store an exception" do
    exception = build_exception
    mock_mongo(:mongo_client_stub => true, :connection_stub => true)
    mock_yogi_fork_database
    YogiBerra::Catcher.connect
    YogiBerra::Data.store!(exception)
  end

  it "should parse an exception" do
    exception = build_exception
    parsed_data = YogiBerra::Data.parse_exception(exception)
    parsed_data[:error_class].should == "Exception"
    parsed_data[:project].should == "test_yogi_project"
    parsed_data[:error_message].should == "Exception"
    parsed_data[:backtraces].size.should > 1
  end

  it "should parse a session" do
    session = build_session
    parsed_session = YogiBerra::Data.parse_session(session)
    parsed_session["password"].should == nil
    parsed_session["access"]["password"].should == nil
    parsed_session["access"]["user_id"].should == 30785
    parsed_session["access"]["id"].should == 605
    parsed_session["access"]["auth_key"].should == "Baseball is ninety percent mental and the other half is physical."
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
yogi_berra-0.2.1 spec/yogi_berra_data_spec.rb
yogi_berra-0.2.0 spec/yogi_berra_data_spec.rb
yogi_berra-0.1.7 spec/yogi_berra_data_spec.rb
yogi_berra-0.1.6 spec/yogi_berra_data_spec.rb
yogi_berra-0.1.4 spec/yogi_berra_data_spec.rb
yogi_berra-0.1.3 spec/yogi_berra_data_spec.rb
yogi_berra-0.1.1 spec/yogi_berra_data_spec.rb
yogi_berra-0.1.0 spec/yogi_berra_data_spec.rb