user_stamp 0.0.3 → 3.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -31,6 +31,7 @@ class MaterialsControllerTest < ActionController::TestCase
31
31
 
32
32
  setup do
33
33
  @admin = users(:one)
34
+ @user = users(:two)
34
35
  @material = materials(:one)
35
36
 
36
37
  # set the user_field to :id
@@ -60,6 +61,7 @@ class MaterialsControllerTest < ActionController::TestCase
60
61
 
61
62
  material = assigns(:material)
62
63
  assert_equal material.created_user, @admin.id
64
+ assert_equal material.updated_user, @admin.id
63
65
  assert_redirected_to material_path(assigns(:material))
64
66
  end
65
67
 
@@ -76,11 +78,12 @@ class MaterialsControllerTest < ActionController::TestCase
76
78
  end
77
79
 
78
80
  test "should update material" do
79
- sign_in @admin
81
+ sign_in @user
80
82
  put :update, id: @material, material: { name: @material.name }
81
83
 
82
84
  material = assigns(:material)
83
- assert_equal material.updated_user, @admin.id
85
+ assert_equal material.created_user, @admin.id
86
+ assert_equal material.updated_user, @user.id
84
87
 
85
88
  assert_redirected_to material_path(assigns(:material))
86
89
  end
@@ -31,6 +31,7 @@ class ProductsControllerTest < ActionController::TestCase
31
31
 
32
32
  setup do
33
33
  @admin = users(:one)
34
+ @user = users(:two)
34
35
  @product = products(:one)
35
36
 
36
37
  # set the user_field to :id
@@ -61,6 +62,7 @@ class ProductsControllerTest < ActionController::TestCase
61
62
 
62
63
  product = assigns(:product)
63
64
  assert_equal product.created_user, @admin.login_name
65
+ assert_equal product.updated_user, @admin.login_name
64
66
  assert_redirected_to product_path(assigns(:product))
65
67
  end
66
68
 
@@ -77,11 +79,12 @@ class ProductsControllerTest < ActionController::TestCase
77
79
  end
78
80
 
79
81
  test "should update product" do
80
- sign_in @admin
82
+ sign_in @user
81
83
  put :update, id: @product, product: { name: @product.name }
82
84
 
83
85
  product = assigns(:product)
84
- assert_equal product.updated_user, @admin.login_name
86
+ assert_equal product.created_user, @admin.login_name
87
+ assert_equal product.updated_user, @user.login_name
85
88
 
86
89
  assert_redirected_to product_path(assigns(:product))
87
90
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: user_stamp
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 3.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Marty Petersen
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-04-20 00:00:00.000000000 Z
11
+ date: 2015-04-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -52,9 +52,10 @@ dependencies:
52
52
  - - ">="
53
53
  - !ruby/object:Gem::Version
54
54
  version: '0'
55
- description: |-
56
- Preserve the user identity when database records are updated for tracking or audit purposes. The models require the addition of 2 fields: created_user, updated_user. The destroy_user is optional (if you are not deleting records).
57
- The gem uses the current_user object from Devise. Users are required to be authenticated to the application.
55
+ description: Preserve the user identity when database records are updated for tracking
56
+ or audit purposes. The gem uses the current_user object from Devise. Users are
57
+ required to be authenticated to the application.For RAILS 3.2.x use gem version
58
+ 3.x, For RAILS 4.x.x use gem version 4.x
58
59
  email:
59
60
  - marty.petersen@pd-techsolutions.com
60
61
  executables: []
@@ -168,82 +169,82 @@ required_rubygems_version: !ruby/object:Gem::Requirement
168
169
  version: '0'
169
170
  requirements: []
170
171
  rubyforge_project:
171
- rubygems_version: 2.2.2
172
+ rubygems_version: 2.4.6
172
173
  signing_key:
173
174
  specification_version: 4
174
175
  summary: Provides the ability to stamp database records with the user name when creating,
175
176
  updating or destroying
176
177
  test_files:
177
- - test/fixtures/products.yml
178
- - test/fixtures/users.yml
179
- - test/fixtures/materials.yml
180
178
  - test/integration/navigation_test.rb
181
- - test/test_helper.rb
182
- - test/user_stamp_test.rb
183
- - test/dummy/app/helpers/application_helper.rb
184
- - test/dummy/app/helpers/products_helper.rb
185
- - test/dummy/app/helpers/materials_helper.rb
186
- - test/dummy/app/controllers/products_controller.rb
187
- - test/dummy/app/controllers/materials_controller.rb
188
- - test/dummy/app/controllers/application_controller.rb
189
- - test/dummy/app/models/user.rb
190
- - test/dummy/app/models/product.rb
191
- - test/dummy/app/models/material.rb
192
179
  - test/dummy/app/assets/javascripts/application.js
193
180
  - test/dummy/app/assets/javascripts/materials.js
194
181
  - test/dummy/app/assets/javascripts/products.js
195
182
  - test/dummy/app/assets/stylesheets/application.css
196
183
  - test/dummy/app/assets/stylesheets/materials.css
197
184
  - test/dummy/app/assets/stylesheets/products.css
