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
@@ -29,114 +29,114 @@ describe FormOfWorksController do
29
29
  FactoryGirl.attributes_for(:form_of_work)
30
30
  end
31
31
 
32
- describe "GET index" do
33
- it "assigns all form_of_works as @form_of_works" do
32
+ describe 'GET index' do
33
+ it 'assigns all form_of_works as @form_of_works' do
34
34
  form_of_work = FormOfWork.create! valid_attributes
35
35
  get :index
36
36
  expect(assigns(:form_of_works)).to eq(FormOfWork.order(:position))
37
37
  end
38
38
  end
39
39
 
40
- describe "GET show" do
41
- it "assigns the requested form_of_work as @form_of_work" do
40
+ describe 'GET show' do
41
+ it 'assigns the requested form_of_work as @form_of_work' do
42
42
  form_of_work = FormOfWork.create! valid_attributes
43
- get :show, :id => form_of_work.id
43
+ get :show, id: form_of_work.id
44
44
  expect(assigns(:form_of_work)).to eq(form_of_work)
45
45
  end
46
46
  end
47
47
 
48
- describe "GET new" do
49
- it "assigns a new form_of_work as @form_of_work" do
48
+ describe 'GET new' do
49
+ it 'assigns a new form_of_work as @form_of_work' do
50
50
  get :new
51
51
  expect(assigns(:form_of_work)).to be_a_new(FormOfWork)
52
52
  end
53
53
  end
54
54
 
55
- describe "GET edit" do
56
- it "assigns the requested form_of_work as @form_of_work" do
55
+ describe 'GET edit' do
56
+ it 'assigns the requested form_of_work as @form_of_work' do
57
57
  form_of_work = FormOfWork.create! valid_attributes
58
- get :edit, :id => form_of_work.id
58
+ get :edit, id: form_of_work.id
59
59
  expect(assigns(:form_of_work)).to eq(form_of_work)
60
60
  end
61
61
  end
62
62
 
63
- describe "POST create" do
64
- describe "with valid params" do
65
- it "creates a new FormOfWork" do
66
- expect {
67
- post :create, :form_of_work => valid_attributes
68
- }.to change(FormOfWork, :count).by(1)
63
+ describe 'POST create' do
64
+ describe 'with valid params' do
65
+ it 'creates a new FormOfWork' do
66
+ expect do
67
+ post :create, form_of_work: valid_attributes
68
+ end.to change(FormOfWork, :count).by(1)
69
69
  end
70
70
 
71
- it "assigns a newly created form_of_work as @form_of_work" do
72
- post :create, :form_of_work => valid_attributes
71
+ it 'assigns a newly created form_of_work as @form_of_work' do
72
+ post :create, form_of_work: valid_attributes
73
73
  expect(assigns(:form_of_work)).to be_a(FormOfWork)
74
74
  expect(assigns(:form_of_work)).to be_persisted
75
75
  end
76
76
 
77
- it "redirects to the created form_of_work" do
78
- post :create, :form_of_work => valid_attributes
77
+ it 'redirects to the created form_of_work' do
78
+ post :create, form_of_work: valid_attributes
79
79
  expect(response).to redirect_to(FormOfWork.last)
80
80
  end
81
81
  end
82
82
 
83
- describe "with invalid params" do
84
- it "assigns a newly created but unsaved form_of_work as @form_of_work" do
83
+ describe 'with invalid params' do
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 => {name: "test"}
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 => {name: "test"}
95
- #expect(response).to render_template("new")
94
+ post :create, form_of_work: { name: 'test' }
95
+ # expect(response).to render_template("new")
96
96
  end
97
97
  end
98
98
  end
99
99
 
100
- describe "PUT update" do
101
- describe "with valid params" do
102
- it "updates the requested form_of_work" do
100
+ describe 'PUT update' do
101
+ describe 'with valid params' do
102
+ it 'updates the requested form_of_work' do
103
103
  form_of_work = FormOfWork.create! valid_attributes
104
104
  # Assuming there are no other form_of_works in the database, this
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({'name' => 'test'})
109
- put :update, :id => form_of_work.id, :form_of_work => {'name' => 'test'}
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
- it "assigns the requested form_of_work as @form_of_work" do
112
+ it 'assigns the requested form_of_work as @form_of_work' do
113
113
  form_of_work = FormOfWork.create! valid_attributes
