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.
Files changed (144) hide show
  1. checksums.yaml +4 -4
  2. data/app/controllers/agent_import_files_controller.rb +9 -2
  3. data/app/controllers/agent_import_results_controller.rb +7 -0
  4. data/app/controllers/agent_merge_lists_controller.rb +7 -2
  5. data/app/controllers/agent_merges_controller.rb +7 -2
  6. data/app/controllers/agent_relationship_types_controller.rb +9 -4
  7. data/app/controllers/agent_relationships_controller.rb +8 -2
  8. data/app/controllers/agent_types_controller.rb +9 -4
  9. data/app/controllers/agents_controller.rb +15 -10
  10. data/app/controllers/carrier_types_controller.rb +14 -2
  11. data/app/controllers/content_types_controller.rb +9 -4
  12. data/app/controllers/countries_controller.rb +11 -4
  13. data/app/controllers/create_types_controller.rb +9 -4
  14. data/app/controllers/creates_controller.rb +8 -2
  15. data/app/controllers/donates_controller.rb +7 -2
  16. data/app/controllers/form_of_works_controller.rb +9 -4
  17. data/app/controllers/frequencies_controller.rb +9 -4
  18. data/app/controllers/identifier_types_controller.rb +11 -4
  19. data/app/controllers/import_requests_controller.rb +15 -2
  20. data/app/controllers/items_controller.rb +21 -3
  21. data/app/controllers/languages_controller.rb +12 -4
  22. data/app/controllers/licenses_controller.rb +9 -4
  23. data/app/controllers/manifestation_relationship_types_controller.rb +11 -4
  24. data/app/controllers/manifestation_relationships_controller.rb +8 -2
  25. data/app/controllers/manifestations_controller.rb +105 -10
  26. data/app/controllers/medium_of_performances_controller.rb +9 -4
  27. data/app/controllers/owns_controller.rb +7 -2
  28. data/app/controllers/picture_files_controller.rb +8 -2
  29. data/app/controllers/produce_types_controller.rb +9 -4
  30. data/app/controllers/produces_controller.rb +8 -2
  31. data/app/controllers/realize_types_controller.rb +11 -4
  32. data/app/controllers/realizes_controller.rb +8 -2
  33. data/app/controllers/resource_export_files_controller.rb +7 -2
  34. data/app/controllers/resource_import_files_controller.rb +9 -2
  35. data/app/controllers/resource_import_results_controller.rb +7 -0
  36. data/app/controllers/series_statement_merge_lists_controller.rb +7 -2
  37. data/app/controllers/series_statement_merges_controller.rb +9 -2
  38. data/app/controllers/series_statements_controller.rb +13 -2
  39. data/app/models/agent.rb +0 -9
  40. data/app/models/agent_import_file.rb +3 -3
  41. data/app/models/agent_import_file_transition.rb +1 -1
  42. data/app/models/agent_import_result.rb +0 -1
  43. data/app/models/agent_merge.rb +0 -1
  44. data/app/models/agent_merge_list.rb +0 -1
  45. data/app/models/agent_relationship.rb +0 -1
  46. data/app/models/agent_relationship_type.rb +0 -1
  47. data/app/models/agent_type.rb +0 -1
  48. data/app/models/carrier_type.rb +1 -7
  49. data/app/models/content_type.rb +0 -1
  50. data/app/models/country.rb +0 -1
  51. data/app/models/create.rb +0 -1
  52. data/app/models/create_type.rb +0 -1
  53. data/app/models/donate.rb +0 -1
  54. data/app/models/enju_biblio/ability.rb +25 -2
  55. data/app/models/exemplify.rb +1 -1
  56. data/app/models/form_of_work.rb +0 -1
  57. data/app/models/frequency.rb +0 -1
  58. data/app/models/identifier.rb +1 -1
  59. data/app/models/identifier_type.rb +0 -1
  60. data/app/models/import_request.rb +8 -7
  61. data/app/models/import_request_transition.rb +1 -1
  62. data/app/models/item.rb +0 -5
  63. data/app/models/language.rb +0 -2
  64. data/app/models/license.rb +0 -1
  65. data/app/models/manifestation.rb +29 -33
  66. data/app/models/manifestation_relationship.rb +0 -1
  67. data/app/models/manifestation_relationship_type.rb +0 -1
  68. data/app/models/medium_of_performance.rb +0 -1
  69. data/app/models/own.rb +0 -1
  70. data/app/models/picture_file.rb +1 -3
  71. data/app/models/produce.rb +0 -1
  72. data/app/models/produce_type.rb +0 -1
  73. data/app/models/realize.rb +0 -1
  74. data/app/models/realize_type.rb +0 -1
  75. data/app/models/resource_export_file.rb +9 -3
  76. data/app/models/resource_export_file_transition.rb +1 -1
  77. data/app/models/resource_import_file.rb +18 -10
  78. data/app/models/resource_import_file_transition.rb +1 -1
  79. data/app/models/resource_import_result.rb +0 -1
  80. data/app/models/series_statement.rb +0 -7
  81. data/app/models/series_statement_merge.rb +0 -1
  82. data/app/models/series_statement_merge_list.rb +0 -1
  83. data/app/views/items/index.html.erb +11 -0
  84. data/app/views/layouts/items.html.erb +29 -0
  85. data/app/views/manifestations/_form.html.erb +3 -3
  86. data/app/views/manifestations/_index_form_series_statement.html.erb +1 -1
  87. data/app/views/manifestations/_list.html.erb +15 -0
  88. data/app/views/manifestations/_manifestation.html.erb +59 -38
  89. data/app/views/manifestations/_pickup.html.erb +8 -0
  90. data/app/views/manifestations/_show_detail_librarian.html.erb +8 -0
  91. data/app/views/manifestations/_show_detail_user.html.erb +8 -0
  92. data/app/views/manifestations/_show_holding.html.erb +19 -0
  93. data/app/views/manifestations/_submenu_parent.html.erb +3 -0
  94. data/app/views/manifestations/index.atom.builder +3 -0
  95. data/app/views/manifestations/index.html.erb +31 -1
  96. data/app/views/manifestations/index.opds.builder +3 -0
  97. data/app/views/manifestations/show.html.erb +4 -1
  98. data/app/views/resource_export_files/index.html.erb +2 -2
  99. data/app/views/resource_export_files/show.html.erb +1 -1
  100. data/config/locales/translation_en.yml +1 -0
  101. data/config/locales/translation_ja.yml +1 -0
  102. data/db/migrate/20150117111136_add_foreign_key_to_items_referencing_manifestations.rb +5 -0
  103. data/lib/enju_biblio/biblio_helper.rb +2 -0
  104. data/lib/enju_biblio/engine.rb +0 -1
  105. data/lib/enju_biblio/version.rb +1 -1
  106. data/spec/controllers/agent_import_files_controller_spec.rb +3 -3
  107. data/spec/controllers/agent_merge_lists_controller_spec.rb +2 -2
  108. data/spec/controllers/agent_merges_controller_spec.rb +1 -1
  109. data/spec/controllers/agent_types_controller_spec.rb +8 -8
  110. data/spec/controllers/carrier_types_controller_spec.rb +8 -8
  111. data/spec/controllers/content_types_controller_spec.rb +8 -8
  112. data/spec/controllers/create_types_controller_spec.rb +6 -6
  113. data/spec/controllers/form_of_works_controller_spec.rb +6 -6
  114. data/spec/controllers/frequencies_controller_spec.rb +8 -8
  115. data/spec/controllers/identifier_types_controller_spec.rb +8 -8
  116. data/spec/controllers/licenses_controller_spec.rb +6 -6
  117. data/spec/controllers/manifestations_controller_spec.rb +22 -2
  118. data/spec/controllers/medium_of_performances_controller_spec.rb +6 -6
  119. data/spec/controllers/produce_types_controller_spec.rb +6 -6
  120. data/spec/controllers/realize_types_controller_spec.rb +6 -6
  121. data/spec/controllers/resource_export_files_controller_spec.rb +23 -23
  122. data/spec/controllers/resource_import_files_controller_spec.rb +4 -4
  123. data/spec/dummy/app/models/user.rb +0 -1
  124. data/spec/dummy/bin/bundle +3 -0
  125. data/spec/dummy/bin/rails +4 -0
  126. data/spec/dummy/bin/rake +4 -0
  127. data/spec/dummy/bin/setup +29 -0
  128. data/spec/dummy/config/application.rb +2 -2
  129. data/spec/dummy/config/boot.rb +4 -9
  130. data/spec/dummy/config/environment.rb +3 -3
  131. data/spec/dummy/db/schema.rb +118 -118
  132. data/spec/factories/manifestation.rb +8 -0
  133. data/spec/factories/series_statement.rb +5 -0
  134. data/spec/fixtures/events.yml +13 -39
  135. data/spec/fixtures/identifier_types.yml +7 -0
  136. data/spec/fixtures/identifiers.yml +7 -0
  137. data/spec/fixtures/manifestations.yml +9 -0
  138. data/spec/fixtures/use_restrictions.yml +1 -1
  139. data/spec/views/manifestations/show.html.erb_spec.rb +8 -0
  140. metadata +31 -43
  141. data/spec/dummy/db/test.sqlite3 +0 -0
  142. data/spec/dummy/script/rails +0 -6
  143. data/spec/dummy/tmp/cache/stdout +0 -25
  144. 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.resource_export.url if resource_export_file.resource_export.path %>
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, method: :delete, data: {confirm: t('page.are_you_sure')}, method: :delete -%>
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.resource_export.url if @resource_export_file.resource_export_file_name %>
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>
@@ -410,6 +410,7 @@ en:
410
410
  add_series_statement: Add another series statement
