enju_ndl 0.1.0.pre7 → 0.1.0.pre8
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.
- data/lib/enju_ndl/version.rb +1 -1
- data/spec/cassette_library/enju_ndl/crd.yml +576 -0
- data/spec/cassette_library/enju_ndl/search.yml +1886 -379
- data/spec/controllers/ndl_books_controller_spec.rb +17 -0
- data/spec/dummy/config/application.rb +1 -0
- data/spec/dummy/db/test.sqlite3 +0 -0
- data/spec/models/manifestation_spec.rb +12 -0
- data/spec/models/ndl_book_spec.rb +1 -1
- data/spec/models/question_spec.rb +11 -0
- data/spec/spec_helper.rb +3 -0
- metadata +315 -295
- data/spec/dummy/db/development.sqlite3 +0 -0
@@ -21,4 +21,21 @@ describe NdlBooksController do
|
|
21
21
|
assigns(:books).should be_empty
|
22
22
|
end
|
23
23
|
end
|
24
|
+
|
25
|
+
describe "POST create" do
|
26
|
+
login_fixture_admin
|
27
|
+
use_vcr_cassette "enju_ndl/search", :record => :new_episodes
|
28
|
+
|
29
|
+
it "should create a bibliographic record if nbn is set" do
|
30
|
+
post :create, :book => {:nbn => '97024234'}
|
31
|
+
assigns(:manifestation).nbn.should eq '97024234'
|
32
|
+
response.should redirect_to manifestation_items_url(assigns(:manifestation))
|
33
|
+
end
|
34
|
+
|
35
|
+
it "should not create a bibliographic record if nbn is not set" do
|
36
|
+
post :create, :book => {:nbn => nil}
|
37
|
+
assigns(:manifestation).should be_nil
|
38
|
+
response.should redirect_to ndl_books_url
|
39
|
+
end
|
40
|
+
end
|
24
41
|
end
|
data/spec/dummy/db/test.sqlite3
CHANGED
Binary file
|
@@ -0,0 +1,12 @@
|
|
1
|
+
# -*- encoding: utf-8 -*-
|
2
|
+
require 'spec_helper'
|
3
|
+
|
4
|
+
describe Manifestation do
|
5
|
+
fixtures :all
|
6
|
+
use_vcr_cassette "enju_ndl/search", :record => :new_episodes
|
7
|
+
|
8
|
+
it "should imporrt a bibliographic record" do
|
9
|
+
manifestation = Manifestation.import_isbn('406258087X')
|
10
|
+
manifestation.should be_valid
|
11
|
+
end
|
12
|
+
end
|
@@ -11,7 +11,7 @@ describe NdlBook do
|
|
11
11
|
context "search" do
|
12
12
|
use_vcr_cassette "enju_ndl/search", :record => :new_episodes
|
13
13
|
it "should search bibliographic record" do
|
14
|
-
NdlBook.search('library system')[:total_entries].should eq
|
14
|
+
NdlBook.search('library system')[:total_entries].should eq 5188
|
15
15
|
end
|
16
16
|
|
17
17
|
it "should not distinguish double byte space from one-byte space in a query" do
|