qa 0.10.1 → 0.10.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (57) hide show
  1. checksums.yaml +4 -4
  2. data/Rakefile +12 -2
  3. data/app/controllers/qa/terms_controller.rb +14 -16
  4. data/app/models/qa/mesh_tree.rb +3 -5
  5. data/app/models/qa/subject_mesh_term.rb +15 -15
  6. data/config/routes.rb +1 -1
  7. data/lib/generators/qa/install/install_generator.rb +2 -3
  8. data/lib/generators/qa/local/tables/mysql/mysql_generator.rb +3 -5
  9. data/lib/generators/qa/local/tables/tables_generator.rb +4 -6
  10. data/lib/qa/authorities/assign_fast/generic_authority.rb +16 -19
  11. data/lib/qa/authorities/assign_fast_subauthority.rb +3 -5
  12. data/lib/qa/authorities/authority_with_sub_authority.rb +1 -2
  13. data/lib/qa/authorities/base.rb +2 -3
  14. data/lib/qa/authorities/geonames.rb +11 -12
  15. data/lib/qa/authorities/getty.rb +7 -8
  16. data/lib/qa/authorities/getty/aat.rb +11 -12
  17. data/lib/qa/authorities/getty/tgn.rb +15 -15
  18. data/lib/qa/authorities/getty/ulan.rb +15 -16
  19. data/lib/qa/authorities/loc/generic_authority.rb +32 -33
  20. data/lib/qa/authorities/loc_subauthority.rb +17 -20
  21. data/lib/qa/authorities/local.rb +41 -40
  22. data/lib/qa/authorities/local/file_based_authority.rb +18 -19
  23. data/lib/qa/authorities/local/mysql_table_based_authority.rb +8 -6
  24. data/lib/qa/authorities/local/registry.rb +5 -5
  25. data/lib/qa/authorities/local/table_based_authority.rb +26 -19
  26. data/lib/qa/authorities/mesh.rb +8 -16
  27. data/lib/qa/authorities/mesh_tools.rb +5 -5
  28. data/lib/qa/authorities/mesh_tools/mesh_data_parser.rb +4 -6
  29. data/lib/qa/authorities/mesh_tools/mesh_importer.rb +11 -13
  30. data/lib/qa/authorities/oclcts.rb +0 -1
  31. data/lib/qa/authorities/oclcts/generic_oclc_authority.rb +16 -16
  32. data/lib/qa/authorities/tgnlang.rb +7 -12
  33. data/lib/qa/version.rb +1 -1
  34. data/spec/controllers/terms_controller_spec.rb +44 -54
  35. data/spec/lib/authorities/assign_fast_spec.rb +25 -27
  36. data/spec/lib/authorities/file_based_authority_spec.rb +25 -26
  37. data/spec/lib/authorities/geonames_spec.rb +5 -6
  38. data/spec/lib/authorities/getty/aat_spec.rb +6 -10
  39. data/spec/lib/authorities/getty/tgn_spec.rb +6 -10
  40. data/spec/lib/authorities/getty/ulan_spec.rb +6 -10
  41. data/spec/lib/authorities/getty_spec.rb +4 -5
  42. data/spec/lib/authorities/loc_spec.rb +30 -36
  43. data/spec/lib/authorities/local_spec.rb +5 -7
  44. data/spec/lib/authorities/mesh_spec.rb +9 -9
  45. data/spec/lib/authorities/mysql_table_based_authority_spec.rb +13 -5
  46. data/spec/lib/authorities/oclcts_spec.rb +17 -21
  47. data/spec/lib/authorities/table_based_authority_spec.rb +21 -12
  48. data/spec/lib/authorities/tgnlang_spec.rb +4 -6
  49. data/spec/lib/authorities_loc_subauthorities.rb +50 -54
  50. data/spec/lib/mesh_data_parser_spec.rb +73 -79
  51. data/spec/lib/services/rdf_authority_parser_spec.rb +2 -7
  52. data/spec/lib/tasks/mesh.rake_spec.rb +16 -12
  53. data/spec/models/subject_mesh_term_spec.rb +4 -4
  54. data/spec/routing/route_spec.rb +13 -15
  55. data/spec/spec_helper.rb +3 -4
  56. data/spec/test_app_templates/lib/generators/test_app_generator.rb +0 -1
  57. metadata +45 -17
