<NME> breadcrumb_logger_spec.rb
<BEF> ADDFILE
<MSG> Add tests on our breadcrumbs integrations (#1013)

* Allow detaching registered Raven::ActiveSupportBreadcrumbs

* Correct sample app's breadcrumbs config

* Support creating isolated test rails app

* Add integration tests for breadcrumb features
<DFF> @@ -0,0 +1,36 @@
+require "spec_helper"
+
+RSpec.describe "Raven::BreadcrumbLogger", :type => :request, :rails => true do
+  before(:all) do
+    require "raven/breadcrumbs/logger"
+    Rails.application = make_basic_app
+  end
+
+  after(:all) do
+    # revert the injected methods to keep other specs clean
+    Raven::BreadcrumbLogger.module_eval do
+      def add(*args)
+        super
+      end
+    end
+  end
+
+  it "captures correct data" do
+    get "/exception"
+
+    expect(response.status).to eq(500)
+    event = JSON.parse!(Raven.client.transport.events.first[1])
+    breadcrumbs = event.dig("breadcrumbs", "values")
+    expect(breadcrumbs.count).to eq(1)
+    expect(breadcrumbs.first).to match(
+      {
+        "category" => "Processing by HelloController#exception as HTML",
+        "data" => {},
+        "level" => "info",
+        "message" => "Processing by HelloController#exception as HTML",
+        "timestamp" => anything,
+        "type" => nil
+      }
+    )
+  end
+end

{'addition_count': 36, 'commit_subject': 'Add tests on our breadcrumbs integrations (#1013)', 'deletion_count': 0, 'file_extension': '.rb', 'lang': 'rb', 'license': 'apache-2.0', 'repo_name': 'getsentry/raven-ruby'}