Sha256: d09b590a16849bc47aa2b189c3bf75d62517fc061033401c63a7c7ddb6318fcb

Contents?: true

Size: 944 Bytes

Versions: 3

Compression:

Stored size: 944 Bytes

Contents

# encoding: utf-8
require "spec_helper"

describe FastshopCatalog::ParticipantService do

  let(:contract_number) do
    "1234567890"
  end
  
  let(:participant) do
    ParticipantFactory.build
  end

  let(:service) do
    service = FastshopCatalog::ParticipantService.new
  end

  describe "insert integration", :integration => true do

    it "should insert the participant and return a null token" do
      expect{service.insert(participant)}.to raise_error(FastshopCatalog::ServiceException) do |e|
        expect(e.code).to eq(45)
        expect(e.description).to eq('Email já cadastrado')
      end
    end
    
    it "should raise incompatible address exception" do
      participant.address.neighborhood = 'Moema'
      expect{service.insert(participant)}.to raise_error(FastshopCatalog::ServiceException) do |e|
        expect(e.code).to eq(2)
        expect(e.description).to eq('Contrato invalido')
      end
    end

  end

end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
fastshop_catalog-0.0.5 spec/fastshop_catalog/integration/participant_service_integration_spec.rb
fastshop_catalog-0.0.4 spec/fastshop_catalog/integration/participant_service_integration_spec.rb
fastshop_catalog-0.0.3 spec/fastshop_catalog/integration/participant_service_integration_spec.rb