enju_biblio 0.2.0 → 0.2.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (76) hide show
  1. checksums.yaml +4 -4
  2. data/app/assets/images/icons/book.png +0 -0
  3. data/app/assets/images/icons/cd.png +0 -0
  4. data/app/assets/images/icons/dvd.png +0 -0
  5. data/app/assets/images/icons/monitor.png +0 -0
  6. data/app/controllers/carrier_types_controller.rb +8 -3
  7. data/app/controllers/manifestations_controller.rb +17 -4
  8. data/app/controllers/picture_files_controller.rb +1 -1
  9. data/app/controllers/series_statements_controller.rb +6 -0
  10. data/app/helpers/manifestations_helper.rb +1 -1
  11. data/app/models/agent_import_file_transition.rb +1 -0
  12. data/app/models/carrier_type.rb +11 -7
  13. data/app/models/import_request_transition.rb +1 -0
  14. data/app/models/manifestation.rb +5 -0
  15. data/app/models/resource_export_file_transition.rb +1 -0
  16. data/app/models/resource_import_file_transition.rb +1 -0
  17. data/app/views/carrier_types/index.html.erb +4 -1
  18. data/app/views/manifestations/_show_detail_librarian.html.erb +4 -0
  19. data/app/views/manifestations/index.html.erb +3 -0
  20. data/config/locales/translation_en.yml +2 -0
  21. data/config/locales/translation_ja.yml +2 -0
  22. data/lib/enju_biblio/biblio_helper.rb +1 -12
  23. data/lib/enju_biblio/version.rb +1 -1
  24. data/lib/generators/enju_biblio/setup/templates/config/schedule.rb +3 -3
  25. data/lib/tasks/carrier_type.rb +30 -18
  26. data/lib/tasks/enju_biblio_tasks.rake +2 -0
  27. data/spec/controllers/agent_import_files_controller_spec.rb +87 -87
  28. data/spec/controllers/agent_import_results_controller_spec.rb +22 -22
  29. data/spec/controllers/agent_merge_lists_controller_spec.rb +157 -157
  30. data/spec/controllers/agent_merges_controller_spec.rb +151 -151
  31. data/spec/controllers/agent_relationship_types_controller_spec.rb +152 -152
  32. data/spec/controllers/agent_relationships_controller_spec.rb +153 -153
  33. data/spec/controllers/agent_types_controller_spec.rb +49 -50
  34. data/spec/controllers/agents_controller_spec.rb +234 -234
  35. data/spec/controllers/carrier_types_controller_spec.rb +123 -103
  36. data/spec/controllers/content_types_controller_spec.rb +51 -52
  37. data/spec/controllers/countries_controller_spec.rb +156 -156
  38. data/spec/controllers/create_types_controller_spec.rb +48 -49
  39. data/spec/controllers/creates_controller_spec.rb +154 -154
  40. data/spec/controllers/donates_controller_spec.rb +153 -153
  41. data/spec/controllers/form_of_works_controller_spec.rb +48 -49
  42. data/spec/controllers/frequencies_controller_spec.rb +51 -52
  43. data/spec/controllers/identifier_types_controller_spec.rb +48 -49
  44. data/spec/controllers/import_requests_controller_spec.rb +165 -164
  45. data/spec/controllers/items_controller_spec.rb +214 -216
  46. data/spec/controllers/languages_controller_spec.rb +109 -109
  47. data/spec/controllers/licenses_controller_spec.rb +48 -49
  48. data/spec/controllers/manifestation_relationship_types_controller_spec.rb +152 -152
  49. data/spec/controllers/manifestation_relationships_controller_spec.rb +153 -153
  50. data/spec/controllers/manifestations_controller_spec.rb +319 -289
  51. data/spec/controllers/medium_of_performances_controller_spec.rb +48 -49
  52. data/spec/controllers/owns_controller_spec.rb +153 -153
  53. data/spec/controllers/picture_files_controller_spec.rb +156 -156
  54. data/spec/controllers/produce_types_controller_spec.rb +48 -49
  55. data/spec/controllers/produces_controller_spec.rb +154 -154
  56. data/spec/controllers/realize_types_controller_spec.rb +48 -49
  57. data/spec/controllers/realizes_controller_spec.rb +155 -155
  58. data/spec/controllers/resource_export_files_controller_spec.rb +72 -72
  59. data/spec/controllers/resource_import_files_controller_spec.rb +90 -90
  60. data/spec/controllers/resource_import_results_controller_spec.rb +43 -43
  61. data/spec/controllers/series_statement_merge_lists_controller_spec.rb +153 -153
  62. data/spec/controllers/series_statement_merges_controller_spec.rb +151 -151
  63. data/spec/controllers/series_statements_controller_spec.rb +154 -154
  64. data/spec/factories/checkout.rb +9 -0
  65. data/spec/factories/library.rb +13 -0
  66. data/spec/factories/shelf.rb +6 -0
  67. data/spec/fixtures/carrier_types.yml +11 -7
  68. data/spec/models/carrier_type_spec.rb +11 -7
  69. data/spec/models/resource_export_file_spec.rb +58 -16
  70. data/spec/support/resque.rb +0 -1
  71. data/spec/views/manifestations/show.html.erb_spec.rb +5 -0
  72. data/spec/views/resource_import_files/index.html.erb_spec.rb +1 -1
  73. data/spec/views/resource_import_files/show.html.erb_spec.rb +1 -1
  74. data/spec/views/resource_import_results/index.html.erb_spec.rb +1 -1
  75. data/spec/views/resource_import_results/show.html.erb_spec.rb +1 -1
  76. metadata +49 -39
