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
@@ -84,15 +84,15 @@ describe IdentifierTypesController do
84
84
  it "assigns a newly created but unsaved identifier_type as @identifier_type" do
85
85
  # Trigger the behavior that occurs when invalid params are submitted
86
86
  IdentifierType.any_instance.stub(:save).and_return(false)
87
- post :create, :identifier_type => {}
87
+ post :create, :identifier_type => {name: "test"}
88
88
  expect(assigns(:identifier_type)).to be_a_new(IdentifierType)
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
  IdentifierType.any_instance.stub(:save).and_return(false)
94
- post :create, :identifier_type => {}
95
- #expect(response).to render_template("new")
94
+ post :create, :identifier_type => {name: "test"}
95
+ expect(response).to render_template("new")
96
96
  end
97
97
  end
98
98
  end
@@ -105,8 +105,8 @@ describe IdentifierTypesController do
105
105
  # specifies that the IdentifierType created on the previous line
106
106
  # receives the :update_attributes message with whatever params are
107
107
  # submitted in the request.
108
- IdentifierType.any_instance.should_receive(:update_attributes).with({'these' => 'params'})
109
- put :update, :id => identifier_type.id, :identifier_type => {'these' => 'params'}
108
+ IdentifierType.any_instance.should_receive(:update_attributes).with({'name' => 'test'})
109
+ put :update, :id => identifier_type.id, :identifier_type => {'name' => 'test'}
110
110
  end
111
111
 
112
112
  it "assigns the requested identifier_type as @identifier_type" do
@@ -135,7 +135,7 @@ describe IdentifierTypesController do
135
135
  identifier_type = IdentifierType.create! valid_attributes
136
136
  # Trigger the behavior that occurs when invalid params are submitted
137
137
  IdentifierType.any_instance.stub(:save).and_return(false)
138
- put :update, :id => identifier_type.id, :identifier_type => {}
138
+ put :update, :id => identifier_type.id, :identifier_type => {name: "test"}
139
139
  expect(assigns(:identifier_type)).to eq(identifier_type)
140
140
  end
141
141
 
@@ -143,8 +143,8 @@ describe IdentifierTypesController do
143
143
  identifier_type = IdentifierType.create! valid_attributes
144
144
  # Trigger the behavior that occurs when invalid params are submitted
145
145
  IdentifierType.any_instance.stub(:save).and_return(false)
146
- put :update, :id => identifier_type.id, :identifier_type => {}
147
- #expect(response).to render_template("edit")
146
+ put :update, :id => identifier_type.id, :identifier_type => {name: "test"}
147
+ expect(response).to render_template("edit")
148
148
  end
149
149
  end
150
150
  end
@@ -84,14 +84,14 @@ describe LicensesController do
84
84
  it "assigns a newly created but unsaved license as @license" do
85
85
  # Trigger the behavior that occurs when invalid params are submitted
86
86
  License.any_instance.stub(:save).and_return(false)
87
- post :create, :license => {}
87
+ post :create, :license => {name: "test"}
88
88
  expect(assigns(:license)).to be_a_new(License)
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
  License.any_instance.stub(:save).and_return(false)
94
- post :create, :license => {}
94
+ post :create, :license => {name: "test"}
95
95
  #expect(response).to render_template("new")
96
96
  end
97
97
  end
@@ -105,8 +105,8 @@ describe LicensesController do
105
105
  # specifies that the License created on the previous line
106
106
  # receives the :update_attributes message with whatever params are
107
107
  # submitted in the request.
108
- License.any_instance.should_receive(:update_attributes).with({'these' => 'params'})
109
- put :update, :id => license.id, :license => {'these' => 'params'}
108
+ License.any_instance.should_receive(:update_attributes).with({'name' => 'test'})
109
+ put :update, :id => license.id, :license => {'name' => 'test'}
110
110
  end
111
111
 
112
112
  it "assigns the requested license as @license" do
@@ -135,7 +135,7 @@ describe LicensesController do
135
135
  license = License.create! valid_attributes
136
136
  # Trigger the behavior that occurs when invalid params are submitted
137
137
  License.any_instance.stub(:save).and_return(false)
138
- put :update, :id => license.id, :license => {}
138
+ put :update, :id => license.id, :license => {name: "test"}
139
139
  expect(assigns(:license)).to eq(license)