@@ -1,18 +1,17 @@
1
1
  require 'spec_helper'
2
2
 
3
3
  describe Qa::Authorities::MeshTools::MeshDataParser do
4
-
5
4
  it "parses a record correctly" do
6
- data = <<-EOS
5
+ data = <<-EOS
7
6
  *NEWRECORD
8
7
  A = 45
9
8
  B = a = b = c = d
10
9
  B = more than one
11
10
  EOS
12
- mesh = Qa::Authorities::MeshTools::MeshDataParser.new(StringIO.new(data))
11
+ mesh = described_class.new(StringIO.new(data))
13
12
  records = mesh.all_records
14
13
  expect(records.length).to eq(1)
15
- expect(records[0]).to eq({'A'=>['45'],'B'=>['a = b = c = d','more than one']})
14
+ expect(records[0]).to eq('A' => ['45'], 'B' => ['a = b = c = d', 'more than one'])
16
15
  end
17
16
 
18
17
  it "handles two records" do
@@ -26,11 +25,11 @@ A = another field
26
25
  print entry = test
27
26
 
28
27
  EOS
29
- mesh = Qa::Authorities::MeshTools::MeshDataParser.new(StringIO.new(data))
28
+ mesh = described_class.new(StringIO.new(data))
30
29
  records = mesh.all_records
31
30
  expect(records.length).to eq(2)
32
- expect(records[0]).to eq({'A'=>['45'],'B'=>['a = b = c = d']})
33
- expect(records[1]).to eq({'A'=>['another field'], 'print entry'=>['test']})
31
+ expect(records[0]).to eq('A' => ['45'], 'B' => ['a = b = c = d'])
32
+ expect(records[1]).to eq('A' => ['another field'], 'print entry' => ['test'])
34
33
  end
35
34
 
36
35
  it 'ignores bad input' do
@@ -41,85 +40,80 @@ B=no space
41
40
  space at beginning of line and no =
42
41
  *NEWRECORD
43
42
  EOS
44
- mesh = Qa::Authorities::MeshTools::MeshDataParser.new(StringIO.new(data))
43
+ mesh = described_class.new(StringIO.new(data))
45
44
  records = mesh.all_records
46
45
  expect(records.length).to eq(2)
47
- expect(records[0]).to eq({'A'=>['45']})
46
+ expect(records[0]).to eq('A' => ['45'])
48
47
  expect(records[1]).to eq({})
49
48
  end
50
49
 
51
50
  it 'parses a sample mesh file' do
52
- mesh = Qa::Authorities::MeshTools::MeshDataParser.new(webmock_fixture('mesh.txt'))
51
+ mesh = described_class.new(webmock_fixture('mesh.txt'))
53
52
  records = mesh.all_records
54
53
  expect(records.length).to eq(11)