@@ -20,7 +20,6 @@ require 'rails_helper'
20
20
 
21
21
  describe CarrierTypesController do
22
22
  fixtures :all
23
- login_fixture_admin
24
23
 
25
24
  # This should return the minimal set of attributes required to create a valid
26
25
  # CarrierType. As you add validations to CarrierType, be sure to
@@ -29,139 +28,160 @@ describe CarrierTypesController do
29
28
  FactoryGirl.attributes_for(:carrier_type)
30
29
  end
31
30
 
32
- describe "GET index" do
33
- it "assigns all carrier_types as @carrier_types" do
34
- carrier_type = CarrierType.create! valid_attributes
35
- get :index
36
- expect(assigns(:carrier_types)).to eq(CarrierType.order(:position).page(1))
37
- end
38
- end
39
-
40
- describe "GET show" do
41
- it "assigns the requested carrier_type as @carrier_type" do
42
- carrier_type = CarrierType.create! valid_attributes
43
- get :show, :id => carrier_type.id
44
- expect(assigns(:carrier_type)).to eq(carrier_type)
45
- end
46
- end
47
-
48
- describe "GET new" do
49
- it "assigns a new carrier_type as @carrier_type" do
50
- get :new
51
- expect(assigns(:carrier_type)).to be_a_new(CarrierType)
52
- end
53
- end
54
-
55
- describe "GET edit" do
56
- it "assigns the requested carrier_type as @carrier_type" do
57
- carrier_type = CarrierType.create! valid_attributes
58
- get :edit, :id => carrier_type.id
59
- expect(assigns(:carrier_type)).to eq(carrier_type)
31
+ context 'When logged in as Administrator' do
32
+ login_fixture_admin
33
+ describe 'GET index' do
34
+ it 'assigns all carrier_types as @carrier_types' do
35
+ carrier_type = CarrierType.create! valid_attributes
36
+ get :index
37
+ expect(assigns(:carrier_types)).to eq(CarrierType.order(:position).page(1))
38
+ end
60
39
  end
61
- end
62
40
 
63
- describe "POST create" do
64
- describe "with valid params" do
65
- it "creates a new CarrierType" do
66
- expect {
67
- post :create, :carrier_type => valid_attributes
68
- }.to change(CarrierType, :count).by(1)
41
+ describe 'GET show' do
42
+ it 'assigns the requested carrier_type as @carrier_type' do
43
+ carrier_type = CarrierType.create! valid_attributes
44
+ get :show, id: carrier_type.id
45
+ expect(assigns(:carrier_type)).to eq(carrier_type)
69
46
  end
47
+ end
70
48
 
71
- it "assigns a newly created carrier_type as @carrier_type" do
72
- post :create, :carrier_type => valid_attributes
73
- expect(assigns(:carrier_type)).to be_a(CarrierType)
74
- expect(assigns(:carrier_type)).to be_persisted
49
+ describe 'GET new' do
50
+ it 'assigns a new carrier_type as @carrier_type' do
51
+ get :new
52
+ expect(assigns(:carrier_type)).to be_a_new(CarrierType)
75
53
  end
54
+ end
76
55
 