411
411
  merge: "Merge!"
412
412
  merge_resource: "Merge %{model}"
413
+ new_acquisition: Acquisition
413
414
 
414
415
  merge_list:
415
416
  successfully_merged: "%{model} were merged successfully."
@@ -414,6 +414,7 @@ ja:
414
414
  add_series_statement: 別のシリーズ情報を追加する
415
415
  merge: "統合する(取り消しはできません)"
416
416
  merge_resource: "%{model}を統合する"
417
+ new_acquisition: 新規受入
417
418
 
418
419
  merge_list:
419
420
  successfully_merged: "%{model}は正常に統合されました。"
@@ -0,0 +1,5 @@
1
+ class AddForeignKeyToItemsReferencingManifestations < ActiveRecord::Migration
2
+ def change
3
+ add_foreign_key :items, :manifestations
4
+ end
5
+ end
@@ -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
@@ -1,4 +1,3 @@
1
- require 'enju_seed'
2
1
  require 'paper_trail'
3
2
  require 'paperclip'
4
3
  require 'paperclip-meta'
@@ -1,3 +1,3 @@
1
1
  module EnjuBiblio
2
- VERSION = "0.1.0.pre63"
2
+ VERSION = "0.1.0.pre64"
3
3
  end
@@ -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', :model => I18n.t('activerecord.models.agent'))
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', :model => I18n.t('activerecord.models.agent'))
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
- #expect(response).to render_template("new")
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({'these' => 'params'})
109
- put :update, :id => agent_type.id, :agent_type => {'these' => 'params'}
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
- #expect(response).to render_template("edit")
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
- #expect(response).to render_template("new")
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({'these' => 'params'})
109
- put :update, :id => carrier_type.id, :carrier_type => {'these' => 'params'}
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
- #expect(response).to render_template("edit")
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
- #expect(response).to render_template("new")
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({'these' => 'params'})
109
- put :update, :id => content_type.id, :content_type => {'these' => 'params'}
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
- #expect(response).to render_template("edit")
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({'these' => 'params'})
109
- put :update, :id => create_type.id, :create_type => {'these' => 'params'}
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({'these' => 'params'})
109
- put :update, :id => form_of_work.id, :form_of_work => {'these' => 'params'}
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
- #expect(response).to render_template("new")
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({'these' => 'params'})
109
- put :update, :id => frequency.id, :frequency => {'these' => 'params'}
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
- #expect(response).to render_template("edit")
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