140
140
  end
141
141
 
@@ -143,7 +143,7 @@ describe LicensesController do
143
143
  license = License.create! valid_attributes
144
144
  # Trigger the behavior that occurs when invalid params are submitted
145
145
  License.any_instance.stub(:save).and_return(false)
146
- put :update, :id => license.id, :license => {}
146
+ put :update, :id => license.id, :license => {name: "test"}
147
147
  #expect(response).to render_template("edit")
148
148
  end
149
149
  end
@@ -88,12 +88,24 @@ describe ManifestationsController do
88
88
  expect(assigns(:manifestations)).to_not be_nil
89
89
  end
90
90
 
91
+ it "assigns all manifestations as @manifestations when old pub_date_from and pub_date_to are specified" do
92
+ get :index, :pub_date_from => '200', :pub_date_to => '207'
93
+ assigns(:query).should eq "date_of_publication_d:[#{Time.zone.parse('200-01-01').utc.iso8601} TO #{Time.zone.parse('207-12-31').end_of_year.utc.iso8601}]"
94
+ expect(assigns(:manifestations)).to_not be_nil
95
+ end
96
+
91
97
  it "assigns all manifestations as @manifestations when acquired_from and pub_date_to are specified" do
92
98
  get :index, :acquired_from => '2000', :acquired_to => '2007'
93
99
  assigns(:query).should eq "acquired_at_d:[#{Time.zone.parse('2000-01-01').utc.iso8601} TO #{Time.zone.parse('2007-12-31').end_of_day.utc.iso8601}]"
94
100
  expect(assigns(:manifestations)).to_not be_nil
95
101
  end
96
102
 
103
+ it "assigns all manifestations as @manifestations when old acquired_from and pub_date_to are specified" do
104
+ get :index, :acquired_from => '200', :acquired_to => '207'
105
+ assigns(:query).should eq "acquired_at_d:[#{Time.zone.parse('200-01-01').utc.iso8601} TO #{Time.zone.parse('207-12-31').end_of_day.utc.iso8601}]"
106
+ expect(assigns(:manifestations)).to_not be_nil
107
+ end
108
+
97
109
  it "assigns all manifestations as @manifestations when number_of_pages_at_least and number_of_pages_at_most are specified" do
98
110
  get :index, :number_of_pages_at_least => '100', :number_of_pages_at_least => '200'
99
111
  expect(assigns(:manifestations)).to_not be_nil
@@ -381,7 +393,7 @@ describe ManifestationsController do
381
393
  end
382
394
 
383
395
  it "assigns a series_statement" do
384
- post :create, :manifestation => @attrs.merge(:series_statements_attributes => {[0] => {:original_title => SeriesStatement.find(1).original_title}})
396
+ post :create, :manifestation => @attrs.merge(:series_statements_attributes => {"0" => {:original_title => SeriesStatement.find(1).original_title}})
385
397
  assigns(:manifestation).reload
386
398
  assigns(:manifestation).series_statements.pluck(:original_title).include?(series_statements(:one).original_title).should be_truthy
387
399
  end
@@ -510,7 +522,7 @@ describe ManifestationsController do
510
522
  end
511
523
 
512
524
  it "assigns a series_statement" do
513
- put :update, :id => @manifestation.id, :manifestation => @attrs.merge(:series_statements_attributes => {[0] => {:original_title => series_statements(:two).original_title, "_destroy"=>"false"}})
525
+ put :update, :id => @manifestation.id, :manifestation => @attrs.merge(:series_statements_attributes => {"0" => {:original_title => series_statements(:two).original_title, "_destroy"=>"false"}})
514
526
  assigns(:manifestation).reload
515
527
  assigns(:manifestation).series_statements.pluck(:original_title).include?(series_statements(:two).original_title).should be_truthy
516
528
  end
@@ -627,6 +639,14 @@ describe ManifestationsController do
627
639
  delete :destroy, :id => 1
628
640
  expect(response).to be_forbidden
629
641
  end
642
+
643
+ it "should not destroy manifestation of series master with children" do
644
+ @series_statement = FactoryGirl.create(:series_statement_serial)
645
+ @manifestation = FactoryGirl.create(:manifestation_serial)
646
+ delete :destroy, :id => @manifestation.id
647
+ expect(response).to redirect_to(manifestations_url)
648
+ end
649
+
630
650
  end