77
- it "redirects to the created carrier_type" do
78
- post :create, :carrier_type => valid_attributes
79
- expect(response).to redirect_to(CarrierType.last)
56
+ describe 'GET edit' do
57
+ it 'assigns the requested carrier_type as @carrier_type' do
58
+ carrier_type = CarrierType.create! valid_attributes
59
+ get :edit, id: carrier_type.id
60
+ expect(assigns(:carrier_type)).to eq(carrier_type)
80
61
  end
81
62
  end
82
63
 
83
- describe "with invalid params" do
84
- it "assigns a newly created but unsaved carrier_type as @carrier_type" do
85
- # Trigger the behavior that occurs when invalid params are submitted
86
- CarrierType.any_instance.stub(:save).and_return(false)
87
- post :create, :carrier_type => {name: "test"}
88
- expect(assigns(:carrier_type)).to be_a_new(CarrierType)
64
+ describe 'POST create' do
65
+ describe 'with valid params' do
66
+ it 'creates a new CarrierType' do
67
+ expect do
68
+ post :create, carrier_type: valid_attributes
69
+ end.to change(CarrierType, :count).by(1)
70
+ end
71
+
72
+ it 'assigns a newly created carrier_type as @carrier_type' do
73
+ post :create, carrier_type: valid_attributes
74
+ expect(assigns(:carrier_type)).to be_a(CarrierType)
75
+ expect(assigns(:carrier_type)).to be_persisted
76
+ end
77
+
78
+ it 'redirects to the created carrier_type' do
79
+ post :create, carrier_type: valid_attributes
80
+ expect(response).to redirect_to(CarrierType.last)
81
+ end
89
82
  end
90
83
 
91
- it "re-renders the 'new' template" do
92
- # Trigger the behavior that occurs when invalid params are submitted
93
- CarrierType.any_instance.stub(:save).and_return(false)
94
- post :create, :carrier_type => {name: "test"}
95
- expect(response).to render_template("new")
84
+ describe 'with invalid params' do
85
+ it 'assigns a newly created but unsaved carrier_type as @carrier_type' do
86
+ # Trigger the behavior that occurs when invalid params are submitted
87
+ CarrierType.any_instance.stub(:save).and_return(false)
88
+ post :create, carrier_type: { name: 'test' }
89
+ expect(assigns(:carrier_type)).to be_a_new(CarrierType)
90
+ end
91
+
92
+ it "re-renders the 'new' template" do
93
+ # Trigger the behavior that occurs when invalid params are submitted
94
+ CarrierType.any_instance.stub(:save).and_return(false)
95
+ post :create, carrier_type: { name: 'test' }
96
+ expect(response).to render_template('new')
97
+ end
96
98
  end
97
99
  end
98
- end
99
100
 
100
- describe "PUT update" do
101
- describe "with valid params" do
102
- it "updates the requested carrier_type" do
103
- carrier_type = CarrierType.create! valid_attributes
104
- # Assuming there are no other carrier_types in the database, this
105
- # specifies that the CarrierType created on the previous line
106
- # receives the :update_attributes message with whatever params are
107
- # submitted in the request.
108
- CarrierType.any_instance.should_receive(:update_attributes).with({'name' => 'test'})
109
- put :update, :id => carrier_type.id, :carrier_type => {'name' => 'test'}
101
+ describe 'PUT update' do
102
+ describe 'with valid params' do
103
+ it 'updates the requested carrier_type' do
104
+ carrier_type = CarrierType.create! valid_attributes
105
+ # Assuming there are no other carrier_types in the database, this
106
+ # specifies that the CarrierType created on the previous line
107
+ # receives the :update_attributes message with whatever params are
108
+ # submitted in the request.
109
+ CarrierType.any_instance.should_receive(:update_attributes).with('name' => 'test')
110
+ put :update, id: carrier_type.id, carrier_type: { 'name' => 'test' }
111
+ end
112
+
113
+ it 'assigns the requested carrier_type as @carrier_type' do
114
+ carrier_type = CarrierType.create! valid_attributes
115
+ put :update, id: carrier_type.id, carrier_type: valid_attributes
116
+ expect(assigns(:carrier_type)).to eq(carrier_type)
117
+ end
118
+
119
+ it 'redirects to the carrier_type' do
120
+ carrier_type = CarrierType.create! valid_attributes
121
+ put :update, id: carrier_type.id, carrier_type: valid_attributes
122
+ expect(response).to redirect_to(carrier_type)
123
+ end
124
+
125
+ it 'moves its position when specified' do
126
+ carrier_type = CarrierType.create! valid_attributes
127
+ position = carrier_type.position
128
+ put :update, id: carrier_type.id, move: 'higher'
129
+ expect(response).to redirect_to carrier_types_url
130
+ assigns(:carrier_type).reload.position.should eq position - 1
131
+ end
110
132
  end
