Sha256: 3b8f7283d5d7f721e82e541f0175d33c6a4c4568580910c10da0fa8c5f950dd2

Contents?: true

Size: 1004 Bytes

Versions: 21

Compression:

Stored size: 1004 Bytes

Contents

require File.join(File.dirname(__FILE__),'..','spec_helper')

describe "SourceJob" do
  it_behaves_like "SharedRhoconnectHelper", :rhoconnect_data => true do
    before(:each) do
      @s = Source.load(@s_fields[:name],@s_params)
    end
    
    it "should perform process_query" do
      set_state('test_db_storage' => @data)  
      SourceJob.perform('query',@s.id,@s.app_id,@s.user_id,nil)
      verify_result(@s.docname(:md) => @data,
        @s.docname(:md_size) => @data.size.to_s)
    end

    it "should perform process_cud" do
      expected = {'backend_id'=>@product1}
      @product1['link'] = 'abc'
      set_zstate({@s.docname(:create) => {'1'=>@product1}}, @c.id, true)
      SourceJob.perform('cud',@s.id,@s.app_id,@s.user_id,nil)
      verify_zresult(@s.docname(:create) => [])
      verify_result(@s.docname(:md) => expected,
        @s.docname(:md_size) => expected.size.to_s,
        @c.docname(:cd) => expected,
        @c.docname(:cd_size) => expected.size.to_s)
    end
  end  
end

Version data entries

21 entries across 21 versions & 1 rubygems

Version Path
rhoconnect-3.1.2 spec/jobs/source_job_spec.rb