631
651
 
632
652
  describe "When logged in as Librarian" do
@@ -84,14 +84,14 @@ describe MediumOfPerformancesController do
84
84
  it "assigns a newly created but unsaved medium_of_performance as @medium_of_performance" do
85
85
  # Trigger the behavior that occurs when invalid params are submitted
86
86
  MediumOfPerformance.any_instance.stub(:save).and_return(false)
87
- post :create, :medium_of_performance => {}
87
+ post :create, :medium_of_performance => {name: "test"}
88
88
  expect(assigns(:medium_of_performance)).to be_a_new(MediumOfPerformance)
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
  MediumOfPerformance.any_instance.stub(:save).and_return(false)
94
- post :create, :medium_of_performance => {}
94
+ post :create, :medium_of_performance => {name: "test"}
95
95
  #expect(response).to render_template("new")
96
96
  end
97
97
  end
@@ -105,8 +105,8 @@ describe MediumOfPerformancesController do
105
105
  # specifies that the MediumOfPerformance created on the previous line
106
106
  # receives the :update_attributes message with whatever params are
107
107
  # submitted in the request.
108
- MediumOfPerformance.any_instance.should_receive(:update_attributes).with({'these' => 'params'})
109
- put :update, :id => medium_of_performance.id, :medium_of_performance => {'these' => 'params'}
108
+ MediumOfPerformance.any_instance.should_receive(:update_attributes).with({'name' => 'test'})
109
+ put :update, :id => medium_of_performance.id, :medium_of_performance => {'name' => 'test'}
110
110
  end
111
111
 
112
112
  it "assigns the requested medium_of_performance as @medium_of_performance" do
@@ -135,7 +135,7 @@ describe MediumOfPerformancesController do
135
135
  medium_of_performance = MediumOfPerformance.create! valid_attributes
136
136
  # Trigger the behavior that occurs when invalid params are submitted
137
137
  MediumOfPerformance.any_instance.stub(:save).and_return(false)
138
- put :update, :id => medium_of_performance.id, :medium_of_performance => {}
138
+ put :update, :id => medium_of_performance.id, :medium_of_performance => {name: "test"}
139
139
  expect(assigns(:medium_of_performance)).to eq(medium_of_performance)
140
140
  end
141
141
 
@@ -143,7 +143,7 @@ describe MediumOfPerformancesController do
143
143
  medium_of_performance = MediumOfPerformance.create! valid_attributes
144
144
  # Trigger the behavior that occurs when invalid params are submitted
145
145
  MediumOfPerformance.any_instance.stub(:save).and_return(false)
146
- put :update, :id => medium_of_performance.id, :medium_of_performance => {}
146
+ put :update, :id => medium_of_performance.id, :medium_of_performance => {name: "test"}
147
147
  #expect(response).to render_template("edit")
148
148
  end
149
149
  end
@@ -84,14 +84,14 @@ describe ProduceTypesController do
84
84
  it "assigns a newly created but unsaved produce_type as @produce_type" do
85
85
  # Trigger the behavior that occurs when invalid params are submitted
86
86
  ProduceType.any_instance.stub(:save).and_return(false)
87
- post :create, :produce_type => {}
87
+ post :create, :produce_type => {name: "test"}
88
88
  expect(assigns(:produce_type)).to be_a_new(ProduceType)
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
  ProduceType.any_instance.stub(:save).and_return(false)
94
- post :create, :produce_type => {}
94
+ post :create, :produce_type => {name: "test"}
95
95
  #expect(response).to render_template("new")
96
96
  end
97
97
  end
@@ -105,8 +105,8 @@ describe ProduceTypesController do
105
105
  # specifies that the ProduceType created on the previous line
106
106
  # receives the :update_attributes message with whatever params are
107
107
  # submitted in the request.
108
- ProduceType.any_instance.should_receive(:update_attributes).with({'these' => 'params'})
109
- put :update, :id => produce_type.id, :produce_type => {'these' => 'params'}
108
+ ProduceType.any_instance.should_receive(:update_attributes).with({'name' => 'test'})
109
+ put :update, :id => produce_type.id, :produce_type => {'name' => 'test'}
110
110
  end
111
111
 
112
112
  it "assigns the requested produce_type as @produce_type" do