111
133
 
112
- it "assigns the requested carrier_type as @carrier_type" do
113
- carrier_type = CarrierType.create! valid_attributes
114
- put :update, :id => carrier_type.id, :carrier_type => valid_attributes
115
- expect(assigns(:carrier_type)).to eq(carrier_type)
134
+ describe 'with invalid params' do
135
+ it 'assigns the carrier_type as @carrier_type' do
136
+ carrier_type = CarrierType.create! valid_attributes
137
+ # Trigger the behavior that occurs when invalid params are submitted
138
+ CarrierType.any_instance.stub(:save).and_return(false)
139
+ put :update, id: carrier_type.id, carrier_type: { name: 'test' }
140
+ expect(assigns(:carrier_type)).to eq(carrier_type)
141
+ end
142
+
143
+ it "re-renders the 'edit' template" do
144
+ carrier_type = CarrierType.create! valid_attributes
145
+ # Trigger the behavior that occurs when invalid params are submitted
146
+ CarrierType.any_instance.stub(:save).and_return(false)
147
+ put :update, id: carrier_type.id, carrier_type: { name: 'test' }
148
+ expect(response).to render_template('edit')
149
+ end
116
150
  end
151
+ end
117
152
 
118
- it "redirects to the carrier_type" do
153
+ describe 'DELETE destroy' do
154
+ it 'destroys the requested carrier_type' do
119
155
  carrier_type = CarrierType.create! valid_attributes
120
- put :update, :id => carrier_type.id, :carrier_type => valid_attributes
121
- expect(response).to redirect_to(carrier_type)
156
+ expect do
157
+ delete :destroy, id: carrier_type.id
158
+ end.to change(CarrierType, :count).by(-1)
122
159
  end
123
160
 
124
- it "moves its position when specified" do
161
+ it 'redirects to the carrier_types list' do
125
162
  carrier_type = CarrierType.create! valid_attributes
126
- position = carrier_type.position
127
- put :update, :id => carrier_type.id, :move => 'higher'
128
- expect(response).to redirect_to carrier_types_url
129
- assigns(:carrier_type).reload.position.should eq position - 1
163
+ delete :destroy, id: carrier_type.id
164
+ expect(response).to redirect_to(carrier_types_url)
130
165
  end
131
166
  end
167
+ end
132
168
 
133
- describe "with invalid params" do
134
- it "assigns the carrier_type as @carrier_type" do
169
+ context 'When not logged in' do
170
+ describe 'GET show' do
171
+ it 'assigns the requested carrier_type as @carrier_type' do
135
172
  carrier_type = CarrierType.create! valid_attributes
136
- # Trigger the behavior that occurs when invalid params are submitted
137
- CarrierType.any_instance.stub(:save).and_return(false)
138
- put :update, :id => carrier_type.id, :carrier_type => {name: "test"}
173
+ get :show, id: carrier_type.id
139
174
  expect(assigns(:carrier_type)).to eq(carrier_type)
175
+ expect(response).to redirect_to(new_user_session_url)
140
176
  end
141
177
 
142
- it "re-renders the 'edit' template" do
178
+ it 'assigns the requested carrier_type as @carrier_type when the format is download' do
143
179
  carrier_type = CarrierType.create! valid_attributes
144
- # Trigger the behavior that occurs when invalid params are submitted
145
- CarrierType.any_instance.stub(:save).and_return(false)
146
- put :update, :id => carrier_type.id, :carrier_type => {name: "test"}
147
- expect(response).to render_template("edit")
180
+ expect{
181
+ get :show, id: carrier_type.id, format: :download
182
+ }.to raise_error(ActionView::MissingTemplate)
183
+ #expect(assigns(:carrier_type)).to raise_error(ActionView::MissingTemplate)
148
184
  end
149
185
  end
150
186
  end
151
-
152
- describe "DELETE destroy" do
153
- it "destroys the requested carrier_type" do
154
- carrier_type = CarrierType.create! valid_attributes
155
- expect {
156
- delete :destroy, :id => carrier_type.id
157
- }.to change(CarrierType, :count).by(-1)
158
- end
159
-
160
- it "redirects to the carrier_types list" do
161
- carrier_type = CarrierType.create! valid_attributes
162
- delete :destroy, :id => carrier_type.id
163
- expect(response).to redirect_to(carrier_types_url)
164
- end
165
- end
166
-
167
187
  end