55
- expect(records[0]).to eq({
56
- "RECTYPE" => ["D"],
57
- "MH" => ["Malaria"],
58
- "AQ" => ["BL CF CI CL CN CO DH DI DT EC EH EM EN EP ET GE HI IM ME MI MO NU PA PC PP PS PX RA RH RI RT SU TH TM UR US VE VI"],
59
- "PRINT ENTRY" => ["Marsh Fever|T047|NON|EQV|NLM (2006)|050114|abcdef",
60
- "Plasmodium Infections|T047|NON|EQV|UNK (19XX)|740330|PLASMODIUM INFECT|abcdefv",
61
- "Remittent Fever|T047|NON|EQV|NLM (2006)|050114|abcdef"],
62
- "ENTRY" => ["Infections, Plasmodium|T047|NON|EQV|NLM (1992)|911126|INFECT PLASMODIUM|abcdefv",
63
- "Paludism|T047|NON|EQV|NLM (2005)|040220|abcdef",
64
- "Fever, Marsh",
65
- "Fever, Remittent",
66
- "Infection, Plasmodium",
67
- "Plasmodium Infection"],
68
- "MN" => ["C03.752.530", "C23.996.660"],
69
- "FX" => ["Antimalarials"],
70
- "MH_TH" => ["NLM (1986)", "ORD (2010)"],
71
- "ST" => ["T047"],
72
- "AN" => ["GEN or unspecified; specify Plasmodium species IM if possible but note P. falciparum malaria = MALARIA, FALCIPARUM; P. vivax malaria = MALARIA, VIVAX; tertian malaria = MALARIA, VIVAX, quartan malaria: coord IM with PLASMODIUM MALARIAE (IM); malariotherapy = HYPERTHERMIA, INDUCED: do not confuse with MALARIA /ther; /drug ther: consider also ANTIMALARIALS"],
73
- "MS" => ["A protozoan disease caused in humans by four species of the PLASMODIUM genus: PLASMODIUM FALCIPARUM; PLASMODIUM VIVAX; PLASMODIUM OVALE; and PLASMODIUM MALARIAE; and transmitted by the bite of an infected female mosquito of the genus ANOPHELES. Malaria is endemic in parts of Asia, Africa, Central and South America, Oceania, and certain Caribbean islands. It is characterized by extreme exhaustion associated with paroxysms of high FEVER; SWEATING; shaking CHILLS; and ANEMIA. Malaria in ANIMALS is caused by other species of plasmodia."],
74
- "OL" => ["use MALARIA to search MALARIA CONTROL 1966"],
75
- "PM" => ["MALARIA CONTROL was heading 1963-66"],
76
- "HN" => ["MALARIA CONTROL was heading 1963-66"],
77
- "MED" => ["*1141", "1541"],
78
- "M90" => ["*2010", "2428"],
79
- "M85" => ["*2929", "3509"],
80
- "M80" => ["*2008", "2567"],
81
- "M75" => ["*1414", "1928"],
82
- "M66" => ["*2561", "3568"],
83
- "M94" => ["*1272", "1646"],
84
- "CATSH" => ["CAT LIST"],
85
- "MR" => ["20120703"],
86
- "DA" => ["19990101"],
87
- "DC" => ["1"],
88
- "UI" => ["D008288"]
89
- })
90
- expect(records[1]).to eq({
91
- "RECTYPE" => ["D"],
92
- "MH" => ["Calcimycin"],
93
- "AQ" => ["AA AD AE AG AI AN BI BL CF CH CL CS CT DU EC HI IM IP ME PD PK PO RE SD ST TO TU UR"],
94
- "ENTRY" => ["A-23187|T109|T195|LAB|NRW|NLM (1991)|900308|abbcdef",
95
- "A23187|T109|T195|LAB|NRW|UNK (19XX)|741111|abbcdef",
96
- "Antibiotic A23187|T109|T195|NON|NRW|NLM (1991)|900308|abbcdef",
97
- "A 23187",
98
- "A23187, Antibiotic"],
99
- "MN" => ["D03.438.221.173"],
100
- "PA" => ["Anti-Bacterial Agents", "Calcium Ionophores"],
101
- "MH_TH" => ["NLM (1975)"],
102
- "ST" => ["T109", "T195"],
103
- "N1" => ["4-Benzoxazolecarboxylic acid, 5-(methylamino)-2-((3,9,11-trimethyl-8-(1-methyl-2-oxo-2-(1H-pyrrol-2-yl)ethyl)-1,7-dioxaspiro(5.5)undec-2-yl)methyl)-, (6S-(6alpha(2S*,3S*),8beta(R*),9beta,11alpha))-"],
104
- "RN" => ["52665-69-7"],
105
- "PI" => ["Antibiotics (1973-1974)", "Carboxylic Acids (1973-1974)"],
106
- "MS" => ["An ionophorous, polyether antibiotic from Streptomyces chartreusensis. It binds and transports CALCIUM and other divalent cations across membranes and uncouples oxidative phosphorylation while inhibiting ATPase of rat liver mitochondria. The substance is used mostly as a biochemical tool to study the role of divalent cations in various biological systems."],
107
- "OL" => ["use CALCIMYCIN to search A 23187 1975-90"],
108
- "PM" => ["91; was A 23187 1975-90 (see under ANTIBIOTICS 1975-83)"],
109
- "HN" => ["91(75); was A 23187 1975-90 (see under ANTIBIOTICS 1975-83)"],
110
- "MED" => ["*62", "847"],
111
- "M90" => ["*299", "2405"],
112
- "M85" => ["*454", "2878"],
113
- "M80" => ["*316", "1601"],
114
- "M75" => ["*300", "823"],
115
- "M66" => ["*1", "3"],
116
- "M94" => ["*153", "1606"],
117
- "MR" => ["20110624"],
118
- "DA" => ["19741119"],
119
- "DC" => ["1"],
120
- "DX" => ["19840101"],
121
- "UI" => ["D000001"]
122
- })
54
+ expect(records[0]).to eq("RECTYPE" => ["D"],
55
+ "MH" => ["Malaria"],
56
+ "AQ" => ["BL CF CI CL CN CO DH DI DT EC EH EM EN EP ET GE HI IM ME MI MO NU PA PC PP PS PX RA RH RI RT SU TH TM UR US VE VI"],
57
+ "PRINT ENTRY" => ["Marsh Fever|T047|NON|EQV|NLM (2006)|050114|abcdef",
58
+ "Plasmodium Infections|T047|NON|EQV|UNK (19XX)|740330|PLASMODIUM INFECT|abcdefv",
59
+ "Remittent Fever|T047|NON|EQV|NLM (2006)|050114|abcdef"],
60
+ "ENTRY" => ["Infections, Plasmodium|T047|NON|EQV|NLM (1992)|911126|INFECT PLASMODIUM|abcdefv",
61
+ "Paludism|T047|NON|EQV|NLM (2005)|040220|abcdef",
62
+ "Fever, Marsh",
63
+ "Fever, Remittent",
64
+ "Infection, Plasmodium",
65
+ "Plasmodium Infection"],
66
+ "MN" => ["C03.752.530", "C23.996.660"],
67
+ "FX" => ["Antimalarials"],
68
+ "MH_TH" => ["NLM (1986)", "ORD (2010)"],
69
+ "ST" => ["T047"],
70
+ "AN" => ["GEN or unspecified; specify Plasmodium species IM if possible but note P. falciparum malaria = MALARIA, FALCIPARUM; P. vivax malaria = MALARIA, VIVAX; tertian malaria = MALARIA, VIVAX, quartan malaria: coord IM with PLASMODIUM MALARIAE (IM); malariotherapy = HYPERTHERMIA, INDUCED: do not confuse with MALARIA /ther; /drug ther: consider also ANTIMALARIALS"],
71
+ "MS" => ["A protozoan disease caused in humans by four species of the PLASMODIUM genus: PLASMODIUM FALCIPARUM; PLASMODIUM VIVAX; PLASMODIUM OVALE; and PLASMODIUM MALARIAE; and transmitted by the bite of an infected female mosquito of the genus ANOPHELES. Malaria is endemic in parts of Asia, Africa, Central and South America, Oceania, and certain Caribbean islands. It is characterized by extreme exhaustion associated with paroxysms of high FEVER; SWEATING; shaking CHILLS; and ANEMIA. Malaria in ANIMALS is caused by other species of plasmodia."],
72
+ "OL" => ["use MALARIA to search MALARIA CONTROL 1966"],
73
+ "PM" => ["MALARIA CONTROL was heading 1963-66"],
74
+ "HN" => ["MALARIA CONTROL was heading 1963-66"],
75
+ "MED" => ["*1141", "1541"],
76
+ "M90" => ["*2010", "2428"],
77
+ "M85" => ["*2929", "3509"],
78
+ "M80" => ["*2008", "2567"],
79
+ "M75" => ["*1414", "1928"],
80
+ "M66" => ["*2561", "3568"],
81
+ "M94" => ["*1272", "1646"],
82
+ "CATSH" => ["CAT LIST"],
83
+ "MR" => ["20120703"],
84
+ "DA" => ["19990101"],
85
+ "DC" => ["1"],
86
+ "UI" => ["D008288"])
87
+ expect(records[1]).to eq("RECTYPE" => ["D"],
88
+ "MH" => ["Calcimycin"],
89
+ "AQ" => ["AA AD AE AG AI AN BI BL CF CH CL CS CT DU EC HI IM IP ME PD PK PO RE SD ST TO TU UR"],
90
+ "ENTRY" => ["A-23187|T109|T195|LAB|NRW|NLM (1991)|900308|abbcdef",
91
+ "A23187|T109|T195|LAB|NRW|UNK (19XX)|741111|abbcdef",
92
+ "Antibiotic A23187|T109|T195|NON|NRW|NLM (1991)|900308|abbcdef",
93
+ "A 23187",
94
+ "A23187, Antibiotic"],
95
+ "MN" => ["D03.438.221.173"],
96
+ "PA" => ["Anti-Bacterial Agents", "Calcium Ionophores"],
97
+ "MH_TH" => ["NLM (1975)"],
98
+ "ST" => ["T109", "T195"],
99
+ "N1" => ["4-Benzoxazolecarboxylic acid, 5-(methylamino)-2-((3,9,11-trimethyl-8-(1-methyl-2-oxo-2-(1H-pyrrol-2-yl)ethyl)-1,7-dioxaspiro(5.5)undec-2-yl)methyl)-, (6S-(6alpha(2S*,3S*),8beta(R*),9beta,11alpha))-"],
100
+ "RN" => ["52665-69-7"],
101
+ "PI" => ["Antibiotics (1973-1974)", "Carboxylic Acids (1973-1974)"],
102
+ "MS" => ["An ionophorous, polyether antibiotic from Streptomyces chartreusensis. It binds and transports CALCIUM and other divalent cations across membranes and uncouples oxidative phosphorylation while inhibiting ATPase of rat liver mitochondria. The substance is used mostly as a biochemical tool to study the role of divalent cations in various biological systems."],
103
+ "OL" => ["use CALCIMYCIN to search A 23187 1975-90"],
104
+ "PM" => ["91; was A 23187 1975-90 (see under ANTIBIOTICS 1975-83)"],
105
+ "HN" => ["91(75); was A 23187 1975-90 (see under ANTIBIOTICS 1975-83)"],
106
+ "MED" => ["*62", "847"],
107
+ "M90" => ["*299", "2405"],
108
+ "M85" => ["*454", "2878"],
109
+ "M80" => ["*316", "1601"],
110
+ "M75" => ["*300", "823"],
111
+ "M66" => ["*1", "3"],
112
+ "M94" => ["*153", "1606"],
113
+ "MR" => ["20110624"],
114
+ "DA" => ["19741119"],
115
+ "DC" => ["1"],
116
+ "DX" => ["19840101"],
117
+ "UI" => ["D000001"])
123
118
  end
