enju_biblio 0.1.0.pre34 → 0.1.0.pre35
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/controllers/manifestations_controller.rb +29 -14
- data/app/models/manifestation.rb +30 -17
- data/app/models/page_sweeper.rb +1 -1
- data/app/models/series_statement.rb +3 -17
- data/app/views/manifestations/_form.html.erb +14 -3
- data/app/views/manifestations/_index_form_parent.html.erb +21 -0
- data/app/views/manifestations/_manifestation.html.erb +12 -12
- data/app/views/manifestations/_show_detail_librarian.html.erb +5 -1
- data/app/views/manifestations/_show_parent.html.erb +26 -0
- data/app/views/manifestations/_show_series_index.html.erb +1 -1
- data/app/views/manifestations/_show_series_statement.html.erb +2 -2
- data/app/views/manifestations/_submenu_parent.html.erb +8 -0
- data/app/views/manifestations/index.html.erb +6 -6
- data/app/views/series_statements/index.html.erb +1 -5
- data/config/locales/translation_en.yml +3 -0
- data/config/locales/translation_ja.yml +3 -0
- data/db/migrate/20130429020822_add_root_manifestation_id_to_series_statement.rb +6 -0
- data/lib/enju_biblio/version.rb +1 -1
- data/spec/cassette_library/ImportRequest/import/should_import_bibliographic_record.yml +44 -50
- data/spec/cassette_library/ImportRequestsController/POST_create/When_logged_in_as_Administrator/with_isbn_which_is_already_imported/redirects_to_the_created_import_request.yml +44 -50
- data/spec/cassette_library/ImportRequestsController/POST_create/When_logged_in_as_Administrator/with_valid_params/assigns_a_newly_created_import_request_as_import_request.yml +43 -49
- data/spec/cassette_library/ImportRequestsController/POST_create/When_logged_in_as_Administrator/with_valid_params/redirects_to_the_created_import_request.yml +43 -49
- data/spec/cassette_library/ImportRequestsController/POST_create/When_logged_in_as_Librarian/with_valid_params/assigns_a_newly_created_import_request_as_import_request.yml +43 -49
- data/spec/cassette_library/ImportRequestsController/POST_create/When_logged_in_as_Librarian/with_valid_params/redirects_to_the_created_import_request.yml +43 -49
- data/spec/cassette_library/Manifestation/should_import_isbn.yml +3643 -0
- data/spec/dummy/app/models/ability.rb +4 -8
- data/spec/dummy/db/development.sqlite3 +0 -0
- data/spec/dummy/db/schema.rb +3 -12
- data/spec/dummy/db/test.sqlite3 +0 -0
- data/spec/dummy/solr/data/test/index/segments.gen +0 -0
- data/spec/dummy/solr/data/test/index/segments_iwe +0 -0
- data/spec/dummy/tmp/cache/4AD/470/country_all +0 -0
- data/spec/fixtures/manifestations.yml +11 -9
- data/spec/fixtures/series_statements.yml +15 -2
- data/spec/models/manifestation_spec.rb +3 -5
- data/spec/models/series_statement_spec.rb +1 -3
- metadata +10 -30
- data/app/controllers/series_has_manifestations_controller.rb +0 -101
- data/app/models/series_has_manifestation.rb +0 -35
- data/app/views/manifestations/_serial_form.html.erb +0 -14
- data/app/views/manifestations/_submenu_series_statement.html.erb +0 -9
- data/app/views/series_has_manifestations/_form.html.erb +0 -27
- data/app/views/series_has_manifestations/edit.html.erb +0 -15
- data/app/views/series_has_manifestations/index.html.erb +0 -34
- data/app/views/series_has_manifestations/new.html.erb +0 -14
- data/app/views/series_has_manifestations/show.html.erb +0 -23
- data/db/migrate/20110820131417_create_series_has_manifestations.rb +0 -13
- data/spec/controllers/series_has_manifestations_controller_spec.rb +0 -443
- data/spec/dummy/solr/data/test/index/segments_gs2 +0 -0
- data/spec/fixtures/series_has_manifestations.yml +0 -35
- data/spec/models/series_has_manifestation_spec.rb +0 -21
- data/spec/routing/series_has_manifestations_routing_spec.rb +0 -35
- data/spec/views/series_has_manifestations/edit.html.erb_spec.rb +0 -21
- data/spec/views/series_has_manifestations/index.html.erb_spec.rb +0 -31
- data/spec/views/series_has_manifestations/new.html.erb_spec.rb +0 -21
- data/spec/views/series_has_manifestations/show.html.erb_spec.rb +0 -21
@@ -1,34 +0,0 @@
|
|
1
|
-
<div id="content_detail" class="ui-corner-all">
|
2
|
-
<h1 class="title"><%= t('page.listing', :model => t('activerecord.models.series_has_manifestation')) -%></h1>
|
3
|
-
<div id="content_list">
|
4
|
-
|
5
|
-
<table class="table table-striped index">
|
6
|
-
<tr>
|
7
|
-
<th><%= t('activerecord.models.series_statement') -%></th>
|
8
|
-
<th><%= t('activerecord.models.manifestation') -%></th>
|
9
|
-
<th></th>
|
10
|
-
</tr>
|
11
|
-
|
12
|
-
<% @series_has_manifestations.each do |series_has_manifestation| %>
|
13
|
-
<tr class="line<%= cycle("0", "1") -%>">
|
14
|
-
<td><%= link_to series_has_manifestation.series_statement.original_title, series_has_manifestation.series_statement %></td>
|
15
|
-
<td><%= link_to series_has_manifestation.manifestation.original_title, series_has_manifestation.manifestation %></td>
|
16
|
-
<td>
|
17
|
-
<%= link_to t('page.show'), series_has_manifestation %>
|
18
|
-
<%= link_to t('page.edit'), edit_series_has_manifestation_path(series_has_manifestation) %>
|
19
|
-
<%= link_to t('page.destroy'), series_has_manifestation, :data => {:confirm => t('page.are_you_sure')}, :method => :delete %>
|
20
|
-
</td>
|
21
|
-
</tr>
|
22
|
-
<% end %>
|
23
|
-
</table>
|
24
|
-
|
25
|
-
<%= paginate(@series_has_manifestations) %>
|
26
|
-
|
27
|
-
</div>
|
28
|
-
</div>
|
29
|
-
|
30
|
-
<div id="submenu" class="ui-corner-all">
|
31
|
-
<ul>
|
32
|
-
<li><%= link_to t('page.new', :model => t('activerecord.models.series_has_manifestation')), new_series_has_manifestation_path -%></li>
|
33
|
-
</ul>
|
34
|
-
</div>
|
@@ -1,14 +0,0 @@
|
|
1
|
-
<div id="content_detail" class="ui-corner-all">
|
2
|
-
<h1 class="title"><%= t('page.new', :model => t('activerecord.models.series_has_manifestation')) -%></h1>
|
3
|
-
<div id="content_list">
|
4
|
-
|
5
|
-
<%= render 'form' %>
|
6
|
-
|
7
|
-
</div>
|
8
|
-
</div>
|
9
|
-
|
10
|
-
<div id="submenu" class="ui-corner-all">
|
11
|
-
<ul>
|
12
|
-
<li><%= link_to t('page.back'), series_has_manifestations_path %></li>
|
13
|
-
</ul>
|
14
|
-
</div>
|
@@ -1,23 +0,0 @@
|
|
1
|
-
<div id="content_detail" class="ui-corner-all">
|
2
|
-
<h1 class="title"><%= t('page.showing', :model => t('activerecord.models.series_has_manifestation')) -%></h1>
|
3
|
-
<div id="content_list">
|
4
|
-
<p id="notice"><%= notice %></p>
|
5
|
-
|
6
|
-
<p>
|
7
|
-
<b><%= t('activerecord.models.series_statement') %>:</b>
|
8
|
-
<%= link_to @series_has_manifestation.series_statement.original_title, @series_has_manifestation.series_statement %>
|
9
|
-
</p>
|
10
|
-
|
11
|
-
<p>
|
12
|
-
<b><%= t('activerecord.models.manifestation') %>:</b>
|
13
|
-
<%= link_to @series_has_manifestation.manifestation.original_title, @series_has_manifestation.manifestation %>
|
14
|
-
</p>
|
15
|
-
|
16
|
-
</div>
|
17
|
-
</div>
|
18
|
-
|
19
|
-
<div id="submenu" class="ui-corner-all">
|
20
|
-
<ul>
|
21
|
-
<li><%= back_to_index(flash[:page_info]) %></li>
|
22
|
-
</ul>
|
23
|
-
</div>
|
@@ -1,13 +0,0 @@
|
|
1
|
-
class CreateSeriesHasManifestations < ActiveRecord::Migration
|
2
|
-
def change
|
3
|
-
create_table :series_has_manifestations do |t|
|
4
|
-
t.integer :series_statement_id
|
5
|
-
t.integer :manifestation_id
|
6
|
-
t.integer :position
|
7
|
-
|
8
|
-
t.timestamps
|
9
|
-
end
|
10
|
-
add_index :series_has_manifestations, :series_statement_id
|
11
|
-
add_index :series_has_manifestations, :manifestation_id
|
12
|
-
end
|
13
|
-
end
|
@@ -1,443 +0,0 @@
|
|
1
|
-
require 'spec_helper'
|
2
|
-
require 'sunspot/rails/spec_helper'
|
3
|
-
|
4
|
-
describe SeriesHasManifestationsController do
|
5
|
-
fixtures :series_has_manifestations
|
6
|
-
disconnect_sunspot
|
7
|
-
|
8
|
-
def valid_attributes
|
9
|
-
FactoryGirl.attributes_for(:series_has_manifestation)
|
10
|
-
end
|
11
|
-
|
12
|
-
def mock_series_has_manifestation(stubs={})
|
13
|
-
@mock_series_has_manifestation ||= mock_model(SeriesHasManifestation, stubs).as_null_object
|
14
|
-
end
|
15
|
-
|
16
|
-
describe "GET index" do
|
17
|
-
describe "When logged in as Administrator" do
|
18
|
-
login_admin
|
19
|
-
|
20
|
-
it "assigns all series_has_manifestations as @series_has_manifestations" do
|
21
|
-
get :index
|
22
|
-
assigns(:series_has_manifestations).should eq(SeriesHasManifestation.page(1))
|
23
|
-
end
|
24
|
-
end
|
25
|
-
|
26
|
-
describe "When logged in as Librarian" do
|
27
|
-
login_librarian
|
28
|
-
|
29
|
-
it "assigns all series_has_manifestations as @series_has_manifestations" do
|
30
|
-
get :index
|
31
|
-
assigns(:series_has_manifestations).should eq(SeriesHasManifestation.page(1))
|
32
|
-
end
|
33
|
-
end
|
34
|
-
|
35
|
-
describe "When logged in as User" do
|
36
|
-
login_user
|
37
|
-
|
38
|
-
it "assigns all series_has_manifestations as @series_has_manifestations" do
|
39
|
-
get :index
|
40
|
-
assigns(:series_has_manifestations).should eq(SeriesHasManifestation.page(1))
|
41
|
-
end
|
42
|
-
end
|
43
|
-
|
44
|
-
describe "When not logged in" do
|
45
|
-
it "assigns all series_has_manifestations as @series_has_manifestations" do
|
46
|
-
get :index
|
47
|
-
assigns(:series_has_manifestations).should eq(SeriesHasManifestation.page(1))
|
48
|
-
end
|
49
|
-
end
|
50
|
-
end
|
51
|
-
|
52
|
-
describe "GET show" do
|
53
|
-
describe "When logged in as Administrator" do
|
54
|
-
login_admin
|
55
|
-
|
56
|
-
it "assigns the requested series_has_manifestation as @series_has_manifestation" do
|
57
|
-
series_has_manifestation = FactoryGirl.create(:series_has_manifestation)
|
58
|
-
get :show, :id => series_has_manifestation.id
|
59
|
-
assigns(:series_has_manifestation).should eq(series_has_manifestation)
|
60
|
-
end
|
61
|
-
end
|
62
|
-
|
63
|
-
describe "When logged in as Librarian" do
|
64
|
-
login_librarian
|
65
|
-
|
66
|
-
it "assigns the requested series_has_manifestation as @series_has_manifestation" do
|
67
|
-
series_has_manifestation = FactoryGirl.create(:series_has_manifestation)
|
68
|
-
get :show, :id => series_has_manifestation.id
|
69
|
-
assigns(:series_has_manifestation).should eq(series_has_manifestation)
|
70
|
-
end
|
71
|
-
end
|
72
|
-
|
73
|
-
describe "When logged in as User" do
|
74
|
-
login_user
|
75
|
-
|
76
|
-
it "assigns the requested series_has_manifestation as @series_has_manifestation" do
|
77
|
-
series_has_manifestation = FactoryGirl.create(:series_has_manifestation)
|
78
|
-
get :show, :id => series_has_manifestation.id
|
79
|
-
assigns(:series_has_manifestation).should eq(series_has_manifestation)
|
80
|
-
end
|
81
|
-
end
|
82
|
-
|
83
|
-
describe "When not logged in" do
|
84
|
-
it "assigns the requested series_has_manifestation as @series_has_manifestation" do
|
85
|
-
series_has_manifestation = FactoryGirl.create(:series_has_manifestation)
|
86
|
-
get :show, :id => series_has_manifestation.id
|
87
|
-
assigns(:series_has_manifestation).should eq(series_has_manifestation)
|
88
|
-
end
|
89
|
-
end
|
90
|
-
end
|
91
|
-
|
92
|
-
describe "GET new" do
|
93
|
-
describe "When logged in as Administrator" do
|
94
|
-
login_admin
|
95
|
-
|
96
|
-
it "assigns the requested series_has_manifestation as @series_has_manifestation" do
|
97
|
-
get :new
|
98
|
-
assigns(:series_has_manifestation).should_not be_valid
|
99
|
-
end
|
100
|
-
end
|
101
|
-
|
102
|
-
describe "When logged in as Librarian" do
|
103
|
-
login_librarian
|
104
|
-
|
105
|
-
it "assigns the requested series_has_manifestation as @series_has_manifestation" do
|
106
|
-
get :new
|
107
|
-
assigns(:series_has_manifestation).should_not be_valid
|
108
|
-
end
|
109
|
-
end
|
110
|
-
|
111
|
-
describe "When logged in as User" do
|
112
|
-
login_user
|
113
|
-
|
114
|
-
it "should not assign the requested series_has_manifestation as @series_has_manifestation" do
|
115
|
-
get :new
|
116
|
-
assigns(:series_has_manifestation).should_not be_valid
|
117
|
-
response.should be_forbidden
|
118
|
-
end
|
119
|
-
end
|
120
|
-
|
121
|
-
describe "When not logged in" do
|
122
|
-
it "should not assign the requested series_has_manifestation as @series_has_manifestation" do
|
123
|
-
get :new
|
124
|
-
assigns(:series_has_manifestation).should_not be_valid
|
125
|
-
response.should redirect_to(new_user_session_url)
|
126
|
-
end
|
127
|
-
end
|
128
|
-
end
|
129
|
-
|
130
|
-
describe "GET edit" do
|
131
|
-
describe "When logged in as Administrator" do
|
132
|
-
login_admin
|
133
|
-
|
134
|
-
it "assigns the requested series_has_manifestation as @series_has_manifestation" do
|
135
|
-
series_has_manifestation = FactoryGirl.create(:series_has_manifestation)
|
136
|
-
get :edit, :id => series_has_manifestation.id
|
137
|
-
assigns(:series_has_manifestation).should eq(series_has_manifestation)
|
138
|
-
end
|
139
|
-
end
|
140
|
-
|
141
|
-
describe "When logged in as Librarian" do
|
142
|
-
login_librarian
|
143
|
-
|
144
|
-
it "assigns the requested series_has_manifestation as @series_has_manifestation" do
|
145
|
-
series_has_manifestation = FactoryGirl.create(:series_has_manifestation)
|
146
|
-
get :edit, :id => series_has_manifestation.id
|
147
|
-
assigns(:series_has_manifestation).should eq(series_has_manifestation)
|
148
|
-
end
|
149
|
-
end
|
150
|
-
|
151
|
-
describe "When logged in as User" do
|
152
|
-
login_user
|
153
|
-
|
154
|
-
it "assigns the requested series_has_manifestation as @series_has_manifestation" do
|
155
|
-
series_has_manifestation = FactoryGirl.create(:series_has_manifestation)
|
156
|
-
get :edit, :id => series_has_manifestation.id
|
157
|
-
response.should be_forbidden
|
158
|
-
end
|
159
|
-
end
|
160
|
-
|
161
|
-
describe "When not logged in" do
|
162
|
-
it "should not assign the requested series_has_manifestation as @series_has_manifestation" do
|
163
|
-
series_has_manifestation = FactoryGirl.create(:series_has_manifestation)
|
164
|
-
get :edit, :id => series_has_manifestation.id
|
165
|
-
response.should redirect_to(new_user_session_url)
|
166
|
-
end
|
167
|
-
end
|
168
|
-
end
|
169
|
-
|
170
|
-
describe "POST create" do
|
171
|
-
before(:each) do
|
172
|
-
@attrs = valid_attributes
|
173
|
-
@invalid_attrs = {:manifestation_id => ''}
|
174
|
-
end
|
175
|
-
|
176
|
-
describe "When logged in as Administrator" do
|
177
|
-
login_admin
|
178
|
-
|
179
|
-
describe "with valid params" do
|
180
|
-
it "assigns a newly created series_has_manifestation as @series_has_manifestation" do
|
181
|
-
post :create, :series_has_manifestation => @attrs
|
182
|
-
assigns(:series_has_manifestation).should be_valid
|
183
|
-
end
|
184
|
-
|
185
|
-
it "redirects to the created series_has_manifestation" do
|
186
|
-
post :create, :series_has_manifestation => @attrs
|
187
|
-
response.should redirect_to(series_has_manifestation_url(assigns(:series_has_manifestation)))
|
188
|
-
end
|
189
|
-
end
|
190
|
-
|
191
|
-
describe "with invalid params" do
|
192
|
-
it "assigns a newly created but unsaved series_has_manifestation as @series_has_manifestation" do
|
193
|
-
post :create, :series_has_manifestation => @invalid_attrs
|
194
|
-
assigns(:series_has_manifestation).should_not be_valid
|
195
|
-
end
|
196
|
-
|
197
|
-
it "re-renders the 'new' template" do
|
198
|
-
post :create, :series_has_manifestation => @invalid_attrs
|
199
|
-
response.should render_template("new")
|
200
|
-
end
|
201
|
-
end
|
202
|
-
end
|
203
|
-
|
204
|
-
describe "When logged in as Librarian" do
|
205
|
-
login_librarian
|
206
|
-
|
207
|
-
describe "with valid params" do
|
208
|
-
it "assigns a newly created series_has_manifestation as @series_has_manifestation" do
|
209
|
-
post :create, :series_has_manifestation => @attrs
|
210
|
-
assigns(:series_has_manifestation).should be_valid
|
211
|
-
end
|
212
|
-
|
213
|
-
it "redirects to the created series_has_manifestation" do
|
214
|
-
post :create, :series_has_manifestation => @attrs
|
215
|
-
response.should redirect_to(series_has_manifestation_url(assigns(:series_has_manifestation)))
|
216
|
-
end
|
217
|
-
end
|
218
|
-
|
219
|
-
describe "with invalid params" do
|
220
|
-
it "assigns a newly created but unsaved series_has_manifestation as @series_has_manifestation" do
|
221
|
-
post :create, :series_has_manifestation => @invalid_attrs
|
222
|
-
assigns(:series_has_manifestation).should_not be_valid
|
223
|
-
end
|
224
|
-
|
225
|
-
it "re-renders the 'new' template" do
|
226
|
-
post :create, :series_has_manifestation => @invalid_attrs
|
227
|
-
response.should render_template("new")
|
228
|
-
end
|
229
|
-
end
|
230
|
-
end
|
231
|
-
|
232
|
-
describe "When logged in as User" do
|
233
|
-
login_user
|
234
|
-
|
235
|
-
describe "with valid params" do
|
236
|
-
it "assigns a newly created series_has_manifestation as @series_has_manifestation" do
|
237
|
-
post :create, :series_has_manifestation => @attrs
|
238
|
-
assigns(:series_has_manifestation).should be_valid
|
239
|
-
end
|
240
|
-
|
241
|
-
it "should be forbidden" do
|
242
|
-
post :create, :series_has_manifestation => @attrs
|
243
|
-
response.should be_forbidden
|
244
|
-
end
|
245
|
-
end
|
246
|
-
|
247
|
-
describe "with invalid params" do
|
248
|
-
it "assigns a newly created but unsaved series_has_manifestation as @series_has_manifestation" do
|
249
|
-
post :create, :series_has_manifestation => @invalid_attrs
|
250
|
-
assigns(:series_has_manifestation).should_not be_valid
|
251
|
-
end
|
252
|
-
|
253
|
-
it "should be forbidden" do
|
254
|
-
post :create, :series_has_manifestation => @invalid_attrs
|
255
|
-
response.should be_forbidden
|
256
|
-
end
|
257
|
-
end
|
258
|
-
end
|
259
|
-
|
260
|
-
describe "When not logged in" do
|
261
|
-
describe "with valid params" do
|
262
|
-
it "assigns a newly created series_has_manifestation as @series_has_manifestation" do
|
263
|
-
post :create, :series_has_manifestation => @attrs
|
264
|
-
assigns(:series_has_manifestation).should be_valid
|
265
|
-
end
|
266
|
-
|
267
|
-
it "should be forbidden" do
|
268
|
-
post :create, :series_has_manifestation => @attrs
|
269
|
-
response.should redirect_to(new_user_session_url)
|
270
|
-
end
|
271
|
-
end
|
272
|
-
|
273
|
-
describe "with invalid params" do
|
274
|
-
it "assigns a newly created but unsaved series_has_manifestation as @series_has_manifestation" do
|
275
|
-
post :create, :series_has_manifestation => @invalid_attrs
|
276
|
-
assigns(:series_has_manifestation).should_not be_valid
|
277
|
-
end
|
278
|
-
|
279
|
-
it "should be forbidden" do
|
280
|
-
post :create, :series_has_manifestation => @invalid_attrs
|
281
|
-
response.should redirect_to(new_user_session_url)
|
282
|
-
end
|
283
|
-
end
|
284
|
-
end
|
285
|
-
end
|
286
|
-
|
287
|
-
describe "PUT update" do
|
288
|
-
before(:each) do
|
289
|
-
@series_has_manifestation = FactoryGirl.create(:series_has_manifestation)
|
290
|
-
@attrs = valid_attributes
|
291
|
-
@invalid_attrs = {:manifestation_id => ''}
|
292
|
-
end
|
293
|
-
|
294
|
-
describe "When logged in as Administrator" do
|
295
|
-
login_admin
|
296
|
-
|
297
|
-
describe "with valid params" do
|
298
|
-
it "updates the requested series_has_manifestation" do
|
299
|
-
put :update, :id => @series_has_manifestation.id, :series_has_manifestation => @attrs
|
300
|
-
end
|
301
|
-
|
302
|
-
it "assigns the requested series_has_manifestation as @series_has_manifestation" do
|
303
|
-
put :update, :id => @series_has_manifestation.id, :series_has_manifestation => @attrs
|
304
|
-
assigns(:series_has_manifestation).should eq(@series_has_manifestation)
|
305
|
-
end
|
306
|
-
end
|
307
|
-
|
308
|
-
describe "with invalid params" do
|
309
|
-
it "assigns the requested series_has_manifestation as @series_has_manifestation" do
|
310
|
-
put :update, :id => @series_has_manifestation.id, :series_has_manifestation => @invalid_attrs
|
311
|
-
response.should render_template("edit")
|
312
|
-
end
|
313
|
-
end
|
314
|
-
end
|
315
|
-
|
316
|
-
describe "When logged in as Librarian" do
|
317
|
-
login_librarian
|
318
|
-
|
319
|
-
describe "with valid params" do
|
320
|
-
it "updates the requested series_has_manifestation" do
|
321
|
-
put :update, :id => @series_has_manifestation.id, :series_has_manifestation => @attrs
|
322
|
-
end
|
323
|
-
|
324
|
-
it "assigns the requested series_has_manifestation as @series_has_manifestation" do
|
325
|
-
put :update, :id => @series_has_manifestation.id, :series_has_manifestation => @attrs
|
326
|
-
assigns(:series_has_manifestation).should eq(@series_has_manifestation)
|
327
|
-
response.should redirect_to(@series_has_manifestation)
|
328
|
-
end
|
329
|
-
end
|
330
|
-
|
331
|
-
describe "with invalid params" do
|
332
|
-
it "assigns the series_has_manifestation as @series_has_manifestation" do
|
333
|
-
put :update, :id => @series_has_manifestation, :series_has_manifestation => @invalid_attrs
|
334
|
-
assigns(:series_has_manifestation).should_not be_valid
|
335
|
-
end
|
336
|
-
|
337
|
-
it "re-renders the 'edit' template" do
|
338
|
-
put :update, :id => @series_has_manifestation, :series_has_manifestation => @invalid_attrs
|
339
|
-
response.should render_template("edit")
|
340
|
-
end
|
341
|
-
end
|
342
|
-
end
|
343
|
-
|
344
|
-
describe "When logged in as User" do
|
345
|
-
login_user
|
346
|
-
|
347
|
-
describe "with valid params" do
|
348
|
-
it "updates the requested series_has_manifestation" do
|
349
|
-
put :update, :id => @series_has_manifestation.id, :series_has_manifestation => @attrs
|
350
|
-
end
|
351
|
-
|
352
|
-
it "assigns the requested series_has_manifestation as @series_has_manifestation" do
|
353
|
-
put :update, :id => @series_has_manifestation.id, :series_has_manifestation => @attrs
|
354
|
-
assigns(:series_has_manifestation).should eq(@series_has_manifestation)
|
355
|
-
response.should be_forbidden
|
356
|
-
end
|
357
|
-
end
|
358
|
-
|
359
|
-
describe "with invalid params" do
|
360
|
-
it "assigns the requested series_has_manifestation as @series_has_manifestation" do
|
361
|
-
put :update, :id => @series_has_manifestation.id, :series_has_manifestation => @invalid_attrs
|
362
|
-
response.should be_forbidden
|
363
|
-
end
|
364
|
-
end
|
365
|
-
end
|
366
|
-
|
367
|
-
describe "When not logged in" do
|
368
|
-
describe "with valid params" do
|
369
|
-
it "updates the requested series_has_manifestation" do
|
370
|
-
put :update, :id => @series_has_manifestation.id, :series_has_manifestation => @attrs
|
371
|
-
end
|
372
|
-
|
373
|
-
it "should be forbidden" do
|
374
|
-
put :update, :id => @series_has_manifestation.id, :series_has_manifestation => @attrs
|
375
|
-
response.should redirect_to(new_user_session_url)
|
376
|
-
end
|
377
|
-
end
|
378
|
-
|
379
|
-
describe "with invalid params" do
|
380
|
-
it "assigns the requested series_has_manifestation as @series_has_manifestation" do
|
381
|
-
put :update, :id => @series_has_manifestation.id, :series_has_manifestation => @invalid_attrs
|
382
|
-
response.should redirect_to(new_user_session_url)
|
383
|
-
end
|
384
|
-
end
|
385
|
-
end
|
386
|
-
end
|
387
|
-
|
388
|
-
describe "DELETE destroy" do
|
389
|
-
before(:each) do
|
390
|
-
@series_has_manifestation = FactoryGirl.create(:series_has_manifestation)
|
391
|
-
end
|
392
|
-
|
393
|
-
describe "When logged in as Administrator" do
|
394
|
-
login_admin
|
395
|
-
|
396
|
-
it "destroys the requested series_has_manifestation" do
|
397
|
-
delete :destroy, :id => @series_has_manifestation.id
|
398
|
-
end
|
399
|
-
|
400
|
-
it "redirects to the series_has_manifestations list" do
|
401
|
-
delete :destroy, :id => @series_has_manifestation.id
|
402
|
-
response.should redirect_to(series_has_manifestations_url)
|
403
|
-
end
|
404
|
-
end
|
405
|
-
|
406
|
-
describe "When logged in as Librarian" do
|
407
|
-
login_librarian
|
408
|
-
|
409
|
-
it "destroys the requested series_has_manifestation" do
|
410
|
-
delete :destroy, :id => @series_has_manifestation.id
|
411
|
-
end
|
412
|
-
|
413
|
-
it "should be forbidden" do
|
414
|
-
delete :destroy, :id => @series_has_manifestation.id
|
415
|
-
response.should redirect_to(series_has_manifestations_url)
|
416
|
-
end
|
417
|
-
end
|
418
|
-
|
419
|
-
describe "When logged in as User" do
|
420
|
-
login_user
|
421
|
-
|
422
|
-
it "destroys the requested series_has_manifestation" do
|
423
|
-
delete :destroy, :id => @series_has_manifestation.id
|
424
|
-
end
|
425
|
-
|
426
|
-
it "should be forbidden" do
|
427
|
-
delete :destroy, :id => @series_has_manifestation.id
|
428
|
-
response.should be_forbidden
|
429
|
-
end
|
430
|
-
end
|
431
|
-
|
432
|
-
describe "When not logged in" do
|
433
|
-
it "destroys the requested series_has_manifestation" do
|
434
|
-
delete :destroy, :id => @series_has_manifestation.id
|
435
|
-
end
|
436
|
-
|
437
|
-
it "should be forbidden" do
|
438
|
-
delete :destroy, :id => @series_has_manifestation.id
|
439
|
-
response.should redirect_to(new_user_session_url)
|
440
|
-
end
|
441
|
-
end
|
442
|
-
end
|
443
|
-
end
|
Binary file
|
@@ -1,35 +0,0 @@
|
|
1
|
-
---
|
2
|
-
series_has_manifestation_00001:
|
3
|
-
updated_at: 2008-01-11 23:28:19.277110 +09:00
|
4
|
-
manifestation_id: 1
|
5
|
-
series_statement_id: 1
|
6
|
-
id: 1
|
7
|
-
position: 1
|
8
|
-
created_at: 2008-01-11 23:28:19.277110 +09:00
|
9
|
-
series_has_manifestation_00002:
|
10
|
-
updated_at: 2008-01-11 23:28:57.068191 +09:00
|
11
|
-
manifestation_id: 202
|
12
|
-
series_statement_id: 2
|
13
|
-
id: 2
|
14
|
-
position: 1
|
15
|
-
created_at: 2008-01-11 23:28:57.068191 +09:00
|
16
|
-
series_has_manifestation_00003:
|
17
|
-
updated_at: 2008-01-11 23:32:03.701425 +09:00
|
18
|
-
manifestation_id: 203
|
19
|
-
series_statement_id: 3
|
20
|
-
id: 3
|
21
|
-
position: 1
|
22
|
-
created_at: 2008-01-11 23:32:03.701425 +09:00
|
23
|
-
|
24
|
-
# == Schema Information
|
25
|
-
#
|
26
|
-
# Table name: series_has_manifestations
|
27
|
-
#
|
28
|
-
# id :integer not null, primary key
|
29
|
-
# series_statement_id :integer
|
30
|
-
# manifestation_id :integer
|
31
|
-
# position :integer
|
32
|
-
# created_at :datetime not null
|
33
|
-
# updated_at :datetime not null
|
34
|
-
#
|
35
|
-
|
@@ -1,21 +0,0 @@
|
|
1
|
-
require 'spec_helper'
|
2
|
-
|
3
|
-
describe SeriesHasManifestation do
|
4
|
-
it "should reindex", :solr => true do
|
5
|
-
series_has_manifestation = FactoryGirl.create(:series_has_manifestation)
|
6
|
-
series_has_manifestation.reindex.should be_true
|
7
|
-
end
|
8
|
-
end
|
9
|
-
|
10
|
-
# == Schema Information
|
11
|
-
#
|
12
|
-
# Table name: series_has_manifestations
|
13
|
-
#
|
14
|
-
# id :integer not null, primary key
|
15
|
-
# series_statement_id :integer
|
16
|
-
# manifestation_id :integer
|
17
|
-
# position :integer
|
18
|
-
# created_at :datetime not null
|
19
|
-
# updated_at :datetime not null
|
20
|
-
#
|
21
|
-
|
@@ -1,35 +0,0 @@
|
|
1
|
-
require "spec_helper"
|
2
|
-
|
3
|
-
describe SeriesHasManifestationsController do
|
4
|
-
describe "routing" do
|
5
|
-
|
6
|
-
it "routes to #index" do
|
7
|
-
get("/series_has_manifestations").should route_to("series_has_manifestations#index")
|
8
|
-
end
|
9
|
-
|
10
|
-
it "routes to #new" do
|
11
|
-
get("/series_has_manifestations/new").should route_to("series_has_manifestations#new")
|
12
|
-
end
|
13
|
-
|
14
|
-
it "routes to #show" do
|
15
|
-
get("/series_has_manifestations/1").should route_to("series_has_manifestations#show", :id => "1")
|
16
|
-
end
|
17
|
-
|
18
|
-
it "routes to #edit" do
|
19
|
-
get("/series_has_manifestations/1/edit").should route_to("series_has_manifestations#edit", :id => "1")
|
20
|
-
end
|
21
|
-
|
22
|
-
it "routes to #create" do
|
23
|
-
post("/series_has_manifestations").should route_to("series_has_manifestations#create")
|
24
|
-
end
|
25
|
-
|
26
|
-
it "routes to #update" do
|
27
|
-
put("/series_has_manifestations/1").should route_to("series_has_manifestations#update", :id => "1")
|
28
|
-
end
|
29
|
-
|
30
|
-
it "routes to #destroy" do
|
31
|
-
delete("/series_has_manifestations/1").should route_to("series_has_manifestations#destroy", :id => "1")
|
32
|
-
end
|
33
|
-
|
34
|
-
end
|
35
|
-
end
|
@@ -1,21 +0,0 @@
|
|
1
|
-
require 'spec_helper'
|
2
|
-
|
3
|
-
describe "series_has_manifestations/edit" do
|
4
|
-
before(:each) do
|
5
|
-
@series_has_manifestation = assign(:series_has_manifestation, stub_model(SeriesHasManifestation,
|
6
|
-
:series_statement_id => 1,
|
7
|
-
:manifestation_id => 1,
|
8
|
-
:position => 1
|
9
|
-
))
|
10
|
-
end
|
11
|
-
|
12
|
-
it "renders the edit series_has_manifestation form" do
|
13
|
-
render
|
14
|
-
|
15
|
-
# Run the generator again with the --webrat flag if you want to use webrat matchers
|
16
|
-
assert_select "form", :action => series_has_manifestations_path(@series_has_manifestation), :method => "post" do
|
17
|
-
assert_select "input#series_has_manifestation_series_statement_id", :name => "series_has_manifestation[series_statement_id]"
|
18
|
-
assert_select "input#series_has_manifestation_manifestation_id", :name => "series_has_manifestation[manifestation_id]"
|
19
|
-
end
|
20
|
-
end
|
21
|
-
end
|
@@ -1,31 +0,0 @@
|
|
1
|
-
require 'spec_helper'
|
2
|
-
|
3
|
-
describe "series_has_manifestations/index" do
|
4
|
-
before(:each) do
|
5
|
-
assign(:series_has_manifestations, Kaminari::paginate_array([
|
6
|
-
stub_model(SeriesHasManifestation,
|
7
|
-
:series_statement_id => 1,
|
8
|
-
:manifestation_id => 1,
|
9
|
-
:position => 1
|
10
|
-
),
|
11
|
-
stub_model(SeriesHasManifestation,
|
12
|
-
:series_statement_id => 1,
|
13
|
-
:manifestation_id => 1,
|
14
|
-
:position => 1
|
15
|
-
)
|
16
|
-
]).page(1))
|
17
|
-
@ability = Object.new
|
18
|
-
@ability.extend(CanCan::Ability)
|
19
|
-
controller.stub(:current_ability) { @ability }
|
20
|
-
end
|
21
|
-
|
22
|
-
it "renders a list of series_has_manifestations" do
|
23
|
-
render
|
24
|
-
# Run the generator again with the --webrat flag if you want to use webrat matchers
|
25
|
-
assert_select "tr>td", :text => SeriesStatement.find(1).original_title, :count => 2
|
26
|
-
# Run the generator again with the --webrat flag if you want to use webrat matchers
|
27
|
-
assert_select "tr>td", :text => SeriesStatement.find(1).original_title, :count => 2
|
28
|
-
# Run the generator again with the --webrat flag if you want to use webrat matchers
|
29
|
-
assert_select "tr>td", :text => SeriesStatement.find(1).original_title, :count => 2
|
30
|
-
end
|
31
|
-
end
|