qa 0.4.0 → 0.4.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/qa/authorities/getty.rb +15 -3
- data/lib/qa/authorities/web_service_base.rb +5 -1
- data/lib/qa/version.rb +1 -1
- data/spec/internal/db/development.sqlite3 +0 -0
- data/spec/internal/log/development.log +1127 -0
- data/spec/lib/authorities_getty_spec.rb +20 -3
- metadata +2 -2
@@ -35,7 +35,6 @@ describe Qa::Authorities::Getty do
|
|
35
35
|
context "authorities" do
|
36
36
|
before do
|
37
37
|
stub_request(:get, /vocab\.getty\.edu.*/).
|
38
|
-
with(:headers => {'Accept'=>'application/json'}).
|
39
38
|
to_return(:body => webmock_fixture("aat-response.txt"), :status => 200)
|
40
39
|
end
|
41
40
|
|
@@ -49,14 +48,27 @@ describe Qa::Authorities::Getty do
|
|
49
48
|
end
|
50
49
|
end
|
51
50
|
|
51
|
+
describe "#untaint" do
|
52
|
+
subject { authority.untaint(value) }
|
53
|
+
|
54
|
+
context "with a good string" do
|
55
|
+
let(:value) { 'Water-color paint' }
|
56
|
+
it { is_expected.to eq 'Water-color paint' }
|
57
|
+
end
|
58
|
+
|
59
|
+
context "bad stuff" do
|
60
|
+
let(:value) { './"' }
|
61
|
+
it { is_expected.to eq '' }
|
62
|
+
end
|
63
|
+
end
|
64
|
+
|
52
65
|
describe "#find" do
|
53
66
|
context "using a subject id" do
|
54
67
|
before do
|
55
68
|
stub_request(:get, "http://vocab.getty.edu/aat/300265560.json").
|
56
|
-
with(headers: { 'Accept'=>'application/json' }).
|
57
69
|
to_return(status: 200, body: webmock_fixture("getty-aat-find-response.json"))
|
58
70
|
end
|
59
|
-
subject {
|
71
|
+
subject { authority.find("300265560") }
|
60
72
|
|
61
73
|
it "returns the complete record for a given subject" do
|
62
74
|
expect(subject['results']['bindings'].size).to eq 189
|
@@ -67,5 +79,10 @@ describe Qa::Authorities::Getty do
|
|
67
79
|
end
|
68
80
|
end
|
69
81
|
|
82
|
+
describe "#request_options" do
|
83
|
+
subject { authority.request_options }
|
84
|
+
it { is_expected.to eq({}) }
|
85
|
+
end
|
86
|
+
|
70
87
|
end
|
71
88
|
|
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.4.
|
4
|
+
version: 0.4.1
|
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: 2015-03-
|
18
|
+
date: 2015-03-13 00:00:00.000000000 Z
|
19
19
|
dependencies:
|
20
20
|
- !ruby/object:Gem::Dependency
|
21
21
|
name: rails
|