198
- - test/dummy/app/views/products/_form.html.erb
199
- - test/dummy/app/views/products/show.html.erb
200
- - test/dummy/app/views/products/new.html.erb
201
- - test/dummy/app/views/products/index.html.erb
202
- - test/dummy/app/views/products/edit.html.erb
185
+ - test/dummy/app/controllers/application_controller.rb
186
+ - test/dummy/app/controllers/materials_controller.rb
187
+ - test/dummy/app/controllers/products_controller.rb
188
+ - test/dummy/app/helpers/application_helper.rb
189
+ - test/dummy/app/helpers/materials_helper.rb
190
+ - test/dummy/app/helpers/products_helper.rb
203
191
  - test/dummy/app/views/layouts/application.html.erb
204
192
  - test/dummy/app/views/materials/_form.html.erb
205
- - test/dummy/app/views/materials/show.html.erb
206
- - test/dummy/app/views/materials/new.html.erb
207
- - test/dummy/app/views/materials/index.html.erb
208
193
  - test/dummy/app/views/materials/edit.html.erb
209
- - test/dummy/log/development.log
210
- - test/dummy/log/test.log
211
- - test/dummy/script/rails
212
- - test/dummy/config.ru
213
- - test/dummy/db/migrate/20150418013334_create_products.rb
214
- - test/dummy/db/migrate/20150418012302_devise_create_users.rb
215
- - test/dummy/db/migrate/20150420023321_create_materials.rb
216
- - test/dummy/db/test.sqlite3
217
- - test/dummy/db/schema.rb
218
- - test/dummy/db/development.sqlite3
194
+ - test/dummy/app/views/materials/index.html.erb
195
+ - test/dummy/app/views/materials/new.html.erb
196
+ - test/dummy/app/views/materials/show.html.erb
197
+ - test/dummy/app/views/products/_form.html.erb
198
+ - test/dummy/app/views/products/edit.html.erb
199
+ - test/dummy/app/views/products/index.html.erb
200
+ - test/dummy/app/views/products/new.html.erb
201
+ - test/dummy/app/views/products/show.html.erb
202
+ - test/dummy/app/models/material.rb
203
+ - test/dummy/app/models/product.rb
204
+ - test/dummy/app/models/user.rb
205
+ - test/dummy/config/environments/development.rb
206
+ - test/dummy/config/environments/production.rb
207
+ - test/dummy/config/environments/test.rb
208
+ - test/dummy/config/initializers/backtrace_silencers.rb
209
+ - test/dummy/config/initializers/devise.rb
219
210
  - test/dummy/config/initializers/inflections.rb
220
- - test/dummy/config/initializers/wrap_parameters.rb
211
+ - test/dummy/config/initializers/mime_types.rb
221
212
  - test/dummy/config/initializers/secret_token.rb
222
213
  - test/dummy/config/initializers/session_store.rb
223
- - test/dummy/config/initializers/devise.rb
224
- - test/dummy/config/initializers/mime_types.rb
225
214
  - test/dummy/config/initializers/user_stamp.rb
226
- - test/dummy/config/initializers/backtrace_silencers.rb
227
- - test/dummy/config/database.yml
228
- - test/dummy/config/routes.rb
229
- - test/dummy/config/environments/development.rb
230
- - test/dummy/config/environments/production.rb
231
- - test/dummy/config/environments/test.rb
232
- - test/dummy/config/locales/en.yml
215
+ - test/dummy/config/initializers/wrap_parameters.rb
233
216
  - test/dummy/config/locales/devise.en.yml
234
- - test/dummy/config/environment.rb
217
+ - test/dummy/config/locales/en.yml
235
218
  - test/dummy/config/application.rb
236
219
  - test/dummy/config/boot.rb
237
- - test/dummy/test/functional/products_controller_test.rb
220
+ - test/dummy/config/database.yml
221
+ - test/dummy/config/environment.rb
222
+ - test/dummy/config/routes.rb
223
+ - test/dummy/public/favicon.ico
224
+ - test/dummy/public/404.html
225
+ - test/dummy/public/422.html
226
+ - test/dummy/public/500.html
227
+ - test/dummy/log/test.log
228
+ - test/dummy/log/development.log
229
+ - test/dummy/db/test.sqlite3
230
+ - test/dummy/db/migrate/20150418012302_devise_create_users.rb
231
+ - test/dummy/db/migrate/20150418013334_create_products.rb
232
+ - test/dummy/db/migrate/20150420023321_create_materials.rb
233
+ - test/dummy/db/schema.rb
234
+ - test/dummy/db/development.sqlite3
235
+ - test/dummy/README.rdoc
236
+ - test/dummy/Rakefile
237
+ - test/dummy/config.ru
238
+ - test/dummy/script/rails
238
239
  - test/dummy/test/functional/materials_controller_test.rb
239
- - test/dummy/test/unit/user_test.rb
240
- - test/dummy/test/unit/product_test.rb
240
+ - test/dummy/test/functional/products_controller_test.rb
241
241
  - test/dummy/test/unit/helpers/materials_helper_test.rb
242
242
  - test/dummy/test/unit/helpers/products_helper_test.rb
243
243
  - test/dummy/test/unit/material_test.rb
244
- - test/dummy/README.rdoc
245
- - test/dummy/Rakefile
246
- - test/dummy/public/favicon.ico
247
- - test/dummy/public/500.html
248
- - test/dummy/public/404.html
249
- - test/dummy/public/422.html
244
+ - test/dummy/test/unit/product_test.rb
245
+ - test/dummy/test/unit/user_test.rb
246
+ - test/fixtures/materials.yml
247
+ - test/fixtures/products.yml
248
+ - test/fixtures/users.yml
249
+ - test/test_helper.rb
250
+ - test/user_stamp_test.rb