qa 0.0.3 → 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (35) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +34 -10
  3. data/app/controllers/qa/terms_controller.rb +1 -1
  4. data/lib/qa/authorities.rb +0 -1
  5. data/lib/qa/authorities/base.rb +1 -1
  6. data/lib/qa/authorities/loc.rb +6 -0
  7. data/lib/qa/authorities/local.rb +0 -1
  8. data/lib/qa/authorities/mesh.rb +7 -1
  9. data/lib/qa/authorities/oclcts.rb +7 -1
  10. data/lib/qa/authorities/tgnlang.rb +6 -0
  11. data/lib/qa/authorities/web_service_base.rb +1 -1
  12. data/lib/qa/version.rb +1 -1
  13. data/spec/controllers/terms_controller_spec.rb +0 -6
  14. data/spec/fixtures/loc-names-response.txt +1733 -0
  15. data/spec/fixtures/loc-subjects-response.txt +1733 -0
  16. data/spec/internal/Gemfile +1 -1
  17. data/spec/internal/Gemfile.lock +55 -56
  18. data/spec/internal/config/initializers/secret_token.rb +1 -1
  19. data/spec/internal/config/routes.rb +0 -4
  20. data/spec/lib/authorities_loc_spec.rb +53 -19
  21. data/spec/lib/authorities_mesh_spec.rb +1 -1
  22. data/spec/lib/authorities_oclcts_spec.rb +2 -2
  23. data/spec/lib/tasks/mesh.rake_spec.rb +1 -1
  24. metadata +22 -96
  25. data/lib/qa/authorities/lcsh.rb +0 -41
  26. data/spec/fixtures/lcsh-response.txt +0 -1
  27. data/spec/internal/config/oclcts-authorities.yml +0 -24
  28. data/spec/internal/db/development.sqlite3 +0 -0
  29. data/spec/internal/db/migrate/20131106203101_create_qa_subject_mesh_terms.qa.rb +0 -12
  30. data/spec/internal/db/migrate/20131106203102_create_qa_mesh_tree.qa.rb +0 -11
  31. data/spec/internal/db/migrate/20131106203103_add_term_lower_to_qa_subject_mesh_terms.qa.rb +0 -8
  32. data/spec/internal/db/schema.rb +0 -34
  33. data/spec/internal/db/test.sqlite3 +0 -0
  34. data/spec/internal/log/development.log +0 -7046
  35. data/spec/lib/authorities_lcsh_spec.rb +0 -50
@@ -1,50 +0,0 @@
1
- require 'spec_helper'
2
-
3
- describe Qa::Authorities::Lcsh do
4
-
5
- before :all do
6
- stub_request(:get, "http://id.loc.gov/authorities/suggest/?q=ABBA").
7
- to_return(:body => webmock_fixture("lcsh-response.txt"), :status => 200)
8
- @terms = Qa::Authorities::Lcsh.new
9
- @terms.search("ABBA")
10
- end
11
-
12
-
13
- describe "presenting the results from LOC" do
14
-
15
- it "has a list of responses" do
16
- @terms.response.should be_kind_of Array
17
- @terms.response.each do |item|
18
- item.should be_kind_of Hash
19
- item.keys.should == ["id", "label"]
20
- end
21
- @terms.response.map { |item| item["label"] }.should include "ABBA (Musical group)"
22
- @terms.response.map { |item| item["id"] }.should include "n78090836"
23
- end
24
- end
25
-
26
- describe "#build_response" do
27
- it "should set .response to be an array of hashes in the id/label structure" do
28
- sample = { "id"=>"n92117993", "label"=>"Abba (Nigeria)" }
29
- # use #send since build_response is private
30
- r = @terms.send(:build_response,
31
- ["ABBA",
32
- ["ABBA (Musical group)",
33
- "ABBA (Musical group). Gold",
34
- "ABBA (Organization)",
35
- "Abba (Nigeria)"],
36
- ["1 result",
37
- "1 result",
38
- "1 result",
39
- "1 result" ],
40
- ["http://id.loc.gov/authorities/names/n78090836",
41
- "http://id.loc.gov/authorities/names/n2003148504",
42
- "http://id.loc.gov/authorities/names/no2012083395",
43
- "http://id.loc.gov/authorities/names/n92117993"]]
44
- )
45
- r.should be_kind_of Array
46
- r.should include sample
47
- end
48
- end
49
-
50
- end