@@ -135,7 +135,7 @@ describe ProduceTypesController do
135
135
  produce_type = ProduceType.create! valid_attributes
136
136
  # Trigger the behavior that occurs when invalid params are submitted
137
137
  ProduceType.any_instance.stub(:save).and_return(false)
138
- put :update, :id => produce_type.id, :produce_type => {}
138
+ put :update, :id => produce_type.id, :produce_type => {name: "test"}
139
139
  expect(assigns(:produce_type)).to eq(produce_type)
140
140
  end
141
141
 
@@ -143,7 +143,7 @@ describe ProduceTypesController do
143
143
  produce_type = ProduceType.create! valid_attributes
144
144
  # Trigger the behavior that occurs when invalid params are submitted
145
145
  ProduceType.any_instance.stub(:save).and_return(false)
146
- put :update, :id => produce_type.id, :produce_type => {}
146
+ put :update, :id => produce_type.id, :produce_type => {name: "test"}
147
147
  #expect(response).to render_template("edit")
148
148
  end
149
149
  end
@@ -84,14 +84,14 @@ describe RealizeTypesController do
84
84
  it "assigns a newly created but unsaved realize_type as @realize_type" do
85
85
  # Trigger the behavior that occurs when invalid params are submitted
86
86
  RealizeType.any_instance.stub(:save).and_return(false)
87
- post :create, :realize_type => {}
87
+ post :create, :realize_type => {name: "test"}
88
88
  expect(assigns(:realize_type)).to be_a_new(RealizeType)
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
  RealizeType.any_instance.stub(:save).and_return(false)
94
- post :create, :realize_type => {}
94
+ post :create, :realize_type => {name: "test"}
95
95
  #expect(response).to render_template("new")
96
96
  end
97
97
  end
@@ -105,8 +105,8 @@ describe RealizeTypesController do
105
105
  # specifies that the RealizeType created on the previous line
106
106
  # receives the :update_attributes message with whatever params are
107
107
  # submitted in the request.
108
- RealizeType.any_instance.should_receive(:update_attributes).with({'these' => 'params'})
109
- put :update, :id => realize_type.id, :realize_type => {'these' => 'params'}
108
+ RealizeType.any_instance.should_receive(:update_attributes).with({'name' => 'test'})
109
+ put :update, :id => realize_type.id, :realize_type => {'name' => 'test'}
110
110
  end
111
111
 
112
112
  it "assigns the requested realize_type as @realize_type" do
@@ -135,7 +135,7 @@ describe RealizeTypesController do
135
135
  realize_type = RealizeType.create! valid_attributes
136
136
  # Trigger the behavior that occurs when invalid params are submitted
137
137
  RealizeType.any_instance.stub(:save).and_return(false)
138
- put :update, :id => realize_type.id, :realize_type => {}
138
+ put :update, :id => realize_type.id, :realize_type => {name: "test"}
139
139
  expect(assigns(:realize_type)).to eq(realize_type)
140
140
  end
141
141
 
@@ -143,7 +143,7 @@ describe RealizeTypesController do
143
143
  realize_type = RealizeType.create! valid_attributes
144
144
  # Trigger the behavior that occurs when invalid params are submitted
145
145
  RealizeType.any_instance.stub(:save).and_return(false)
146
- put :update, :id => realize_type.id, :realize_type => {}
146
+ put :update, :id => realize_type.id, :realize_type => {name: "test"}
147
147
  #expect(response).to render_template("edit")
148
148
  end
149
149
  end
@@ -46,7 +46,7 @@ describe ResourceExportFilesController do
46
46
  login_fixture_admin
47
47
 
48
48
  it "assigns the requested resource_export_file as @resource_export_file" do
49
- get :show, :id => resource_export_files(:resource_export_file_00003).id
49
+ get :show, id: resource_export_files(:resource_export_file_00003).id
50
50
  expect(assigns(:resource_export_file)).to eq(resource_export_files(:resource_export_file_00003))
51
51
  expect(response).to be_success
52
52
  end
@@ -56,7 +56,7 @@ describe ResourceExportFilesController do
56
56
  login_fixture_librarian
57
57
 
58
58
  it "assigns the requested resource_export_file as @resource_export_file" do
59
- get :show, :id => resource_export_files(:resource_export_file_00003).id
59
+ get :show, id: resource_export_files(:resource_export_file_00003).id
60
60
  expect(assigns(:resource_export_file)).to eq(resource_export_files(:resource_export_file_00003))
