enju_biblio 0.1.0.pre56 → 0.1.0.pre57
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/controllers/agent_import_files_controller.rb +1 -1
- data/app/controllers/agent_import_results_controller.rb +30 -6
- data/app/controllers/agent_relationship_types_controller.rb +74 -4
- data/app/controllers/agent_relationships_controller.rb +92 -10
- data/app/controllers/agent_types_controller.rb +74 -3
- data/app/controllers/carrier_types_controller.rb +1 -1
- data/app/controllers/content_types_controller.rb +74 -4
- data/app/controllers/countries_controller.rb +66 -4
- data/app/controllers/create_types_controller.rb +74 -3
- data/app/controllers/extents_controller.rb +74 -4
- data/app/controllers/form_of_works_controller.rb +74 -4
- data/app/controllers/frequencies_controller.rb +74 -4
- data/app/controllers/identifier_types_controller.rb +4 -5
- data/app/controllers/import_requests_controller.rb +1 -1
- data/app/controllers/languages_controller.rb +66 -4
- data/app/controllers/licenses_controller.rb +74 -3
- data/app/controllers/manifestation_relationship_types_controller.rb +74 -3
- data/app/controllers/manifestation_relationships_controller.rb +92 -9
- data/app/controllers/medium_of_performances_controller.rb +74 -3
- data/app/controllers/picture_files_controller.rb +34 -10
- data/app/controllers/produce_types_controller.rb +74 -3
- data/app/controllers/realize_types_controller.rb +74 -3
- data/app/controllers/resource_import_files_controller.rb +2 -1
- data/app/controllers/resource_import_results_controller.rb +31 -11
- data/app/models/agent_import_file.rb +1 -1
- data/app/models/agent_import_result.rb +0 -2
- data/app/models/carrier_type.rb +1 -1
- data/app/models/identifier.rb +5 -0
- data/app/models/item.rb +1 -1
- data/app/models/manifestation.rb +13 -8
- data/app/models/resource_import_file.rb +73 -79
- data/app/views/agent_import_files/index.html.erb +1 -0
- data/app/views/agent_relationship_types/index.html.erb +5 -4
- data/app/views/agent_types/index.html.erb +5 -4
- data/app/views/carrier_types/index.html.erb +2 -1
- data/app/views/content_types/index.html.erb +1 -0
- data/app/views/countries/show.html.erb +5 -0
- data/app/views/create_types/index.html.erb +5 -4
- data/app/views/extents/index.html.erb +2 -1
- data/app/views/form_of_works/index.html.erb +2 -1
- data/app/views/frequencies/index.html.erb +2 -1
- data/app/views/identifier_types/index.html.erb +12 -5
- data/app/views/import_requests/index.html.erb +1 -0
- data/app/views/items/show.html.erb +3 -7
- data/app/views/languages/_form.html.erb +19 -4
- data/app/views/languages/index.html.erb +6 -5
- data/app/views/languages/show.html.erb +19 -4
- data/app/views/layouts/manifestations.html.erb +2 -1
- data/app/views/licenses/index.html.erb +2 -1
- data/app/views/manifestation_relationship_types/index.html.erb +5 -4
- data/app/views/manifestations/_call_number.html.erb +1 -1
- data/app/views/manifestations/_edit_detail.html.erb +4 -1
- data/app/views/manifestations/_form.html.erb +5 -5
- data/app/views/manifestations/_show_detail_librarian.html.erb +8 -3
- data/app/views/manifestations/_show_detail_user.html.erb +8 -3
- data/app/views/medium_of_performances/index.html.erb +2 -1
- data/app/views/notifier/manifestation_info.en.text.erb +1 -1
- data/app/views/notifier/manifestation_info.ja.text.erb +1 -1
- data/app/views/picture_files/_index.html.erb +1 -0
- data/app/views/picture_files/_index_agent.html.erb +1 -0
- data/app/views/picture_files/_index_manifestation.html.erb +1 -0
- data/app/views/picture_files/show.html.erb +15 -7
- data/app/views/produce_types/index.html.erb +5 -4
- data/app/views/realize_types/index.html.erb +5 -4
- data/app/views/resource_import_files/index.html.erb +1 -0
- data/app/views/series_statements/_index.html.erb +1 -0
- data/app/views/series_statements/_index_series_statement_merge_list.html.erb +1 -0
- data/config/locales/translation_en.yml +70 -1
- data/config/locales/translation_ja.yml +77 -8
- data/db/migrate/20140817155043_add_extent_of_text_to_manifestation.rb +5 -0
- data/lib/enju_biblio/biblio_helper.rb +13 -0
- data/lib/enju_biblio/engine.rb +0 -2
- data/lib/enju_biblio/version.rb +1 -1
- data/lib/generators/enju_biblio/setup/templates/db/fixtures/content_types.yml +1 -1
- data/lib/generators/enju_biblio/setup/templates/db/fixtures/identifier_types.yml +24 -3
- data/lib/tasks/enju_biblio_tasks.rake +2 -0
- data/lib/tasks/identifier_type.rb +12 -0
- data/lib/tasks/item.rb +1 -1
- data/spec/cassette_library/ResourceImportFile/when_its_mode_is_create_/when_it_is_written_in_utf-8/should_send_message_when_import_is_completed.yml +433 -0
- data/spec/controllers/agent_import_files_controller_spec.rb +35 -35
- data/spec/controllers/agent_import_results_controller_spec.rb +11 -11
- data/spec/controllers/agent_relationship_types_controller_spec.rb +51 -51
- data/spec/controllers/agent_relationships_controller_spec.rb +53 -53
- data/spec/controllers/agent_types_controller_spec.rb +15 -15
- data/spec/controllers/agents_controller_spec.rb +96 -96
- data/spec/controllers/carrier_types_controller_spec.rb +15 -15
- data/spec/controllers/content_types_controller_spec.rb +15 -15
- data/spec/controllers/countries_controller_spec.rb +25 -25
- data/spec/controllers/create_types_controller_spec.rb +15 -15
- data/spec/controllers/creates_controller_spec.rb +50 -50
- data/spec/controllers/donates_controller_spec.rb +49 -49
- data/spec/controllers/extents_controller_spec.rb +15 -15
- data/spec/controllers/form_of_works_controller_spec.rb +15 -15
- data/spec/controllers/frequencies_controller_spec.rb +6 -6
- data/spec/controllers/identifier_types_controller_spec.rb +15 -15
- data/spec/controllers/import_requests_controller_spec.rb +50 -50
- data/spec/controllers/items_controller_spec.rb +72 -72
- data/spec/controllers/languages_controller_spec.rb +18 -18
- data/spec/controllers/licenses_controller_spec.rb +15 -15
- data/spec/controllers/manifestation_relationship_types_controller_spec.rb +51 -51
- data/spec/controllers/manifestation_relationships_controller_spec.rb +53 -53
- data/spec/controllers/manifestations_controller_spec.rb +108 -108
- data/spec/controllers/medium_of_performances_controller_spec.rb +15 -15
- data/spec/controllers/owns_controller_spec.rb +52 -52
- data/spec/controllers/picture_files_controller_spec.rb +52 -52
- data/spec/controllers/produce_types_controller_spec.rb +15 -15
- data/spec/controllers/produces_controller_spec.rb +50 -50
- data/spec/controllers/realize_types_controller_spec.rb +15 -15
- data/spec/controllers/realizes_controller_spec.rb +51 -51
- data/spec/controllers/resource_export_files_controller_spec.rb +38 -38
- data/spec/controllers/resource_import_files_controller_spec.rb +38 -38
- data/spec/controllers/resource_import_results_controller_spec.rb +15 -15
- data/spec/controllers/series_statements_controller_spec.rb +54 -54
- data/spec/dummy/db/development.sqlite3 +0 -0
- data/spec/dummy/db/schema.rb +2 -3
- data/spec/dummy/db/test.sqlite3 +0 -0
- data/spec/dummy/private/system/resource_import_files/resource_imports/000/000/004/original/resource_import_file_sample1.tsv +19 -19
- data/spec/dummy/private/system/resource_import_files/resource_imports/000/000/004/original/resource_import_file_sample2.tsv +19 -19
- data/spec/dummy/public/system/resource_export_files/resource_exports/000/000/004/original/resource_export_file_20140818-53863-1jz1wlr.txt +147 -0
- data/spec/dummy/public/system/resource_export_files/resource_exports/000/000/004/original/resource_export_file_20140818-55246-1rvhs1s.txt +147 -0
- data/spec/dummy/public/system/resource_export_files/resource_exports/000/000/004/original/resource_export_file_20140818-60268-1psjqua.txt +147 -0
- data/spec/dummy/public/system/resource_export_files/resource_exports/000/000/004/original/resource_export_file_20140818-60996-1cy28m2.txt +147 -0
- data/spec/dummy/public/system/resource_export_files/resource_exports/000/000/004/original/resource_export_file_20140818-67507-19qjhj3.txt +147 -0
- data/spec/dummy/public/system/resource_export_files/resource_exports/000/000/004/original/resource_export_file_20140818-69234-1cllrec.txt +147 -0
- data/spec/dummy/public/system/resource_export_files/resource_exports/000/000/004/original/resource_export_file_20140818-76875-1os6joy.txt +147 -0
- data/spec/dummy/public/system/resource_export_files/resource_exports/000/000/004/original/resource_export_file_20140819-1148-136brhb.txt +147 -0
- data/spec/dummy/public/system/resource_export_files/resource_exports/000/000/004/original/resource_export_file_20140819-473-1c326dm.txt +147 -0
- data/spec/dummy/public/system/resource_export_files/resource_exports/000/000/004/original/resource_export_file_20140819-93795-1x882ik.txt +147 -0
- data/spec/dummy/public/system/resource_export_files/resource_exports/000/000/004/original/resource_export_file_20140819-94274-1xr9d9e.txt +147 -0
- data/spec/dummy/public/system/resource_export_files/resource_exports/000/000/004/original/resource_export_file_20140819-94643-1fjcept.txt +147 -0
- data/spec/dummy/public/system/resource_export_files/resource_exports/000/000/004/original/resource_export_file_20140819-97947-mfqh5b.txt +147 -0
- data/spec/dummy/public/system/resource_export_files/resource_exports/000/000/004/original/resource_export_file_20140819-98488-126cvb4.txt +147 -0
- data/spec/dummy/public/system/resource_export_files/resource_exports/000/000/004/original/resource_export_file_20140819-98849-1lg47mm.txt +147 -0
- data/spec/dummy/solr/test/data/index/segments.gen +0 -0
- data/spec/dummy/solr/test/data/index/segments_5ur +0 -0
- data/spec/dummy/solr/test/data/tlog/tlog.0000000000000007580 +0 -0
- data/spec/dummy/solr/test/data/tlog/tlog.0000000000000007581 +0 -0
- data/spec/dummy/solr/test/data/tlog/tlog.0000000000000007582 +0 -0
- data/spec/dummy/solr/test/data/tlog/tlog.0000000000000007583 +0 -0
- data/spec/dummy/solr/test/data/tlog/tlog.0000000000000007584 +0 -0
- data/spec/dummy/solr/test/data/tlog/tlog.0000000000000007585 +0 -0
- data/spec/dummy/tmp/cache/ACB/B20/manifestation_search_total +0 -0
- data/spec/dummy/tmp/cache/stdout +2554 -0
- data/spec/dummy/tmp/pids/redis-test.pid +1 -1
- data/spec/fixtures/agent_import_results.yml +0 -3
- data/spec/fixtures/carrier_types.yml +16 -16
- data/spec/fixtures/content_types.yml +78 -29
- data/spec/fixtures/frequencies.yml +32 -62
- data/spec/fixtures/manifestations.yml +1 -1
- data/spec/models/agent_import_result_spec.rb +0 -2
- data/spec/models/manifestation_spec.rb +1 -1
- data/spec/models/resource_import_file_spec.rb +30 -3
- data/spec/views/manifestations/show.html.erb_spec.rb +1 -1
- metadata +68 -103
- data/app/views/picture_files/_index_event.html.erb +0 -53
- data/app/views/picture_files/_index_shelf.html.erb +0 -53
- data/db/migrate/20121116033446_add_doi_to_manifestation.rb +0 -6
- data/spec/dummy/solr/test/data/index/_20i.fdt +0 -0
- data/spec/dummy/solr/test/data/index/_20i.fdx +0 -0
- data/spec/dummy/solr/test/data/index/_20i.fnm +0 -0
- data/spec/dummy/solr/test/data/index/_20i.nvd +0 -0
- data/spec/dummy/solr/test/data/index/_20i.nvm +0 -0
- data/spec/dummy/solr/test/data/index/_20i.si +0 -0
- data/spec/dummy/solr/test/data/index/_20i_Lucene41_0.doc +0 -0
- data/spec/dummy/solr/test/data/index/_20i_Lucene41_0.pos +0 -0
- data/spec/dummy/solr/test/data/index/_20i_Lucene41_0.tim +0 -0
- data/spec/dummy/solr/test/data/index/_20i_Lucene41_0.tip +0 -0
- data/spec/dummy/solr/test/data/index/_20j.fdt +0 -0
- data/spec/dummy/solr/test/data/index/_20j.fdx +0 -0
- data/spec/dummy/solr/test/data/index/_20j.fnm +0 -0
- data/spec/dummy/solr/test/data/index/_20j.nvd +0 -0
- data/spec/dummy/solr/test/data/index/_20j.nvm +0 -0
- data/spec/dummy/solr/test/data/index/_20j.si +0 -0
- data/spec/dummy/solr/test/data/index/_20j_Lucene41_0.doc +0 -0
- data/spec/dummy/solr/test/data/index/_20j_Lucene41_0.pos +0 -0
- data/spec/dummy/solr/test/data/index/_20j_Lucene41_0.tim +0 -0
- data/spec/dummy/solr/test/data/index/_20j_Lucene41_0.tip +0 -0
- data/spec/dummy/solr/test/data/index/_20k.fdt +0 -0
- data/spec/dummy/solr/test/data/index/_20k.fdx +0 -0
- data/spec/dummy/solr/test/data/index/_20k.fnm +0 -0
- data/spec/dummy/solr/test/data/index/_20k.nvd +0 -0
- data/spec/dummy/solr/test/data/index/_20k.nvm +0 -0
- data/spec/dummy/solr/test/data/index/_20k.si +0 -0
- data/spec/dummy/solr/test/data/index/_20k_Lucene41_0.doc +0 -0
- data/spec/dummy/solr/test/data/index/_20k_Lucene41_0.pos +0 -0
- data/spec/dummy/solr/test/data/index/_20k_Lucene41_0.tim +0 -0
- data/spec/dummy/solr/test/data/index/_20k_Lucene41_0.tip +0 -0
- data/spec/dummy/solr/test/data/index/segments_2uc +0 -0
- data/spec/dummy/solr/test/data/tlog/tlog.0000000000000003680 +0 -0
- data/spec/dummy/solr/test/data/tlog/tlog.0000000000000003681 +0 -0
- data/spec/dummy/solr/test/data/tlog/tlog.0000000000000003682 +0 -0
@@ -17,7 +17,7 @@ describe ManifestationsController do
|
|
17
17
|
|
18
18
|
it "assigns all manifestations as @manifestations" do
|
19
19
|
get :index
|
20
|
-
assigns(:manifestations).
|
20
|
+
expect(assigns(:manifestations)).to_not be_nil
|
21
21
|
end
|
22
22
|
end
|
23
23
|
|
@@ -26,7 +26,7 @@ describe ManifestationsController do
|
|
26
26
|
|
27
27
|
it "assigns all manifestations as @manifestations" do
|
28
28
|
get :index
|
29
|
-
assigns(:manifestations).
|
29
|
+
expect(assigns(:manifestations)).to_not be_nil
|
30
30
|
end
|
31
31
|
end
|
32
32
|
|
@@ -35,131 +35,131 @@ describe ManifestationsController do
|
|
35
35
|
|
36
36
|
it "assigns all manifestations as @manifestations" do
|
37
37
|
get :index
|
38
|
-
assigns(:manifestations).
|
38
|
+
expect(assigns(:manifestations)).to_not be_nil
|
39
39
|
end
|
40
40
|
end
|
41
41
|
|
42
42
|
describe "When not logged in" do
|
43
43
|
it "assigns all manifestations as @manifestations" do
|
44
44
|
get :index
|
45
|
-
assigns(:manifestations).
|
45
|
+
expect(assigns(:manifestations)).to_not be_nil
|
46
46
|
end
|
47
47
|
|
48
48
|
it "assigns all manifestations as @manifestations in xml format without operation" do
|
49
49
|
get :index, :format => 'xml'
|
50
|
-
response.
|
51
|
-
assigns(:manifestations).
|
50
|
+
expect(response).to be_success
|
51
|
+
expect(assigns(:manifestations)).to_not be_nil
|
52
52
|
end
|
53
53
|
|
54
54
|
it "assigns all manifestations as @manifestations in txt format without operation" do
|
55
55
|
get :index, :format => 'txt'
|
56
|
-
response.
|
57
|
-
assigns(:manifestations).
|
58
|
-
response.
|
56
|
+
expect(response).to be_success
|
57
|
+
expect(assigns(:manifestations)).to_not be_nil
|
58
|
+
expect(response).to render_template('manifestations/index')
|
59
59
|
end
|
60
60
|
|
61
61
|
it "assigns all manifestations as @manifestations in sru format without operation" do
|
62
62
|
get :index, :format => 'sru'
|
63
63
|
assert_response :success
|
64
|
-
assigns(:manifestations).
|
65
|
-
response.
|
64
|
+
expect(assigns(:manifestations)).to be_nil
|
65
|
+
expect(response).to render_template('manifestations/explain')
|
66
66
|
end
|
67
67
|
|
68
68
|
it "assigns all manifestations as @manifestations in sru format with operation" do
|
69
69
|
get :index, :format => 'sru', :operation => 'searchRetrieve', :query => 'ruby'
|
70
|
-
assigns(:manifestations).
|
71
|
-
response.
|
70
|
+
expect(assigns(:manifestations)).to_not be_nil
|
71
|
+
expect(response).to render_template('manifestations/index')
|
72
72
|
end
|
73
73
|
|
74
74
|
it "assigns all manifestations as @manifestations in sru format with operation and title" do
|
75
75
|
get :index, :format => 'sru', :query => 'title=ruby', :operation => 'searchRetrieve'
|
76
|
-
assigns(:manifestations).
|
77
|
-
response.
|
76
|
+
expect(assigns(:manifestations)).to_not be_nil
|
77
|
+
expect(response).to render_template('manifestations/index')
|
78
78
|
end
|
79
79
|
|
80
80
|
it "assigns all manifestations as @manifestations in openurl" do
|
81
81
|
get :index, :api => 'openurl', :title => 'ruby'
|
82
|
-
assigns(:manifestations).
|
82
|
+
expect(assigns(:manifestations)).to_not be_nil
|
83
83
|
end
|
84
84
|
|
85
85
|
it "assigns all manifestations as @manifestations when pub_date_from and pub_date_to are specified" do
|
86
86
|
get :index, :pub_date_from => '2000', :pub_date_to => '2007'
|
87
87
|
assigns(:query).should eq "date_of_publication_d:[#{Time.zone.parse('2000-01-01').utc.iso8601} TO #{Time.zone.parse('2007-12-31').end_of_year.utc.iso8601}]"
|
88
|
-
assigns(:manifestations).
|
88
|
+
expect(assigns(:manifestations)).to_not be_nil
|
89
89
|
end
|
90
90
|
|
91
91
|
it "assigns all manifestations as @manifestations when acquired_from and pub_date_to are specified" do
|
92
92
|
get :index, :acquired_from => '2000', :acquired_to => '2007'
|
93
93
|
assigns(:query).should eq "acquired_at_d:[#{Time.zone.parse('2000-01-01').utc.iso8601} TO #{Time.zone.parse('2007-12-31').end_of_day.utc.iso8601}]"
|
94
|
-
assigns(:manifestations).
|
94
|
+
expect(assigns(:manifestations)).to_not be_nil
|
95
95
|
end
|
96
96
|
|
97
97
|
it "assigns all manifestations as @manifestations when number_of_pages_at_least and number_of_pages_at_most are specified" do
|
98
98
|
get :index, :number_of_pages_at_least => '100', :number_of_pages_at_least => '200'
|
99
|
-
assigns(:manifestations).
|
99
|
+
expect(assigns(:manifestations)).to_not be_nil
|
100
100
|
end
|
101
101
|
|
102
102
|
it "assigns all manifestations as @manifestations in mods format" do
|
103
103
|
get :index, :format => 'mods'
|
104
|
-
assigns(:manifestations).
|
105
|
-
response.
|
104
|
+
expect(assigns(:manifestations)).to_not be_nil
|
105
|
+
expect(response).to render_template("manifestations/index")
|
106
106
|
end
|
107
107
|
|
108
108
|
it "assigns all manifestations as @manifestations in rdf format" do
|
109
109
|
get :index, :format => 'rdf'
|
110
|
-
assigns(:manifestations).
|
111
|
-
response.
|
110
|
+
expect(assigns(:manifestations)).to_not be_nil
|
111
|
+
expect(response).to render_template("manifestations/index")
|
112
112
|
end
|
113
113
|
|
114
114
|
it "should get index with manifestation_id" do
|
115
115
|
get :index, :manifestation_id => 1
|
116
|
-
response.
|
117
|
-
assigns(:manifestation).
|
116
|
+
expect(response).to be_success
|
117
|
+
expect(assigns(:manifestation)).to eq Manifestation.find(1)
|
118
118
|
assigns(:manifestations).collect(&:id).should eq assigns(:manifestation).derived_manifestations.collect(&:id)
|
119
119
|
end
|
120
120
|
|
121
121
|
it "should get index with query" do
|
122
122
|
get :index, :query => '2005'
|
123
|
-
response.
|
124
|
-
assigns(:manifestations).
|
123
|
+
expect(response).to be_success
|
124
|
+
expect(assigns(:manifestations)).to_not be_blank
|
125
125
|
end
|
126
126
|
|
127
127
|
it "should get index with page number" do
|
128
128
|
get :index, :query => '2005', :number_of_pages_at_least => 1, :number_of_pages_at_most => 100
|
129
|
-
response.
|
129
|
+
expect(response).to be_success
|
130
130
|
assigns(:query).should eq '2005 number_of_pages_i:[1 TO 100]'
|
131
131
|
end
|
132
132
|
|
133
133
|
it "should get index with pub_date_from" do
|
134
134
|
get :index, :query => '2005', :pub_date_from => '2000'
|
135
|
-
response.
|
136
|
-
assigns(:manifestations).
|
135
|
+
expect(response).to be_success
|
136
|
+
expect(assigns(:manifestations)).to be_truthy
|
137
137
|
assigns(:query).should eq '2005 date_of_publication_d:[1999-12-31T15:00:00Z TO *]'
|
138
138
|
end
|
139
139
|
|
140
140
|
it "should get index with pub_date_to" do
|
141
141
|
get :index, :query => '2005', :pub_date_to => '2000'
|
142
|
-
response.
|
143
|
-
assigns(:manifestations).
|
142
|
+
expect(response).to be_success
|
143
|
+
expect(assigns(:manifestations)).to be_truthy
|
144
144
|
assigns(:query).should eq '2005 date_of_publication_d:[* TO 2000-12-31T14:59:59Z]'
|
145
145
|
end
|
146
146
|
|
147
147
|
it "should get tag_cloud" do
|
148
148
|
get :index, :query => '2005', :view => 'tag_cloud'
|
149
|
-
response.
|
150
|
-
response.
|
149
|
+
expect(response).to be_success
|
150
|
+
expect(response).to render_template("manifestations/_tag_cloud")
|
151
151
|
end
|
152
152
|
|
153
153
|
it "should show manifestation with isbn", :solr => true do
|
154
154
|
get :index, :isbn => "4798002062"
|
155
|
-
response.
|
156
|
-
assigns(:manifestations).count.
|
155
|
+
expect(response).to be_success
|
156
|
+
expect(assigns(:manifestations).count).to eq 1
|
157
157
|
end
|
158
158
|
|
159
159
|
it "should not show missing manifestation with isbn", :solr => true do
|
160
160
|
get :index, :isbn => "47980020620"
|
161
|
-
response.
|
162
|
-
assigns(:manifestations).
|
161
|
+
expect(response).to be_success
|
162
|
+
expect(assigns(:manifestations)).to be_empty
|
163
163
|
end
|
164
164
|
end
|
165
165
|
end
|
@@ -170,7 +170,7 @@ describe ManifestationsController do
|
|
170
170
|
|
171
171
|
it "assigns the requested manifestation as @manifestation" do
|
172
172
|
get :show, :id => 1
|
173
|
-
assigns(:manifestation).
|
173
|
+
expect(assigns(:manifestation)).to eq(Manifestation.find(1))
|
174
174
|
end
|
175
175
|
end
|
176
176
|
|
@@ -179,13 +179,13 @@ describe ManifestationsController do
|
|
179
179
|
|
180
180
|
it "assigns the requested manifestation as @manifestation" do
|
181
181
|
get :show, :id => 1
|
182
|
-
assigns(:manifestation).
|
182
|
+
expect(assigns(:manifestation)).to eq(Manifestation.find(1))
|
183
183
|
end
|
184
184
|
|
185
185
|
it "should show manifestation with agent who does not produce it" do
|
186
186
|
get :show, :id => 3, :agent_id => 3
|
187
|
-
assigns(:manifestation).
|
188
|
-
response.
|
187
|
+
expect(assigns(:manifestation)).to eq assigns(:agent).manifestations.find(3)
|
188
|
+
expect(response).to be_success
|
189
189
|
end
|
190
190
|
end
|
191
191
|
|
@@ -194,70 +194,70 @@ describe ManifestationsController do
|
|
194
194
|
|
195
195
|
it "assigns the requested manifestation as @manifestation" do
|
196
196
|
get :show, :id => 1
|
197
|
-
assigns(:manifestation).
|
197
|
+
expect(assigns(:manifestation)).to eq(Manifestation.find(1))
|
198
198
|
end
|
199
199
|
|
200
200
|
it "should send manifestation detail email" do
|
201
201
|
get :show, :id => 1, :mode => 'send_email'
|
202
|
-
response.
|
202
|
+
expect(response).to redirect_to manifestation_url(assigns(:manifestation))
|
203
203
|
end
|
204
204
|
|
205
205
|
#it "should show myself" do
|
206
206
|
# get :show, :id => users(:user1).agent
|
207
|
-
# response.
|
207
|
+
# expect(response).to be_success
|
208
208
|
#end
|
209
209
|
end
|
210
210
|
|
211
211
|
describe "When not logged in" do
|
212
212
|
it "assigns the requested manifestation as @manifestation" do
|
213
213
|
get :show, :id => 1
|
214
|
-
assigns(:manifestation).
|
214
|
+
expect(assigns(:manifestation)).to eq(Manifestation.find(1))
|
215
215
|
end
|
216
216
|
|
217
217
|
it "guest should show manifestation mods template" do
|
218
218
|
get :show, :id => 22, :format => 'mods'
|
219
|
-
assigns(:manifestation).
|
220
|
-
response.
|
219
|
+
expect(assigns(:manifestation)).to eq Manifestation.find(22)
|
220
|
+
expect(response).to render_template("manifestations/show")
|
221
221
|
end
|
222
222
|
|
223
223
|
it "should show manifestation rdf template" do
|
224
224
|
get :show, :id => 22, :format => 'rdf'
|
225
|
-
assigns(:manifestation).
|
226
|
-
response.
|
225
|
+
expect(assigns(:manifestation)).to eq Manifestation.find(22)
|
226
|
+
expect(response).to render_template("manifestations/show")
|
227
227
|
end
|
228
228
|
|
229
229
|
it "should show manifestation with holding" do
|
230
230
|
get :show, :id => 1, :mode => 'holding'
|
231
|
-
response.
|
231
|
+
expect(response).to be_success
|
232
232
|
end
|
233
233
|
|
234
234
|
it "should show manifestation with tag_edit" do
|
235
235
|
get :show, :id => 1, :mode => 'tag_edit'
|
236
|
-
response.
|
237
|
-
response.
|
236
|
+
expect(response).to render_template('manifestations/_tag_edit')
|
237
|
+
expect(response).to be_success
|
238
238
|
end
|
239
239
|
|
240
240
|
it "should show manifestation with tag_list" do
|
241
241
|
get :show, :id => 1, :mode => 'tag_list'
|
242
|
-
response.
|
243
|
-
response.
|
242
|
+
expect(response).to render_template('manifestations/_tag_list')
|
243
|
+
expect(response).to be_success
|
244
244
|
end
|
245
245
|
|
246
246
|
it "should show manifestation with show_creators" do
|
247
247
|
get :show, :id => 1, :mode => 'show_creators'
|
248
|
-
response.
|
249
|
-
response.
|
248
|
+
expect(response).to render_template('manifestations/_show_creators')
|
249
|
+
expect(response).to be_success
|
250
250
|
end
|
251
251
|
|
252
252
|
it "should show manifestation with show_all_creators" do
|
253
253
|
get :show, :id => 1, :mode => 'show_all_creators'
|
254
|
-
response.
|
255
|
-
response.
|
254
|
+
expect(response).to render_template('manifestations/_show_creators')
|
255
|
+
expect(response).to be_success
|
256
256
|
end
|
257
257
|
|
258
258
|
it "should not send manifestation's detail email" do
|
259
259
|
get :show, :id => 1, :mode => 'send_email'
|
260
|
-
response.
|
260
|
+
expect(response).to redirect_to new_user_session_url
|
261
261
|
end
|
262
262
|
end
|
263
263
|
end
|
@@ -268,17 +268,17 @@ describe ManifestationsController do
|
|
268
268
|
|
269
269
|
it "assigns the requested manifestation as @manifestation" do
|
270
270
|
get :new
|
271
|
-
assigns(:manifestation).
|
271
|
+
expect(assigns(:manifestation)).to_not be_valid
|
272
272
|
end
|
273
273
|
|
274
274
|
it "should get new template without expression_id" do
|
275
275
|
get :new
|
276
|
-
response.
|
276
|
+
expect(response).to be_success
|
277
277
|
end
|
278
278
|
|
279
279
|
it "should get new template with expression_id" do
|
280
280
|
get :new, :expression_id => 1
|
281
|
-
response.
|
281
|
+
expect(response).to be_success
|
282
282
|
end
|
283
283
|
end
|
284
284
|
|
@@ -287,17 +287,17 @@ describe ManifestationsController do
|
|
287
287
|
|
288
288
|
it "assigns the requested manifestation as @manifestation" do
|
289
289
|
get :new
|
290
|
-
assigns(:manifestation).
|
290
|
+
expect(assigns(:manifestation)).to_not be_valid
|
291
291
|
end
|
292
292
|
|
293
293
|
it "should get new template without expression_id" do
|
294
294
|
get :new
|
295
|
-
response.
|
295
|
+
expect(response).to be_success
|
296
296
|
end
|
297
297
|
|
298
298
|
it "should get new template with expression_id" do
|
299
299
|
get :new, :expression_id => 1
|
300
|
-
response.
|
300
|
+
expect(response).to be_success
|
301
301
|
end
|
302
302
|
end
|
303
303
|
|
@@ -306,16 +306,16 @@ describe ManifestationsController do
|
|
306
306
|
|
307
307
|
it "should not assign the requested manifestation as @manifestation" do
|
308
308
|
get :new
|
309
|
-
assigns(:manifestation).
|
310
|
-
response.
|
309
|
+
expect(assigns(:manifestation)).to_not be_valid
|
310
|
+
expect(response).to be_forbidden
|
311
311
|
end
|
312
312
|
end
|
313
313
|
|
314
314
|
describe "When not logged in" do
|
315
315
|
it "should not assign the requested manifestation as @manifestation" do
|
316
316
|
get :new
|
317
|
-
assigns(:manifestation).
|
318
|
-
response.
|
317
|
+
expect(assigns(:manifestation)).to_not be_valid
|
318
|
+
expect(response).to redirect_to(new_user_session_url)
|
319
319
|
end
|
320
320
|
end
|
321
321
|
end
|
@@ -327,7 +327,7 @@ describe ManifestationsController do
|
|
327
327
|
it "assigns the requested manifestation as @manifestation" do
|
328
328
|
manifestation = FactoryGirl.create(:manifestation)
|
329
329
|
get :edit, :id => manifestation.id
|
330
|
-
assigns(:manifestation).
|
330
|
+
expect(assigns(:manifestation)).to eq(manifestation)
|
331
331
|
end
|
332
332
|
end
|
333
333
|
|
@@ -337,7 +337,7 @@ describe ManifestationsController do
|
|
337
337
|
it "assigns the requested manifestation as @manifestation" do
|
338
338
|
manifestation = FactoryGirl.create(:manifestation)
|
339
339
|
get :edit, :id => manifestation.id
|
340
|
-
assigns(:manifestation).
|
340
|
+
expect(assigns(:manifestation)).to eq(manifestation)
|
341
341
|
end
|
342
342
|
end
|
343
343
|
|
@@ -347,12 +347,12 @@ describe ManifestationsController do
|
|
347
347
|
it "assigns the requested manifestation as @manifestation" do
|
348
348
|
manifestation = FactoryGirl.create(:manifestation)
|
349
349
|
get :edit, :id => manifestation.id
|
350
|
-
response.
|
350
|
+
expect(response).to be_forbidden
|
351
351
|
end
|
352
352
|
|
353
353
|
it "should edit manifestation with tag_edit" do
|
354
354
|
get :edit, :id => 1, :mode => 'tag_edit'
|
355
|
-
response.
|
355
|
+
expect(response).to be_success
|
356
356
|
end
|
357
357
|
end
|
358
358
|
|
@@ -360,7 +360,7 @@ describe ManifestationsController do
|
|
360
360
|
it "should not assign the requested manifestation as @manifestation" do
|
361
361
|
manifestation = FactoryGirl.create(:manifestation)
|
362
362
|
get :edit, :id => manifestation.id
|
363
|
-
response.
|
363
|
+
expect(response).to redirect_to(new_user_session_url)
|
364
364
|
end
|
365
365
|
end
|
366
366
|
end
|
@@ -377,7 +377,7 @@ describe ManifestationsController do
|
|
377
377
|
describe "with valid params" do
|
378
378
|
it "assigns a newly created manifestation as @manifestation" do
|
379
379
|
post :create, :manifestation => @attrs
|
380
|
-
assigns(:manifestation).
|
380
|
+
expect(assigns(:manifestation)).to be_valid
|
381
381
|
end
|
382
382
|
|
383
383
|
it "assigns a series_statement" do
|
@@ -388,19 +388,19 @@ describe ManifestationsController do
|
|
388
388
|
|
389
389
|
it "redirects to the created manifestation" do
|
390
390
|
post :create, :manifestation => @attrs
|
391
|
-
response.
|
391
|
+
expect(response).to redirect_to(manifestation_url(assigns(:manifestation)))
|
392
392
|
end
|
393
393
|
end
|
394
394
|
|
395
395
|
describe "with invalid params" do
|
396
396
|
it "assigns a newly created but unsaved manifestation as @manifestation" do
|
397
397
|
post :create, :manifestation => @invalid_attrs
|
398
|
-
assigns(:manifestation).
|
398
|
+
expect(assigns(:manifestation)).to_not be_valid
|
399
399
|
end
|
400
400
|
|
401
401
|
it "re-renders the 'new' template" do
|
402
402
|
post :create, :manifestation => @invalid_attrs
|
403
|
-
response.
|
403
|
+
expect(response).to render_template("new")
|
404
404
|
end
|
405
405
|
end
|
406
406
|
end
|
@@ -411,24 +411,24 @@ describe ManifestationsController do
|
|
411
411
|
describe "with valid params" do
|
412
412
|
it "assigns a newly created manifestation as @manifestation" do
|
413
413
|
post :create, :manifestation => @attrs
|
414
|
-
assigns(:manifestation).
|
414
|
+
expect(assigns(:manifestation)).to be_valid
|
415
415
|
end
|
416
416
|
|
417
417
|
it "redirects to the created manifestation" do
|
418
418
|
post :create, :manifestation => @attrs
|
419
|
-
response.
|
419
|
+
expect(response).to redirect_to(manifestation_url(assigns(:manifestation)))
|
420
420
|
end
|
421
421
|
end
|
422
422
|
|
423
423
|
describe "with invalid params" do
|
424
424
|
it "assigns a newly created but unsaved manifestation as @manifestation" do
|
425
425
|
post :create, :manifestation => @invalid_attrs
|
426
|
-
assigns(:manifestation).
|
426
|
+
expect(assigns(:manifestation)).to_not be_valid
|
427
427
|
end
|
428
428
|
|
429
429
|
it "re-renders the 'new' template" do
|
430
430
|
post :create, :manifestation => @invalid_attrs
|
431
|
-
response.
|
431
|
+
expect(response).to render_template("new")
|
432
432
|
end
|
433
433
|
end
|
434
434
|
end
|
@@ -439,24 +439,24 @@ describe ManifestationsController do
|
|
439
439
|
describe "with valid params" do
|
440
440
|
it "assigns a newly created manifestation as @manifestation" do
|
441
441
|
post :create, :manifestation => @attrs
|
442
|
-
assigns(:manifestation).
|
442
|
+
expect(assigns(:manifestation)).to be_valid
|
443
443
|
end
|
444
444
|
|
445
445
|
it "should be forbidden" do
|
446
446
|
post :create, :manifestation => @attrs
|
447
|
-
response.
|
447
|
+
expect(response).to be_forbidden
|
448
448
|
end
|
449
449
|
end
|
450
450
|
|
451
451
|
describe "with invalid params" do
|
452
452
|
it "assigns a newly created but unsaved manifestation as @manifestation" do
|
453
453
|
post :create, :manifestation => @invalid_attrs
|
454
|
-
assigns(:manifestation).
|
454
|
+
expect(assigns(:manifestation)).to_not be_valid
|
455
455
|
end
|
456
456
|
|
457
457
|
it "should be forbidden" do
|
458
458
|
post :create, :manifestation => @invalid_attrs
|
459
|
-
response.
|
459
|
+
expect(response).to be_forbidden
|
460
460
|
end
|
461
461
|
end
|
462
462
|
end
|
@@ -465,24 +465,24 @@ describe ManifestationsController do
|
|
465
465
|
describe "with valid params" do
|
466
466
|
it "assigns a newly created manifestation as @manifestation" do
|
467
467
|
post :create, :manifestation => @attrs
|
468
|
-
assigns(:manifestation).
|
468
|
+
expect(assigns(:manifestation)).to be_valid
|
469
469
|
end
|
470
470
|
|
471
471
|
it "should be forbidden" do
|
472
472
|
post :create, :manifestation => @attrs
|
473
|
-
response.
|
473
|
+
expect(response).to redirect_to(new_user_session_url)
|
474
474
|
end
|
475
475
|
end
|
476
476
|
|
477
477
|
describe "with invalid params" do
|
478
478
|
it "assigns a newly created but unsaved manifestation as @manifestation" do
|
479
479
|
post :create, :manifestation => @invalid_attrs
|
480
|
-
assigns(:manifestation).
|
480
|
+
expect(assigns(:manifestation)).to_not be_valid
|
481
481
|
end
|
482
482
|
|
483
483
|
it "should be forbidden" do
|
484
484
|
post :create, :manifestation => @invalid_attrs
|
485
|
-
response.
|
485
|
+
expect(response).to redirect_to(new_user_session_url)
|
486
486
|
end
|
487
487
|
end
|
488
488
|
end
|
@@ -512,14 +512,14 @@ describe ManifestationsController do
|
|
512
512
|
|
513
513
|
it "assigns the requested manifestation as @manifestation" do
|
514
514
|
put :update, :id => @manifestation.id, :manifestation => @attrs
|
515
|
-
assigns(:manifestation).
|
515
|
+
expect(assigns(:manifestation)).to eq(@manifestation)
|
516
516
|
end
|
517
517
|
end
|
518
518
|
|
519
519
|
describe "with invalid params" do
|
520
520
|
it "assigns the requested manifestation as @manifestation" do
|
521
521
|
put :update, :id => @manifestation.id, :manifestation => @invalid_attrs
|
522
|
-
response.
|
522
|
+
expect(response).to render_template("edit")
|
523
523
|
end
|
524
524
|
end
|
525
525
|
end
|
@@ -534,20 +534,20 @@ describe ManifestationsController do
|
|
534
534
|
|
535
535
|
it "assigns the requested manifestation as @manifestation" do
|
536
536
|
put :update, :id => @manifestation.id, :manifestation => @attrs
|
537
|
-
assigns(:manifestation).
|
538
|
-
response.
|
537
|
+
expect(assigns(:manifestation)).to eq(@manifestation)
|
538
|
+
expect(response).to redirect_to(@manifestation)
|
539
539
|
end
|
540
540
|
end
|
541
541
|
|
542
542
|
describe "with invalid params" do
|
543
543
|
it "assigns the manifestation as @manifestation" do
|
544
544
|
put :update, :id => @manifestation, :manifestation => @invalid_attrs
|
545
|
-
assigns(:manifestation).
|
545
|
+
expect(assigns(:manifestation)).to_not be_valid
|
546
546
|
end
|
547
547
|
|
548
548
|
it "re-renders the 'edit' template" do
|
549
549
|
put :update, :id => @manifestation, :manifestation => @invalid_attrs
|
550
|
-
response.
|
550
|
+
expect(response).to render_template("edit")
|
551
551
|
end
|
552
552
|
end
|
553
553
|
end
|
@@ -562,15 +562,15 @@ describe ManifestationsController do
|
|
562
562
|
|
563
563
|
it "assigns the requested manifestation as @manifestation" do
|
564
564
|
put :update, :id => @manifestation.id, :manifestation => @attrs
|
565
|
-
assigns(:manifestation).
|
566
|
-
response.
|
565
|
+
expect(assigns(:manifestation)).to eq(@manifestation)
|
566
|
+
expect(response).to be_forbidden
|
567
567
|
end
|
568
568
|
end
|
569
569
|
|
570
570
|
describe "with invalid params" do
|
571
571
|
it "assigns the requested manifestation as @manifestation" do
|
572
572
|
put :update, :id => @manifestation.id, :manifestation => @invalid_attrs
|
573
|
-
response.
|
573
|
+
expect(response).to be_forbidden
|
574
574
|
end
|
575
575
|
end
|
576
576
|
end
|
@@ -583,14 +583,14 @@ describe ManifestationsController do
|
|
583
583
|
|
584
584
|
it "should be forbidden" do
|
585
585
|
put :update, :id => @manifestation.id, :manifestation => @attrs
|
586
|
-
response.
|
586
|
+
expect(response).to redirect_to(new_user_session_url)
|
587
587
|
end
|
588
588
|
end
|
589
589
|
|
590
590
|
describe "with invalid params" do
|
591
591
|
it "assigns the requested manifestation as @manifestation" do
|
592
592
|
put :update, :id => @manifestation.id, :manifestation => @invalid_attrs
|
593
|
-
response.
|
593
|
+
expect(response).to redirect_to(new_user_session_url)
|
594
594
|
end
|
595
595
|
end
|
596
596
|
end
|
@@ -610,17 +610,17 @@ describe ManifestationsController do
|
|
610
610
|
|
611
611
|
it "redirects to the manifestations list" do
|
612
612
|
delete :destroy, :id => @manifestation.id
|
613
|
-
response.
|
613
|
+
expect(response).to redirect_to(manifestations_url)
|
614
614
|
end
|
615
615
|
|
616
616
|
it "should not destroy the reserved manifestation" do
|
617
617
|
delete :destroy, :id => 2
|
618
|
-
response.
|
618
|
+
expect(response).to be_forbidden
|
619
619
|
end
|
620
620
|
|
621
621
|
it "should not destroy manifestation contains items" do
|
622
622
|
delete :destroy, :id => 1
|
623
|
-
response.
|
623
|
+
expect(response).to be_forbidden
|
624
624
|
end
|
625
625
|
end
|
626
626
|
|
@@ -633,7 +633,7 @@ describe ManifestationsController do
|
|
633
633
|
|
634
634
|
it "should be forbidden" do
|
635
635
|
delete :destroy, :id => @manifestation.id
|
636
|
-
response.
|
636
|
+
expect(response).to redirect_to(manifestations_url)
|
637
637
|
end
|
638
638
|
end
|
639
639
|
|
@@ -646,7 +646,7 @@ describe ManifestationsController do
|
|
646
646
|
|
647
647
|
it "should be forbidden" do
|
648
648
|
delete :destroy, :id => @manifestation.id
|
649
|
-
response.
|
649
|
+
expect(response).to be_forbidden
|
650
650
|
end
|
651
651
|
end
|
652
652
|
|
@@ -657,7 +657,7 @@ describe ManifestationsController do
|
|
657
657
|
|
658
658
|
it "should be forbidden" do
|
659
659
|
delete :destroy, :id => @manifestation.id
|
660
|
-
response.
|
660
|
+
expect(response).to redirect_to(new_user_session_url)
|
661
661
|
end
|
662
662
|
end
|
663
663
|
end
|