114
- put :update, :id => form_of_work.id, :form_of_work => valid_attributes
114
+ put :update, id: form_of_work.id, form_of_work: valid_attributes
115
115
  expect(assigns(:form_of_work)).to eq(form_of_work)
116
116
  end
117
117
 
118
- it "redirects to the form_of_work" do
118
+ it 'redirects to the form_of_work' do
119
119
  form_of_work = FormOfWork.create! valid_attributes
120
- put :update, :id => form_of_work.id, :form_of_work => valid_attributes
120
+ put :update, id: form_of_work.id, form_of_work: valid_attributes
121
121
  expect(response).to redirect_to(form_of_work)
122
122
  end
123
123
 
124
- it "moves its position when specified" do
124
+ it 'moves its position when specified' do
125
125
  form_of_work = FormOfWork.create! valid_attributes
126
126
  position = form_of_work.position
127
- put :update, :id => form_of_work.id, :move => 'higher'
127
+ put :update, id: form_of_work.id, move: 'higher'
128
128
  expect(response).to redirect_to form_of_works_url
129
129
  form_of_work.reload
130
130
  form_of_work.position.should eq position - 1
131
131
  end
132
132
  end
133
133
 
134
- describe "with invalid params" do
135
- it "assigns the form_of_work as @form_of_work" do
134
+ describe 'with invalid params' do
135
+ it 'assigns the form_of_work as @form_of_work' do
136
136
  form_of_work = FormOfWork.create! valid_attributes
137
137
  # Trigger the behavior that occurs when invalid params are submitted
138
138
  FormOfWork.any_instance.stub(:save).and_return(false)
139
- put :update, :id => form_of_work.id, :form_of_work => {name: "test"}
139
+ put :update, id: form_of_work.id, form_of_work: { name: 'test' }
140
140
  expect(assigns(:form_of_work)).to eq(form_of_work)
141
141
  end
142
142
 
@@ -144,25 +144,24 @@ describe FormOfWorksController do
144
144
  form_of_work = FormOfWork.create! valid_attributes
145
145
  # Trigger the behavior that occurs when invalid params are submitted
146
146
  FormOfWork.any_instance.stub(:save).and_return(false)
147
- put :update, :id => form_of_work.id, :form_of_work => {name: "test"}
148
- #expect(response).to render_template("edit")
147
+ put :update, id: form_of_work.id, form_of_work: { name: 'test' }
148
+ # expect(response).to render_template("edit")
149
149
  end
150
150
  end
151
151
  end
152
152
 
153
- describe "DELETE destroy" do
154
- it "destroys the requested form_of_work" do
153
+ describe 'DELETE destroy' do
154
+ it 'destroys the requested form_of_work' do
155
155
  form_of_work = FormOfWork.create! valid_attributes
156
- expect {
157
- delete :destroy, :id => form_of_work.id
158
- }.to change(FormOfWork, :count).by(-1)
156
+ expect do
157
+ delete :destroy, id: form_of_work.id
158
+ end.to change(FormOfWork, :count).by(-1)
159
159
  end
160
160
 
161
- it "redirects to the form_of_works list" do
161
+ it 'redirects to the form_of_works list' do
162
162
  form_of_work = FormOfWork.create! valid_attributes
163
- delete :destroy, :id => form_of_work.id
163
+ delete :destroy, id: form_of_work.id
164
164
  expect(response).to redirect_to(form_of_works_url)
165
165
  end
166
166
  end
167
-
168
167
  end
@@ -29,120 +29,120 @@ describe FrequenciesController do
29
29
  FactoryGirl.attributes_for(:frequency)
30
30
  end
31
31
 
32
- describe "GET index" do
33
- it "assigns all frequencies as @frequencies" do
32
+ describe 'GET index' do
33
+ it 'assigns all frequencies as @frequencies' do
34
34
  frequency = Frequency.create! valid_attributes
35
35
  get :index
36
36
  assigns(:frequencies).should eq(Frequency.order(:position))
37
37
  end
38
38
  end
39
39
 
40
- describe "GET show" do
41
- it "assigns the requested frequency as @frequency" do
40
+ describe 'GET show' do
41
+ it 'assigns the requested frequency as @frequency' do
42
42
  frequency = Frequency.create! valid_attributes
43
- get :show, :id => frequency.id
43
+ get :show, id: frequency.id
44
44
  assigns(:frequency).should eq(frequency)
45
45
  end
46
46
  end
47
47
 