124
119
  end
125
-
@@ -2,7 +2,7 @@
2
2
  require 'spec_helper'
3
3
 
4
4
  describe Qa::Services::RDFAuthorityParser do
5
- let(:source) {[File.join(fixture_path,'lexvo_snippet.rdf')] }
5
+ let(:source) { [File.join(fixture_path, 'lexvo_snippet.rdf')] }
6
6
  let(:format) { 'rdfxml' }
7
7
  let(:predicate) { RDF::URI("http://www.w3.org/2008/05/skos#prefLabel") }
8
8
  let(:name) { 'language' }
@@ -10,17 +10,12 @@ describe Qa::Services::RDFAuthorityParser do
10
10
  let(:ari_entry) { Qa::LocalAuthorityEntry.find_by(label: 'Ari') }
11
11
 
12
12
  describe "#import_rdf" do
13
- before do
14
- blah = Qa::LocalAuthority.find_by_name(name)
15
- described_class.import_rdf(name, source, format: format, predicate: predicate)
16
- end
13
+ before { described_class.import_rdf(name, source, format: format, predicate: predicate) }
17
14
  it "creates the authority and authority entries" do
18
15
  expect(Qa::LocalAuthority.count).to eq(1)
19
16
  expect(Qa::LocalAuthority.find_by(name: name)).not_to be_nil
