Sha256: e8597c1a46bcab1f713b7d261d83d5ce52de973f0416824f2b16648632d7ad0c

Contents?: true

Size: 1.22 KB

Versions: 7

Compression:

Stored size: 1.22 KB

Contents

require "spec_helper"

describe FastshopCatalog::BaseService do

  describe "camelize" do

    it 'should convert the underscore string to camel' do
      expect(FastshopCatalog::BaseService.camelize('some_dull_text')).to eq('SomeDullText')
    end

  end
  
  describe "initialization" do
    
    let(:service) do
      class TempService < FastshopCatalog::BaseService
        def initialize
          @service = 'SomePath/some_service'
          @interface = 'ISomeInterface'
          @soap_method = :some_method
          @return_key = 'SomeName'
          super
        end
      end
      TempService.new
    end

    it 'should return the correct service_url' do
      expect(service.service_url).to eq('http://www.fastincentivos.com.br/SomePath/some_service')
    end
    
    it 'should return the correct service_url if base_url changed' do
      FastshopCatalog::BaseService.base_url = 'http://yourserverhere.com'
      expect(service.service_url).to eq('http://yourserverhere.com/SomePath/some_service')
      FastshopCatalog::BaseService.base_url = FastshopCatalog::BaseService::DEFAULT_BASE_URL
    end

    it 'should return the correct action' do
      expect(service.action).to eq('ISomeInterface/SomeMethod')
    end

  end

end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
fastshop_catalog-0.0.7 spec/fastshop_catalog/base_service_spec.rb
fastshop_catalog-0.0.6 spec/fastshop_catalog/base_service_spec.rb
fastshop_catalog-0.0.5 spec/fastshop_catalog/base_service_spec.rb
fastshop_catalog-0.0.4 spec/fastshop_catalog/base_service_spec.rb
fastshop_catalog-0.0.3 spec/fastshop_catalog/base_service_spec.rb
fastshop_catalog-0.0.2 spec/fastshop_catalog/base_service_spec.rb
fastshop_catalog-0.0.1 spec/fastshop_catalog/base_service_spec.rb