61
61
  expect(response).to be_success
62
62
  end
@@ -66,7 +66,7 @@ describe ResourceExportFilesController do
66
66
  login_fixture_user
67
67
 
68
68
  it "assigns the requested resource_export_file as @resource_export_file" do
69
- get :show, :id => resource_export_files(:resource_export_file_00003).id
69
+ get :show, id: resource_export_files(:resource_export_file_00003).id
70
70
  expect(assigns(:resource_export_file)).to eq(resource_export_files(:resource_export_file_00003))
71
71
  expect(response).to be_forbidden
72
72
  end
@@ -74,7 +74,7 @@ describe ResourceExportFilesController do
74
74
 
75
75
  describe "When not logged in" do
76
76
  it "assigns the requested resource_export_file as @resource_export_file" do
77
- get :show, :id => resource_export_files(:resource_export_file_00003).id
77
+ get :show, id: resource_export_files(:resource_export_file_00003).id
78
78
  expect(assigns(:resource_export_file)).to eq(resource_export_files(:resource_export_file_00003))
79
79
  expect(response).to redirect_to(new_user_session_url)
80
80
  end
@@ -129,7 +129,7 @@ describe ResourceExportFilesController do
129
129
  end
130
130
 
131
131
  it "should create agent_export_file" do
132
- post :create, :resource_export_file => { }
132
+ post :create, resource_export_file: {mode: 'export'}
133
133
  expect(assigns(:resource_export_file)).to be_valid
134
134
  assigns(:resource_export_file).user.username.should eq @user.username
135
135
  expect(response).to redirect_to resource_export_file_url(assigns(:resource_export_file))
@@ -143,7 +143,7 @@ describe ResourceExportFilesController do
143
143
  end
144
144
 
145
145
  it "should be forbidden" do
146
- post :create, :resource_export_file => { }
146
+ post :create, resource_export_file: {mode: 'export'}
147
147
  assigns(:resource_export_file).user.should be_nil
148
148
  expect(response).to be_forbidden
149
149
  end
@@ -151,7 +151,7 @@ describe ResourceExportFilesController do
151
151
 
152
152
  describe "When not logged in" do
153
153
  it "should be redirected to new session url" do
154
- post :create, :resource_export_file => { }
154
+ post :create, resource_export_file: {mode: 'export'}
155
155
  assigns(:resource_export_file).user.should be_nil
156
156
  expect(response).to redirect_to new_user_session_url
157
157
  end
@@ -164,7 +164,7 @@ describe ResourceExportFilesController do
164
164
 
165
165
  it "assigns the requested resource_export_file as @resource_export_file" do
166
166
  resource_export_file = resource_export_files(:resource_export_file_00001)
167
- get :edit, :id => resource_export_file.id
167
+ get :edit, id: resource_export_file.id
168
168
  expect(assigns(:resource_export_file)).to eq(resource_export_file)
169
169
  end
170
170
  end
@@ -174,7 +174,7 @@ describe ResourceExportFilesController do
174
174
 
175
175
  it "assigns the requested resource_export_file as @resource_export_file" do
176
176
  resource_export_file = resource_export_files(:resource_export_file_00001)
177
- get :edit, :id => resource_export_file.id
177
+ get :edit, id: resource_export_file.id
178
178
  expect(assigns(:resource_export_file)).to eq(resource_export_file)
179
179
  end
180
180
  end
@@ -184,7 +184,7 @@ describe ResourceExportFilesController do
184
184
 
185
185
  it "assigns the requested resource_export_file as @resource_export_file" do
186
186
  resource_export_file = resource_export_files(:resource_export_file_00001)
187
- get :edit, :id => resource_export_file.id
187
+ get :edit, id: resource_export_file.id
188
188
  expect(response).to be_forbidden
189
189
  end
190
190
  end
@@ -192,7 +192,7 @@ describe ResourceExportFilesController do
192
192
  describe "When not logged in" do
193
193
  it "should not assign the requested resource_export_file as @resource_export_file" do
194
194
  resource_export_file = resource_export_files(:resource_export_file_00001)
195
- get :edit, :id => resource_export_file.id
195
+ get :edit, id: resource_export_file.id
196
196
  expect(response).to redirect_to(new_user_session_url)
