Sha256: 9f5b1263d5f79f1969bb8e153821949203586adfe0600f4d57a0f4a5a94fa3b4

Contents?: true

Size: 1.09 KB

Versions: 5

Compression:

Stored size: 1.09 KB

Contents

require File.expand_path(File.dirname(__FILE__) + '/../../test_helper')

module ESP::Integration
  class Suppression
    class UniqueIdentifierTest < ESP::Integration::TestCase
      context ESP::Suppression::UniqueIdentifier do
        context 'live calls' do
          context '.create' do
            should 'return error when reason is not supplied' do
              alert_id = ESP::Report.all.detect { |r| r.status == 'complete' }.alerts.last.id

              suppression = ESP::Suppression::UniqueIdentifier.create(alert_id: alert_id)

              assert_equal "Suppression reason can't be blank", suppression.errors.full_messages.first
            end

            should 'return suppression' do
              alert_id = ESP::Report.all.detect { |r| r.status == 'complete' }.alerts.last.id

              suppression = ESP::Suppression::UniqueIdentifier.create(alert_id: alert_id, reason: 'test')

              assert_predicate suppression.errors, :blank?
              assert_equal ESP::Suppression::UniqueIdentifier, suppression.class
            end
          end
        end
      end
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
esp_sdk-2.7.0 test/esp/integration/suppression_unique_identifier_integration_test.rb
esp_sdk-2.6.0 test/esp/integration/suppression_unique_identifier_integration_test.rb
esp_sdk-2.5.0 test/esp/integration/suppression_unique_identifier_integration_test.rb
esp_sdk-2.4.0 test/esp/integration/suppression_unique_identifier_integration_test.rb
esp_sdk-2.3.0 test/esp/integration/suppression_unique_identifier_integration_test.rb