Sha256: 11fd2c21cefa0f8509b3a6045837bc9247b1e539ea8462e693f9bd87dccb3702

Contents?: true

Size: 1 KB

Versions: 18

Compression:

Stored size: 1 KB

Contents

require File.dirname(__FILE__) + "/integration_helper"

feature "exception handling" do
  before do
    Errplane.configure do |config|
      config.ignored_environments = %w{development}
    end
  end

  describe "in an action that raises an exception" do
    scenario "should make an HTTP call to the API" do
      stub_request(:post, "#{Errplane.configuration.api_host}/exceptions").to_return(status: 200)

      lambda { visit new_widget_path }.should raise_error

      assert_requested :post, "#{Errplane.configuration.api_host}/api/v1/applications/#{Errplane.configuration.application_id}/exceptions/test?api_key=f123-e456-d789c012"
    end
  end

  describe "in an action that does not raise an exception" do
    scenario "should not make an HTTP call to the API" do
      lambda { visit widgets_path }.should_not raise_error

      assert_not_requested :post, "#{Errplane.configuration.api_host}/api/v1/applications/#{Errplane.configuration.application_id}/exceptions/test?api_key=f123-e456-d789c012"
    end
  end
end

Version data entries

18 entries across 18 versions & 1 rubygems

Version Path
errplane-0.2.5 spec/integration/exceptions_spec.rb
errplane-0.2.4 spec/integration/exceptions_spec.rb
errplane-0.2.3 spec/integration/exceptions_spec.rb
errplane-0.2.0 spec/integration/exceptions_spec.rb
errplane-0.1.9 spec/integration/exceptions_spec.rb
errplane-0.1.8 spec/integration/exceptions_spec.rb
errplane-0.1.7 spec/integration/exceptions_spec.rb
errplane-0.1.6 spec/integration/exceptions_spec.rb
errplane-0.1.5 spec/integration/exceptions_spec.rb
errplane-0.1.4 spec/integration/exceptions_spec.rb
errplane-0.1.3 spec/integration/exceptions_spec.rb
errplane-0.1.2 spec/integration/exceptions_spec.rb
errplane-0.1.1 spec/integration/exceptions_spec.rb
errplane-0.1.0 spec/integration/exceptions_spec.rb
errplane-0.0.6 spec/integration/exceptions_spec.rb
errplane-0.0.5 spec/integration/exceptions_spec.rb
errplane-0.0.4 spec/integration/exceptions_spec.rb
errplane-0.0.3 spec/integration/exceptions_spec.rb