Sha256: 76c2300ecbb1e67b199841e9fa4db4c52270c5156602e19272dea02cf427ec61

Contents?: true

Size: 1.5 KB

Versions: 2

Compression:

Stored size: 1.5 KB

Contents

require File.dirname(__FILE__) + '/../spec_helper'
require File.dirname(__FILE__) + '/../../lib/etsy4r'

describe Etsy4r::CategoryCommands do
  include Etsy4rSpecHelper
  
  before do
    @client = etsy4r_client
    @category_commands = Etsy4r::CategoryCommands.new(@client)
  end
    
  describe 'initialize' do    
    it 'set the client' do 
      @category_commands.client.class.should == Etsy4r::Client
    end
  end
  
  describe 'get_top_categories' do
    it 'should return the top level tags' do
      @res = @category_commands.get_top_categories
      @res.should be_success
      @res.results.should_not be_nil
      @res.error_message.should be_blank
    end
  end
  
  describe 'get_child_categories' do
    it 'should return child tags when given a formatted tag' do
      @res = @category_commands.get_child_categories('bags_and_purses')
      @res.should be_success
      @res.results.should_not be_nil
      @res.error_message.should be_blank
    end
    
    it 'should return child tags when given a tag with spaces' do
      @res = @category_commands.get_child_categories('bags and purses')
      @res.should be_success
      @res.results.should_not be_nil
      @res.error_message.should be_blank
    end
    it 'should return child tags when given a tag with dashes' do
      @res = @category_commands.get_child_categories('bags-and-purses')
      @res.should be_success
      @res.results.should_not be_nil
      @res.error_message.should be_blank
    end
  end
  
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
tcocca-etsy4r-0.3.2 spec/etsy4r/category_commands_spec.rb
tcocca-etsy4r-0.4.0 spec/etsy4r/category_commands_spec.rb