20
17
  expect(Qa::LocalAuthorityEntry.count).to eq(2)
21
- expect(alum_entry).not_to be_nil
22
18
  expect(alum_entry.uri).to eq('http://lexvo.org/id/iso639-3/aab')
23
- expect(ari_entry).not_to be_nil
24
19
  expect(ari_entry.uri).to eq('http://lexvo.org/id/iso639-3/aac')
25
20
  end
26
21
  end
@@ -7,7 +7,7 @@ describe "mesh rake tasks" do
7
7
  @rake = Rake::Application.new
8
8
  Rake.application = @rake
9
9
  Rake.application.rake_require "mesh", ["#{Rails.root}/lib/tasks", "#{Rails.root}/../lib/tasks"], []
10
- Rake::Task.define_task(:environment) # rspec has loaded rails
10
+ Rake::Task.define_task(:environment) # rspec has loaded rails
11
11
  end
12
12
 
13
13
  describe "mesh:import" do
@@ -19,25 +19,29 @@ describe "mesh rake tasks" do
19
19
  after :all do
20
20
  $stdout = STDOUT
21
21
  end
22
- it "should have 'environment' as a prereq" do
22
+ it "has 'environment' as a prereq" do
23
23
  expect(@rake[@task_name].prerequisites).to include("environment")