@@ -29,120 +29,120 @@ describe ContentTypesController do
29
29
  FactoryGirl.attributes_for(:content_type)
30
30
  end
31
31
 
32
- describe "GET index" do
33
- it "assigns all content_types as @content_types" do
32
+ describe 'GET index' do
33
+ it 'assigns all content_types as @content_types' do
34
34
  content_type = ContentType.create! valid_attributes
35
35
  get :index
36
36
  expect(assigns(:content_types)).to eq(ContentType.all)
37
37
  end
38
38
  end
39
39
 
40
- describe "GET show" do
41
- it "assigns the requested content_type as @content_type" do
40
+ describe 'GET show' do
41
+ it 'assigns the requested content_type as @content_type' do
42
42
  content_type = ContentType.create! valid_attributes
43
- get :show, :id => content_type.id
43
+ get :show, id: content_type.id
44
44
  expect(assigns(:content_type)).to eq(content_type)
45
45
  end
46
46
  end
47
47
 
48
- describe "GET new" do
49
- it "assigns a new content_type as @content_type" do
48
+ describe 'GET new' do
49
+ it 'assigns a new content_type as @content_type' do
50
50
  get :new
51
51
  expect(assigns(:content_type)).to be_a_new(ContentType)
52
52
  end
53
53
  end
54
54
 
55
- describe "GET edit" do
56
- it "assigns the requested content_type as @content_type" do
55
+ describe 'GET edit' do
56
+ it 'assigns the requested content_type as @content_type' do
57
57
  content_type = ContentType.create! valid_attributes
58
- get :edit, :id => content_type.id
58
+ get :edit, id: content_type.id
59
59
  expect(assigns(:content_type)).to eq(content_type)
60
60
  end
61
- it "assigns the content_type even if it associates manifestation(s)" do
61
+ it 'assigns the content_type even if it associates manifestation(s)' do
62
62
  content_type = FactoryGirl.create(:content_type)
63
- manifestation = FactoryGirl.create(:manifestation, :content_type_id => content_type.id)
64
- get :edit, :id => content_type.id
63
+ manifestation = FactoryGirl.create(:manifestation, content_type_id: content_type.id)
64
+ get :edit, id: content_type.id
65
65
  expect(assigns(:content_type)).to eq content_type
66
66
  expect(response).to be_success
67
67
  end
68
68
  end
69
69
 
70
- describe "POST create" do
71
- describe "with valid params" do
72
- it "creates a new ContentType" do
73
- expect {
74
- post :create, :content_type => valid_attributes
75
- }.to change(ContentType, :count).by(1)
70
+ describe 'POST create' do
71
+ describe 'with valid params' do
72
+ it 'creates a new ContentType' do
73
+ expect do
74
+ post :create, content_type: valid_attributes
75
+ end.to change(ContentType, :count).by(1)
76
76
  end
77
77
 
78
- it "assigns a newly created content_type as @content_type" do
79
- post :create, :content_type => valid_attributes
78
+ it 'assigns a newly created content_type as @content_type' do
79
+ post :create, content_type: valid_attributes
80
80
  expect(assigns(:content_type)).to be_a(ContentType)
81
81
  expect(assigns(:content_type)).to be_persisted
82
82
  end
83
83
 
84
- it "redirects to the created content_type" do
85
- post :create, :content_type => valid_attributes
84
+ it 'redirects to the created content_type' do
85
+ post :create, content_type: valid_attributes
86
86
  expect(response).to redirect_to(ContentType.last)
87
87
  end
88
88
  end
89
89
 
90
- describe "with invalid params" do
91
- it "assigns a newly created but unsaved content_type as @content_type" do
90
+ describe 'with invalid params' do
91
+ it 'assigns a newly created but unsaved content_type as @content_type' 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 => {name: "test"}
94
+ post :create, content_type: { name: 'test' }
95
95
  expect(assigns(:content_type)).to be_a_new(ContentType)
96
96
  end
97
97
 
98
98
  it "re-renders the 'new' template" do
99
99
  # Trigger the behavior that occurs when invalid params are submitted
100
100
  ContentType.any_instance.stub(:save).and_return(false)
