Sha256: b694dd7a0d217a1c12beb48ec48999550edf6b935d0692a12b896a338ac7095c

Contents?: true

Size: 1.43 KB

Versions: 6

Compression:

Stored size: 1.43 KB

Contents

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

describe Etsy4r::TagCommands do
  include Etsy4rSpecHelper
  
  before do
    @client = etsy4r_client
    @tag_commands = Etsy4r::TagCommands.new(@client)
  end
    
  describe 'initialize' do    
    it 'set the client' do 
      @tag_commands.client.class.should == Etsy4r::Client
    end
  end
  
  describe 'get_top_tags' do
    it 'should return the top level tags' do
      @res = @tag_commands.get_top_tags
      @res.should be_success
      @res.results.should_not be_nil
      @res.error_message.should be_blank
    end
  end
  
  describe 'get_child_tags' do
    it 'should return child tags when given a formatted tag' do
      @res = @tag_commands.get_child_tags('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 = @tag_commands.get_child_tags('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 = @tag_commands.get_child_tags('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

6 entries across 6 versions & 1 rubygems

Version Path
tcocca-etsy4r-0.1.0 spec/etsy4r/tag_commands_spec.rb
tcocca-etsy4r-0.2.0 spec/etsy4r/tag_commands_spec.rb
tcocca-etsy4r-0.3.0 spec/etsy4r/tag_commands_spec.rb
tcocca-etsy4r-0.3.1 spec/etsy4r/tag_commands_spec.rb
tcocca-etsy4r-0.3.2 spec/etsy4r/tag_commands_spec.rb
tcocca-etsy4r-0.4.0 spec/etsy4r/tag_commands_spec.rb