48
- describe "GET new" do
49
- it "assigns a new frequency as @frequency" do
48
+ describe 'GET new' do
49
+ it 'assigns a new frequency as @frequency' do
50
50
  get :new
51
51
  assigns(:frequency).should be_a_new(Frequency)
52
52
  end
53
53
  end
54
54
 
55
- describe "GET edit" do
56
- it "assigns the requested frequency as @frequency" do
55
+ describe 'GET edit' do
56
+ it 'assigns the requested frequency as @frequency' do
57
57
  frequency = Frequency.create! valid_attributes
58
- get :edit, :id => frequency.id
58
+ get :edit, id: frequency.id
59
59
  assigns(:frequency).should eq(frequency)
60
60
  end
61
- it "assigns the frequency even if it associates manifestation(s)" do
61
+ it 'assigns the frequency even if it associates manifestation(s)' do
62
62
  frequency = FactoryGirl.create(:frequency)
63
- manifestation = FactoryGirl.create(:manifestation, :frequency_id => frequency.id)
64
- get :edit, :id => frequency.id
63
+ manifestation = FactoryGirl.create(:manifestation, frequency_id: frequency.id)
64
+ get :edit, id: frequency.id
65
65
  expect(assigns(:frequency)).to eq frequency
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 Frequency" do
73
- expect {
74
- post :create, :frequency => valid_attributes
75
- }.to change(Frequency, :count).by(1)
70
+ describe 'POST create' do
71
+ describe 'with valid params' do
72
+ it 'creates a new Frequency' do
73
+ expect do
74
+ post :create, frequency: valid_attributes
75
+ end.to change(Frequency, :count).by(1)
76
76
  end
77
77
 
78
- it "assigns a newly created frequency as @frequency" do
79
- post :create, :frequency => valid_attributes
78
+ it 'assigns a newly created frequency as @frequency' do
79
+ post :create, frequency: valid_attributes
80
80
  assigns(:frequency).should be_a(Frequency)
81
81
  assigns(:frequency).should be_persisted
82
82
  end
83
83
 
84
- it "redirects to the created frequency" do
85
- post :create, :frequency => valid_attributes
84
+ it 'redirects to the created frequency' do
85
+ post :create, frequency: valid_attributes
86
86
  expect(response).to redirect_to(Frequency.last)
87
87
  end
88
88
  end
89
89
 
90
- describe "with invalid params" do
91
- it "assigns a newly created but unsaved frequency as @frequency" do
90
+ describe 'with invalid params' do
91
+ it 'assigns a newly created but unsaved frequency as @frequency' 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 => {name: "test"}
94
+ post :create, frequency: { name: 'test' }
95
95
  assigns(:frequency).should be_a_new(Frequency)
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
  Frequency.any_instance.stub(:save).and_return(false)
