Sha256: dec44cc1a05970b2d65e97e6d20ae6e22abaaed62ccd8aca585df6dd4e3e7b7b

Contents?: true

Size: 562 Bytes

Versions: 5

Compression:

Stored size: 562 Bytes

Contents

require 'test_helper'

describe GatewayNotification do
  describe "create" do
    it "raise EmptyChargeId if charge_id = nil" do
      ->{
        GatewayNotification.create!(gateway: "webmoney")
      }.must_raise GatewayNotification::EmptyChargeIdError
    end

    it "charge id is inherited from adapter" do
      gateway_notification = GatewayNotification.new

      adapter = stub(item_id: 42)
      gateway_notification.stubs(:adapter).returns(adapter)

      gateway_notification.save!
      gateway_notification.charge_id.must_equal 42
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
supercharged-2.0.4 test/supercharged/models/geneway_notification_test.rb
supercharged-2.0.3 test/supercharged/models/geneway_notification_test.rb
supercharged-2.0.2 test/supercharged/models/geneway_notification_test.rb
supercharged-2.0.1 test/supercharged/models/geneway_notification_test.rb
supercharged-2.0.0 test/supercharged/models/geneway_notification_test.rb