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
@@ -33,7 +33,7 @@ describe CarrierTypesController do
|
|
33
33
|
it "assigns all carrier_types as @carrier_types" do
|
34
34
|
carrier_type = CarrierType.create! valid_attributes
|
35
35
|
get :index
|
36
|
-
assigns(:carrier_types).
|
36
|
+
expect(assigns(:carrier_types)).to eq(CarrierType.all)
|
37
37
|
end
|
38
38
|
end
|
39
39
|
|
@@ -41,14 +41,14 @@ describe CarrierTypesController do
|
|
41
41
|
it "assigns the requested carrier_type as @carrier_type" do
|
42
42
|
carrier_type = CarrierType.create! valid_attributes
|
43
43
|
get :show, :id => carrier_type.id
|
44
|
-
assigns(:carrier_type).
|
44
|
+
expect(assigns(:carrier_type)).to eq(carrier_type)
|
45
45
|
end
|
46
46
|
end
|
47
47
|
|
48
48
|
describe "GET new" do
|
49
49
|
it "assigns a new carrier_type as @carrier_type" do
|
50
50
|
get :new
|
51
|
-
assigns(:carrier_type).
|
51
|
+
expect(assigns(:carrier_type)).to be_a_new(CarrierType)
|
52
52
|
end
|
53
53
|
end
|
54
54
|
|
@@ -56,7 +56,7 @@ describe CarrierTypesController do
|
|
56
56
|
it "assigns the requested carrier_type as @carrier_type" do
|
57
57
|
carrier_type = CarrierType.create! valid_attributes
|
58
58
|
get :edit, :id => carrier_type.id
|
59
|
-
assigns(:carrier_type).
|
59
|
+
expect(assigns(:carrier_type)).to eq(carrier_type)
|
60
60
|
end
|
61
61
|
end
|
62
62
|
|
@@ -70,13 +70,13 @@ describe CarrierTypesController do
|
|
70
70
|
|
71
71
|
it "assigns a newly created carrier_type as @carrier_type" do
|
72
72
|
post :create, :carrier_type => valid_attributes
|
73
|
-
assigns(:carrier_type).
|
74
|
-
assigns(:carrier_type).
|
73
|
+
expect(assigns(:carrier_type)).to be_a(CarrierType)
|
74
|
+
expect(assigns(:carrier_type)).to be_persisted
|
75
75
|
end
|
76
76
|
|
77
77
|
it "redirects to the created carrier_type" do
|
78
78
|
post :create, :carrier_type => valid_attributes
|
79
|
-
response.
|
79
|
+
expect(response).to redirect_to(CarrierType.last)
|
80
80
|
end
|
81
81
|
end
|
82
82
|
|
@@ -85,14 +85,14 @@ describe CarrierTypesController do
|
|
85
85
|
# Trigger the behavior that occurs when invalid params are submitted
|
86
86
|
CarrierType.any_instance.stub(:save).and_return(false)
|
87
87
|
post :create, :carrier_type => {}
|
88
|
-
assigns(:carrier_type).
|
88
|
+
expect(assigns(:carrier_type)).to be_a_new(CarrierType)
|
89
89
|
end
|
90
90
|
|
91
91
|
it "re-renders the 'new' template" do
|
92
92
|
# Trigger the behavior that occurs when invalid params are submitted
|
93
93
|
CarrierType.any_instance.stub(:save).and_return(false)
|
94
94
|
post :create, :carrier_type => {}
|
95
|
-
#response.
|
95
|
+
#expect(response).to render_template("new")
|
96
96
|
end
|
97
97
|
end
|
98
98
|
end
|
@@ -112,20 +112,20 @@ describe CarrierTypesController do
|
|
112
112
|
it "assigns the requested carrier_type as @carrier_type" do
|
113
113
|
carrier_type = CarrierType.create! valid_attributes
|
114
114
|
put :update, :id => carrier_type.id, :carrier_type => valid_attributes
|
115
|
-
assigns(:carrier_type).
|
115
|
+
expect(assigns(:carrier_type)).to eq(carrier_type)
|
116
116
|
end
|
117
117
|
|
118
118
|
it "redirects to the carrier_type" do
|
119
119
|
carrier_type = CarrierType.create! valid_attributes
|
120
120
|
put :update, :id => carrier_type.id, :carrier_type => valid_attributes
|
121
|
-
response.
|
121
|
+
expect(response).to redirect_to(carrier_type)
|
122
122
|
end
|
123
123
|
|
124
124
|
it "moves its position when specified" do
|
125
125
|
carrier_type = CarrierType.create! valid_attributes
|
126
126
|
position = carrier_type.position
|
127
127
|
put :update, :id => carrier_type.id, :move => 'higher'
|
128
|
-
response.
|
128
|
+
expect(response).to redirect_to carrier_types_url
|
129
129
|
assigns(:carrier_type).position.should eq position - 1
|
130
130
|
end
|
131
131
|
end
|
@@ -136,7 +136,7 @@ describe CarrierTypesController do
|
|
136
136
|
# Trigger the behavior that occurs when invalid params are submitted
|
137
137
|
CarrierType.any_instance.stub(:save).and_return(false)
|
138
138
|
put :update, :id => carrier_type.id, :carrier_type => {}
|
139
|
-
assigns(:carrier_type).
|
139
|
+
expect(assigns(:carrier_type)).to eq(carrier_type)
|
140
140
|
end
|
141
141
|
|
142
142
|
it "re-renders the 'edit' template" do
|
@@ -144,7 +144,7 @@ describe CarrierTypesController do
|
|
144
144
|
# Trigger the behavior that occurs when invalid params are submitted
|
145
145
|
CarrierType.any_instance.stub(:save).and_return(false)
|
146
146
|
put :update, :id => carrier_type.id, :carrier_type => {}
|
147
|
-
#response.
|
147
|
+
#expect(response).to render_template("edit")
|
148
148
|
end
|
149
149
|
end
|
150
150
|
end
|
@@ -160,7 +160,7 @@ describe CarrierTypesController do
|
|
160
160
|
it "redirects to the carrier_types list" do
|
161
161
|
carrier_type = CarrierType.create! valid_attributes
|
162
162
|
delete :destroy, :id => carrier_type.id
|
163
|
-
response.
|
163
|
+
expect(response).to redirect_to(carrier_types_url)
|
164
164
|
end
|
165
165
|
end
|
166
166
|
|
@@ -33,7 +33,7 @@ describe ContentTypesController do
|
|
33
33
|
it "assigns all content_types as @content_types" do
|
34
34
|
content_type = ContentType.create! valid_attributes
|
35
35
|
get :index
|
36
|
-
assigns(:content_types).
|
36
|
+
expect(assigns(:content_types)).to eq(ContentType.all)
|
37
37
|
end
|
38
38
|
end
|
39
39
|
|
@@ -41,14 +41,14 @@ describe ContentTypesController do
|
|
41
41
|
it "assigns the requested content_type as @content_type" do
|
42
42
|
content_type = ContentType.create! valid_attributes
|
43
43
|
get :show, :id => content_type.id
|
44
|
-
assigns(:content_type).
|
44
|
+
expect(assigns(:content_type)).to eq(content_type)
|
45
45
|
end
|
46
46
|
end
|
47
47
|
|
48
48
|
describe "GET new" do
|
49
49
|
it "assigns a new content_type as @content_type" do
|
50
50
|
get :new
|
51
|
-
assigns(:content_type).
|
51
|
+
expect(assigns(:content_type)).to be_a_new(ContentType)
|
52
52
|
end
|
53
53
|
end
|
54
54
|
|
@@ -56,7 +56,7 @@ describe ContentTypesController do
|
|
56
56
|
it "assigns the requested content_type as @content_type" do
|
57
57
|
content_type = ContentType.create! valid_attributes
|
58
58
|
get :edit, :id => content_type.id
|
59
|
-
assigns(:content_type).
|
59
|
+
expect(assigns(:content_type)).to eq(content_type)
|
60
60
|
end
|
61
61
|
end
|
62
62
|
|
@@ -70,13 +70,13 @@ describe ContentTypesController do
|
|
70
70
|
|
71
71
|
it "assigns a newly created content_type as @content_type" do
|
72
72
|
post :create, :content_type => valid_attributes
|
73
|
-
assigns(:content_type).
|
74
|
-
assigns(:content_type).
|
73
|
+
expect(assigns(:content_type)).to be_a(ContentType)
|
74
|
+
expect(assigns(:content_type)).to be_persisted
|
75
75
|
end
|
76
76
|
|
77
77
|
it "redirects to the created content_type" do
|
78
78
|
post :create, :content_type => valid_attributes
|
79
|
-
response.
|
79
|
+
expect(response).to redirect_to(ContentType.last)
|
80
80
|
end
|
81
81
|
end
|
82
82
|
|
@@ -85,14 +85,14 @@ describe ContentTypesController do
|
|
85
85
|
# Trigger the behavior that occurs when invalid params are submitted
|
86
86
|
ContentType.any_instance.stub(:save).and_return(false)
|
87
87
|
post :create, :content_type => {}
|
88
|
-
assigns(:content_type).
|
88
|
+
expect(assigns(:content_type)).to be_a_new(ContentType)
|
89
89
|
end
|
90
90
|
|
91
91
|
it "re-renders the 'new' template" do
|
92
92
|
# Trigger the behavior that occurs when invalid params are submitted
|
93
93
|
ContentType.any_instance.stub(:save).and_return(false)
|
94
94
|
post :create, :content_type => {}
|
95
|
-
#response.
|
95
|
+
#expect(response).to render_template("new")
|
96
96
|
end
|
97
97
|
end
|
98
98
|
end
|
@@ -112,20 +112,20 @@ describe ContentTypesController do
|
|
112
112
|
it "assigns the requested content_type as @content_type" do
|
113
113
|
content_type = ContentType.create! valid_attributes
|
114
114
|
put :update, :id => content_type.id, :content_type => valid_attributes
|
115
|
-
assigns(:content_type).
|
115
|
+
expect(assigns(:content_type)).to eq(content_type)
|
116
116
|
end
|
117
117
|
|
118
118
|
it "redirects to the content_type" do
|
119
119
|
content_type = ContentType.create! valid_attributes
|
120
120
|
put :update, :id => content_type.id, :content_type => valid_attributes
|
121
|
-
response.
|
121
|
+
expect(response).to redirect_to(content_type)
|
122
122
|
end
|
123
123
|
|
124
124
|
it "moves its position when specified" do
|
125
125
|
content_type = ContentType.create! valid_attributes
|
126
126
|
position = content_type.position
|
127
127
|
put :update, :id => content_type.id, :move => 'higher'
|
128
|
-
response.
|
128
|
+
expect(response).to redirect_to content_types_url
|
129
129
|
assigns(:content_type).position.should eq position - 1
|
130
130
|
end
|
131
131
|
end
|
@@ -136,7 +136,7 @@ describe ContentTypesController do
|
|
136
136
|
# Trigger the behavior that occurs when invalid params are submitted
|
137
137
|
ContentType.any_instance.stub(:save).and_return(false)
|
138
138
|
put :update, :id => content_type.id, :content_type => {}
|
139
|
-
assigns(:content_type).
|
139
|
+
expect(assigns(:content_type)).to eq(content_type)
|
140
140
|
end
|
141
141
|
|
142
142
|
it "re-renders the 'edit' template" do
|
@@ -144,7 +144,7 @@ describe ContentTypesController do
|
|
144
144
|
# Trigger the behavior that occurs when invalid params are submitted
|
145
145
|
ContentType.any_instance.stub(:save).and_return(false)
|
146
146
|
put :update, :id => content_type.id, :content_type => {}
|
147
|
-
#response.
|
147
|
+
#expect(response).to render_template("edit")
|
148
148
|
end
|
149
149
|
end
|
150
150
|
end
|
@@ -160,7 +160,7 @@ describe ContentTypesController do
|
|
160
160
|
it "redirects to the content_types list" do
|
161
161
|
content_type = ContentType.create! valid_attributes
|
162
162
|
delete :destroy, :id => content_type.id
|
163
|
-
response.
|
163
|
+
expect(response).to redirect_to(content_types_url)
|
164
164
|
end
|
165
165
|
end
|
166
166
|
|
@@ -96,7 +96,7 @@ describe CountriesController do
|
|
96
96
|
it "assigns the requested country as @country" do
|
97
97
|
get :new
|
98
98
|
assigns(:country).should_not be_valid
|
99
|
-
response.
|
99
|
+
expect(response).to be_success
|
100
100
|
end
|
101
101
|
end
|
102
102
|
|
@@ -106,7 +106,7 @@ describe CountriesController do
|
|
106
106
|
it "assigns the requested country as @country" do
|
107
107
|
get :new
|
108
108
|
assigns(:country).should_not be_valid
|
109
|
-
response.
|
109
|
+
expect(response).to be_forbidden
|
110
110
|
end
|
111
111
|
end
|
112
112
|
|
@@ -116,7 +116,7 @@ describe CountriesController do
|
|
116
116
|
it "assigns the requested country as @country" do
|
117
117
|
get :new
|
118
118
|
assigns(:country).should_not be_valid
|
119
|
-
response.
|
119
|
+
expect(response).to be_forbidden
|
120
120
|
end
|
121
121
|
end
|
122
122
|
|
@@ -124,7 +124,7 @@ describe CountriesController do
|
|
124
124
|
it "should not assign the requested country as @country" do
|
125
125
|
get :new
|
126
126
|
assigns(:country).should_not be_valid
|
127
|
-
response.
|
127
|
+
expect(response).to redirect_to(new_user_session_url)
|
128
128
|
end
|
129
129
|
end
|
130
130
|
end
|
@@ -164,7 +164,7 @@ describe CountriesController do
|
|
164
164
|
it "should not assign the requested country as @country" do
|
165
165
|
country = FactoryGirl.create(:country)
|
166
166
|
get :edit, :id => country.id
|
167
|
-
response.
|
167
|
+
expect(response).to redirect_to(new_user_session_url)
|
168
168
|
end
|
169
169
|
end
|
170
170
|
end
|
@@ -186,7 +186,7 @@ describe CountriesController do
|
|
186
186
|
|
187
187
|
it "redirects to the created country" do
|
188
188
|
post :create, :country => @attrs
|
189
|
-
response.
|
189
|
+
expect(response).to redirect_to(assigns(:country))
|
190
190
|
end
|
191
191
|
end
|
192
192
|
|
@@ -198,7 +198,7 @@ describe CountriesController do
|
|
198
198
|
|
199
199
|
it "re-renders the 'new' template" do
|
200
200
|
post :create, :country => @invalid_attrs
|
201
|
-
response.
|
201
|
+
expect(response).to render_template("new")
|
202
202
|
end
|
203
203
|
end
|
204
204
|
end
|
@@ -214,7 +214,7 @@ describe CountriesController do
|
|
214
214
|
|
215
215
|
it "should be forbidden" do
|
216
216
|
post :create, :country => @attrs
|
217
|
-
response.
|
217
|
+
expect(response).to be_forbidden
|
218
218
|
end
|
219
219
|
end
|
220
220
|
|
@@ -226,7 +226,7 @@ describe CountriesController do
|
|
226
226
|
|
227
227
|
it "should be forbidden" do
|
228
228
|
post :create, :country => @invalid_attrs
|
229
|
-
response.
|
229
|
+
expect(response).to be_forbidden
|
230
230
|
end
|
231
231
|
end
|
232
232
|
end
|
@@ -242,7 +242,7 @@ describe CountriesController do
|
|
242
242
|
|
243
243
|
it "should be forbidden" do
|
244
244
|
post :create, :country => @attrs
|
245
|
-
response.
|
245
|
+
expect(response).to be_forbidden
|
246
246
|
end
|
247
247
|
end
|
248
248
|
|
@@ -254,7 +254,7 @@ describe CountriesController do
|
|
254
254
|
|
255
255
|
it "should be forbidden" do
|
256
256
|
post :create, :country => @invalid_attrs
|
257
|
-
response.
|
257
|
+
expect(response).to be_forbidden
|
258
258
|
end
|
259
259
|
end
|
260
260
|
end
|
@@ -268,7 +268,7 @@ describe CountriesController do
|
|
268
268
|
|
269
269
|
it "should be forbidden" do
|
270
270
|
post :create, :country => @attrs
|
271
|
-
response.
|
271
|
+
expect(response).to redirect_to(new_user_session_url)
|
272
272
|
end
|
273
273
|
end
|
274
274
|
|
@@ -280,7 +280,7 @@ describe CountriesController do
|
|
280
280
|
|
281
281
|
it "should be forbidden" do
|
282
282
|
post :create, :country => @invalid_attrs
|
283
|
-
response.
|
283
|
+
expect(response).to redirect_to(new_user_session_url)
|
284
284
|
end
|
285
285
|
end
|
286
286
|
end
|
@@ -308,14 +308,14 @@ describe CountriesController do
|
|
308
308
|
|
309
309
|
it "moves its position when specified" do
|
310
310
|
put :update, :id => @country.id, :country => @attrs, :move => 'lower'
|
311
|
-
response.
|
311
|
+
expect(response).to redirect_to(countries_url)
|
312
312
|
end
|
313
313
|
end
|
314
314
|
|
315
315
|
describe "with invalid params" do
|
316
316
|
it "assigns the requested country as @country" do
|
317
317
|
put :update, :id => @country.id, :country => @invalid_attrs
|
318
|
-
response.
|
318
|
+
expect(response).to render_template("edit")
|
319
319
|
end
|
320
320
|
end
|
321
321
|
end
|
@@ -335,14 +335,14 @@ describe CountriesController do
|
|
335
335
|
|
336
336
|
it "moves its position when specified" do
|
337
337
|
put :update, :id => @country.id, :country => @attrs, :move => 'lower'
|
338
|
-
response.
|
338
|
+
expect(response).to be_forbidden
|
339
339
|
end
|
340
340
|
end
|
341
341
|
|
342
342
|
describe "with invalid params" do
|
343
343
|
it "assigns the requested country as @country" do
|
344
344
|
put :update, :id => @country.id, :country => @invalid_attrs
|
345
|
-
response.
|
345
|
+
expect(response).to be_forbidden
|
346
346
|
end
|
347
347
|
end
|
348
348
|
end
|
@@ -362,14 +362,14 @@ describe CountriesController do
|
|
362
362
|
|
363
363
|
it "moves its position when specified" do
|
364
364
|
put :update, :id => @country.id, :country => @attrs, :move => 'lower'
|
365
|
-
response.
|
365
|
+
expect(response).to be_forbidden
|
366
366
|
end
|
367
367
|
end
|
368
368
|
|
369
369
|
describe "with invalid params" do
|
370
370
|
it "assigns the requested country as @country" do
|
371
371
|
put :update, :id => @country.id, :country => @invalid_attrs
|
372
|
-
response.
|
372
|
+
expect(response).to be_forbidden
|
373
373
|
end
|
374
374
|
end
|
375
375
|
end
|
@@ -382,14 +382,14 @@ describe CountriesController do
|
|
382
382
|
|
383
383
|
it "should be forbidden" do
|
384
384
|
put :update, :id => @country.id, :country => @attrs
|
385
|
-
response.
|
385
|
+
expect(response).to redirect_to(new_user_session_url)
|
386
386
|
end
|
387
387
|
end
|
388
388
|
|
389
389
|
describe "with invalid params" do
|
390
390
|
it "assigns the requested country as @country" do
|
391
391
|
put :update, :id => @country.id, :country => @invalid_attrs
|
392
|
-
response.
|
392
|
+
expect(response).to redirect_to(new_user_session_url)
|
393
393
|
end
|
394
394
|
end
|
395
395
|
end
|
@@ -409,7 +409,7 @@ describe CountriesController do
|
|
409
409
|
|
410
410
|
it "redirects to the countries list" do
|
411
411
|
delete :destroy, :id => @country.id
|
412
|
-
response.
|
412
|
+
expect(response).to redirect_to(countries_url)
|
413
413
|
end
|
414
414
|
end
|
415
415
|
|
@@ -422,7 +422,7 @@ describe CountriesController do
|
|
422
422
|
|
423
423
|
it "should be forbidden" do
|
424
424
|
delete :destroy, :id => @country.id
|
425
|
-
response.
|
425
|
+
expect(response).to be_forbidden
|
426
426
|
end
|
427
427
|
end
|
428
428
|
|
@@ -435,7 +435,7 @@ describe CountriesController do
|
|
435
435
|
|
436
436
|
it "should be forbidden" do
|
437
437
|
delete :destroy, :id => @country.id
|
438
|
-
response.
|
438
|
+
expect(response).to be_forbidden
|
439
439
|
end
|
440
440
|
end
|
441
441
|
|
@@ -446,7 +446,7 @@ describe CountriesController do
|
|
446
446
|
|
447
447
|
it "should be forbidden" do
|
448
448
|
delete :destroy, :id => @country.id
|
449
|
-
response.
|
449
|
+
expect(response).to redirect_to(new_user_session_url)
|
450
450
|
end
|
451
451
|
end
|
452
452
|
end
|
@@ -33,7 +33,7 @@ describe CreateTypesController do
|
|
33
33
|
it "assigns all create_types as @create_types" do
|
34
34
|
create_type = CreateType.create! valid_attributes
|
35
35
|
get :index
|
36
|
-
assigns(:create_types).
|
36
|
+
expect(assigns(:create_types)).to eq(CreateType.all)
|
37
37
|
end
|
38
38
|
end
|
39
39
|
|
@@ -41,14 +41,14 @@ describe CreateTypesController do
|
|
41
41
|
it "assigns the requested create_type as @create_type" do
|
42
42
|
create_type = CreateType.create! valid_attributes
|
43
43
|
get :show, :id => create_type.id
|
44
|
-
assigns(:create_type).
|
44
|
+
expect(assigns(:create_type)).to eq(create_type)
|
45
45
|
end
|
46
46
|
end
|
47
47
|
|
48
48
|
describe "GET new" do
|
49
49
|
it "assigns a new create_type as @create_type" do
|
50
50
|
get :new
|
51
|
-
assigns(:create_type).
|
51
|
+
expect(assigns(:create_type)).to be_a_new(CreateType)
|
52
52
|
end
|
53
53
|
end
|
54
54
|
|
@@ -56,7 +56,7 @@ describe CreateTypesController do
|
|
56
56
|
it "assigns the requested create_type as @create_type" do
|
57
57
|
create_type = CreateType.create! valid_attributes
|
58
58
|
get :edit, :id => create_type.id
|
59
|
-
assigns(:create_type).
|
59
|
+
expect(assigns(:create_type)).to eq(create_type)
|
60
60
|
end
|
61
61
|
end
|
62
62
|
|
@@ -70,13 +70,13 @@ describe CreateTypesController do
|
|
70
70
|
|
71
71
|
it "assigns a newly created create_type as @create_type" do
|
72
72
|
post :create, :create_type => valid_attributes
|
73
|
-
assigns(:create_type).
|
74
|
-
assigns(:create_type).
|
73
|
+
expect(assigns(:create_type)).to be_a(CreateType)
|
74
|
+
expect(assigns(:create_type)).to be_persisted
|
75
75
|
end
|
76
76
|
|
77
77
|
it "redirects to the created create_type" do
|
78
78
|
post :create, :create_type => valid_attributes
|
79
|
-
response.
|
79
|
+
expect(response).to redirect_to(CreateType.last)
|
80
80
|
end
|
81
81
|
end
|
82
82
|
|
@@ -85,14 +85,14 @@ describe CreateTypesController do
|
|
85
85
|
# Trigger the behavior that occurs when invalid params are submitted
|
86
86
|
CreateType.any_instance.stub(:save).and_return(false)
|
87
87
|
post :create, :create_type => {}
|
88
|
-
assigns(:create_type).
|
88
|
+
expect(assigns(:create_type)).to be_a_new(CreateType)
|
89
89
|
end
|
90
90
|
|
91
91
|
it "re-renders the 'new' template" do
|
92
92
|
# Trigger the behavior that occurs when invalid params are submitted
|
93
93
|
CreateType.any_instance.stub(:save).and_return(false)
|
94
94
|
post :create, :create_type => {}
|
95
|
-
#response.
|
95
|
+
#expect(response).to render_template("new")
|
96
96
|
end
|
97
97
|
end
|
98
98
|
end
|
@@ -112,20 +112,20 @@ describe CreateTypesController do
|
|
112
112
|
it "assigns the requested create_type as @create_type" do
|
113
113
|
create_type = CreateType.create! valid_attributes
|
114
114
|
put :update, :id => create_type.id, :create_type => valid_attributes
|
115
|
-
assigns(:create_type).
|
115
|
+
expect(assigns(:create_type)).to eq(create_type)
|
116
116
|
end
|
117
117
|
|
118
118
|
it "redirects to the create_type" do
|
119
119
|
create_type = CreateType.create! valid_attributes
|
120
120
|
put :update, :id => create_type.id, :create_type => valid_attributes
|
121
|
-
response.
|
121
|
+
expect(response).to redirect_to(create_type)
|
122
122
|
end
|
123
123
|
|
124
124
|
it "moves its position when specified" do
|
125
125
|
create_type = CreateType.create! valid_attributes
|
126
126
|
position = create_type.position
|
127
127
|
put :update, :id => create_type.id, :move => 'higher'
|
128
|
-
response.
|
128
|
+
expect(response).to redirect_to create_types_url
|
129
129
|
assigns(:create_type).position.should eq position - 1
|
130
130
|
end
|
131
131
|
end
|
@@ -136,7 +136,7 @@ describe CreateTypesController do
|
|
136
136
|
# Trigger the behavior that occurs when invalid params are submitted
|
137
137
|
CreateType.any_instance.stub(:save).and_return(false)
|
138
138
|
put :update, :id => create_type.id, :create_type => {}
|
139
|
-
assigns(:create_type).
|
139
|
+
expect(assigns(:create_type)).to eq(create_type)
|
140
140
|
end
|
141
141
|
|
142
142
|
it "re-renders the 'edit' template" do
|
@@ -144,7 +144,7 @@ describe CreateTypesController do
|
|
144
144
|
# Trigger the behavior that occurs when invalid params are submitted
|
145
145
|
CreateType.any_instance.stub(:save).and_return(false)
|
146
146
|
put :update, :id => create_type.id, :create_type => {}
|
147
|
-
#response.
|
147
|
+
#expect(response).to render_template("edit")
|
148
148
|
end
|
149
149
|
end
|
150
150
|
end
|
@@ -160,7 +160,7 @@ describe CreateTypesController do
|
|
160
160
|
it "redirects to the create_types list" do
|
161
161
|
create_type = CreateType.create! valid_attributes
|
162
162
|
delete :destroy, :id => create_type.id
|
163
|
-
response.
|
163
|
+
expect(response).to redirect_to(create_types_url)
|
164
164
|
end
|
165
165
|
end
|
166
166
|
|