101
- post :create, :frequency => {name: "test"}
102
- expect(response).to render_template("new")
101
+ post :create, frequency: { 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 frequency" do
107
+ describe 'PUT update' do
108
+ describe 'with valid params' do
109
+ it 'updates the requested frequency' do
110
110
  frequency = Frequency.create! valid_attributes
111
111
  # Assuming there are no other frequencies in the database, this
112
112
  # specifies that the Frequency created on the previous line
113
113
  # receives the :update_attributes message with whatever params are
114
114
  # submitted in the request.
115
- Frequency.any_instance.should_receive(:update_attributes).with({'name' => 'test'})
116
- put :update, :id => frequency.id, :frequency => {'name' => 'test'}
115
+ Frequency.any_instance.should_receive(:update_attributes).with('name' => 'test')
116
+ put :update, id: frequency.id, frequency: { 'name' => 'test' }
117
117
  end
118
118
 
119
- it "assigns the requested frequency as @frequency" do
119
+ it 'assigns the requested frequency as @frequency' do
120
120
  frequency = Frequency.create! valid_attributes
121
- put :update, :id => frequency.id, :frequency => valid_attributes
121
+ put :update, id: frequency.id, frequency: valid_attributes
122
122
  assigns(:frequency).should eq(frequency)
123
123
  end
124
124
 
125
- it "redirects to the frequency" do
125
+ it 'redirects to the frequency' do
126
126
  frequency = Frequency.create! valid_attributes
127
- put :update, :id => frequency.id, :frequency => valid_attributes
127
+ put :update, id: frequency.id, frequency: valid_attributes
128
128
  expect(response).to redirect_to(frequency)
129
129
  end
130
130
 
131
- it "moves its position when specified" do
131
+ it 'moves its position when specified' do
132
132
  frequency = Frequency.create! valid_attributes
133
133
  position = frequency.position
134
- put :update, :id => frequency.id, :move => 'higher'
134
+ put :update, id: frequency.id, move: 'higher'
135
135
  expect(response).to redirect_to frequencies_url
136
136
  assigns(:frequency).reload.position.should eq position - 1
137
137
  end
138
138
  end
139
139
 
140
- describe "with invalid params" do
141
- it "assigns the frequency as @frequency" do
140
+ describe 'with invalid params' do
141
+ it 'assigns the frequency as @frequency' do
142
142
  frequency = Frequency.create! valid_attributes
143
143
  # Trigger the behavior that occurs when invalid params are submitted
144
144
  Frequency.any_instance.stub(:save).and_return(false)
145
- put :update, :id => frequency.id, :frequency => {name: "test"}
145
+ put :update, id: frequency.id, frequency: { name: 'test' }
146
146
  assigns(:frequency).should eq(frequency)
147
147
  end
148
148
 
@@ -150,25 +150,24 @@ describe FrequenciesController do
150
150
  frequency = Frequency.create! valid_attributes
151
151
  # Trigger the behavior that occurs when invalid params are submitted
152
152
  Frequency.any_instance.stub(:save).and_return(false)
153
- put :update, :id => frequency.id, :frequency => {name: "test"}
154
- expect(response).to render_template("edit")
153
+ put :update, id: frequency.id, frequency: { 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 frequency" do
159
+ describe 'DELETE destroy' do
160
+ it 'destroys the requested frequency' do
161
161
  frequency = Frequency.create! valid_attributes
162
- expect {
163
- delete :destroy, :id => frequency.id
164
- }.to change(Frequency, :count).by(-1)
162
+ expect do
163
+ delete :destroy, id: frequency.id
164
+ end.to change(Frequency, :count).by(-1)
165
165
  end
166
166
 
167
- it "redirects to the frequencies list" do
167
+ it 'redirects to the frequencies list' do
168
168
  frequency = Frequency.create! valid_attributes
169
- delete :destroy, :id => frequency.id
169
+ delete :destroy, id: frequency.id
170
170
  expect(response).to redirect_to(frequencies_url)
171
171
  end
172
172
  end
173
-
174
173
  end
@@ -29,113 +29,113 @@ describe IdentifierTypesController do
29
29
  FactoryGirl.attributes_for(:identifier_type)
30
30
  end
31
31
 
32
- describe "GET index" do
33
- it "assigns all identifier_types as @identifier_types" do
32
+ describe 'GET index' do
33
+ it 'assigns all identifier_types as @identifier_types' do
34
34
  identifier_type = IdentifierType.create! valid_attributes
35
35
  get :index
36
36
  expect(assigns(:identifier_types)).to eq(IdentifierType.order(:position))
37
37
  end
38
38
  end
39
39
 
40
- describe "GET show" do
41
- it "assigns the requested identifier_type as @identifier_type" do
40
+ describe 'GET show' do
41
+ it 'assigns the requested identifier_type as @identifier_type' do
42
42
  identifier_type = IdentifierType.create! valid_attributes
43
- get :show, :id => identifier_type.id
43
+ get :show, id: identifier_type.id
44
44
  expect(assigns(:identifier_type)).to eq(identifier_type)
45
45
  end
46
46
  end
47
47
 
48
- describe "GET new" do
49
- it "assigns a new identifier_type as @identifier_type" do
48
+ describe 'GET new' do
49
+ it 'assigns a new identifier_type as @identifier_type' do
50
50
  get :new
51
51
  expect(assigns(:identifier_type)).to be_a_new(IdentifierType)
52
52
  end
53
53
  end
54
54
 
55
- describe "GET edit" do
56
- it "assigns the requested identifier_type as @identifier_type" do
55
+ describe 'GET edit' do
56
+ it 'assigns the requested identifier_type as @identifier_type' do
57
57
  identifier_type = IdentifierType.create! valid_attributes
58
- get :edit, :id => identifier_type.id
58
+ get :edit, id: identifier_type.id
59
59
  expect(assigns(:identifier_type)).to eq(identifier_type)
60
60
  end
61
61
  end
62
62
 
63
- describe "POST create" do
64
- describe "with valid params" do
65
- it "creates a new IdentifierType" do
66
- expect {
67
- post :create, :identifier_type => valid_attributes
68
- }.to change(IdentifierType, :count).by(1)
63
+ describe 'POST create' do
64
+ describe 'with valid params' do
65
+ it 'creates a new IdentifierType' do
66
+ expect do
67
+ post :create, identifier_type: valid_attributes
68
+ end.to change(IdentifierType, :count).by(1)
69
69
  end
70
70
 
71
- it "assigns a newly created identifier_type as @identifier_type" do
72
- post :create, :identifier_type => valid_attributes
71
+ it 'assigns a newly created identifier_type as @identifier_type' do
72
+ post :create, identifier_type: valid_attributes
73
73
  expect(assigns(:identifier_type)).to be_a(IdentifierType)
74
74
  expect(assigns(:identifier_type)).to be_persisted
75
75
  end
76
76
 
77
- it "redirects to the created identifier_type" do
78
- post :create, :identifier_type => valid_attributes
77
+ it 'redirects to the created identifier_type' do
78
+ post :create, identifier_type: valid_attributes
79
79
  expect(response).to redirect_to(IdentifierType.last)
80
80
  end
81
81
  end
82
82
 
83
- describe "with invalid params" do
84
- it "assigns a newly created but unsaved identifier_type as @identifier_type" do
83
+ describe 'with invalid params' do
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 => {name: "test"}
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 => {name: "test"}
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
99
99
 
100
- describe "PUT update" do
101
- describe "with valid params" do
102
- it "updates the requested identifier_type" do
100
+ describe 'PUT update' do
101
+ describe 'with valid params' do
102
+ it 'updates the requested identifier_type' do
103
103
  identifier_type = IdentifierType.create! valid_attributes
104
104
  # Assuming there are no other identifier_types in the database, this
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({'name' => 'test'})
109
- put :update, :id => identifier_type.id, :identifier_type => {'name' => 'test'}
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
- it "assigns the requested identifier_type as @identifier_type" do
112
+ it 'assigns the requested identifier_type as @identifier_type' do
113
113
  identifier_type = IdentifierType.create! valid_attributes
114
- put :update, :id => identifier_type.id, :identifier_type => valid_attributes
114
+ put :update, id: identifier_type.id, identifier_type: valid_attributes
115
115
  expect(assigns(:identifier_type)).to eq(identifier_type)
116
116
  end
117
117
 
118
- it "redirects to the identifier_type" do
118
+ it 'redirects to the identifier_type' do
119
119
  identifier_type = IdentifierType.create! valid_attributes
120
- put :update, :id => identifier_type.id, :identifier_type => valid_attributes
120
+ put :update, id: identifier_type.id, identifier_type: valid_attributes
121
121
  expect(response).to redirect_to(identifier_type)
122
122
  end
123
123
 
124
- it "moves its position when specified" do
124
+ it 'moves its position when specified' do
125
125
  identifier_type = IdentifierType.create! valid_attributes
126
126
  position = identifier_type.position
127
- put :update, :id => identifier_type.id, :move => 'higher'
127
+ put :update, id: identifier_type.id, move: 'higher'
128
128
  expect(response).to redirect_to identifier_types_url
129
129
  assigns(:identifier_type).reload.position.should eq position - 1
130
130
  end
131
131
  end
132
132
 
133
- describe "with invalid params" do
134
- it "assigns the identifier_type as @identifier_type" do
133
+ describe 'with invalid params' do
134
+ it 'assigns the identifier_type as @identifier_type' 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 => {name: "test"}
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,25 +143,24 @@ 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 => {name: "test"}
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
151
151
 
152
- describe "DELETE destroy" do
153
- it "destroys the requested identifier_type" do
152
+ describe 'DELETE destroy' do
153
+ it 'destroys the requested identifier_type' do
154
154
  identifier_type = IdentifierType.create! valid_attributes
155
- expect {
156
- delete :destroy, :id => identifier_type.id
157
- }.to change(IdentifierType, :count).by(-1)
155
+ expect do
156
+ delete :destroy, id: identifier_type.id
157
+ end.to change(IdentifierType, :count).by(-1)
158
158
  end
159
159
 
160
- it "redirects to the identifier_types list" do
160
+ it 'redirects to the identifier_types list' do
161
161
  identifier_type = IdentifierType.create! valid_attributes
162
- delete :destroy, :id => identifier_type.id
162
+ delete :destroy, id: identifier_type.id
163
163
  expect(response).to redirect_to(identifier_types_url)
164
164
  end
165
165
  end
166
-
167
166
  end