spec/source_sync_spec.rb in rhosync-2.1.0.beta.2 vs spec/source_sync_spec.rb in rhosync-2.1.0
- old
+ new
@@ -103,20 +103,10 @@
@ss.adapter.should_receive(:logoff).once.with(no_args()).and_return(nil)
@ss.process_query
end
end
- it "should process source adapter with pass_through set" do
- expected = {'1'=>@product1,'2'=>@product2}
- set_state('test_db_storage' => expected)
- @s.pass_through = 'true'
- @ss.process_query.should == expected
- verify_result(@s.docname(:md) => {},
- @s.docname(:md_size) => nil)
- @s.pass_through = nil
- end
-
describe "create" do
it "should do create where adapter.create returns nil" do
set_state(@c.docname(:create) => {'2'=>@product2})
@ss.create(@c.id)
verify_result(@c.docname(:create_errors) => {},
@@ -238,25 +228,25 @@
if operation == 'query'
@ss.read.should == true
verify_result(@s.docname(:md) => expected,
@s.docname(:errors) => {})
else
- @ss.search(@c.id).should == expected
+ @ss.search(@c.id).should == true
verify_result(@c.docname(:search) => expected,
@c.docname(:search_errors) => {})
end
end
def verify_read_operation_with_error(operation)
msg = "Error during #{operation}"
@ss.should_receive(:log).with("SourceAdapter raised #{operation} exception: #{msg}")
set_test_data('test_db_storage',{},msg,"#{operation} error")
if operation == 'query'
- @ss.read.should be_nil
+ @ss.read.should == true
verify_result(@s.docname(:md) => {},
@s.docname(:errors) => {'query-error'=>{'message'=>msg}})
else
- @ss.search(@c.id).should be_nil
+ @ss.search(@c.id).should == true
verify_result(@c.docname(:search) => {},
@c.docname(:search_errors) => {'search-error'=>{'message'=>msg}})
end
end
end
\ No newline at end of file