24
24
  end
25
- it "should require $MESH_FILE to be set" do
25
+ it "requires $MESH_FILE to be set" do
26
26
  old_mesh_file = ENV.delete('MESH_FILE')
27
27
  @rake[@task_name].invoke
28
28
  @output.seek(0)
29
29
  expect(@output.read).to match(/Need to set \$MESH_FILE with path to file to ingest/)
30
30
  ENV['MESH_FILE'] = old_mesh_file
31
31
  end
32
- it "should create or update all records in the config file" do
33
- ENV['MESH_FILE'] = "dummy"
34
- input = StringIO.new("*NEWRECORD\nUI = 5\nMH = test\n")
35
- expect(File).to receive(:open).with("dummy").and_yield(input)
36
- @rake[@task_name].invoke
37
- term = Qa::SubjectMeshTerm.find_by_term_id(5)
38
- expect(term).not_to be_nil
39
- expect(term.term).to eq("test")
40
- ENV['MESH_FILE'] = nil
32
+ describe "create or update" do
33
+ let(:input) { StringIO.new("*NEWRECORD\nUI = 5\nMH = test\n") }
34
+ let(:term) { Qa::SubjectMeshTerm.find_by_term_id(5) }
35
+
36
+ before do
37
+ ENV['MESH_FILE'] = "dummy"
38
+ allow(File).to receive(:open).with("dummy").and_yield(input)
39
+ @rake[@task_name].invoke
40
+ end
41
+ it "creates or update all records in the config file" do
42
+ expect(term).not_to be_nil
43
+ expect(term.term).to eq("test")
44
+ end
41
45
  end
42
46
  end
43
47
  end
@@ -1,6 +1,6 @@
1
1
  require 'spec_helper'
2
2
 
3
- describe Qa::SubjectMeshTerm, :type => :model do
3
+ describe Qa::SubjectMeshTerm, type: :model do
4
4
  before(:all) do
5
5
  @term = Qa::SubjectMeshTerm.new
6
6
  @term.term_id = "ABCDEFG"
@@ -19,7 +19,7 @@ describe Qa::SubjectMeshTerm, :type => :model do
19
19
  it "saves a synonym list" do
20
20
  a = Qa::SubjectMeshTerm.new
21
21
  a.term_id = 'a'
22
- a.synonyms = ['b','c']
22
+ a.synonyms = ['b', 'c']
23
23
  a.save
24
24
  expect(a.synonyms).to eq(['b', 'c'])
25
25
  end
@@ -33,7 +33,7 @@ describe Qa::SubjectMeshTerm, :type => :model do
33
33
  end
34
34
 
35
35
  it "returns parents"
36
- #do
36
+ # do
37
37
  # SubjectMeshTerm.create(term_id: "1")
38
38
  # SubjectMeshTerm.create(term_id: "2")
39
39
  # SubjectMeshTerm.create(term_id: "3")
@@ -45,5 +45,5 @@ describe Qa::SubjectMeshTerm, :type => :model do
45
45
 
46
46
  # @term.trees.should == ["D1.2.3", "D1.A.3"]
47
47
  # @term.parents.map { |p| p.term_id }.should == ["1", "2", "3"]
48
- #end
48
+ # end
49
49
  end
@@ -1,34 +1,32 @@
1
1
  require 'spec_helper'
2
2
 
3
- describe "QA Routes", :type => :routing do
4
-
3
+ describe "QA Routes", type: :routing do
5
4
  routes { Qa::Engine.routes }
6
5
 
7
6
  context "listing terms" do
8
- it "should route to index with an authority" do
9
- expect({ get: '/terms/vocab' }).to route_to(controller: 'qa/terms', action: 'index', vocab: 'vocab')
7
+ it "routes to index with an authority" do
8
+ expect(get: '/terms/vocab').to route_to(controller: 'qa/terms', action: 'index', vocab: 'vocab')
10
9
  end