197
197
  end
198
198
  end
@@ -203,7 +203,7 @@ describe ResourceExportFilesController do
203
203
  login_fixture_admin
204
204
 
205
205
  it "should update resource_export_file" do
206
- put :update, :id => resource_export_files(:resource_export_file_00003).id, :resource_export_file => { }
206
+ put :update, id: resource_export_files(:resource_export_file_00003).id, resource_export_file: {mode: 'export'}
207
207
  expect(response).to redirect_to resource_export_file_url(assigns(:resource_export_file))
208
208
  end
209
209
  end
@@ -212,7 +212,7 @@ describe ResourceExportFilesController do
212
212
  login_fixture_librarian
213
213
 
214
214
  it "should update resource_export_file" do
215
- put :update, :id => resource_export_files(:resource_export_file_00003).id, :resource_export_file => { }
215
+ put :update, id: resource_export_files(:resource_export_file_00003).id, resource_export_file: {mode: 'export'}
216
216
  expect(response).to redirect_to resource_export_file_url(assigns(:resource_export_file))
217
217
  end
218
218
  end
@@ -221,14 +221,14 @@ describe ResourceExportFilesController do
221
221
  login_fixture_user
222
222
 
223
223
  it "should not update resource_export_file" do
224
- put :update, :id => resource_export_files(:resource_export_file_00003).id, :resource_export_file => { }
224
+ put :update, id: resource_export_files(:resource_export_file_00003).id, resource_export_file: {mode: 'export'}
225
225
  expect(response).to be_forbidden
226
226
  end
227
227
  end
228
228
 
229
229
  describe "When not logged in" do
230
230
  it "should not update resource_export_file" do
231
- put :update, :id => resource_export_files(:resource_export_file_00003).id, :resource_export_file => { }
231
+ put :update, id: resource_export_files(:resource_export_file_00003).id, resource_export_file: {mode: 'export'}
232
232
  expect(response).to redirect_to new_user_session_url
233
233
  end
234
234
  end
@@ -243,11 +243,11 @@ describe ResourceExportFilesController do
243
243
  login_fixture_admin
244
244
 
245
245
  it "destroys the requested resource_export_file" do
246
- delete :destroy, :id => @resource_export_file.id
246
+ delete :destroy, id: @resource_export_file.id
247
247
  end
248
248
 
249
249
  it "redirects to the resource_export_files list" do
250
- delete :destroy, :id => @resource_export_file.id
250
+ delete :destroy, id: @resource_export_file.id
251
251
  expect(response).to redirect_to(resource_export_files_url)
252
252
  end
253
253
  end
@@ -256,11 +256,11 @@ describe ResourceExportFilesController do
256
256
  login_fixture_librarian
257
257
 
258
258
  it "destroys the requested resource_export_file" do
259
- delete :destroy, :id => @resource_export_file.id
259
+ delete :destroy, id: @resource_export_file.id
260
260
  end
261
261
 
262
262
  it "redirects to the resource_export_files list" do
263
- delete :destroy, :id => @resource_export_file.id
263
+ delete :destroy, id: @resource_export_file.id
264
264
  expect(response).to redirect_to(resource_export_files_url)
265
265
  end
266
266
  end
@@ -269,22 +269,22 @@ describe ResourceExportFilesController do
269
269
  login_fixture_user
270
270
 
271
271
  it "destroys the requested resource_export_file" do
272
- delete :destroy, :id => @resource_export_file.id
272
+ delete :destroy, id: @resource_export_file.id
273
273
  end
274
274
 
275
275
  it "should be forbidden" do
276
- delete :destroy, :id => @resource_export_file.id
276
+ delete :destroy, id: @resource_export_file.id
277
277
  expect(response).to be_forbidden
278
278
  end
279
279
  end
280
280
 
281
281
  describe "When not logged in" do
282
282
  it "destroys the requested resource_export_file" do
283
- delete :destroy, :id => @resource_export_file.id
283
+ delete :destroy, id: @resource_export_file.id
284
284
  end
285
285
 
286
286
  it "should be forbidden" do
287
- delete :destroy, :id => @resource_export_file.id
287
+ delete :destroy, id: @resource_export_file.id
288
288
  expect(response).to redirect_to(new_user_session_url)
289
289
  end
290
290
  end