Sha256: 3b2e7cc84298f79cda02c5a6b23825e4de3039fa0dd8c5d34328078c005e86e9

Contents?: true

Size: 845 Bytes

Versions: 10

Compression:

Stored size: 845 Bytes

Contents

require "support"

class TestDocument < Omise::Test
  setup do
    @documents = Omise::Dispute.retrieve("dspt_test_5089off452g5m5te7xs").documents
    @document = @documents.retrieve("docu_test_55869onwfm2g3bsw8d8")
  end

  def test_that_we_can_retrieve_a_document
    assert_instance_of Omise::Document, @document
    assert_equal "docu_test_55869onwfm2g3bsw8d8", @document.id
  end

  def test_that_we_can_upload_a_new_document
    document = @documents.upload(StringIO.new)

    assert_instance_of Omise::Document, document
    assert_equal "docu_test_55869onwfm2g3bsw8d8", document.id
  end

  def test_that_a_document_can_be_reloaded
    @document.attributes.taint
    @document.reload

    refute @document.attributes.tainted?
  end

  def test_that_we_can_destroy_a_document
    @document.destroy

    assert @document.deleted
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
omise-0.10.0 test/omise/test_document.rb
omise-0.9.1 test/omise/test_document.rb
omise-0.9.0 test/omise/test_document.rb
omise-0.7.2 test/omise/test_document.rb
omise-0.8.0 test/omise/test_document.rb
omise-0.7.1 test/omise/test_document.rb
omise-0.7.0 test/omise/test_document.rb
omise-0.6.0 test/omise/test_document.rb
omise-0.5.1 test/omise/test_document.rb
omise-0.5.0 test/omise/test_document.rb