101
- post :create, :content_type => {name: "test"}
102
- expect(response).to render_template("new")
101
+ post :create, content_type: { name: 'test' }
102
+ expect(response).to render_template('new')
103
103
  end
104
104
  end
105
105
  end
106
106
 
107
- describe "PUT update" do
108
- describe "with valid params" do
109
- it "updates the requested content_type" do
107
+ describe 'PUT update' do
108
+ describe 'with valid params' do
109
+ it 'updates the requested content_type' do
110
110
  content_type = ContentType.create! valid_attributes
111
111
  # Assuming there are no other content_types in the database, this
112
112
  # specifies that the ContentType created on the previous line
113
113
  # receives the :update_attributes message with whatever params are
114
114
  # submitted in the request.
115
- ContentType.any_instance.should_receive(:update_attributes).with({'name' => 'test'})
116
- put :update, :id => content_type.id, :content_type => {'name' => 'test'}
115
+ ContentType.any_instance.should_receive(:update_attributes).with('name' => 'test')
116
+ put :update, id: content_type.id, content_type: { 'name' => 'test' }
117
117
  end
118
118
 
119
- it "assigns the requested content_type as @content_type" do
119
+ it 'assigns the requested content_type as @content_type' do
120
120
  content_type = ContentType.create! valid_attributes
121
- put :update, :id => content_type.id, :content_type => valid_attributes
121
+ put :update, id: content_type.id, content_type: valid_attributes
122
122
  expect(assigns(:content_type)).to eq(content_type)
123
123
  end
124
124
 
125
- it "redirects to the content_type" do
125
+ it 'redirects to the content_type' do
126
126
  content_type = ContentType.create! valid_attributes
127
- put :update, :id => content_type.id, :content_type => valid_attributes
127
+ put :update, id: content_type.id, content_type: valid_attributes
128
128
  expect(response).to redirect_to(content_type)
129
129
  end
130
130
 
131
- it "moves its position when specified" do
131
+ it 'moves its position when specified' do
132
132
  content_type = ContentType.create! valid_attributes
133
133
  position = content_type.position
134
- put :update, :id => content_type.id, :move => 'higher'
134
+ put :update, id: content_type.id, move: 'higher'
135
135
  expect(response).to redirect_to content_types_url
136
136
  assigns(:content_type).reload.position.should eq position - 1
137
137
  end
138
138
  end
139
139
 
140
- describe "with invalid params" do
141
- it "assigns the content_type as @content_type" do
140
+ describe 'with invalid params' do
141
+ it 'assigns the content_type as @content_type' do
142
142
  content_type = ContentType.create! valid_attributes
143
143
  # Trigger the behavior that occurs when invalid params are submitted
144
144
  ContentType.any_instance.stub(:save).and_return(false)
145
- put :update, :id => content_type.id, :content_type => {name: "test"}
145
+ put :update, id: content_type.id, content_type: { name: 'test' }
146
146
  expect(assigns(:content_type)).to eq(content_type)
147
147
  end
148
148
 
@@ -150,25 +150,24 @@ describe ContentTypesController do
150
150
  content_type = ContentType.create! valid_attributes
151
151
  # Trigger the behavior that occurs when invalid params are submitted
152
152
  ContentType.any_instance.stub(:save).and_return(false)
153
- put :update, :id => content_type.id, :content_type => {name: "test"}
154
- expect(response).to render_template("edit")
153
+ put :update, id: content_type.id, content_type: { name: 'test' }
154
+ expect(response).to render_template('edit')
155
155
  end
156
156
  end
157
157
  end
158
158
 
159
- describe "DELETE destroy" do
160
- it "destroys the requested content_type" do
159
+ describe 'DELETE destroy' do
160
+ it 'destroys the requested content_type' do
161
161
  content_type = ContentType.create! valid_attributes
162
- expect {
163
- delete :destroy, :id => content_type.id
164
- }.to change(ContentType, :count).by(-1)
162
+ expect do
163
+ delete :destroy, id: content_type.id
164
+ end.to change(ContentType, :count).by(-1)
165
165
  end
166
166
 
167
- it "redirects to the content_types list" do
167
+ it 'redirects to the content_types list' do
168
168
  content_type = ContentType.create! valid_attributes
169
- delete :destroy, :id => content_type.id
169
+ delete :destroy, id: content_type.id
170
170
  expect(response).to redirect_to(content_types_url)
171
171
  end
172
172
  end
173
-
174
173
  end