enju_biblio 0.1.0.pre63 → 0.1.0.pre64
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 +9 -2
- data/app/controllers/agent_import_results_controller.rb +7 -0
- data/app/controllers/agent_merge_lists_controller.rb +7 -2
- data/app/controllers/agent_merges_controller.rb +7 -2
- data/app/controllers/agent_relationship_types_controller.rb +9 -4
- data/app/controllers/agent_relationships_controller.rb +8 -2
- data/app/controllers/agent_types_controller.rb +9 -4
- data/app/controllers/agents_controller.rb +15 -10
- data/app/controllers/carrier_types_controller.rb +14 -2
- data/app/controllers/content_types_controller.rb +9 -4
- data/app/controllers/countries_controller.rb +11 -4
- data/app/controllers/create_types_controller.rb +9 -4
- data/app/controllers/creates_controller.rb +8 -2
- data/app/controllers/donates_controller.rb +7 -2
- data/app/controllers/form_of_works_controller.rb +9 -4
- data/app/controllers/frequencies_controller.rb +9 -4
- data/app/controllers/identifier_types_controller.rb +11 -4
- data/app/controllers/import_requests_controller.rb +15 -2
- data/app/controllers/items_controller.rb +21 -3
- data/app/controllers/languages_controller.rb +12 -4
- data/app/controllers/licenses_controller.rb +9 -4
- data/app/controllers/manifestation_relationship_types_controller.rb +11 -4
- data/app/controllers/manifestation_relationships_controller.rb +8 -2
- data/app/controllers/manifestations_controller.rb +105 -10
- data/app/controllers/medium_of_performances_controller.rb +9 -4
- data/app/controllers/owns_controller.rb +7 -2
- data/app/controllers/picture_files_controller.rb +8 -2
- data/app/controllers/produce_types_controller.rb +9 -4
- data/app/controllers/produces_controller.rb +8 -2
- data/app/controllers/realize_types_controller.rb +11 -4
- data/app/controllers/realizes_controller.rb +8 -2
- data/app/controllers/resource_export_files_controller.rb +7 -2
- data/app/controllers/resource_import_files_controller.rb +9 -2
- data/app/controllers/resource_import_results_controller.rb +7 -0
- data/app/controllers/series_statement_merge_lists_controller.rb +7 -2
- data/app/controllers/series_statement_merges_controller.rb +9 -2
- data/app/controllers/series_statements_controller.rb +13 -2
- data/app/models/agent.rb +0 -9
- data/app/models/agent_import_file.rb +3 -3
- data/app/models/agent_import_file_transition.rb +1 -1
- data/app/models/agent_import_result.rb +0 -1
- data/app/models/agent_merge.rb +0 -1
- data/app/models/agent_merge_list.rb +0 -1
- data/app/models/agent_relationship.rb +0 -1
- data/app/models/agent_relationship_type.rb +0 -1
- data/app/models/agent_type.rb +0 -1
- data/app/models/carrier_type.rb +1 -7
- data/app/models/content_type.rb +0 -1
- data/app/models/country.rb +0 -1
- data/app/models/create.rb +0 -1
- data/app/models/create_type.rb +0 -1
- data/app/models/donate.rb +0 -1
- data/app/models/enju_biblio/ability.rb +25 -2
- data/app/models/exemplify.rb +1 -1
- data/app/models/form_of_work.rb +0 -1
- data/app/models/frequency.rb +0 -1
- data/app/models/identifier.rb +1 -1
- data/app/models/identifier_type.rb +0 -1
- data/app/models/import_request.rb +8 -7
- data/app/models/import_request_transition.rb +1 -1
- data/app/models/item.rb +0 -5
- data/app/models/language.rb +0 -2
- data/app/models/license.rb +0 -1
- data/app/models/manifestation.rb +29 -33
- data/app/models/manifestation_relationship.rb +0 -1
- data/app/models/manifestation_relationship_type.rb +0 -1
- data/app/models/medium_of_performance.rb +0 -1
- data/app/models/own.rb +0 -1
- data/app/models/picture_file.rb +1 -3
- data/app/models/produce.rb +0 -1
- data/app/models/produce_type.rb +0 -1
- data/app/models/realize.rb +0 -1
- data/app/models/realize_type.rb +0 -1
- data/app/models/resource_export_file.rb +9 -3
- data/app/models/resource_export_file_transition.rb +1 -1
- data/app/models/resource_import_file.rb +18 -10
- data/app/models/resource_import_file_transition.rb +1 -1
- data/app/models/resource_import_result.rb +0 -1
- data/app/models/series_statement.rb +0 -7
- data/app/models/series_statement_merge.rb +0 -1
- data/app/models/series_statement_merge_list.rb +0 -1
- data/app/views/items/index.html.erb +11 -0
- data/app/views/layouts/items.html.erb +29 -0
- data/app/views/manifestations/_form.html.erb +3 -3
- data/app/views/manifestations/_index_form_series_statement.html.erb +1 -1
- data/app/views/manifestations/_list.html.erb +15 -0
- data/app/views/manifestations/_manifestation.html.erb +59 -38
- data/app/views/manifestations/_pickup.html.erb +8 -0
- data/app/views/manifestations/_show_detail_librarian.html.erb +8 -0
- data/app/views/manifestations/_show_detail_user.html.erb +8 -0
- data/app/views/manifestations/_show_holding.html.erb +19 -0
- data/app/views/manifestations/_submenu_parent.html.erb +3 -0
- data/app/views/manifestations/index.atom.builder +3 -0
- data/app/views/manifestations/index.html.erb +31 -1
- data/app/views/manifestations/index.opds.builder +3 -0
- data/app/views/manifestations/show.html.erb +4 -1
- data/app/views/resource_export_files/index.html.erb +2 -2
- data/app/views/resource_export_files/show.html.erb +1 -1
- data/config/locales/translation_en.yml +1 -0
- data/config/locales/translation_ja.yml +1 -0
- data/db/migrate/20150117111136_add_foreign_key_to_items_referencing_manifestations.rb +5 -0
- data/lib/enju_biblio/biblio_helper.rb +2 -0
- data/lib/enju_biblio/engine.rb +0 -1
- data/lib/enju_biblio/version.rb +1 -1
- data/spec/controllers/agent_import_files_controller_spec.rb +3 -3
- data/spec/controllers/agent_merge_lists_controller_spec.rb +2 -2
- data/spec/controllers/agent_merges_controller_spec.rb +1 -1
- data/spec/controllers/agent_types_controller_spec.rb +8 -8
- data/spec/controllers/carrier_types_controller_spec.rb +8 -8
- data/spec/controllers/content_types_controller_spec.rb +8 -8
- data/spec/controllers/create_types_controller_spec.rb +6 -6
- data/spec/controllers/form_of_works_controller_spec.rb +6 -6
- data/spec/controllers/frequencies_controller_spec.rb +8 -8
- data/spec/controllers/identifier_types_controller_spec.rb +8 -8
- data/spec/controllers/licenses_controller_spec.rb +6 -6
- data/spec/controllers/manifestations_controller_spec.rb +22 -2
- data/spec/controllers/medium_of_performances_controller_spec.rb +6 -6
- data/spec/controllers/produce_types_controller_spec.rb +6 -6
- data/spec/controllers/realize_types_controller_spec.rb +6 -6
- data/spec/controllers/resource_export_files_controller_spec.rb +23 -23
- data/spec/controllers/resource_import_files_controller_spec.rb +4 -4
- data/spec/dummy/app/models/user.rb +0 -1
- data/spec/dummy/bin/bundle +3 -0
- data/spec/dummy/bin/rails +4 -0
- data/spec/dummy/bin/rake +4 -0
- data/spec/dummy/bin/setup +29 -0
- data/spec/dummy/config/application.rb +2 -2
- data/spec/dummy/config/boot.rb +4 -9
- data/spec/dummy/config/environment.rb +3 -3
- data/spec/dummy/db/schema.rb +118 -118
- data/spec/factories/manifestation.rb +8 -0
- data/spec/factories/series_statement.rb +5 -0
- data/spec/fixtures/events.yml +13 -39
- data/spec/fixtures/identifier_types.yml +7 -0
- data/spec/fixtures/identifiers.yml +7 -0
- data/spec/fixtures/manifestations.yml +9 -0
- data/spec/fixtures/use_restrictions.yml +1 -1
- data/spec/views/manifestations/show.html.erb_spec.rb +8 -0
- metadata +31 -43
- data/spec/dummy/db/test.sqlite3 +0 -0
- data/spec/dummy/script/rails +0 -6
- data/spec/dummy/tmp/cache/stdout +0 -25
- data/spec/dummy/tmp/pids/redis-test.pid +0 -1
@@ -10,6 +10,9 @@ atom_feed(url: manifestations_url(format: :atom),
|
|
10
10
|
feed.entry(manifestation) do |entry|
|
11
11
|
entry.link rel: "http://opds-spec.org/acquisition/borrow", href: manifestation_url(manifestation), type: 'text/html'
|
12
12
|
entry.title(manifestation.original_title)
|
13
|
+
if defined?(EnjuBookmark)
|
14
|
+
entry.content(manifestation.tags.join(' '), type: 'html')
|
15
|
+
end
|
13
16
|
|
14
17
|
manifestation.creators.readable_by(current_user).each do |agent|
|
15
18
|
entry.author do |author|
|
@@ -48,6 +48,9 @@
|
|
48
48
|
<%- if current_user.email.present? -%>
|
49
49
|
<li><%= link_to t('manifestation.send_email'), manifestation_path(mode: 'send_email'), data: {confirm: t('page.are_you_sure')} -%></li>
|
50
50
|
<%- end -%>
|
51
|
+
<% if defined?(EnjuBookmark) %>
|
52
|
+
<li><%= link_to_bookmark(@manifestation) %></li>
|
53
|
+
<% end %>
|
51
54
|
<% end %>
|
52
55
|
|
53
56
|
<%- unless @manifestation.carrier_type.name == 'file' -%>
|
@@ -56,7 +59,7 @@
|
|
56
59
|
<% if @manifestation.is_reservable_by?(current_user) %>
|
57
60
|
<li><%= link_to_reservation(@manifestation, @reserve) %>
|
58
61
|
<br />
|
59
|
-
(<%= t('page.number_of_reservations', count: @reserved_count) -%>)</li>
|
62
|
+
(<%= link_to_if(current_user.has_role?('Librarian'), t('page.number_of_reservations', count: @reserved_count), reserves_path(query: "manifestation_id_i:#{@manifestation.id}")) -%>)</li>
|
60
63
|
<%- else -%>
|
61
64
|
<% if defined?(EnjuPurchaseRequest) %>
|
62
65
|
<li><%= link_to t('activerecord.models.purchase_request'), new_purchase_request_path(purchase_request: {url: manifestation_url(@manifestation)}) %></li>
|
@@ -19,13 +19,13 @@
|
|
19
19
|
<td><%= link_to resource_export_file.id, resource_export_file %></td>
|
20
20
|
<td><%= resource_export_file.user.try(:username) %></td>
|
21
21
|
<td>
|
22
|
-
<%= link_to resource_export_file.resource_export_file_name, resource_export_file
|
22
|
+
<%= link_to resource_export_file.resource_export_file_name, resource_export_file_path(resource_export_file, format: :download) if resource_export_file.resource_export.path %>
|
23
23
|
<br />
|
24
24
|
<%= resource_export_file.created_at %>
|
25
25
|
</td>
|
26
26
|
<td><%= localized_state(resource_export_file.current_state) -%></td>
|
27
27
|
<td>
|
28
|
-
<%= link_to t('page.destroy'), resource_export_file,
|
28
|
+
<%= link_to t('page.destroy'), resource_export_file, data: {confirm: t('page.are_you_sure')}, method: :delete -%>
|
29
29
|
</td>
|
30
30
|
</tr>
|
31
31
|
<% end %>
|
@@ -10,7 +10,7 @@
|
|
10
10
|
|
11
11
|
<p>
|
12
12
|
<strong><%= t('activerecord.attributes.resource_export_file.resource_export_file_name') -%></strong>
|
13
|
-
<%= link_to @resource_export_file.resource_export_file_name, @resource_export_file
|
13
|
+
<%= link_to @resource_export_file.resource_export_file_name, resource_export_file_path(@resource_export_file, format: :download) if @resource_export_file.resource_export_file_name %>
|
14
14
|
</p>
|
15
15
|
|
16
16
|
<p>
|
@@ -64,6 +64,8 @@ module EnjuBiblio
|
|
64
64
|
link_to identifier.body, "http://iss.ndl.go.jp/books/#{identifier.body}"
|
65
65
|
when 'lccn'
|
66
66
|
link_to identifier.body, "http://lccn.loc.gov/#{identifier.body}"
|
67
|
+
when 'ncid'
|
68
|
+
link_to identifier.body, "http://ci.nii.ac.jp/ncid/#{identifier.body}"
|
67
69
|
else
|
68
70
|
identifier.body
|
69
71
|
end
|
data/lib/enju_biblio/engine.rb
CHANGED
data/lib/enju_biblio/version.rb
CHANGED
@@ -201,7 +201,7 @@ describe AgentImportFilesController do
|
|
201
201
|
login_fixture_librarian
|
202
202
|
|
203
203
|
it "should update agent_import_file" do
|
204
|
-
put :update, :id => agent_import_files(:agent_import_file_00003).id, :agent_import_file => { }
|
204
|
+
put :update, :id => agent_import_files(:agent_import_file_00003).id, :agent_import_file => {mode: "modify"}
|
205
205
|
expect(response).to redirect_to agent_import_file_url(assigns(:agent_import_file))
|
206
206
|
end
|
207
207
|
end
|
@@ -210,14 +210,14 @@ describe AgentImportFilesController do
|
|
210
210
|
login_fixture_user
|
211
211
|
|
212
212
|
it "should not update agent_import_file" do
|
213
|
-
put :update, :id => agent_import_files(:agent_import_file_00003).id, :agent_import_file => { }
|
213
|
+
put :update, :id => agent_import_files(:agent_import_file_00003).id, :agent_import_file => {mode: "modify"}
|
214
214
|
expect(response).to be_forbidden
|
215
215
|
end
|
216
216
|
end
|
217
217
|
|
218
218
|
describe "When not logged in" do
|
219
219
|
it "should not update agent_import_file" do
|
220
|
-
put :update, :id => agent_import_files(:agent_import_file_00003).id, :agent_import_file => { }
|
220
|
+
put :update, :id => agent_import_files(:agent_import_file_00003).id, :agent_import_file => {mode: "modify"}
|
221
221
|
expect(response).to redirect_to new_user_session_url
|
222
222
|
end
|
223
223
|
end
|
@@ -343,13 +343,13 @@ describe AgentMergeListsController do
|
|
343
343
|
|
344
344
|
it "should not merge agents without selected_agent_id" do
|
345
345
|
put :update, :id => agent_merge_lists(:agent_merge_list_00001).id, :mode => 'merge'
|
346
|
-
flash[:notice].should eq I18n.t('merge_list.specify_id', :
|
346
|
+
flash[:notice].should eq I18n.t('merge_list.specify_id', model: I18n.t('activerecord.models.agent'))
|
347
347
|
response.should redirect_to agent_merge_list_url(assigns(:agent_merge_list))
|
348
348
|
end
|
349
349
|
|
350
350
|
it "should merge agents with selected_agent_idand merge_mode" do
|
351
351
|
put :update, :id => agent_merge_lists(:agent_merge_list_00001).id, :selected_agent_id => 3, :mode => 'merge'
|
352
|
-
flash[:notice].should eq I18n.t('merge_list.successfully_merged', :
|
352
|
+
flash[:notice].should eq I18n.t('merge_list.successfully_merged', model: I18n.t('activerecord.models.agent'))
|
353
353
|
response.should redirect_to agent_merge_list_url(assigns(:agent_merge_list))
|
354
354
|
end
|
355
355
|
end
|
@@ -168,7 +168,7 @@ describe AgentMergesController do
|
|
168
168
|
describe "POST create" do
|
169
169
|
before(:each) do
|
170
170
|
@attrs = FactoryGirl.attributes_for(:agent_merge)
|
171
|
-
@invalid_attrs = {:agent_merge_list_id
|
171
|
+
@invalid_attrs = {agent_id: 'invalid', agent_merge_list_id: 'invalid'}
|
172
172
|
end
|
173
173
|
|
174
174
|
describe "When logged in as Administrator" do
|
@@ -84,15 +84,15 @@ describe AgentTypesController do
|
|
84
84
|
it "assigns a newly created but unsaved agent_type as @agent_type" do
|
85
85
|
# Trigger the behavior that occurs when invalid params are submitted
|
86
86
|
AgentType.any_instance.stub(:save).and_return(false)
|
87
|
-
post :create, :agent_type => {}
|
87
|
+
post :create, :agent_type => {name: "test"}
|
88
88
|
expect(assigns(:agent_type)).to be_a_new(AgentType)
|
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
|
AgentType.any_instance.stub(:save).and_return(false)
|
94
|
-
post :create, :agent_type => {}
|
95
|
-
|
94
|
+
post :create, :agent_type => {name: "test"}
|
95
|
+
expect(response).to render_template("new")
|
96
96
|
end
|
97
97
|
end
|
98
98
|
end
|
@@ -105,8 +105,8 @@ describe AgentTypesController do
|
|
105
105
|
# specifies that the AgentType created on the previous line
|
106
106
|
# receives the :update_attributes message with whatever params are
|
107
107
|
# submitted in the request.
|
108
|
-
AgentType.any_instance.should_receive(:update_attributes).with({'
|
109
|
-
put :update, :id => agent_type.id, :agent_type => {'
|
108
|
+
AgentType.any_instance.should_receive(:update_attributes).with({'name' => 'test'})
|
109
|
+
put :update, :id => agent_type.id, :agent_type => {'name' => 'test'}
|
110
110
|
end
|
111
111
|
|
112
112
|
it "assigns the requested agent_type as @agent_type" do
|
@@ -135,7 +135,7 @@ describe AgentTypesController do
|
|
135
135
|
agent_type = AgentType.create! valid_attributes
|
136
136
|
# Trigger the behavior that occurs when invalid params are submitted
|
137
137
|
AgentType.any_instance.stub(:save).and_return(false)
|
138
|
-
put :update, :id => agent_type.id, :agent_type => {}
|
138
|
+
put :update, :id => agent_type.id, :agent_type => {name: "test"}
|
139
139
|
expect(assigns(:agent_type)).to eq(agent_type)
|
140
140
|
end
|
141
141
|
|
@@ -143,8 +143,8 @@ describe AgentTypesController do
|
|
143
143
|
agent_type = AgentType.create! valid_attributes
|
144
144
|
# Trigger the behavior that occurs when invalid params are submitted
|
145
145
|
AgentType.any_instance.stub(:save).and_return(false)
|
146
|
-
put :update, :id => agent_type.id, :agent_type => {}
|
147
|
-
|
146
|
+
put :update, :id => agent_type.id, :agent_type => {name: "test"}
|
147
|
+
expect(response).to render_template("edit")
|
148
148
|
end
|
149
149
|
end
|
150
150
|
end
|
@@ -84,15 +84,15 @@ describe CarrierTypesController do
|
|
84
84
|
it "assigns a newly created but unsaved carrier_type as @carrier_type" do
|
85
85
|
# Trigger the behavior that occurs when invalid params are submitted
|
86
86
|
CarrierType.any_instance.stub(:save).and_return(false)
|
87
|
-
post :create, :carrier_type => {}
|
87
|
+
post :create, :carrier_type => {name: "test"}
|
88
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
|
-
post :create, :carrier_type => {}
|
95
|
-
|
94
|
+
post :create, :carrier_type => {name: "test"}
|
95
|
+
expect(response).to render_template("new")
|
96
96
|
end
|
97
97
|
end
|
98
98
|
end
|
@@ -105,8 +105,8 @@ describe CarrierTypesController do
|
|
105
105
|
# specifies that the CarrierType created on the previous line
|
106
106
|
# receives the :update_attributes message with whatever params are
|
107
107
|
# submitted in the request.
|
108
|
-
CarrierType.any_instance.should_receive(:update_attributes).with({'
|
109
|
-
put :update, :id => carrier_type.id, :carrier_type => {'
|
108
|
+
CarrierType.any_instance.should_receive(:update_attributes).with({'name' => 'test'})
|
109
|
+
put :update, :id => carrier_type.id, :carrier_type => {'name' => 'test'}
|
110
110
|
end
|
111
111
|
|
112
112
|
it "assigns the requested carrier_type as @carrier_type" do
|
@@ -135,7 +135,7 @@ describe CarrierTypesController do
|
|
135
135
|
carrier_type = CarrierType.create! valid_attributes
|
136
136
|
# Trigger the behavior that occurs when invalid params are submitted
|
137
137
|
CarrierType.any_instance.stub(:save).and_return(false)
|
138
|
-
put :update, :id => carrier_type.id, :carrier_type => {}
|
138
|
+
put :update, :id => carrier_type.id, :carrier_type => {name: "test"}
|
139
139
|
expect(assigns(:carrier_type)).to eq(carrier_type)
|
140
140
|
end
|
141
141
|
|
@@ -143,8 +143,8 @@ describe CarrierTypesController do
|
|
143
143
|
carrier_type = CarrierType.create! valid_attributes
|
144
144
|
# Trigger the behavior that occurs when invalid params are submitted
|
145
145
|
CarrierType.any_instance.stub(:save).and_return(false)
|
146
|
-
put :update, :id => carrier_type.id, :carrier_type => {}
|
147
|
-
|
146
|
+
put :update, :id => carrier_type.id, :carrier_type => {name: "test"}
|
147
|
+
expect(response).to render_template("edit")
|
148
148
|
end
|
149
149
|
end
|
150
150
|
end
|
@@ -84,15 +84,15 @@ describe ContentTypesController do
|
|
84
84
|
it "assigns a newly created but unsaved content_type as @content_type" do
|
85
85
|
# Trigger the behavior that occurs when invalid params are submitted
|
86
86
|
ContentType.any_instance.stub(:save).and_return(false)
|
87
|
-
post :create, :content_type => {}
|
87
|
+
post :create, :content_type => {name: "test"}
|
88
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
|
-
post :create, :content_type => {}
|
95
|
-
|
94
|
+
post :create, :content_type => {name: "test"}
|
95
|
+
expect(response).to render_template("new")
|
96
96
|
end
|
97
97
|
end
|
98
98
|
end
|
@@ -105,8 +105,8 @@ describe ContentTypesController do
|
|
105
105
|
# specifies that the ContentType created on the previous line
|
106
106
|
# receives the :update_attributes message with whatever params are
|
107
107
|
# submitted in the request.
|
108
|
-
ContentType.any_instance.should_receive(:update_attributes).with({'
|
109
|
-
put :update, :id => content_type.id, :content_type => {'
|
108
|
+
ContentType.any_instance.should_receive(:update_attributes).with({'name' => 'test'})
|
109
|
+
put :update, :id => content_type.id, :content_type => {'name' => 'test'}
|
110
110
|
end
|
111
111
|
|
112
112
|
it "assigns the requested content_type as @content_type" do
|
@@ -135,7 +135,7 @@ describe ContentTypesController do
|
|
135
135
|
content_type = ContentType.create! valid_attributes
|
136
136
|
# Trigger the behavior that occurs when invalid params are submitted
|
137
137
|
ContentType.any_instance.stub(:save).and_return(false)
|
138
|
-
put :update, :id => content_type.id, :content_type => {}
|
138
|
+
put :update, :id => content_type.id, :content_type => {name: "test"}
|
139
139
|
expect(assigns(:content_type)).to eq(content_type)
|
140
140
|
end
|
141
141
|
|
@@ -143,8 +143,8 @@ describe ContentTypesController do
|
|
143
143
|
content_type = ContentType.create! valid_attributes
|
144
144
|
# Trigger the behavior that occurs when invalid params are submitted
|
145
145
|
ContentType.any_instance.stub(:save).and_return(false)
|
146
|
-
put :update, :id => content_type.id, :content_type => {}
|
147
|
-
|
146
|
+
put :update, :id => content_type.id, :content_type => {name: "test"}
|
147
|
+
expect(response).to render_template("edit")
|
148
148
|
end
|
149
149
|
end
|
150
150
|
end
|
@@ -84,14 +84,14 @@ describe CreateTypesController do
|
|
84
84
|
it "assigns a newly created but unsaved create_type as @create_type" do
|
85
85
|
# Trigger the behavior that occurs when invalid params are submitted
|
86
86
|
CreateType.any_instance.stub(:save).and_return(false)
|
87
|
-
post :create, :create_type => {}
|
87
|
+
post :create, :create_type => {name: "test"}
|
88
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
|
-
post :create, :create_type => {}
|
94
|
+
post :create, :create_type => {name: "test"}
|
95
95
|
#expect(response).to render_template("new")
|
96
96
|
end
|
97
97
|
end
|
@@ -105,8 +105,8 @@ describe CreateTypesController do
|
|
105
105
|
# specifies that the CreateType created on the previous line
|
106
106
|
# receives the :update_attributes message with whatever params are
|
107
107
|
# submitted in the request.
|
108
|
-
CreateType.any_instance.should_receive(:update_attributes).with({'
|
109
|
-
put :update, :id => create_type.id, :create_type => {'
|
108
|
+
CreateType.any_instance.should_receive(:update_attributes).with({'name' => 'test'})
|
109
|
+
put :update, :id => create_type.id, :create_type => {'name' => 'test'}
|
110
110
|
end
|
111
111
|
|
112
112
|
it "assigns the requested create_type as @create_type" do
|
@@ -135,7 +135,7 @@ describe CreateTypesController do
|
|
135
135
|
create_type = CreateType.create! valid_attributes
|
136
136
|
# Trigger the behavior that occurs when invalid params are submitted
|
137
137
|
CreateType.any_instance.stub(:save).and_return(false)
|
138
|
-
put :update, :id => create_type.id, :create_type => {}
|
138
|
+
put :update, :id => create_type.id, :create_type => {name: "test"}
|
139
139
|
expect(assigns(:create_type)).to eq(create_type)
|
140
140
|
end
|
141
141
|
|
@@ -143,7 +143,7 @@ describe CreateTypesController do
|
|
143
143
|
create_type = CreateType.create! valid_attributes
|
144
144
|
# Trigger the behavior that occurs when invalid params are submitted
|
145
145
|
CreateType.any_instance.stub(:save).and_return(false)
|
146
|
-
put :update, :id => create_type.id, :create_type => {}
|
146
|
+
put :update, :id => create_type.id, :create_type => {name: "test"}
|
147
147
|
#expect(response).to render_template("edit")
|
148
148
|
end
|
149
149
|
end
|
@@ -84,14 +84,14 @@ describe FormOfWorksController do
|
|
84
84
|
it "assigns a newly created but unsaved form_of_work as @form_of_work" do
|
85
85
|
# Trigger the behavior that occurs when invalid params are submitted
|
86
86
|
FormOfWork.any_instance.stub(:save).and_return(false)
|
87
|
-
post :create, :form_of_work => {}
|
87
|
+
post :create, :form_of_work => {name: "test"}
|
88
88
|
expect(assigns(:form_of_work)).to be_a_new(FormOfWork)
|
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
|
FormOfWork.any_instance.stub(:save).and_return(false)
|
94
|
-
post :create, :form_of_work => {}
|
94
|
+
post :create, :form_of_work => {name: "test"}
|
95
95
|
#expect(response).to render_template("new")
|
96
96
|
end
|
97
97
|
end
|
@@ -105,8 +105,8 @@ describe FormOfWorksController do
|
|
105
105
|
# specifies that the FormOfWork created on the previous line
|
106
106
|
# receives the :update_attributes message with whatever params are
|
107
107
|
# submitted in the request.
|
108
|
-
FormOfWork.any_instance.should_receive(:update_attributes).with({'
|
109
|
-
put :update, :id => form_of_work.id, :form_of_work => {'
|
108
|
+
FormOfWork.any_instance.should_receive(:update_attributes).with({'name' => 'test'})
|
109
|
+
put :update, :id => form_of_work.id, :form_of_work => {'name' => 'test'}
|
110
110
|
end
|
111
111
|
|
112
112
|
it "assigns the requested form_of_work as @form_of_work" do
|
@@ -135,7 +135,7 @@ describe FormOfWorksController do
|
|
135
135
|
form_of_work = FormOfWork.create! valid_attributes
|
136
136
|
# Trigger the behavior that occurs when invalid params are submitted
|
137
137
|
FormOfWork.any_instance.stub(:save).and_return(false)
|
138
|
-
put :update, :id => form_of_work.id, :form_of_work => {}
|
138
|
+
put :update, :id => form_of_work.id, :form_of_work => {name: "test"}
|
139
139
|
expect(assigns(:form_of_work)).to eq(form_of_work)
|
140
140
|
end
|
141
141
|
|
@@ -143,7 +143,7 @@ describe FormOfWorksController do
|
|
143
143
|
form_of_work = FormOfWork.create! valid_attributes
|
144
144
|
# Trigger the behavior that occurs when invalid params are submitted
|
145
145
|
FormOfWork.any_instance.stub(:save).and_return(false)
|
146
|
-
put :update, :id => form_of_work.id, :form_of_work => {}
|
146
|
+
put :update, :id => form_of_work.id, :form_of_work => {name: "test"}
|
147
147
|
#expect(response).to render_template("edit")
|
148
148
|
end
|
149
149
|
end
|
@@ -84,15 +84,15 @@ describe FrequenciesController do
|
|
84
84
|
it "assigns a newly created but unsaved frequency as @frequency" do
|
85
85
|
# Trigger the behavior that occurs when invalid params are submitted
|
86
86
|
Frequency.any_instance.stub(:save).and_return(false)
|
87
|
-
post :create, :frequency => {}
|
87
|
+
post :create, :frequency => {name: "test"}
|
88
88
|
assigns(:frequency).should be_a_new(Frequency)
|
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
|
Frequency.any_instance.stub(:save).and_return(false)
|
94
|
-
post :create, :frequency => {}
|
95
|
-
|
94
|
+
post :create, :frequency => {name: "test"}
|
95
|
+
expect(response).to render_template("new")
|
96
96
|
end
|
97
97
|
end
|
98
98
|
end
|
@@ -105,8 +105,8 @@ describe FrequenciesController do
|
|
105
105
|
# specifies that the Frequency created on the previous line
|
106
106
|
# receives the :update_attributes message with whatever params are
|
107
107
|
# submitted in the request.
|
108
|
-
Frequency.any_instance.should_receive(:update_attributes).with({'
|
109
|
-
put :update, :id => frequency.id, :frequency => {'
|
108
|
+
Frequency.any_instance.should_receive(:update_attributes).with({'name' => 'test'})
|
109
|
+
put :update, :id => frequency.id, :frequency => {'name' => 'test'}
|
110
110
|
end
|
111
111
|
|
112
112
|
it "assigns the requested frequency as @frequency" do
|
@@ -135,7 +135,7 @@ describe FrequenciesController do
|
|
135
135
|
frequency = Frequency.create! valid_attributes
|
136
136
|
# Trigger the behavior that occurs when invalid params are submitted
|
137
137
|
Frequency.any_instance.stub(:save).and_return(false)
|
138
|
-
put :update, :id => frequency.id, :frequency => {}
|
138
|
+
put :update, :id => frequency.id, :frequency => {name: "test"}
|
139
139
|
assigns(:frequency).should eq(frequency)
|
140
140
|
end
|
141
141
|
|
@@ -143,8 +143,8 @@ describe FrequenciesController do
|
|
143
143
|
frequency = Frequency.create! valid_attributes
|
144
144
|
# Trigger the behavior that occurs when invalid params are submitted
|
145
145
|
Frequency.any_instance.stub(:save).and_return(false)
|
146
|
-
put :update, :id => frequency.id, :frequency => {}
|
147
|
-
|
146
|
+
put :update, :id => frequency.id, :frequency => {name: "test"}
|
147
|
+
expect(response).to render_template("edit")
|
148
148
|
end
|
149
149
|
end
|
150
150
|
end
|