11
- it "should route to index with an authority and a subauthority" do
12
- expect({ get: '/terms/vocab/sub' }).to route_to(controller: 'qa/terms', action: 'index', vocab: 'vocab', subauthority: 'sub')
10
+ it "routes to index with an authority and a subauthority" do
11
+ expect(get: '/terms/vocab/sub').to route_to(controller: 'qa/terms', action: 'index', vocab: 'vocab', subauthority: 'sub')
13
12
  end
14
13
  end
15
14
 
16
15
  context "searching for terms" do
17
- it "should route to searching for an authority" do
18
- expect({ get: '/search/vocab' }).to route_to(controller: 'qa/terms', action: 'search', vocab: 'vocab')
16
+ it "routes to searching for an authority" do
17
+ expect(get: '/search/vocab').to route_to(controller: 'qa/terms', action: 'search', vocab: 'vocab')
19
18
  end
20
- it "should route to searching for an authority and a subauthority" do
21
- expect({ get: '/search/vocab/sub' }).to route_to(controller: 'qa/terms', action: 'search', vocab: 'vocab', subauthority: 'sub')
19
+ it "routes to searching for an authority and a subauthority" do
20
+ expect(get: '/search/vocab/sub').to route_to(controller: 'qa/terms', action: 'search', vocab: 'vocab', subauthority: 'sub')
22
21
  end
23
22
  end
24
23
 
25
24
  context "displaying a single term" do
26
- it "should route to an authority" do
27
- expect({ get: '/show/vocab/term_id' }).to route_to(controller: 'qa/terms', action: 'show', vocab: 'vocab', id: 'term_id')
25
+ it "routes to an authority" do
26
+ expect(get: '/show/vocab/term_id').to route_to(controller: 'qa/terms', action: 'show', vocab: 'vocab', id: 'term_id')
28
27
  end
29
- it "should route to an authority with a subauthority" do
30
- expect({ get: '/show/vocab/sub/term_id' }).to route_to(controller: 'qa/terms', action: 'show', vocab: 'vocab', subauthority: 'sub', id: 'term_id')
28
+ it "routes to an authority with a subauthority" do
29
+ expect(get: '/show/vocab/sub/term_id').to route_to(controller: 'qa/terms', action: 'show', vocab: 'vocab', subauthority: 'sub', id: 'term_id')
31
30
  end
32
31
  end
33
-
34
32
  end
data/spec/spec_helper.rb CHANGED
@@ -19,8 +19,7 @@ require 'webmock/rspec'
19
19
  Dir[Rails.root.join("spec/support/**/*.rb")].each { |f| require f }
20
20
 
21
21
  RSpec.configure do |config|
22
-
23
- config.fixture_path = File.expand_path("../fixtures", __FILE__)
22
+ config.fixture_path = File.expand_path("../fixtures", __FILE__)
24
23
 
25
24
  config.use_transactional_fixtures = true
26
25
 
@@ -41,8 +40,8 @@ RSpec.configure do |config|
41
40
  config.infer_spec_type_from_file_location!
42
41
  end
43
42
 
44
- def webmock_fixture fixture
45
- File.new File.expand_path(File.join("../fixtures", fixture), __FILE__)
43
+ def webmock_fixture(fixture)
44
+ File.new File.expand_path(File.join("../fixtures", fixture), __FILE__)
46
45
  end
47
46
 
48
47
  # returns the file contents
@@ -26,5 +26,4 @@ class TestAppGenerator < Rails::Generators::Base
26
26
  rake "qa:install:migrations"
27
27
  rake "db:migrate"
28
28
  end
29
-
30
29
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: qa
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.10.1
4
+ version: 0.10.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Stephen Anderson
@@ -15,7 +15,7 @@ authors:
15
15
  autorequire:
16
16
  bindir: bin
17
17
  cert_chain: []
18
- date: 2016-09-27 00:00:00.000000000 Z
18
+ date: 2016-10-25 00:00:00.000000000 Z
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency
21
21
  name: rails
@@ -94,7 +94,7 @@ dependencies:
94
94
  - !ruby/object:Gem::Version
