Sha256: d5ad69cd8e5994a8272d0aa1f385e9af6b82614be7259c14bee2ab0004d8de40

Contents?: true

Size: 1.7 KB

Versions: 11

Compression:

Stored size: 1.7 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 hideable" do
      begin
        e = Tamber::Item.hide(
          :id => 'item_i5gq90scc1',
        )
        puts e
      rescue TamberError => error
        puts error.message
      end
    end

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

  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
tamber-0.2.2 test/item_test.rb
tamber-0.2.1 test/item_test.rb
tamber-0.2.0 test/item_test.rb
tamber-0.1.14 test/item_test.rb
tamber-0.1.13 test/item_test.rb
tamber-0.1.12 test/item_test.rb
tamber-0.1.11 test/item_test.rb
tamber-0.1.10 test/item_test.rb
tamber-0.1.9 test/item_test.rb
tamber-0.1.8 test/item_test.rb
tamber-0.1.7 test/item_test.rb