Sha256: 09757fabd10a36976032603e37c8414e2659130b138db0d5a65d4fbce5f52625

Contents?: true

Size: 1.74 KB

Versions: 25

Compression:

Stored size: 1.74 KB

Contents

module WebService
  module Response
    require 'test_helper'
    class DidUMeanTest < Test::Unit::TestCase
      def setup
        @base_url = "http://bobcatdev.library.nyu.edu"
        @isbn = "0143039008"
        @user_id = "N12162279"
        @institution = "NYU"
        @doc_id = "nyu_aleph000062856"
        @dedupmgr_id = "dedupmrg17343091"
        @basket_id ="210075761"
        @did_u_mean_title = "Digital dvide"
      end

      def test_did_u_mean_enabled
        VCR.use_cassette('response did u mean enabled') {
          soap_action = :search_brief
          request = Exlibris::Primo::WebService::Request::Search.new(:user_id => @user_id, 
            :institution => @institution, :did_u_mean_enabled => "true")
          request.add_query_term(@did_u_mean_title, "title")
          client = Exlibris::Primo::WebService::Client::Search.new(:base_url => @base_url)
          response = Exlibris::Primo::WebService::Response::Search.new(
            client.send(soap_action, request.to_xml), soap_action)
          assert_not_nil response.did_u_mean
          assert_equal "digital d vide", response.did_u_mean
        }
      end

      def test_did_u_mean_disabled
        VCR.use_cassette('response did u mean disabled') {
          soap_action = :search_brief
          request = Exlibris::Primo::WebService::Request::Search.new(:user_id => @user_id, 
            :institution => @institution)
          request.add_query_term(@did_u_mean_title, "title")
          client = Exlibris::Primo::WebService::Client::Search.new(:base_url => @base_url)
          response = Exlibris::Primo::WebService::Response::Search.new(
            client.send(soap_action, request.to_xml), soap_action)
          assert_nil response.did_u_mean
        }
      end
    end
  end
end

Version data entries

25 entries across 25 versions & 1 rubygems

Version Path
exlibris-primo-2.1.1 test/web_service/response/did_u_mean_test.rb
exlibris-primo-2.1.0 test/web_service/response/did_u_mean_test.rb
exlibris-primo-2.0.0 test/web_service/response/did_u_mean_test.rb
exlibris-primo-1.1.9 test/web_service/response/did_u_mean_test.rb
exlibris-primo-1.1.8 test/web_service/response/did_u_mean_test.rb
exlibris-primo-1.1.7 test/web_service/response/did_u_mean_test.rb
exlibris-primo-1.1.6 test/web_service/response/did_u_mean_test.rb
exlibris-primo-1.1.5 test/web_service/response/did_u_mean_test.rb
exlibris-primo-1.1.4 test/web_service/response/did_u_mean_test.rb
exlibris-primo-1.1.3 test/web_service/response/did_u_mean_test.rb
exlibris-primo-1.1.2 test/web_service/response/did_u_mean_test.rb
exlibris-primo-1.1.1 test/web_service/response/did_u_mean_test.rb
exlibris-primo-1.1.0 test/web_service/response/did_u_mean_test.rb
exlibris-primo-1.0.11 test/web_service/response/did_u_mean_test.rb
exlibris-primo-1.0.10 test/web_service/response/did_u_mean_test.rb
exlibris-primo-1.0.9 test/web_service/response/did_u_mean_test.rb
exlibris-primo-1.0.8 test/web_service/response/did_u_mean_test.rb
exlibris-primo-1.0.7 test/web_service/response/did_u_mean_test.rb
exlibris-primo-1.0.6 test/web_service/response/did_u_mean_test.rb
exlibris-primo-1.0.5 test/web_service/response/did_u_mean_test.rb