Sha256: 8a195585c8726605a56e6e9477b312b48e13c85813d34fea2c1b337020e8a204

Contents?: true

Size: 837 Bytes

Versions: 2

Compression:

Stored size: 837 Bytes

Contents

require 'test_helper'

class EmatrixJournalSearcherTest < ActiveSupport::TestCase

  setup do
    @journal = QuickSearch::EmatrixJournalSearcher.new(HTTPClient.new, 'chemistry', 3)
  end

  test "should have http client, query, and per_page" do
    assert @journal.http.is_a? HTTPClient
    assert @journal.q == 'chemistry'
    assert_equal 3, @journal.per_page
  end

  vcr_test "should have raw result", 'searches', cassette: 'ematrix_journal_chemistry' do
    raw_results = @journal.search
    assert raw_results.is_a?(Nokogiri::XML::Document)
  end

  vcr_test "should have parsed results", 'searches', cassette: 'ematrix_journal_chemistry' do
    @journal.search
    parsed_results = @journal.results
    assert parsed_results.first.title.include?('Annual reports')
    assert parsed_results.first.link.include?('33000')
  end

end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
quick_search-core-0.0.1 test/searcher/ematrix_journal_test.rb
quick_search-core-0.0.1.test test/searcher/ematrix_journal_test.rb