enju_biblio 0.1.0.pre17 → 0.1.0.pre18
Sign up to get free protection for your applications and to get access to all the features.
- data/app/views/import_requests/new.html.erb +1 -1
- data/app/views/items/_form.html.erb +1 -1
- data/app/views/manifestations/_form.html.erb +1 -1
- data/app/views/manifestations/index.rdf.builder +2 -0
- data/app/views/manifestations/show.rdf.builder +1 -0
- data/app/views/resource_import_results/index.csv.erb +2 -2
- data/app/views/resource_import_results/index.html.erb +1 -1
- data/config/locales/translation_en.yml +1 -0
- data/config/locales/translation_ja.yml +1 -0
- data/lib/enju_biblio/version.rb +1 -1
- data/spec/controllers/carrier_types_controller_spec.rb +1 -0
- data/spec/controllers/import_requests_controller_spec.rb +30 -29
- data/spec/dummy/config/application.rb +1 -1
- data/spec/dummy/db/test.sqlite3 +0 -0
- data/spec/dummy/tmp/cache/4F7/F90/default_role +0 -0
- data/spec/dummy/tmp/cache/6E4/420/search_engine_all +0 -0
- data/spec/models/manifestation_spec.rb +4 -3
- data/spec/models/resource_import_file_spec.rb +140 -139
- data/spec/spec_helper.rb +4 -2
- metadata +25 -27
- data/spec/support/vcr.rb +0 -9
@@ -152,5 +152,5 @@
|
|
152
152
|
<%= hidden_field_tag :manifestation_id, @original_manifestation.id if @original_manifestation -%>
|
153
153
|
<%= f.submit %>
|
154
154
|
</div>
|
155
|
-
<%= javascript_tag("$('#
|
155
|
+
<%= javascript_tag("$(function(){$('#query').focus()})") %>
|
156
156
|
<%- end -%>
|
@@ -3,6 +3,8 @@ xml.rdf(:RDF,
|
|
3
3
|
'xmlns' => "http://purl.org/rss/1.0/",
|
4
4
|
'xmlns:rdf' => "http://www.w3.org/1999/02/22-rdf-syntax-ns#",
|
5
5
|
'xmlns:dc' => "http://purl.org/dc/elements/1.1/",
|
6
|
+
'xmlns:dcterms' => "http://purl.org/dc/terms/",
|
7
|
+
'xmlns:dcndl' => "http://ndl.go.jp/dcndl/terms/",
|
6
8
|
'xmlns:foaf' => "http://xmlns.com/foaf/0.1/",
|
7
9
|
'xmlns:prism' => "http://prismstandard.org/namespaces/basic/2.0/",
|
8
10
|
'xmlns:rdfs' =>"http://www.w3.org/2000/01/rdf-schema#"){
|
@@ -6,6 +6,7 @@ xml.rdf(:RDF,
|
|
6
6
|
'xmlns:dcterms' => "http://purl.org/dc/terms/",
|
7
7
|
'xmlns:dcndl' => "http://ndl.go.jp/dcndl/terms/",
|
8
8
|
'xmlns:foaf' => "http://xmlns.com/foaf/0.1/",
|
9
|
+
'xmlns:prism' => "http://prismstandard.org/namespaces/basic/2.0/",
|
9
10
|
'xmlns:rdfs' =>"http://www.w3.org/2000/01/rdf-schema#") do
|
10
11
|
xml << render('manifestations/show', :manifestation => @manifestation)
|
11
12
|
end
|
@@ -1,4 +1,4 @@
|
|
1
|
-
manifestation_id
|
1
|
+
manifestation_id item_id
|
2
2
|
<%- @resource_import_results.each do |resource_import_result| -%>
|
3
|
-
<%= resource_import_result.manifestation_id %>
|
3
|
+
<%= resource_import_result.manifestation_id %> <%= resource_import_result.item_id %> <%= resource_import_result.body %>
|
4
4
|
<%- end -%>
|
@@ -41,7 +41,7 @@
|
|
41
41
|
<ul>
|
42
42
|
<li>
|
43
43
|
<% if @resource_import_file %>
|
44
|
-
<%= link_to((image_tag 'icons/page_white_excel.png', :size => '16x16', :alt => '
|
44
|
+
<%= link_to((image_tag 'icons/page_white_excel.png', :size => '16x16', :alt => 'TSV', :class => 'icon'), resource_import_file_resource_import_results_path(@resource_import_file, :format => :csv, :locale => @locale.to_s)) -%>
|
45
45
|
(<%= link_to 'CSV', resource_import_file_resource_import_results_path(:format => :csv, :locale => @locale.to_s) -%>)
|
46
46
|
<% else %>
|
47
47
|
<%= link_to((image_tag 'icons/page_white_excel.png', :size => '16x16', :alt => 'CSV', :class => 'icon'), resource_import_results_path(:format => :csv, :locale => @locale.to_s)) -%>
|
data/lib/enju_biblio/version.rb
CHANGED
@@ -164,44 +164,45 @@ describe ImportRequestsController do
|
|
164
164
|
@attrs = {:isbn => '9784873114422'}
|
165
165
|
@invalid_attrs = {:isbn => 'invalid'}
|
166
166
|
end
|
167
|
-
|
167
|
+
VCR.use_cassette "enju_ndl/ndl_search", :record => :new_episodes do
|
168
168
|
|
169
|
-
|
170
|
-
|
169
|
+
describe "When logged in as Administrator" do
|
170
|
+
login_admin
|
171
171
|
|
172
|
-
|
173
|
-
|
174
|
-
|
175
|
-
|
176
|
-
|
172
|
+
describe "with valid params" do
|
173
|
+
it "assigns a newly created import_request as @import_request" do
|
174
|
+
post :create, :import_request => @attrs
|
175
|
+
assigns(:import_request).should be_valid
|
176
|
+
end
|
177
177
|
|
178
|
-
|
179
|
-
|
180
|
-
|
178
|
+
it "redirects to the created import_request" do
|
179
|
+
post :create, :import_request => @attrs
|
180
|
+
response.should redirect_to manifestation_items_url(assigns(:import_request).manifestation)
|
181
|
+
end
|
181
182
|
end
|
182
|
-
end
|
183
183
|
|
184
|
-
|
185
|
-
|
186
|
-
|
187
|
-
|
188
|
-
|
184
|
+
describe "with invalid params" do
|
185
|
+
it "assigns a newly created but unsaved import_request as @import_request" do
|
186
|
+
post :create, :import_request => @invalid_attrs
|
187
|
+
assigns(:import_request).should_not be_valid
|
188
|
+
end
|
189
189
|
|
190
|
-
|
191
|
-
|
192
|
-
|
190
|
+
it "re-renders the 'new' template" do
|
191
|
+
post :create, :import_request => @invalid_attrs
|
192
|
+
response.should render_template("new")
|
193
|
+
end
|
193
194
|
end
|
194
|
-
end
|
195
195
|
|
196
|
-
|
197
|
-
|
198
|
-
|
199
|
-
|
200
|
-
|
196
|
+
describe "with isbn which is already imported" do
|
197
|
+
it "assigns a newly created import_request as @import_request" do
|
198
|
+
post :create, :import_request => {:isbn => manifestations(:manifestation_00001).isbn}
|
199
|
+
assigns(:import_request).should be_valid
|
200
|
+
end
|
201
201
|
|
202
|
-
|
203
|
-
|
204
|
-
|
202
|
+
it "redirects to the created import_request" do
|
203
|
+
post :create, :import_request => @attrs
|
204
|
+
response.should redirect_to manifestation_items_url(assigns(:import_request).manifestation)
|
205
|
+
end
|
205
206
|
end
|
206
207
|
end
|
207
208
|
end
|
@@ -54,7 +54,6 @@ module Dummy
|
|
54
54
|
end
|
55
55
|
end
|
56
56
|
|
57
|
-
require 'enju_core'
|
58
57
|
require 'enju_library'
|
59
58
|
require 'enju_circulation'
|
60
59
|
require 'enju_inventory'
|
@@ -65,4 +64,5 @@ require 'enju_book_jacket'
|
|
65
64
|
require 'enju_export'
|
66
65
|
require 'enju_oai'
|
67
66
|
require 'enju_ndl'
|
67
|
+
require 'mobylette'
|
68
68
|
require 'plugins'
|
data/spec/dummy/db/test.sqlite3
CHANGED
Binary file
|
Binary file
|
Binary file
|
@@ -3,7 +3,6 @@ require 'spec_helper'
|
|
3
3
|
|
4
4
|
describe Manifestation, :solr => true do
|
5
5
|
fixtures :all
|
6
|
-
use_vcr_cassette "enju_ndl/manifestation", :record => :new_episodes
|
7
6
|
before do
|
8
7
|
Manifestation.reindex
|
9
8
|
end
|
@@ -201,8 +200,10 @@ describe Manifestation, :solr => true do
|
|
201
200
|
manifestations(:manifestation_00001).title.should be_true
|
202
201
|
end
|
203
202
|
|
204
|
-
|
205
|
-
|
203
|
+
VCR.use_cassette "enju_ndl/manifestation", :record => :new_episodes do
|
204
|
+
it "should import isbn" do
|
205
|
+
Manifestation.import_isbn('4797327030').should be_valid
|
206
|
+
end
|
206
207
|
end
|
207
208
|
|
208
209
|
it "should respond to pickup" do
|
@@ -1,155 +1,156 @@
|
|
1
1
|
# -*- encoding: utf-8 -*-
|
2
2
|
require 'spec_helper'
|
3
|
-
|
3
|
+
|
4
4
|
describe ResourceImportFile do
|
5
5
|
fixtures :all
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
6
|
+
VCR.use_cassette "enju_ndl/ndl_search", :record => :new_episodes do
|
7
|
+
|
8
|
+
describe "when its mode is 'create'" do
|
9
|
+
describe "when it is written in utf-8" do
|
10
|
+
before(:each) do
|
11
|
+
@file = ResourceImportFile.create :resource_import => File.new("#{Rails.root.to_s}/../../examples/resource_import_file_sample1.tsv")
|
12
|
+
end
|
13
|
+
|
14
|
+
it "should be imported" do
|
15
|
+
old_manifestations_count = Manifestation.count
|
16
|
+
old_items_count = Item.count
|
17
|
+
old_patrons_count = Patron.count
|
18
|
+
old_import_results_count = ResourceImportResult.count
|
19
|
+
@file.import_start.should eq({:manifestation_imported => 9, :item_imported => 6, :manifestation_found => 3, :item_found => 3, :failed => 7})
|
20
|
+
manifestation = Item.where(:item_identifier => '11111').first.manifestation
|
21
|
+
manifestation.publishers.first.full_name.should eq 'test4'
|
22
|
+
manifestation.publishers.first.full_name_transcription.should eq 'てすと4'
|
23
|
+
manifestation.publishers.second.full_name_transcription.should eq 'てすと5'
|
24
|
+
manifestation.produces.first.produce_type.name.should eq 'publisher'
|
25
|
+
manifestation.creates.first.create_type.name.should eq 'author'
|
26
|
+
Manifestation.count.should eq old_manifestations_count + 8
|
27
|
+
Item.count.should eq old_items_count + 6
|
28
|
+
Patron.count.should eq old_patrons_count + 6
|
29
|
+
ResourceImportResult.count.should eq old_import_results_count + 17
|
30
|
+
|
31
|
+
manifestation_101 = Manifestation.where(:manifestation_identifier => '101').first
|
32
|
+
manifestation_101.series_statement.original_title.should eq '主シリーズ'
|
33
|
+
manifestation_101.series_statement.title_transcription.should eq 'しゅしりーず'
|
34
|
+
manifestation_101.series_statement.title_subseries.should eq '副シリーズ 1'
|
35
|
+
manifestation_101.series_statement.title_subseries_transcription.should eq 'ふくしりーず いち'
|
36
|
+
|
37
|
+
item_10101 = Item.where(:item_identifier => '10101').first
|
38
|
+
item_10101.manifestation.creators.size.should eq 2
|
39
|
+
item_10101.manifestation.creates.order(:id).first.create_type.name.should eq 'author'
|
40
|
+
item_10101.manifestation.creates.order(:id).second.patron.full_name.should eq 'test1'
|
41
|
+
item_10101.manifestation.creates.order(:id).second.create_type.name.should eq 'illustrator'
|
42
|
+
item_10101.manifestation.date_of_publication.should eq Time.zone.parse('2001-01-01')
|
43
|
+
item_10101.budget_type.name.should eq 'Public fund'
|
44
|
+
item_10101.bookstore.name.should eq 'Example store'
|
45
|
+
item_10101.use_restriction.name.should eq 'Not For Loan'
|
46
|
+
Item.where(:item_identifier => '10102').first.manifestation.date_of_publication.should eq Time.zone.parse('2001-01-01')
|
47
|
+
Item.where(:item_identifier => '10104').first.manifestation.date_of_publication.should eq Time.zone.parse('2001-01-01')
|
48
|
+
Manifestation.where(:manifestation_identifier => '103').first.original_title.should eq 'ダブル"クォート"を含む資料'
|
49
|
+
item = Item.where(:item_identifier => '11111').first
|
50
|
+
Shelf.find_by_name('first_shelf').should eq item.shelf
|
51
|
+
item.manifestation.price.should eq 1000
|
52
|
+
item.price.should eq 0
|
53
|
+
item.manifestation.publishers.size.should eq 2
|
54
|
+
|
55
|
+
item_10103 = Item.where(:item_identifier => '10103').first
|
56
|
+
item_10103.budget_type.should be_nil
|
57
|
+
item_10103.bookstore.name.should eq 'Example store'
|
58
|
+
|
59
|
+
item_10104 = Item.where(:item_identifier => '10104').first
|
60
|
+
item_10104.budget_type.name.should eq 'Public fund'
|
61
|
+
item_10104.bookstore.should be_nil
|
62
|
+
|
63
|
+
manifestation_104 = Manifestation.where(:manifestation_identifier => '104').first
|
64
|
+
manifestation_104.isbn.should eq '9784797327038'
|
65
|
+
manifestation_104.original_title.should eq 'test10'
|
66
|
+
manifestation_104.creators.collect(&:full_name).should eq ['test3']
|
67
|
+
manifestation_104.publishers.collect(&:full_name).should eq ['test4']
|
68
|
+
|
69
|
+
@file.resource_import_fingerprint.should be_true
|
70
|
+
@file.executed_at.should be_true
|
71
|
+
end
|
12
72
|
end
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
Item.where(:item_identifier => '10104').first.manifestation.date_of_publication.should eq Time.zone.parse('2001-01-01')
|
48
|
-
Manifestation.where(:manifestation_identifier => '103').first.original_title.should eq 'ダブル"クォート"を含む資料'
|
49
|
-
item = Item.where(:item_identifier => '11111').first
|
50
|
-
Shelf.find_by_name('first_shelf').should eq item.shelf
|
51
|
-
item.manifestation.price.should eq 1000
|
52
|
-
item.price.should eq 0
|
53
|
-
item.manifestation.publishers.size.should eq 2
|
54
|
-
|
55
|
-
item_10103 = Item.where(:item_identifier => '10103').first
|
56
|
-
item_10103.budget_type.should be_nil
|
57
|
-
item_10103.bookstore.name.should eq 'Example store'
|
58
|
-
|
59
|
-
item_10104 = Item.where(:item_identifier => '10104').first
|
60
|
-
item_10104.budget_type.name.should eq 'Public fund'
|
61
|
-
item_10104.bookstore.should be_nil
|
62
|
-
|
63
|
-
manifestation_104 = Manifestation.where(:manifestation_identifier => '104').first
|
64
|
-
manifestation_104.isbn.should eq '9784797327038'
|
65
|
-
manifestation_104.original_title.should eq 'test10'
|
66
|
-
manifestation_104.creators.collect(&:full_name).should eq ['test3']
|
67
|
-
manifestation_104.publishers.collect(&:full_name).should eq ['test4']
|
68
|
-
|
69
|
-
@file.resource_import_fingerprint.should be_true
|
70
|
-
@file.executed_at.should be_true
|
73
|
+
|
74
|
+
describe "when it is written in shift_jis" do
|
75
|
+
before(:each) do
|
76
|
+
@file = ResourceImportFile.create :resource_import => File.new("#{Rails.root.to_s}/../../examples/resource_import_file_sample2.tsv")
|
77
|
+
end
|
78
|
+
|
79
|
+
it "should be imported" do
|
80
|
+
old_manifestations_count = Manifestation.count
|
81
|
+
old_items_count = Item.count
|
82
|
+
old_patrons_count = Patron.count
|
83
|
+
old_import_results_count = ResourceImportResult.count
|
84
|
+
@file.import_start.should eq({:manifestation_imported => 9, :item_imported => 6, :manifestation_found => 3, :item_found => 3, :failed => 7})
|
85
|
+
manifestation = Item.where(:item_identifier => '11111').first.manifestation
|
86
|
+
manifestation.publishers.first.full_name.should eq 'test4'
|
87
|
+
manifestation.publishers.first.full_name_transcription.should eq 'てすと4'
|
88
|
+
manifestation.publishers.second.full_name_transcription.should eq 'てすと5'
|
89
|
+
Manifestation.count.should eq old_manifestations_count + 8
|
90
|
+
Item.count.should eq old_items_count + 6
|
91
|
+
Patron.count.should eq old_patrons_count + 6
|
92
|
+
ResourceImportResult.count.should eq old_import_results_count + 17
|
93
|
+
Item.find_by_item_identifier('10101').manifestation.creators.size.should eq 2
|
94
|
+
Item.find_by_item_identifier('10101').manifestation.date_of_publication.should eq Time.zone.parse('2001-01-01')
|
95
|
+
Item.find_by_item_identifier('10102').manifestation.date_of_publication.should eq Time.zone.parse('2001-01-01')
|
96
|
+
Item.find_by_item_identifier('10104').manifestation.date_of_publication.should eq Time.zone.parse('2001-01-01')
|
97
|
+
Manifestation.find_by_manifestation_identifier('103').original_title.should eq 'ダブル"クォート"を含む資料'
|
98
|
+
item = Item.find_by_item_identifier('11111')
|
99
|
+
Shelf.find_by_name('first_shelf').should eq item.shelf
|
100
|
+
item.manifestation.price.should eq 1000
|
101
|
+
item.price.should eq 0
|
102
|
+
item.manifestation.publishers.size.should eq 2
|
103
|
+
|
104
|
+
@file.resource_import_fingerprint.should be_true
|
105
|
+
@file.executed_at.should be_true
|
106
|
+
end
|
71
107
|
end
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
manifestation = Item.where(:item_identifier => '11111').first.manifestation
|
86
|
-
manifestation.publishers.first.full_name.should eq 'test4'
|
87
|
-
manifestation.publishers.first.full_name_transcription.should eq 'てすと4'
|
88
|
-
manifestation.publishers.second.full_name_transcription.should eq 'てすと5'
|
89
|
-
Manifestation.count.should eq old_manifestations_count + 8
|
90
|
-
Item.count.should eq old_items_count + 6
|
91
|
-
Patron.count.should eq old_patrons_count + 6
|
92
|
-
ResourceImportResult.count.should eq old_import_results_count + 17
|
93
|
-
Item.find_by_item_identifier('10101').manifestation.creators.size.should eq 2
|
94
|
-
Item.find_by_item_identifier('10101').manifestation.date_of_publication.should eq Time.zone.parse('2001-01-01')
|
95
|
-
Item.find_by_item_identifier('10102').manifestation.date_of_publication.should eq Time.zone.parse('2001-01-01')
|
96
|
-
Item.find_by_item_identifier('10104').manifestation.date_of_publication.should eq Time.zone.parse('2001-01-01')
|
97
|
-
Manifestation.find_by_manifestation_identifier('103').original_title.should eq 'ダブル"クォート"を含む資料'
|
98
|
-
item = Item.find_by_item_identifier('11111')
|
99
|
-
Shelf.find_by_name('first_shelf').should eq item.shelf
|
100
|
-
item.manifestation.price.should eq 1000
|
101
|
-
item.price.should eq 0
|
102
|
-
item.manifestation.publishers.size.should eq 2
|
103
|
-
|
104
|
-
@file.resource_import_fingerprint.should be_true
|
105
|
-
@file.executed_at.should be_true
|
108
|
+
|
109
|
+
describe "when it has only isbn" do
|
110
|
+
before(:each) do
|
111
|
+
@file = ResourceImportFile.create :resource_import => File.new("#{Rails.root.to_s}/../../examples/isbn_sample.txt")
|
112
|
+
end
|
113
|
+
|
114
|
+
it "should be imported" do
|
115
|
+
old_manifestations_count = Manifestation.count
|
116
|
+
old_patrons_count = Patron.count
|
117
|
+
@file.import_start
|
118
|
+
Manifestation.count.should eq old_manifestations_count + 1
|
119
|
+
Patron.count.should eq old_patrons_count + 4
|
120
|
+
end
|
106
121
|
end
|
107
122
|
end
|
108
|
-
|
109
|
-
describe "when
|
110
|
-
|
111
|
-
@file = ResourceImportFile.create :resource_import => File.new("#{Rails.root.to_s}/../../examples/
|
123
|
+
|
124
|
+
describe "when its mode is 'update'" do
|
125
|
+
it "should update items" do
|
126
|
+
@file = ResourceImportFile.create :resource_import => File.new("#{Rails.root.to_s}/../../examples/item_update_file.tsv"), :edit_mode => 'update'
|
127
|
+
@file.modify
|
128
|
+
Item.where(:item_identifier => '00001').first.manifestation.creators.order('patrons.id').collect(&:full_name).should eq ['たなべ', 'こうすけ']
|
129
|
+
Item.where(:item_identifier => '00002').first.manifestation.publishers.collect(&:full_name).should eq ['test2']
|
130
|
+
Item.where(:item_identifier => '00003').first.manifestation.original_title.should eq 'テスト3'
|
131
|
+
Item.where(:item_identifier => '00003').first.acquired_at.should eq Time.zone.parse('2012-01-01')
|
112
132
|
end
|
113
|
-
|
114
|
-
it "should
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
133
|
+
|
134
|
+
it "should update series_statement" do
|
135
|
+
manifestation = Manifestation.find(10)
|
136
|
+
file = ResourceImportFile.create :resource_import => File.new("#{Rails.root.to_s}/../../examples/update_series_statement.tsv"), :edit_mode => 'update'
|
137
|
+
file.modify
|
138
|
+
manifestation.reload
|
139
|
+
manifestation.series_statement.should eq SeriesStatement.find(2)
|
120
140
|
end
|
121
141
|
end
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
Item.where(:item_identifier => '00003').first.manifestation.original_title.should eq 'テスト3'
|
131
|
-
Item.where(:item_identifier => '00003').first.acquired_at.should eq Time.zone.parse('2012-01-01')
|
132
|
-
end
|
133
|
-
|
134
|
-
it "should update series_statement" do
|
135
|
-
manifestation = Manifestation.find(10)
|
136
|
-
file = ResourceImportFile.create :resource_import => File.new("#{Rails.root.to_s}/../../examples/update_series_statement.tsv"), :edit_mode => 'update'
|
137
|
-
file.modify
|
138
|
-
manifestation.reload
|
139
|
-
manifestation.series_statement.should eq SeriesStatement.find(2)
|
140
|
-
end
|
141
|
-
end
|
142
|
-
|
143
|
-
describe "when its mode is 'destroy'" do
|
144
|
-
it "should remove items" do
|
145
|
-
old_count = Item.count
|
146
|
-
@file = ResourceImportFile.create :resource_import => File.new("#{Rails.root.to_s}/../../examples/item_delete_file.tsv"), :edit_mode => 'destroy'
|
147
|
-
@file.remove
|
148
|
-
Item.count.should eq old_count - 2
|
142
|
+
|
143
|
+
describe "when its mode is 'destroy'" do
|
144
|
+
it "should remove items" do
|
145
|
+
old_count = Item.count
|
146
|
+
@file = ResourceImportFile.create :resource_import => File.new("#{Rails.root.to_s}/../../examples/item_delete_file.tsv"), :edit_mode => 'destroy'
|
147
|
+
@file.remove
|
148
|
+
Item.count.should eq old_count - 2
|
149
|
+
end
|
149
150
|
end
|
150
151
|
end
|
151
152
|
end
|
152
|
-
|
153
|
+
|
153
154
|
# == Schema Information
|
154
155
|
#
|
155
156
|
# Table name: resource_import_files
|
@@ -172,4 +173,4 @@ end
|
|
172
173
|
# resource_import_fingerprint :string(255)
|
173
174
|
# error_message :text
|
174
175
|
#
|
175
|
-
|
176
|
+
|
data/spec/spec_helper.rb
CHANGED
@@ -38,8 +38,6 @@ RSpec.configure do |config|
|
|
38
38
|
|
39
39
|
config.extend ControllerMacros, :type => :controller
|
40
40
|
|
41
|
-
config.extend VCR::RSpec::Macros
|
42
|
-
|
43
41
|
$original_sunspot_session = Sunspot.session
|
44
42
|
|
45
43
|
config.before do
|
@@ -55,3 +53,7 @@ end
|
|
55
53
|
|
56
54
|
FactoryGirl.definition_file_paths << "#{::Rails.root}/../../spec/factories"
|
57
55
|
FactoryGirl.find_definitions
|
56
|
+
|
57
|
+
VCR.configure do |c|
|
58
|
+
c.allow_http_connections_when_no_cassette = true
|
59
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: enju_biblio
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.0.
|
4
|
+
version: 0.1.0.pre18
|
5
5
|
prerelease: 6
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2013-02-
|
12
|
+
date: 2013-02-24 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rails
|
@@ -347,22 +347,6 @@ dependencies:
|
|
347
347
|
- - ! '>='
|
348
348
|
- !ruby/object:Gem::Version
|
349
349
|
version: '0'
|
350
|
-
- !ruby/object:Gem::Dependency
|
351
|
-
name: fakeweb
|
352
|
-
requirement: !ruby/object:Gem::Requirement
|
353
|
-
none: false
|
354
|
-
requirements:
|
355
|
-
- - ! '>='
|
356
|
-
- !ruby/object:Gem::Version
|
357
|
-
version: '0'
|
358
|
-
type: :development
|
359
|
-
prerelease: false
|
360
|
-
version_requirements: !ruby/object:Gem::Requirement
|
361
|
-
none: false
|
362
|
-
requirements:
|
363
|
-
- - ! '>='
|
364
|
-
- !ruby/object:Gem::Version
|
365
|
-
version: '0'
|
366
350
|
- !ruby/object:Gem::Dependency
|
367
351
|
name: sunspot_solr
|
368
352
|
requirement: !ruby/object:Gem::Requirement
|
@@ -386,7 +370,7 @@ dependencies:
|
|
386
370
|
requirements:
|
387
371
|
- - ~>
|
388
372
|
- !ruby/object:Gem::Version
|
389
|
-
version: 0.1.0.
|
373
|
+
version: 0.1.0.pre8
|
390
374
|
type: :development
|
391
375
|
prerelease: false
|
392
376
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -394,7 +378,7 @@ dependencies:
|
|
394
378
|
requirements:
|
395
379
|
- - ~>
|
396
380
|
- !ruby/object:Gem::Version
|
397
|
-
version: 0.1.0.
|
381
|
+
version: 0.1.0.pre8
|
398
382
|
- !ruby/object:Gem::Dependency
|
399
383
|
name: enju_inventory
|
400
384
|
requirement: !ruby/object:Gem::Requirement
|
@@ -466,7 +450,7 @@ dependencies:
|
|
466
450
|
requirements:
|
467
451
|
- - ~>
|
468
452
|
- !ruby/object:Gem::Version
|
469
|
-
version: 0.1.0.
|
453
|
+
version: 0.1.0.pre4
|
470
454
|
type: :development
|
471
455
|
prerelease: false
|
472
456
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -474,7 +458,7 @@ dependencies:
|
|
474
458
|
requirements:
|
475
459
|
- - ~>
|
476
460
|
- !ruby/object:Gem::Version
|
477
|
-
version: 0.1.0.
|
461
|
+
version: 0.1.0.pre4
|
478
462
|
- !ruby/object:Gem::Dependency
|
479
463
|
name: enju_export
|
480
464
|
requirement: !ruby/object:Gem::Requirement
|
@@ -514,7 +498,7 @@ dependencies:
|
|
514
498
|
requirements:
|
515
499
|
- - ~>
|
516
500
|
- !ruby/object:Gem::Version
|
517
|
-
version: 0.1.0.
|
501
|
+
version: 0.1.0.pre7
|
518
502
|
type: :development
|
519
503
|
prerelease: false
|
520
504
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -522,7 +506,7 @@ dependencies:
|
|
522
506
|
requirements:
|
523
507
|
- - ~>
|
524
508
|
- !ruby/object:Gem::Version
|
525
|
-
version: 0.1.0.
|
509
|
+
version: 0.1.0.pre7
|
526
510
|
- !ruby/object:Gem::Dependency
|
527
511
|
name: enju_ndl
|
528
512
|
requirement: !ruby/object:Gem::Requirement
|
@@ -539,6 +523,22 @@ dependencies:
|
|
539
523
|
- - ~>
|
540
524
|
- !ruby/object:Gem::Version
|
541
525
|
version: 0.1.0.pre8
|
526
|
+
- !ruby/object:Gem::Dependency
|
527
|
+
name: mobylette
|
528
|
+
requirement: !ruby/object:Gem::Requirement
|
529
|
+
none: false
|
530
|
+
requirements:
|
531
|
+
- - ! '>='
|
532
|
+
- !ruby/object:Gem::Version
|
533
|
+
version: '0'
|
534
|
+
type: :development
|
535
|
+
prerelease: false
|
536
|
+
version_requirements: !ruby/object:Gem::Requirement
|
537
|
+
none: false
|
538
|
+
requirements:
|
539
|
+
- - ! '>='
|
540
|
+
- !ruby/object:Gem::Version
|
541
|
+
version: '0'
|
542
542
|
- !ruby/object:Gem::Dependency
|
543
543
|
name: simplecov
|
544
544
|
requirement: !ruby/object:Gem::Requirement
|
@@ -1380,7 +1380,6 @@ files:
|
|
1380
1380
|
- spec/spec_helper.rb
|
1381
1381
|
- spec/support/controller_macros.rb
|
1382
1382
|
- spec/support/devise.rb
|
1383
|
-
- spec/support/vcr.rb
|
1384
1383
|
- spec/views/create_types/edit.html.erb_spec.rb
|
1385
1384
|
- spec/views/create_types/index.html.erb_spec.rb
|
1386
1385
|
- spec/views/create_types/new.html.erb_spec.rb
|
@@ -1436,7 +1435,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
1436
1435
|
version: '0'
|
1437
1436
|
segments:
|
1438
1437
|
- 0
|
1439
|
-
hash:
|
1438
|
+
hash: 4384560399090921622
|
1440
1439
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
1441
1440
|
none: false
|
1442
1441
|
requirements:
|
@@ -1811,7 +1810,6 @@ test_files:
|
|
1811
1810
|
- spec/spec_helper.rb
|
1812
1811
|
- spec/support/controller_macros.rb
|
1813
1812
|
- spec/support/devise.rb
|
1814
|
-
- spec/support/vcr.rb
|
1815
1813
|
- spec/views/create_types/edit.html.erb_spec.rb
|
1816
1814
|
- spec/views/create_types/index.html.erb_spec.rb
|
1817
1815
|
- spec/views/create_types/new.html.erb_spec.rb
|