Sha256: ab03cde3d14e17d507df1fd999e3eca96ed6e7e240055817bc87c9cc9851cfdc

Contents?: true

Size: 1.49 KB

Versions: 2

Compression:

Stored size: 1.49 KB

Contents

require File.expand_path('../test_helper', __FILE__)

module Tamber
  class ItemTest < Test::Unit::TestCase
    should "be creatable" do
      begin
        e = Tamber::Item.create(
          :id => 'item_i5gq90scc1',
          :properties =>  {
            'type'=> 'artwork',
            'artist'=> 'Alexander Calder',
            'img_small'=> 'https://imgs.acalder.png'
          },
          :tags => ['modern', 'acryllic'],
          :created => 1454465400
        )
        puts e
      rescue TamberError => error
        puts error.message
      end
    end

    should "be updatable" do
      begin
        e = Tamber::Item.update(
          :id => 'item_i5gq90scc1',
          :updates => {
            :add => {
              :properties => {
                'available_large' => false,
                'stock' => 89
              }
            },
            :remove => {
              :tags => [
                'casual'
              ]
            }
          }
        )
        puts e
      rescue TamberError => error
        puts error.message
      end
    end

    should "be retrievable" do
      begin
        e = Tamber::Item.retrieve(
          :id => 'item_i5gq90scc1',
        )
        puts e
      rescue TamberError => error
        puts error.message
      end
    end

    should "be removable" do
      begin
        e = Tamber::Item.remove(
          :id => 'item_i5gq90scc1',
        )
        puts e
      rescue TamberError => error
        puts error.message
      end
    end

  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
tamber-0.1.6 test/item_test.rb
tamber-0.1.4 test/item_test.rb