95
95
  version: '0'
96
96
  - !ruby/object:Gem::Dependency
97
- name: sqlite3
97
+ name: byebug
98
98
  requirement: !ruby/object:Gem::Requirement
99
99
  requirements:
100
100
  - - ">="
@@ -108,7 +108,21 @@ dependencies:
108
108
  - !ruby/object:Gem::Version
109
109
  version: '0'
110
110
  - !ruby/object:Gem::Dependency
111
- name: rspec-rails
111
+ name: engine_cart
112
+ requirement: !ruby/object:Gem::Requirement
113
+ requirements:
114
+ - - "~>"
115
+ - !ruby/object:Gem::Version
116
+ version: '0.8'
117
+ type: :development
118
+ prerelease: false
119
+ version_requirements: !ruby/object:Gem::Requirement
120
+ requirements:
121
+ - - "~>"
122
+ - !ruby/object:Gem::Version
123
+ version: '0.8'
124
+ - !ruby/object:Gem::Dependency
125
+ name: linkeddata
112
126
  requirement: !ruby/object:Gem::Requirement
113
127
  requirements:
114
128
  - - ">="
@@ -122,7 +136,7 @@ dependencies:
122
136
  - !ruby/object:Gem::Version
123
137
  version: '0'
124
138
  - !ruby/object:Gem::Dependency
125
- name: webmock
139
+ name: rspec-rails
126
140
  requirement: !ruby/object:Gem::Requirement
127
141
  requirements:
128
142
  - - ">="
@@ -150,21 +164,21 @@ dependencies:
150
164
  - !ruby/object:Gem::Version
151
165
  version: '0'
152
166
  - !ruby/object:Gem::Dependency
153
- name: engine_cart
167
+ name: sqlite3
154
168
  requirement: !ruby/object:Gem::Requirement
155
169
  requirements:
156
- - - "~>"
170
+ - - ">="
157
171
  - !ruby/object:Gem::Version
158
- version: '0.8'
172
+ version: '0'
159
173
  type: :development
160
174
  prerelease: false
161
175
  version_requirements: !ruby/object:Gem::Requirement
162
176
  requirements:
163
- - - "~>"
177
+ - - ">="
164
178
  - !ruby/object:Gem::Version
165
- version: '0.8'
179
+ version: '0'
166
180
  - !ruby/object:Gem::Dependency
167
- name: byebug
181
+ name: webmock
168
182
  requirement: !ruby/object:Gem::Requirement
169
183
  requirements:
170
184
  - - ">="
@@ -178,19 +192,33 @@ dependencies:
178
192
  - !ruby/object:Gem::Version
179
193
  version: '0'
180
194
  - !ruby/object:Gem::Dependency
181
- name: linkeddata
195
+ name: rubocop
182
196
  requirement: !ruby/object:Gem::Requirement
183
197
  requirements:
184
- - - ">="
198
+ - - "~>"
185
199
  - !ruby/object:Gem::Version
186
- version: '0'
200
+ version: 0.42.0
187
201
  type: :development
188
202
  prerelease: false
189
203
  version_requirements: !ruby/object:Gem::Requirement
190
204
  requirements:
191
- - - ">="
205
+ - - "~>"
192
206
  - !ruby/object:Gem::Version
193
- version: '0'
207
+ version: 0.42.0
208
+ - !ruby/object:Gem::Dependency
209
+ name: rubocop-rspec
210
+ requirement: !ruby/object:Gem::Requirement
211
+ requirements:
212
+ - - "~>"
213
+ - !ruby/object:Gem::Version
214
+ version: '1.5'
215
+ type: :development
216
+ prerelease: false
217
+ version_requirements: !ruby/object:Gem::Requirement
218
+ requirements:
219
+ - - "~>"
220
+ - !ruby/object:Gem::Version
221
+ version: '1.5'
194
222
  description: Provides a set of uniform RESTful routes to query any controlled vocabulary
195
223
  or set of authority terms.
196
224
  email:
@@ -331,7 +359,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
331
359
  version: '0'
332
360
  requirements: []
333
361
  rubyforge_project:
334
- rubygems_version: 2.5.1
362
+ rubygems_version: 2.6.4
335
363
  signing_key:
336
364
  specification_version: 4
337
365
  summary: You should question your authorities.