user_impersonate2 0.9.1 → 0.9.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (133) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +15 -12
  3. data/Rakefile +6 -4
  4. data/app/controllers/user_impersonate/impersonate_controller.rb +1 -1
  5. data/lib/user_impersonate/version.rb +1 -1
  6. data/test/{dummy → dummy-rails3}/README.rdoc +0 -0
  7. data/test/{dummy → dummy-rails3}/Rakefile +0 -0
  8. data/test/{dummy → dummy-rails3}/app/assets/javascripts/application.js +0 -0
  9. data/test/{dummy → dummy-rails3}/app/assets/javascripts/home.js +0 -0
  10. data/test/{dummy → dummy-rails3}/app/assets/stylesheets/application.css +0 -0
  11. data/test/{dummy → dummy-rails3}/app/assets/stylesheets/home.css +0 -0
  12. data/test/{dummy → dummy-rails3}/app/controllers/application_controller.rb +0 -0
  13. data/test/{dummy → dummy-rails3}/app/controllers/home_controller.rb +0 -0
  14. data/test/{dummy → dummy-rails3}/app/helpers/application_helper.rb +0 -0
  15. data/test/{dummy → dummy-rails3}/app/helpers/home_helper.rb +0 -0
  16. data/test/{dummy → dummy-rails3}/app/models/user.rb +0 -0
  17. data/test/{dummy → dummy-rails3}/app/views/home/index.html.erb +0 -0
  18. data/test/{dummy → dummy-rails3}/app/views/layouts/application.html.erb +0 -0
  19. data/test/{dummy → dummy-rails3}/app/views/user_impersonate/_header.html.erb +0 -0
  20. data/test/{dummy → dummy-rails3}/config.ru +0 -0
  21. data/test/{dummy → dummy-rails3}/config/application.rb +0 -0
  22. data/test/{dummy → dummy-rails3}/config/boot.rb +0 -0
  23. data/test/{dummy → dummy-rails3}/config/database.yml +0 -0
  24. data/test/{dummy → dummy-rails3}/config/environment.rb +0 -0
  25. data/test/{dummy → dummy-rails3}/config/environments/development.rb +0 -0
  26. data/test/{dummy → dummy-rails3}/config/environments/production.rb +0 -0
  27. data/test/{dummy → dummy-rails3}/config/environments/test.rb +0 -0
  28. data/test/{dummy → dummy-rails3}/config/initializers/backtrace_silencers.rb +0 -0
  29. data/test/{dummy → dummy-rails3}/config/initializers/devise.rb +0 -0
  30. data/test/{dummy → dummy-rails3}/config/initializers/inflections.rb +0 -0
  31. data/test/{dummy → dummy-rails3}/config/initializers/mime_types.rb +0 -0
  32. data/test/{dummy → dummy-rails3}/config/initializers/secret_token.rb +0 -0
  33. data/test/{dummy → dummy-rails3}/config/initializers/session_store.rb +0 -0
  34. data/test/{dummy → dummy-rails3}/config/initializers/user_impersonate.rb +0 -0
  35. data/test/{dummy → dummy-rails3}/config/initializers/wrap_parameters.rb +0 -0
  36. data/test/{dummy → dummy-rails3}/config/locales/devise.en.yml +0 -0
  37. data/test/{dummy → dummy-rails3}/config/locales/en.yml +0 -0
  38. data/test/{dummy → dummy-rails3}/config/routes.rb +0 -0
  39. data/test/{dummy → dummy-rails3}/db/development.sqlite3 +0 -0
  40. data/test/{dummy → dummy-rails3}/db/migrate/20120914174453_devise_create_users.rb +0 -0
  41. data/test/{dummy → dummy-rails3}/db/migrate/20120914184123_add_staff_flag_to_users.rb +0 -0
  42. data/test/{dummy → dummy-rails3}/db/schema.rb +0 -0
  43. data/test/{dummy → dummy-rails3}/db/test.sqlite3 +0 -0
  44. data/test/{dummy → dummy-rails3}/lib/tasks/cucumber.rake +0 -0
  45. data/test/dummy-rails3/log/development.log +262 -0
  46. data/test/dummy-rails3/log/test.log +1091 -0
  47. data/test/{dummy → dummy-rails3}/public/404.html +0 -0
  48. data/test/{dummy → dummy-rails3}/public/422.html +0 -0
  49. data/test/{dummy → dummy-rails3}/public/500.html +0 -0
  50. data/test/{dummy → dummy-rails3}/public/favicon.ico +0 -0
  51. data/test/{dummy → dummy-rails3}/script/rails +0 -0
  52. data/test/{dummy → dummy-rails3}/test/fixtures/users.yml +0 -0
  53. data/test/{dummy → dummy-rails3}/test/unit/helpers/home_helper_test.rb +0 -0
  54. data/test/{dummy → dummy-rails3}/test/unit/user_test.rb +0 -0
  55. data/test/dummy-rails4/README.rdoc +261 -0
  56. data/test/dummy-rails4/Rakefile +7 -0
  57. data/test/dummy-rails4/app/assets/javascripts/application.js +15 -0
  58. data/test/dummy-rails4/app/assets/javascripts/home.js +2 -0
  59. data/test/dummy-rails4/app/assets/stylesheets/application.css +16 -0
  60. data/test/dummy-rails4/app/assets/stylesheets/home.css +7 -0
  61. data/test/dummy-rails4/app/controllers/application_controller.rb +3 -0
  62. data/test/dummy-rails4/app/controllers/home_controller.rb +4 -0
  63. data/test/dummy-rails4/app/helpers/application_helper.rb +2 -0
  64. data/test/dummy-rails4/app/helpers/home_helper.rb +2 -0
  65. data/test/dummy-rails4/app/models/user.rb +17 -0
  66. data/test/dummy-rails4/app/views/home/index.html.erb +11 -0
  67. data/test/dummy-rails4/app/views/layouts/application.html.erb +22 -0
  68. data/test/dummy-rails4/app/views/user_impersonate/_header.html.erb +65 -0
  69. data/test/dummy-rails4/config.ru +4 -0
  70. data/test/dummy-rails4/config/application.rb +57 -0
  71. data/test/dummy-rails4/config/boot.rb +10 -0
  72. data/test/dummy-rails4/config/database.yml +25 -0
  73. data/test/dummy-rails4/config/environment.rb +5 -0
  74. data/test/dummy-rails4/config/environments/development.rb +36 -0
  75. data/test/dummy-rails4/config/environments/production.rb +69 -0
  76. data/test/dummy-rails4/config/environments/test.rb +33 -0
  77. data/test/dummy-rails4/config/initializers/backtrace_silencers.rb +7 -0
  78. data/test/dummy-rails4/config/initializers/devise.rb +234 -0
  79. data/test/dummy-rails4/config/initializers/inflections.rb +15 -0
  80. data/test/dummy-rails4/config/initializers/mime_types.rb +5 -0
  81. data/test/dummy-rails4/config/initializers/secret_token.rb +9 -0
  82. data/test/dummy-rails4/config/initializers/session_store.rb +8 -0
  83. data/test/dummy-rails4/config/initializers/user_impersonate.rb +18 -0
  84. data/test/dummy-rails4/config/initializers/wrap_parameters.rb +14 -0
  85. data/test/dummy-rails4/config/locales/devise.en.yml +58 -0
  86. data/test/dummy-rails4/config/locales/en.yml +5 -0
  87. data/test/dummy-rails4/config/routes.rb +8 -0
  88. data/test/dummy-rails4/db/development.sqlite3 +0 -0
  89. data/test/dummy-rails4/db/migrate/20120914174453_devise_create_users.rb +48 -0
  90. data/test/dummy-rails4/db/migrate/20120914184123_add_staff_flag_to_users.rb +5 -0
  91. data/test/dummy-rails4/db/schema.rb +36 -0
  92. data/test/dummy-rails4/db/test.sqlite3 +0 -0
  93. data/test/dummy-rails4/lib/tasks/cucumber.rake +65 -0
  94. data/test/dummy-rails4/log/development.log +27 -0
  95. data/test/dummy-rails4/log/test.log +465 -0
  96. data/test/dummy-rails4/public/404.html +26 -0
  97. data/test/dummy-rails4/public/422.html +26 -0
  98. data/test/dummy-rails4/public/500.html +25 -0
  99. data/test/dummy-rails4/public/favicon.ico +0 -0
  100. data/test/dummy-rails4/script/rails +6 -0
  101. data/test/dummy-rails4/test/fixtures/users.yml +14 -0
  102. data/test/dummy-rails4/test/unit/helpers/home_helper_test.rb +4 -0
  103. data/test/dummy-rails4/test/unit/user_test.rb +7 -0
  104. data/test/dummy-rails4/tmp/cache/assets/test/sprockets/13fe41fee1fe35b49d145bcc06610705 +0 -0
  105. data/test/dummy-rails4/tmp/cache/assets/test/sprockets/1c9faaf28d05409b88ad3113374d613c +0 -0
  106. data/test/dummy-rails4/tmp/cache/assets/test/sprockets/2625847957ecb8614efc9b58b07cabdf +0 -0
  107. data/test/dummy-rails4/tmp/cache/assets/test/sprockets/2f5173deea6c795b8fdde723bb4b63af +0 -0
  108. data/test/dummy-rails4/tmp/cache/assets/test/sprockets/357970feca3ac29060c1e3861e2c0953 +0 -0
  109. data/test/dummy-rails4/tmp/cache/assets/test/sprockets/35f33ae400a6b0b5bf527436a68133b5 +0 -0
  110. data/test/dummy-rails4/tmp/cache/assets/test/sprockets/3b83d2c20dfdb631259eb9d056ea4419 +0 -0
  111. data/test/dummy-rails4/tmp/cache/assets/test/sprockets/40fc2f3d2a468a00e463f1d313cb1683 +0 -0
  112. data/test/dummy-rails4/tmp/cache/assets/test/sprockets/5f1c168e97e274509aa4673eab0d86f6 +0 -0
  113. data/test/dummy-rails4/tmp/cache/assets/test/sprockets/681d1010f98d5ed273e67645c7cb454d +0 -0
  114. data/test/dummy-rails4/tmp/cache/assets/test/sprockets/7411b44628aea038332f13f5ed73e073 +0 -0
  115. data/test/dummy-rails4/tmp/cache/assets/test/sprockets/7f14251885cab31b58c878119cbdc199 +0 -0
  116. data/test/dummy-rails4/tmp/cache/assets/test/sprockets/8483b329d12e7e986bc5a2204bbcb4f8 +0 -0
  117. data/test/dummy-rails4/tmp/cache/assets/test/sprockets/8ff157af159f38d424ce1367e29760a2 +0 -0
  118. data/test/dummy-rails4/tmp/cache/assets/test/sprockets/b6f020b01a84691088a0c459a18f9c7e +0 -0
  119. data/test/dummy-rails4/tmp/cache/assets/test/sprockets/b878faf942403e313a5b103e5d80488e +0 -0
  120. data/test/dummy-rails4/tmp/cache/assets/test/sprockets/bdaaf186999b6b59a3063d23b589d307 +0 -0
  121. data/test/dummy-rails4/tmp/cache/assets/test/sprockets/cffd775d018f68ce5dba1ee0d951a994 +0 -0
  122. data/test/dummy-rails4/tmp/cache/assets/test/sprockets/d0cde4ef34755468270bb49c4a3689f1 +0 -0
  123. data/test/dummy-rails4/tmp/cache/assets/test/sprockets/d771ace226fc8215a3572e0aa35bb0d6 +0 -0
  124. data/test/dummy-rails4/tmp/cache/assets/test/sprockets/edbef6e0d0a4742346cf479f2c522eb0 +0 -0
  125. data/test/dummy-rails4/tmp/cache/assets/test/sprockets/f1aac9109f5dae028b3c56eb07311208 +0 -0
  126. data/test/dummy-rails4/tmp/cache/assets/test/sprockets/f7cbd26ba1d28d48de824f0e94586655 +0 -0
  127. data/test/dummy-rails4/tmp/cache/assets/test/sprockets/fd6c8e27b44aa2db77bf0a8b5118bdf8 +0 -0
  128. data/test/functional/impersonate_controller_test.rb +19 -0
  129. data/test/test_helper.rb +18 -4
  130. data/test/test_utils.rb +49 -0
  131. metadata +262 -112
  132. data/test/dummy/log/development.log +0 -751
  133. data/test/dummy/log/test.log +0 -8348
@@ -0,0 +1,15 @@
1
+ # Be sure to restart your server when you modify this file.
2
+
3
+ # Add new inflection rules using the following format
4
+ # (all these examples are active by default):
5
+ # ActiveSupport::Inflector.inflections do |inflect|
6
+ # inflect.plural /^(ox)$/i, '\1en'
7
+ # inflect.singular /^(ox)en/i, '\1'
8
+ # inflect.irregular 'person', 'people'
9
+ # inflect.uncountable %w( fish sheep )
10
+ # end
11
+ #
12
+ # These inflection rules are supported but not enabled by default:
13
+ # ActiveSupport::Inflector.inflections do |inflect|
14
+ # inflect.acronym 'RESTful'
15
+ # end
@@ -0,0 +1,5 @@
1
+ # Be sure to restart your server when you modify this file.
2
+
3
+ # Add new mime types for use in respond_to blocks:
4
+ # Mime::Type.register "text/richtext", :rtf
5
+ # Mime::Type.register_alias "text/html", :iphone
@@ -0,0 +1,9 @@
1
+ # Be sure to restart your server when you modify this file.
2
+
3
+ # Your secret key for verifying the integrity of signed cookies.
4
+ # If you change this key, all old signed cookies will become invalid!
5
+ # Make sure the secret is at least 30 characters and all random,
6
+ # no regular words or you'll be exposed to dictionary attacks.
7
+ Dummy::Application.config.secret_token = 'e36bbdeff169a44379d0b3024d3c7ae3960c0297b6c9ed3132ad9978dc1f93515ff1872c9e6a8a2795649dbdf2d3108f7c6f6fad0d11acc3bc9cbffb74df1cad'
8
+ Dummy::Application.config.secret_key_base = 'f229f86ddb3092a60e3874bea65fb520e4c66bc1ad34a39c9735ab4b776e4b6c8da14ea2f0c1f7e34388860670e8a45d41149ab45862718891fb5cb078327cec'
9
+
@@ -0,0 +1,8 @@
1
+ # Be sure to restart your server when you modify this file.
2
+
3
+ Dummy::Application.config.session_store :cookie_store, key: '_dummy_session'
4
+
5
+ # Use the database for sessions instead of the cookie-based default,
6
+ # which shouldn't be used to store highly confidential information
7
+ # (create the session table with "rails generate session_migration")
8
+ # Dummy::Application.config.session_store :active_record_store
@@ -0,0 +1,18 @@
1
+ module UserImpersonate
2
+ class Engine < Rails::Engine
3
+ config.user_class = "User"
4
+ config.user_finder = "find" # User.find
5
+ config.user_id_column = "id" # Such that User.find(aUser.id) works
6
+ config.user_name_column = "name" # Such that User.where("#{user_name_column} like ?", "%#{params[:search]}%") works
7
+ config.user_is_staff_method = "staff?" # current_user.staff?
8
+
9
+ config.redirect_on_impersonate = "/"
10
+
11
+ # Do not use the default /impersonate URL since this
12
+ # does not render with impersonation header
13
+ config.redirect_on_revert = "/"
14
+
15
+ config.authenticate_user_method = "authenticate_user!" # protect impersonation controller
16
+ config.sign_in_user_method = "sign_in" # sign_in(user)
17
+ end
18
+ end
@@ -0,0 +1,14 @@
1
+ # Be sure to restart your server when you modify this file.
2
+ #
3
+ # This file contains settings for ActionController::ParamsWrapper which
4
+ # is enabled by default.
5
+
6
+ # Enable parameter wrapping for JSON. You can disable this by setting :format to an empty array.
7
+ ActiveSupport.on_load(:action_controller) do
8
+ wrap_parameters format: [:json]
9
+ end
10
+
11
+ # Disable root element in JSON by default.
12
+ ActiveSupport.on_load(:active_record) do
13
+ self.include_root_in_json = false
14
+ end
@@ -0,0 +1,58 @@
1
+ # Additional translations at https://github.com/plataformatec/devise/wiki/I18n
2
+
3
+ en:
4
+ errors:
5
+ messages:
6
+ expired: "has expired, please request a new one"
7
+ not_found: "not found"
8
+ already_confirmed: "was already confirmed, please try signing in"
9
+ not_locked: "was not locked"
10
+ not_saved:
11
+ one: "1 error prohibited this %{resource} from being saved:"
12
+ other: "%{count} errors prohibited this %{resource} from being saved:"
13
+
14
+ devise:
15
+ failure:
16
+ already_authenticated: 'You are already signed in.'
17
+ unauthenticated: 'You need to sign in or sign up before continuing.'
18
+ unconfirmed: 'You have to confirm your account before continuing.'
19
+ locked: 'Your account is locked.'
20
+ invalid: 'Invalid email or password.'
21
+ invalid_token: 'Invalid authentication token.'
22
+ timeout: 'Your session expired, please sign in again to continue.'
23
+ inactive: 'Your account was not activated yet.'
24
+ sessions:
25
+ signed_in: 'Signed in successfully.'
26
+ signed_out: 'Signed out successfully.'
27
+ passwords:
28
+ send_instructions: 'You will receive an email with instructions about how to reset your password in a few minutes.'
29
+ updated: 'Your password was changed successfully. You are now signed in.'
30
+ updated_not_active: 'Your password was changed successfully.'
31
+ send_paranoid_instructions: "If your email address exists in our database, you will receive a password recovery link at your email address in a few minutes."
32
+ no_token: "You can't access this page without coming from a password reset email. If you do come from a password reset email, please make sure you used the full URL provided."
33
+ confirmations:
34
+ send_instructions: 'You will receive an email with instructions about how to confirm your account in a few minutes.'
35
+ send_paranoid_instructions: 'If your email address exists in our database, you will receive an email with instructions about how to confirm your account in a few minutes.'
36
+ confirmed: 'Your account was successfully confirmed. You are now signed in.'
37
+ registrations:
38
+ signed_up: 'Welcome! You have signed up successfully.'
39
+ signed_up_but_unconfirmed: 'A message with a confirmation link has been sent to your email address. Please open the link to activate your account.'
40
+ signed_up_but_inactive: 'You have signed up successfully. However, we could not sign you in because your account is not yet activated.'
41
+ signed_up_but_locked: 'You have signed up successfully. However, we could not sign you in because your account is locked.'
42
+ updated: 'You updated your account successfully.'
43
+ update_needs_confirmation: "You updated your account successfully, but we need to verify your new email address. Please check your email and click on the confirm link to finalize confirming your new email address."
44
+ destroyed: 'Bye! Your account was successfully cancelled. We hope to see you again soon.'
45
+ unlocks:
46
+ send_instructions: 'You will receive an email with instructions about how to unlock your account in a few minutes.'
47
+ unlocked: 'Your account has been unlocked successfully. Please sign in to continue.'
48
+ send_paranoid_instructions: 'If your account exists, you will receive an email with instructions about how to unlock it in a few minutes.'
49
+ omniauth_callbacks:
50
+ success: 'Successfully authenticated from %{kind} account.'
51
+ failure: 'Could not authenticate you from %{kind} because "%{reason}".'
52
+ mailer:
53
+ confirmation_instructions:
54
+ subject: 'Confirmation instructions'
55
+ reset_password_instructions:
56
+ subject: 'Reset password instructions'
57
+ unlock_instructions:
58
+ subject: 'Unlock Instructions'
@@ -0,0 +1,5 @@
1
+ # Sample localization file for English. Add more files in this directory for other locales.
2
+ # See https://github.com/svenfuchs/rails-i18n/tree/master/rails%2Flocale for starting points.
3
+
4
+ en:
5
+ hello: "Hello world"
@@ -0,0 +1,8 @@
1
+ Rails.application.routes.draw do
2
+
3
+ devise_for :users
4
+
5
+ root :to => "home#index"
6
+
7
+ mount UserImpersonate::Engine => "/impersonate", as: "impersonate_engine"
8
+ end
@@ -0,0 +1,48 @@
1
+ class DeviseCreateUsers < ActiveRecord::Migration
2
+ def change
3
+ create_table(:users) do |t|
4
+ t.string :name, :null => false, :default => ""
5
+
6
+ ## Database authenticatable
7
+ t.string :email, :null => false, :default => ""
8
+ t.string :encrypted_password, :null => false, :default => ""
9
+
10
+ ## Recoverable
11
+ t.string :reset_password_token
12
+ t.datetime :reset_password_sent_at
13
+
14
+ ## Rememberable
15
+ t.datetime :remember_created_at
16
+
17
+ ## Trackable
18
+ t.integer :sign_in_count, :default => 0
19
+ t.datetime :current_sign_in_at
20
+ t.datetime :last_sign_in_at
21
+ t.string :current_sign_in_ip
22
+ t.string :last_sign_in_ip
23
+
24
+ ## Confirmable
25
+ # t.string :confirmation_token
26
+ # t.datetime :confirmed_at
27
+ # t.datetime :confirmation_sent_at
28
+ # t.string :unconfirmed_email # Only if using reconfirmable
29
+
30
+ ## Lockable
31
+ # t.integer :failed_attempts, :default => 0 # Only if lock strategy is :failed_attempts
32
+ # t.string :unlock_token # Only if unlock strategy is :email or :both
33
+ # t.datetime :locked_at
34
+
35
+ ## Token authenticatable
36
+ # t.string :authentication_token
37
+
38
+
39
+ t.timestamps
40
+ end
41
+
42
+ add_index :users, :email, :unique => true
43
+ add_index :users, :reset_password_token, :unique => true
44
+ # add_index :users, :confirmation_token, :unique => true
45
+ # add_index :users, :unlock_token, :unique => true
46
+ # add_index :users, :authentication_token, :unique => true
47
+ end
48
+ end
@@ -0,0 +1,5 @@
1
+ class AddStaffFlagToUsers < ActiveRecord::Migration
2
+ def change
3
+ add_column :users, :staff, :boolean, default: false
4
+ end
5
+ end
@@ -0,0 +1,36 @@
1
+ # encoding: UTF-8
2
+ # This file is auto-generated from the current state of the database. Instead
3
+ # of editing this file, please use the migrations feature of Active Record to
4
+ # incrementally modify your database, and then regenerate this schema definition.
5
+ #
6
+ # Note that this schema.rb definition is the authoritative source for your
7
+ # database schema. If you need to create the application database on another
8
+ # system, you should be using db:schema:load, not running all the migrations
9
+ # from scratch. The latter is a flawed and unsustainable approach (the more migrations
10
+ # you'll amass, the slower it'll run and the greater likelihood for issues).
11
+ #
12
+ # It's strongly recommended to check this file into your version control system.
13
+
14
+ ActiveRecord::Schema.define(:version => 20120914184123) do
15
+
16
+ create_table "users", :force => true do |t|
17
+ t.string "name", :default => "", :null => false
18
+ t.string "email", :default => "", :null => false
19
+ t.string "encrypted_password", :default => "", :null => false
20
+ t.string "reset_password_token"
21
+ t.datetime "reset_password_sent_at"
22
+ t.datetime "remember_created_at"
23
+ t.integer "sign_in_count", :default => 0
24
+ t.datetime "current_sign_in_at"
25
+ t.datetime "last_sign_in_at"
26
+ t.string "current_sign_in_ip"
27
+ t.string "last_sign_in_ip"
28
+ t.datetime "created_at", :null => false
29
+ t.datetime "updated_at", :null => false
30
+ t.boolean "staff", :default => false
31
+ end
32
+
33
+ add_index "users", ["email"], :name => "index_users_on_email", :unique => true
34
+ add_index "users", ["reset_password_token"], :name => "index_users_on_reset_password_token", :unique => true
35
+
36
+ end
Binary file
@@ -0,0 +1,65 @@
1
+ # IMPORTANT: This file is generated by cucumber-rails - edit at your own peril.
2
+ # It is recommended to regenerate this file in the future when you upgrade to a
3
+ # newer version of cucumber-rails. Consider adding your own code to a new file
4
+ # instead of editing this one. Cucumber will automatically load all features/**/*.rb
5
+ # files.
6
+
7
+
8
+ unless ARGV.any? {|a| a =~ /^gems/} # Don't load anything when running the gems:* tasks
9
+
10
+ vendored_cucumber_bin = Dir["#{Rails.root}/vendor/{gems,plugins}/cucumber*/bin/cucumber"].first
11
+ $LOAD_PATH.unshift(File.dirname(vendored_cucumber_bin) + '/../lib') unless vendored_cucumber_bin.nil?
12
+
13
+ begin
14
+ require 'cucumber/rake/task'
15
+
16
+ namespace :cucumber do
17
+ Cucumber::Rake::Task.new({:ok => 'db:test:prepare'}, 'Run features that should pass') do |t|
18
+ t.binary = vendored_cucumber_bin # If nil, the gem's binary is used.
19
+ t.fork = true # You may get faster startup if you set this to false
20
+ t.profile = 'default'
21
+ end
22
+
23
+ Cucumber::Rake::Task.new({:wip => 'db:test:prepare'}, 'Run features that are being worked on') do |t|
24
+ t.binary = vendored_cucumber_bin
25
+ t.fork = true # You may get faster startup if you set this to false
26
+ t.profile = 'wip'
27
+ end
28
+
29
+ Cucumber::Rake::Task.new({:rerun => 'db:test:prepare'}, 'Record failing features and run only them if any exist') do |t|
30
+ t.binary = vendored_cucumber_bin
31
+ t.fork = true # You may get faster startup if you set this to false
32
+ t.profile = 'rerun'
33
+ end
34
+
35
+ desc 'Run all features'
36
+ task :all => [:ok, :wip]
37
+
38
+ task :statsetup do
39
+ require 'rails/code_statistics'
40
+ ::STATS_DIRECTORIES << %w(Cucumber\ features features) if File.exist?('features')
41
+ ::CodeStatistics::TEST_TYPES << "Cucumber features" if File.exist?('features')
42
+ end
43
+ end
44
+ desc 'Alias for cucumber:ok'
45
+ task :cucumber => 'cucumber:ok'
46
+
47
+ task :default => :cucumber
48
+
49
+ task :features => :cucumber do
50
+ STDERR.puts "*** The 'features' task is deprecated. See rake -T cucumber ***"
51
+ end
52
+
53
+ # In case we don't have ActiveRecord, append a no-op task that we can depend upon.
54
+ task 'db:test:prepare' do
55
+ end
56
+
57
+ task :stats => 'cucumber:statsetup'
58
+ rescue LoadError
59
+ desc 'cucumber rake task not available (cucumber not installed)'
60
+ task :cucumber do
61
+ abort 'Cucumber rake task is not available. Be sure to install cucumber as a gem or plugin'
62
+ end
63
+ end
64
+
65
+ end
@@ -0,0 +1,27 @@
1
+  (30.7ms) CREATE TABLE "users" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar(255) DEFAULT '' NOT NULL, "email" varchar(255) DEFAULT '' NOT NULL, "encrypted_password" varchar(255) DEFAULT '' NOT NULL, "reset_password_token" varchar(255), "reset_password_sent_at" datetime, "remember_created_at" datetime, "sign_in_count" integer DEFAULT 0, "current_sign_in_at" datetime, "last_sign_in_at" datetime, "current_sign_in_ip" varchar(255), "last_sign_in_ip" varchar(255), "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL, "staff" boolean DEFAULT 'f') 
2
+  (19.6ms) CREATE UNIQUE INDEX "index_users_on_email" ON "users" ("email")
3
+  (16.2ms) CREATE UNIQUE INDEX "index_users_on_reset_password_token" ON "users" ("reset_password_token")
4
+  (19.1ms) CREATE TABLE "schema_migrations" ("version" varchar(255) NOT NULL)
5
+  (16.5ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
6
+  (0.1ms) SELECT version FROM "schema_migrations"
7
+  (16.5ms) INSERT INTO "schema_migrations" (version) VALUES ('20120914184123')
8
+  (16.5ms) INSERT INTO "schema_migrations" (version) VALUES ('20120914174453')
9
+ ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
10
+  (25.9ms) CREATE TABLE "users" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar(255) DEFAULT '' NOT NULL, "email" varchar(255) DEFAULT '' NOT NULL, "encrypted_password" varchar(255) DEFAULT '' NOT NULL, "reset_password_token" varchar(255), "reset_password_sent_at" datetime, "remember_created_at" datetime, "sign_in_count" integer DEFAULT 0, "current_sign_in_at" datetime, "last_sign_in_at" datetime, "current_sign_in_ip" varchar(255), "last_sign_in_ip" varchar(255), "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL, "staff" boolean DEFAULT 'f') 
11
+  (14.9ms) CREATE UNIQUE INDEX "index_users_on_email" ON "users" ("email")
12
+  (20.7ms) CREATE UNIQUE INDEX "index_users_on_reset_password_token" ON "users" ("reset_password_token")
13
+  (15.8ms) CREATE TABLE "schema_migrations" ("version" varchar(255) NOT NULL)
14
+  (15.7ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
15
+  (0.1ms) SELECT version FROM "schema_migrations"
16
+  (15.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20120914184123')
17
+  (26.1ms) INSERT INTO "schema_migrations" (version) VALUES ('20120914174453')
18
+ ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
19
+  (21.9ms) CREATE TABLE "users" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar(255) DEFAULT '' NOT NULL, "email" varchar(255) DEFAULT '' NOT NULL, "encrypted_password" varchar(255) DEFAULT '' NOT NULL, "reset_password_token" varchar(255), "reset_password_sent_at" datetime, "remember_created_at" datetime, "sign_in_count" integer DEFAULT 0, "current_sign_in_at" datetime, "last_sign_in_at" datetime, "current_sign_in_ip" varchar(255), "last_sign_in_ip" varchar(255), "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL, "staff" boolean DEFAULT 'f') 
20
+  (34.1ms) CREATE UNIQUE INDEX "index_users_on_email" ON "users" ("email")
21
+  (33.1ms) CREATE UNIQUE INDEX "index_users_on_reset_password_token" ON "users" ("reset_password_token")
22
+  (31.2ms) CREATE TABLE "schema_migrations" ("version" varchar(255) NOT NULL)
23
+  (29.5ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
24
+  (0.1ms) SELECT version FROM "schema_migrations"
25
+  (20.0ms) INSERT INTO "schema_migrations" (version) VALUES ('20120914184123')
26
+  (25.0ms) INSERT INTO "schema_migrations" (version) VALUES ('20120914174453')
27
+ ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
@@ -0,0 +1,465 @@
1
+  (0.3ms) begin transaction
2
+ -------------------------------------------------------------------------------------
3
+ UserImpersonate::ImpersonateControllerTest: test_create_should_require_authentication
4
+ -------------------------------------------------------------------------------------
5
+ Processing by UserImpersonate::ImpersonateController#create as HTML
6
+ Completed 401 Unauthorized in 10ms
7
+ Rendered text template (0.0ms)
8
+  (0.1ms) rollback transaction
9
+  (0.1ms) begin transaction
10
+ ------------------------------------------------------------------------------------------
11
+ UserImpersonate::ImpersonateControllerTest: test_destroy_should_not_require_authentication
12
+ ------------------------------------------------------------------------------------------
13
+ Processing by UserImpersonate::ImpersonateController#destroy as HTML
14
+ Redirected to http://test.host/
15
+ Completed 302 Found in 0ms (ActiveRecord: 0.0ms)
16
+  (0.1ms) rollback transaction
17
+  (0.1ms) begin transaction
18
+ ------------------------------------------------------------------------------------
19
+ UserImpersonate::ImpersonateControllerTest: test_index_should_require_authentication
20
+ ------------------------------------------------------------------------------------
21
+ Processing by UserImpersonate::ImpersonateController#index as HTML
22
+ Completed 401 Unauthorized in 0ms
23
+  (0.1ms) rollback transaction
24
+  (0.1ms) begin transaction
25
+ -------------------------------
26
+ UserImpersonateTest: test_truth
27
+ -------------------------------
28
+  (0.1ms) rollback transaction
29
+  (27.3ms) CREATE TABLE "users" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar(255) DEFAULT '' NOT NULL, "email" varchar(255) DEFAULT '' NOT NULL, "encrypted_password" varchar(255) DEFAULT '' NOT NULL, "reset_password_token" varchar(255), "reset_password_sent_at" datetime, "remember_created_at" datetime, "sign_in_count" integer DEFAULT 0, "current_sign_in_at" datetime, "last_sign_in_at" datetime, "current_sign_in_ip" varchar(255), "last_sign_in_ip" varchar(255), "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL, "staff" boolean DEFAULT 'f') 
30
+  (15.4ms) CREATE UNIQUE INDEX "index_users_on_email" ON "users" ("email")
31
+  (19.5ms) CREATE UNIQUE INDEX "index_users_on_reset_password_token" ON "users" ("reset_password_token")
32
+  (22.6ms) CREATE TABLE "schema_migrations" ("version" varchar(255) NOT NULL)
33
+  (21.2ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
34
+  (0.1ms) SELECT version FROM "schema_migrations"
35
+  (16.0ms) INSERT INTO "schema_migrations" (version) VALUES ('20120914184123')
36
+  (22.1ms) INSERT INTO "schema_migrations" (version) VALUES ('20120914174453')
37
+  (0.3ms) begin transaction
38
+  (0.0ms) commit transaction
39
+  (0.0ms) begin transaction
40
+  (0.1ms) SAVEPOINT active_record_1
41
+ Fixture Delete (0.1ms) DELETE FROM "users"
42
+ Fixture Insert (0.1ms) INSERT INTO "users" ("id", "name", "email", "staff", "encrypted_password", "created_at", "updated_at") VALUES (1, 'Dr Nic Williams', 'drnicwilliams@gmail.com', 't', '$2a$10$HV6E2Hgk2z6hqow76r6IL.5gcnqCSqJYuOuOT.nbqdPffBLvwglzK', '2014-03-18 23:18:57', '2014-03-18 23:18:57')
43
+ Fixture Insert (0.1ms) INSERT INTO "users" ("id", "name", "email", "encrypted_password", "created_at", "updated_at") VALUES (2, 'Normal User', 'normaluser@gmail.com', '$2a$10$HV6E2Hgk2z6hqow76r6IL.5gcnqCSqJYuOuOT.nbqdPffBLvwglzK', '2014-03-18 23:18:57', '2014-03-18 23:18:57')
44
+  (0.0ms) RELEASE SAVEPOINT active_record_1
45
+ User Load (0.1ms) SELECT "users".* FROM "users" WHERE "users"."name" = 'Normal User' LIMIT 1
46
+ Started GET "/users/sign_in" for 127.0.0.1 at 2014-03-18 16:18:57 -0700
47
+ Processing by Devise::SessionsController#new as HTML
48
+ Rendered /home/rcook/.rbenv/versions/2.0.0-p451/lib/ruby/gems/2.0.0/gems/devise-3.2.2/app/views/devise/shared/_links.erb (1.3ms)
49
+ Rendered /home/rcook/.rbenv/versions/2.0.0-p451/lib/ruby/gems/2.0.0/gems/devise-3.2.2/app/views/devise/sessions/new.html.erb within layouts/application (43.1ms)
50
+ Completed 200 OK in 91ms (Views: 67.9ms | ActiveRecord: 0.0ms)
51
+ Started POST "/users/sign_in" for 127.0.0.1 at 2014-03-18 16:18:57 -0700
52
+ Processing by Devise::SessionsController#create as HTML
53
+ Parameters: {"utf8"=>"✓", "user"=>{"email"=>"normaluser@gmail.com", "password"=>"[FILTERED]", "remember_me"=>"0"}, "commit"=>"Sign in"}
54
+ User Load (0.2ms) SELECT "users".* FROM "users" WHERE "users"."email" = 'normaluser@gmail.com' ORDER BY "users"."id" ASC LIMIT 1
55
+ SQL (0.9ms) UPDATE "users" SET "last_sign_in_at" = ?, "current_sign_in_at" = ?, "last_sign_in_ip" = ?, "current_sign_in_ip" = ?, "sign_in_count" = ?, "updated_at" = ? WHERE "users"."id" = 2 [["last_sign_in_at", Tue, 18 Mar 2014 23:18:57 UTC +00:00], ["current_sign_in_at", Tue, 18 Mar 2014 23:18:57 UTC +00:00], ["last_sign_in_ip", "127.0.0.1"], ["current_sign_in_ip", "127.0.0.1"], ["sign_in_count", 1], ["updated_at", Tue, 18 Mar 2014 23:18:57 UTC +00:00]]
56
+ Redirected to http://www.example.com/
57
+ Completed 302 Found in 82ms (ActiveRecord: 1.1ms)
58
+ Started GET "/" for 127.0.0.1 at 2014-03-18 16:18:57 -0700
59
+ Processing by HomeController#index as HTML
60
+ User Load (0.2ms) SELECT "users".* FROM "users" WHERE "users"."id" = 2 ORDER BY "users"."id" ASC LIMIT 1
61
+ Rendered home/index.html.erb within layouts/application (1.8ms)
62
+ Completed 200 OK in 4ms (Views: 3.2ms | ActiveRecord: 0.2ms)
63
+ Started GET "/" for 127.0.0.1 at 2014-03-18 16:18:57 -0700
64
+ Processing by HomeController#index as HTML
65
+ User Load (0.2ms) SELECT "users".* FROM "users" WHERE "users"."id" = 2 ORDER BY "users"."id" ASC LIMIT 1
66
+ Rendered home/index.html.erb within layouts/application (1.0ms)
67
+ Completed 200 OK in 2ms (Views: 1.5ms | ActiveRecord: 0.2ms)
68
+ Started GET "/impersonate" for 127.0.0.1 at 2014-03-18 16:18:57 -0700
69
+ Processing by UserImpersonate::ImpersonateController#index as HTML
70
+ User Load (0.2ms) SELECT "users".* FROM "users" WHERE "users"."id" = 2 ORDER BY "users"."id" ASC LIMIT 1
71
+ Redirected to
72
+ Redirected to http://www.example.com/
73
+ Filter chain halted as :current_user_must_be_staff! rendered or redirected
74
+ Completed 302 Found in 2ms (ActiveRecord: 0.2ms)
75
+ Started GET "/" for 127.0.0.1 at 2014-03-18 16:18:57 -0700
76
+ Processing by HomeController#index as HTML
77
+ User Load (0.1ms) SELECT "users".* FROM "users" WHERE "users"."id" = 2 ORDER BY "users"."id" ASC LIMIT 1
78
+ Rendered home/index.html.erb within layouts/application (0.8ms)
79
+ Completed 200 OK in 2ms (Views: 1.5ms | ActiveRecord: 0.1ms)
80
+  (0.1ms) rollback transaction
81
+  (0.1ms) begin transaction
82
+  (0.0ms) commit transaction
83
+  (0.1ms) begin transaction
84
+  (0.1ms) SAVEPOINT active_record_1
85
+ Fixture Delete (0.1ms) DELETE FROM "users"
86
+ Fixture Insert (0.1ms) INSERT INTO "users" ("id", "name", "email", "staff", "encrypted_password", "created_at", "updated_at") VALUES (1, 'Dr Nic Williams', 'drnicwilliams@gmail.com', 't', '$2a$10$HV6E2Hgk2z6hqow76r6IL.5gcnqCSqJYuOuOT.nbqdPffBLvwglzK', '2014-03-18 23:18:57', '2014-03-18 23:18:57')
87
+ Fixture Insert (0.1ms) INSERT INTO "users" ("id", "name", "email", "encrypted_password", "created_at", "updated_at") VALUES (2, 'Normal User', 'normaluser@gmail.com', '$2a$10$HV6E2Hgk2z6hqow76r6IL.5gcnqCSqJYuOuOT.nbqdPffBLvwglzK', '2014-03-18 23:18:57', '2014-03-18 23:18:57')
88
+  (0.0ms) RELEASE SAVEPOINT active_record_1
89
+ User Load (0.1ms) SELECT "users".* FROM "users" WHERE "users"."name" = 'Dr Nic Williams' LIMIT 1
90
+ Started GET "/users/sign_in" for 127.0.0.1 at 2014-03-18 16:18:57 -0700
91
+ Processing by Devise::SessionsController#new as HTML
92
+ Rendered /home/rcook/.rbenv/versions/2.0.0-p451/lib/ruby/gems/2.0.0/gems/devise-3.2.2/app/views/devise/shared/_links.erb (0.3ms)
93
+ Rendered /home/rcook/.rbenv/versions/2.0.0-p451/lib/ruby/gems/2.0.0/gems/devise-3.2.2/app/views/devise/sessions/new.html.erb within layouts/application (2.3ms)
94
+ Completed 200 OK in 4ms (Views: 3.1ms | ActiveRecord: 0.0ms)
95
+ Started POST "/users/sign_in" for 127.0.0.1 at 2014-03-18 16:18:57 -0700
96
+ Processing by Devise::SessionsController#create as HTML
97
+ Parameters: {"utf8"=>"✓", "user"=>{"email"=>"drnicwilliams@gmail.com", "password"=>"[FILTERED]", "remember_me"=>"0"}, "commit"=>"Sign in"}
98
+ User Load (0.2ms) SELECT "users".* FROM "users" WHERE "users"."email" = 'drnicwilliams@gmail.com' ORDER BY "users"."id" ASC LIMIT 1
99
+ SQL (0.4ms) UPDATE "users" SET "last_sign_in_at" = ?, "current_sign_in_at" = ?, "last_sign_in_ip" = ?, "current_sign_in_ip" = ?, "sign_in_count" = ?, "updated_at" = ? WHERE "users"."id" = 1 [["last_sign_in_at", Tue, 18 Mar 2014 23:18:57 UTC +00:00], ["current_sign_in_at", Tue, 18 Mar 2014 23:18:57 UTC +00:00], ["last_sign_in_ip", "127.0.0.1"], ["current_sign_in_ip", "127.0.0.1"], ["sign_in_count", 1], ["updated_at", Tue, 18 Mar 2014 23:18:57 UTC +00:00]]
100
+ Redirected to http://www.example.com/
101
+ Completed 302 Found in 78ms (ActiveRecord: 0.5ms)
102
+ Started GET "/" for 127.0.0.1 at 2014-03-18 16:18:57 -0700
103
+ Processing by HomeController#index as HTML
104
+ User Load (0.1ms) SELECT "users".* FROM "users" WHERE "users"."id" = 1 ORDER BY "users"."id" ASC LIMIT 1
105
+ Rendered home/index.html.erb within layouts/application (1.3ms)
106
+ Completed 200 OK in 2ms (Views: 1.9ms | ActiveRecord: 0.1ms)
107
+ Started GET "/" for 127.0.0.1 at 2014-03-18 16:18:57 -0700
108
+ Processing by HomeController#index as HTML
109
+ User Load (0.1ms) SELECT "users".* FROM "users" WHERE "users"."id" = 1 ORDER BY "users"."id" ASC LIMIT 1
110
+ Rendered home/index.html.erb within layouts/application (1.4ms)
111
+ Completed 200 OK in 2ms (Views: 1.8ms | ActiveRecord: 0.1ms)
112
+ Started GET "/impersonate" for 127.0.0.1 at 2014-03-18 16:18:57 -0700
113
+ Processing by UserImpersonate::ImpersonateController#index as HTML
114
+ User Load (0.1ms) SELECT "users".* FROM "users" WHERE "users"."id" = 1 ORDER BY "users"."id" ASC LIMIT 1
115
+  (0.1ms) SELECT COUNT(*) FROM "users" WHERE ("users"."id" NOT IN (1))
116
+ User Load (0.1ms) SELECT "users".* FROM "users" WHERE ("users"."id" NOT IN (1)) ORDER BY updated_at DESC
117
+ Rendered /home/rcook/src/user_impersonate2/app/views/user_impersonate/impersonate/index.html.erb within layouts/user_impersonate/application (2.8ms)
118
+ Completed 200 OK in 45ms (Views: 43.6ms | ActiveRecord: 0.4ms)
119
+ Started GET "/impersonate/?utf8=%E2%9C%93&search=Normal+User" for 127.0.0.1 at 2014-03-18 16:18:57 -0700
120
+ Processing by UserImpersonate::ImpersonateController#index as HTML
121
+ Parameters: {"utf8"=>"✓", "search"=>"Normal User"}
122
+ User Load (0.2ms) SELECT "users".* FROM "users" WHERE "users"."id" = 1 ORDER BY "users"."id" ASC LIMIT 1
123
+  (0.1ms) SELECT COUNT(*) FROM "users" WHERE ("users"."id" NOT IN (1)) AND (name like '%Normal User%')
124
+ User Load (0.1ms) SELECT "users".* FROM "users" WHERE ("users"."id" NOT IN (1)) AND (name like '%Normal User%') ORDER BY updated_at DESC
125
+ Rendered /home/rcook/src/user_impersonate2/app/views/user_impersonate/impersonate/index.html.erb within layouts/user_impersonate/application (1.5ms)
126
+ Completed 200 OK in 4ms (Views: 1.9ms | ActiveRecord: 0.4ms)
127
+ Started GET "/impersonate/user/2" for 127.0.0.1 at 2014-03-18 16:18:57 -0700
128
+ Processing by UserImpersonate::ImpersonateController#create as HTML
129
+ Parameters: {"user_id"=>"2"}
130
+ User Load (0.1ms) SELECT "users".* FROM "users" WHERE "users"."id" = 1 ORDER BY "users"."id" ASC LIMIT 1
131
+ User Load (0.1ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT 1 [["id", "2"]]
132
+ SQL (0.2ms) UPDATE "users" SET "last_sign_in_at" = ?, "current_sign_in_at" = ?, "last_sign_in_ip" = ?, "current_sign_in_ip" = ?, "sign_in_count" = ?, "updated_at" = ? WHERE "users"."id" = 2 [["last_sign_in_at", Tue, 18 Mar 2014 23:18:57 UTC +00:00], ["current_sign_in_at", Tue, 18 Mar 2014 23:18:57 UTC +00:00], ["last_sign_in_ip", "127.0.0.1"], ["current_sign_in_ip", "127.0.0.1"], ["sign_in_count", 1], ["updated_at", Tue, 18 Mar 2014 23:18:57 UTC +00:00]]
133
+ Redirected to http://www.example.com/
134
+ Completed 302 Found in 3ms (ActiveRecord: 0.4ms)
135
+ Started GET "/" for 127.0.0.1 at 2014-03-18 16:18:57 -0700
136
+ Processing by HomeController#index as HTML
137
+ User Load (0.1ms) SELECT "users".* FROM "users" WHERE "users"."id" = 2 ORDER BY "users"."id" ASC LIMIT 1
138
+ Rendered home/index.html.erb within layouts/application (0.8ms)
139
+ User Load (0.0ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT 1 [["id", 1]]
140
+ Rendered user_impersonate/_header.html.erb (4.2ms)
141
+ Completed 200 OK in 7ms (Views: 6.3ms | ActiveRecord: 0.2ms)
142
+ Started DELETE "/impersonate/revert" for 127.0.0.1 at 2014-03-18 16:18:57 -0700
143
+ Processing by UserImpersonate::ImpersonateController#destroy as HTML
144
+ Parameters: {"utf8"=>"✓"}
145
+ User Load (0.1ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT 1 [["id", 1]]
146
+ User Load (0.1ms) SELECT "users".* FROM "users" WHERE "users"."id" = 2 ORDER BY "users"."id" ASC LIMIT 1
147
+ SQL (0.2ms) UPDATE "users" SET "current_sign_in_at" = ?, "sign_in_count" = ?, "updated_at" = ? WHERE "users"."id" = 1 [["current_sign_in_at", Tue, 18 Mar 2014 23:18:57 UTC +00:00], ["sign_in_count", 2], ["updated_at", Tue, 18 Mar 2014 23:18:57 UTC +00:00]]
148
+ Redirected to http://www.example.com/
149
+ Completed 302 Found in 3ms (ActiveRecord: 0.4ms)
150
+ Started GET "/" for 127.0.0.1 at 2014-03-18 16:18:57 -0700
151
+ Processing by HomeController#index as HTML
152
+ User Load (0.1ms) SELECT "users".* FROM "users" WHERE "users"."id" = 1 ORDER BY "users"."id" ASC LIMIT 1
153
+ Rendered home/index.html.erb within layouts/application (1.0ms)
154
+ Completed 200 OK in 2ms (Views: 1.6ms | ActiveRecord: 0.1ms)
155
+  (0.2ms) rollback transaction
156
+  (0.3ms) begin transaction
157
+ -------------------------------------------------------------------------------------
158
+ UserImpersonate::ImpersonateControllerTest: test_create_should_require_authentication
159
+ -------------------------------------------------------------------------------------
160
+ Processing by UserImpersonate::ImpersonateController#create as HTML
161
+ Completed 401 Unauthorized in 9ms
162
+ Rendered text template (0.0ms)
163
+  (0.1ms) rollback transaction
164
+  (0.1ms) begin transaction
165
+ ------------------------------------------------------------------------------------------
166
+ UserImpersonate::ImpersonateControllerTest: test_destroy_should_not_require_authentication
167
+ ------------------------------------------------------------------------------------------
168
+ Processing by UserImpersonate::ImpersonateController#destroy as HTML
169
+ Redirected to http://test.host/
170
+ Completed 302 Found in 0ms (ActiveRecord: 0.0ms)
171
+  (0.1ms) rollback transaction
172
+  (0.1ms) begin transaction
173
+ ------------------------------------------------------------------------------------
174
+ UserImpersonate::ImpersonateControllerTest: test_index_should_require_authentication
175
+ ------------------------------------------------------------------------------------
176
+ Processing by UserImpersonate::ImpersonateController#index as HTML
177
+ Completed 401 Unauthorized in 0ms
178
+  (0.1ms) rollback transaction
179
+  (0.0ms) begin transaction
180
+ -------------------------------
181
+ UserImpersonateTest: test_truth
182
+ -------------------------------
183
+  (0.1ms) rollback transaction
184
+  (24.2ms) CREATE TABLE "users" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar(255) DEFAULT '' NOT NULL, "email" varchar(255) DEFAULT '' NOT NULL, "encrypted_password" varchar(255) DEFAULT '' NOT NULL, "reset_password_token" varchar(255), "reset_password_sent_at" datetime, "remember_created_at" datetime, "sign_in_count" integer DEFAULT 0, "current_sign_in_at" datetime, "last_sign_in_at" datetime, "current_sign_in_ip" varchar(255), "last_sign_in_ip" varchar(255), "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL, "staff" boolean DEFAULT 'f') 
185
+  (21.7ms) CREATE UNIQUE INDEX "index_users_on_email" ON "users" ("email")
186
+  (21.2ms) CREATE UNIQUE INDEX "index_users_on_reset_password_token" ON "users" ("reset_password_token")
187
+  (21.5ms) CREATE TABLE "schema_migrations" ("version" varchar(255) NOT NULL)
188
+  (21.2ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
189
+  (0.1ms) SELECT version FROM "schema_migrations"
190
+  (16.0ms) INSERT INTO "schema_migrations" (version) VALUES ('20120914184123')
191
+  (30.2ms) INSERT INTO "schema_migrations" (version) VALUES ('20120914174453')
192
+  (0.3ms) begin transaction
193
+  (0.0ms) commit transaction
194
+  (0.0ms) begin transaction
195
+  (0.1ms) SAVEPOINT active_record_1
196
+ Fixture Delete (0.1ms) DELETE FROM "users"
197
+ Fixture Insert (0.1ms) INSERT INTO "users" ("id", "name", "email", "staff", "encrypted_password", "created_at", "updated_at") VALUES (1, 'Dr Nic Williams', 'drnicwilliams@gmail.com', 't', '$2a$10$HV6E2Hgk2z6hqow76r6IL.5gcnqCSqJYuOuOT.nbqdPffBLvwglzK', '2014-03-18 23:24:52', '2014-03-18 23:24:52')
198
+ Fixture Insert (0.1ms) INSERT INTO "users" ("id", "name", "email", "encrypted_password", "created_at", "updated_at") VALUES (2, 'Normal User', 'normaluser@gmail.com', '$2a$10$HV6E2Hgk2z6hqow76r6IL.5gcnqCSqJYuOuOT.nbqdPffBLvwglzK', '2014-03-18 23:24:52', '2014-03-18 23:24:52')
199
+  (0.0ms) RELEASE SAVEPOINT active_record_1
200
+ User Load (0.1ms) SELECT "users".* FROM "users" WHERE "users"."name" = 'Normal User' LIMIT 1
201
+ Started GET "/users/sign_in" for 127.0.0.1 at 2014-03-18 16:24:52 -0700
202
+ Processing by Devise::SessionsController#new as HTML
203
+ Rendered /home/rcook/.rbenv/versions/2.0.0-p451/lib/ruby/gems/2.0.0/gems/devise-3.2.2/app/views/devise/shared/_links.erb (1.3ms)
204
+ Rendered /home/rcook/.rbenv/versions/2.0.0-p451/lib/ruby/gems/2.0.0/gems/devise-3.2.2/app/views/devise/sessions/new.html.erb within layouts/application (43.1ms)
205
+ Completed 200 OK in 79ms (Views: 56.5ms | ActiveRecord: 0.0ms)
206
+ Started POST "/users/sign_in" for 127.0.0.1 at 2014-03-18 16:24:52 -0700
207
+ Processing by Devise::SessionsController#create as HTML
208
+ Parameters: {"utf8"=>"✓", "user"=>{"email"=>"normaluser@gmail.com", "password"=>"[FILTERED]", "remember_me"=>"0"}, "commit"=>"Sign in"}
209
+ User Load (0.2ms) SELECT "users".* FROM "users" WHERE "users"."email" = 'normaluser@gmail.com' ORDER BY "users"."id" ASC LIMIT 1
210
+ SQL (0.9ms) UPDATE "users" SET "last_sign_in_at" = ?, "current_sign_in_at" = ?, "last_sign_in_ip" = ?, "current_sign_in_ip" = ?, "sign_in_count" = ?, "updated_at" = ? WHERE "users"."id" = 2 [["last_sign_in_at", Tue, 18 Mar 2014 23:24:52 UTC +00:00], ["current_sign_in_at", Tue, 18 Mar 2014 23:24:52 UTC +00:00], ["last_sign_in_ip", "127.0.0.1"], ["current_sign_in_ip", "127.0.0.1"], ["sign_in_count", 1], ["updated_at", Tue, 18 Mar 2014 23:24:52 UTC +00:00]]
211
+ Redirected to http://www.example.com/
212
+ Completed 302 Found in 82ms (ActiveRecord: 1.1ms)
213
+ Started GET "/" for 127.0.0.1 at 2014-03-18 16:24:52 -0700
214
+ Processing by HomeController#index as HTML
215
+ User Load (0.2ms) SELECT "users".* FROM "users" WHERE "users"."id" = 2 ORDER BY "users"."id" ASC LIMIT 1
216
+ Rendered home/index.html.erb within layouts/application (1.8ms)
217
+ Completed 200 OK in 4ms (Views: 3.2ms | ActiveRecord: 0.2ms)
218
+ Started GET "/" for 127.0.0.1 at 2014-03-18 16:24:52 -0700
219
+ Processing by HomeController#index as HTML
220
+ User Load (0.1ms) SELECT "users".* FROM "users" WHERE "users"."id" = 2 ORDER BY "users"."id" ASC LIMIT 1
221
+ Rendered home/index.html.erb within layouts/application (0.9ms)
222
+ Completed 200 OK in 2ms (Views: 1.3ms | ActiveRecord: 0.1ms)
223
+ Started GET "/impersonate" for 127.0.0.1 at 2014-03-18 16:24:52 -0700
224
+ Processing by UserImpersonate::ImpersonateController#index as HTML
225
+ User Load (0.1ms) SELECT "users".* FROM "users" WHERE "users"."id" = 2 ORDER BY "users"."id" ASC LIMIT 1
226
+ Redirected to
227
+ Redirected to http://www.example.com/
228
+ Filter chain halted as :current_user_must_be_staff! rendered or redirected
229
+ Completed 302 Found in 2ms (ActiveRecord: 0.1ms)
230
+ Started GET "/" for 127.0.0.1 at 2014-03-18 16:24:52 -0700
231
+ Processing by HomeController#index as HTML
232
+ User Load (0.1ms) SELECT "users".* FROM "users" WHERE "users"."id" = 2 ORDER BY "users"."id" ASC LIMIT 1
233
+ Rendered home/index.html.erb within layouts/application (0.9ms)
234
+ Completed 200 OK in 2ms (Views: 1.5ms | ActiveRecord: 0.1ms)
235
+  (0.2ms) rollback transaction
236
+  (0.1ms) begin transaction
237
+  (0.0ms) commit transaction
238
+  (0.0ms) begin transaction
239
+  (0.0ms) SAVEPOINT active_record_1
240
+ Fixture Delete (0.1ms) DELETE FROM "users"
241
+ Fixture Insert (0.1ms) INSERT INTO "users" ("id", "name", "email", "staff", "encrypted_password", "created_at", "updated_at") VALUES (1, 'Dr Nic Williams', 'drnicwilliams@gmail.com', 't', '$2a$10$HV6E2Hgk2z6hqow76r6IL.5gcnqCSqJYuOuOT.nbqdPffBLvwglzK', '2014-03-18 23:24:52', '2014-03-18 23:24:52')
242
+ Fixture Insert (0.1ms) INSERT INTO "users" ("id", "name", "email", "encrypted_password", "created_at", "updated_at") VALUES (2, 'Normal User', 'normaluser@gmail.com', '$2a$10$HV6E2Hgk2z6hqow76r6IL.5gcnqCSqJYuOuOT.nbqdPffBLvwglzK', '2014-03-18 23:24:52', '2014-03-18 23:24:52')
243
+  (0.0ms) RELEASE SAVEPOINT active_record_1
244
+ User Load (0.1ms) SELECT "users".* FROM "users" WHERE "users"."name" = 'Dr Nic Williams' LIMIT 1
245
+ Started GET "/users/sign_in" for 127.0.0.1 at 2014-03-18 16:24:52 -0700
246
+ Processing by Devise::SessionsController#new as HTML
247
+ Rendered /home/rcook/.rbenv/versions/2.0.0-p451/lib/ruby/gems/2.0.0/gems/devise-3.2.2/app/views/devise/shared/_links.erb (0.3ms)
248
+ Rendered /home/rcook/.rbenv/versions/2.0.0-p451/lib/ruby/gems/2.0.0/gems/devise-3.2.2/app/views/devise/sessions/new.html.erb within layouts/application (2.2ms)
249
+ Completed 200 OK in 4ms (Views: 3.0ms | ActiveRecord: 0.0ms)
250
+ Started POST "/users/sign_in" for 127.0.0.1 at 2014-03-18 16:24:52 -0700
251
+ Processing by Devise::SessionsController#create as HTML
252
+ Parameters: {"utf8"=>"✓", "user"=>{"email"=>"drnicwilliams@gmail.com", "password"=>"[FILTERED]", "remember_me"=>"0"}, "commit"=>"Sign in"}
253
+ User Load (0.2ms) SELECT "users".* FROM "users" WHERE "users"."email" = 'drnicwilliams@gmail.com' ORDER BY "users"."id" ASC LIMIT 1
254
+ SQL (0.4ms) UPDATE "users" SET "last_sign_in_at" = ?, "current_sign_in_at" = ?, "last_sign_in_ip" = ?, "current_sign_in_ip" = ?, "sign_in_count" = ?, "updated_at" = ? WHERE "users"."id" = 1 [["last_sign_in_at", Tue, 18 Mar 2014 23:24:52 UTC +00:00], ["current_sign_in_at", Tue, 18 Mar 2014 23:24:52 UTC +00:00], ["last_sign_in_ip", "127.0.0.1"], ["current_sign_in_ip", "127.0.0.1"], ["sign_in_count", 1], ["updated_at", Tue, 18 Mar 2014 23:24:52 UTC +00:00]]
255
+ Redirected to http://www.example.com/
256
+ Completed 302 Found in 79ms (ActiveRecord: 0.5ms)
257
+ Started GET "/" for 127.0.0.1 at 2014-03-18 16:24:52 -0700
258
+ Processing by HomeController#index as HTML
259
+ User Load (0.1ms) SELECT "users".* FROM "users" WHERE "users"."id" = 1 ORDER BY "users"."id" ASC LIMIT 1
260
+ Rendered home/index.html.erb within layouts/application (1.4ms)
261
+ Completed 200 OK in 2ms (Views: 2.0ms | ActiveRecord: 0.1ms)
262
+ Started GET "/" for 127.0.0.1 at 2014-03-18 16:24:52 -0700
263
+ Processing by HomeController#index as HTML
264
+ User Load (0.2ms) SELECT "users".* FROM "users" WHERE "users"."id" = 1 ORDER BY "users"."id" ASC LIMIT 1
265
+ Rendered home/index.html.erb within layouts/application (1.5ms)
266
+ Completed 200 OK in 2ms (Views: 1.9ms | ActiveRecord: 0.2ms)
267
+ Started GET "/impersonate" for 127.0.0.1 at 2014-03-18 16:24:52 -0700
268
+ Processing by UserImpersonate::ImpersonateController#index as HTML
269
+ User Load (0.1ms) SELECT "users".* FROM "users" WHERE "users"."id" = 1 ORDER BY "users"."id" ASC LIMIT 1
270
+  (0.1ms) SELECT COUNT(*) FROM "users" WHERE ("users"."id" NOT IN (1))
271
+ User Load (0.1ms) SELECT "users".* FROM "users" WHERE ("users"."id" NOT IN (1)) ORDER BY updated_at DESC
272
+ Rendered /home/rcook/src/user_impersonate2/app/views/user_impersonate/impersonate/index.html.erb within layouts/user_impersonate/application (5.8ms)
273
+ Completed 200 OK in 13ms (Views: 11.6ms | ActiveRecord: 0.4ms)
274
+ Started GET "/impersonate/?utf8=%E2%9C%93&search=Normal+User" for 127.0.0.1 at 2014-03-18 16:24:52 -0700
275
+ Processing by UserImpersonate::ImpersonateController#index as HTML
276
+ Parameters: {"utf8"=>"✓", "search"=>"Normal User"}
277
+ User Load (0.1ms) SELECT "users".* FROM "users" WHERE "users"."id" = 1 ORDER BY "users"."id" ASC LIMIT 1
278
+  (0.1ms) SELECT COUNT(*) FROM "users" WHERE ("users"."id" NOT IN (1)) AND (name like '%Normal User%')
279
+ User Load (0.1ms) SELECT "users".* FROM "users" WHERE ("users"."id" NOT IN (1)) AND (name like '%Normal User%') ORDER BY updated_at DESC
280
+ Rendered /home/rcook/src/user_impersonate2/app/views/user_impersonate/impersonate/index.html.erb within layouts/user_impersonate/application (1.4ms)
281
+ Completed 200 OK in 4ms (Views: 1.8ms | ActiveRecord: 0.4ms)
282
+ Started GET "/impersonate/user/2" for 127.0.0.1 at 2014-03-18 16:24:52 -0700
283
+ Processing by UserImpersonate::ImpersonateController#create as HTML
284
+ Parameters: {"user_id"=>"2"}
285
+ User Load (0.2ms) SELECT "users".* FROM "users" WHERE "users"."id" = 1 ORDER BY "users"."id" ASC LIMIT 1
286
+ User Load (0.1ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT 1 [["id", "2"]]
287
+ SQL (0.2ms) UPDATE "users" SET "last_sign_in_at" = ?, "current_sign_in_at" = ?, "last_sign_in_ip" = ?, "current_sign_in_ip" = ?, "sign_in_count" = ?, "updated_at" = ? WHERE "users"."id" = 2 [["last_sign_in_at", Tue, 18 Mar 2014 23:24:52 UTC +00:00], ["current_sign_in_at", Tue, 18 Mar 2014 23:24:52 UTC +00:00], ["last_sign_in_ip", "127.0.0.1"], ["current_sign_in_ip", "127.0.0.1"], ["sign_in_count", 1], ["updated_at", Tue, 18 Mar 2014 23:24:52 UTC +00:00]]
288
+ Redirected to http://www.example.com/
289
+ Completed 302 Found in 4ms (ActiveRecord: 0.5ms)
290
+ Started GET "/" for 127.0.0.1 at 2014-03-18 16:24:52 -0700
291
+ Processing by HomeController#index as HTML
292
+ User Load (0.1ms) SELECT "users".* FROM "users" WHERE "users"."id" = 2 ORDER BY "users"."id" ASC LIMIT 1
293
+ Rendered home/index.html.erb within layouts/application (1.0ms)
294
+ User Load (0.1ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT 1 [["id", 1]]
295
+ Rendered user_impersonate/_header.html.erb (1.3ms)
296
+ Completed 200 OK in 4ms (Views: 3.7ms | ActiveRecord: 0.2ms)
297
+ Started DELETE "/impersonate/revert" for 127.0.0.1 at 2014-03-18 16:24:52 -0700
298
+ Processing by UserImpersonate::ImpersonateController#destroy as HTML
299
+ Parameters: {"utf8"=>"✓"}
300
+ User Load (0.1ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT 1 [["id", 1]]
301
+ User Load (0.2ms) SELECT "users".* FROM "users" WHERE "users"."id" = 2 ORDER BY "users"."id" ASC LIMIT 1
302
+ SQL (0.2ms) UPDATE "users" SET "current_sign_in_at" = ?, "sign_in_count" = ?, "updated_at" = ? WHERE "users"."id" = 1 [["current_sign_in_at", Tue, 18 Mar 2014 23:24:52 UTC +00:00], ["sign_in_count", 2], ["updated_at", Tue, 18 Mar 2014 23:24:52 UTC +00:00]]
303
+ Redirected to http://www.example.com/
304
+ Completed 302 Found in 4ms (ActiveRecord: 0.4ms)
305
+ Started GET "/" for 127.0.0.1 at 2014-03-18 16:24:52 -0700
306
+ Processing by HomeController#index as HTML
307
+ User Load (0.1ms) SELECT "users".* FROM "users" WHERE "users"."id" = 1 ORDER BY "users"."id" ASC LIMIT 1
308
+ Rendered home/index.html.erb within layouts/application (1.1ms)
309
+ Completed 200 OK in 2ms (Views: 1.7ms | ActiveRecord: 0.1ms)
310
+  (0.1ms) rollback transaction
311
+  (0.5ms) begin transaction
312
+ -------------------------------------------------------------------------------------
313
+ UserImpersonate::ImpersonateControllerTest: test_create_should_require_authentication
314
+ -------------------------------------------------------------------------------------
315
+ Processing by UserImpersonate::ImpersonateController#create as HTML
316
+ Completed 401 Unauthorized in 9ms
317
+ Rendered text template (0.0ms)
318
+  (0.1ms) rollback transaction
319
+  (0.1ms) begin transaction
320
+ ------------------------------------------------------------------------------------------
321
+ UserImpersonate::ImpersonateControllerTest: test_destroy_should_not_require_authentication
322
+ ------------------------------------------------------------------------------------------
323
+ Processing by UserImpersonate::ImpersonateController#destroy as HTML
324
+ Redirected to http://test.host/
325
+ Completed 302 Found in 1ms (ActiveRecord: 0.0ms)
326
+  (0.1ms) rollback transaction
327
+  (0.1ms) begin transaction
328
+ ------------------------------------------------------------------------------------
329
+ UserImpersonate::ImpersonateControllerTest: test_index_should_require_authentication
330
+ ------------------------------------------------------------------------------------
331
+ Processing by UserImpersonate::ImpersonateController#index as HTML
332
+ Completed 401 Unauthorized in 0ms
333
+  (0.1ms) rollback transaction
334
+  (0.1ms) begin transaction
335
+ -------------------------------
336
+ UserImpersonateTest: test_truth
337
+ -------------------------------
338
+  (0.1ms) rollback transaction
339
+  (15.8ms) CREATE TABLE "users" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar(255) DEFAULT '' NOT NULL, "email" varchar(255) DEFAULT '' NOT NULL, "encrypted_password" varchar(255) DEFAULT '' NOT NULL, "reset_password_token" varchar(255), "reset_password_sent_at" datetime, "remember_created_at" datetime, "sign_in_count" integer DEFAULT 0, "current_sign_in_at" datetime, "last_sign_in_at" datetime, "current_sign_in_ip" varchar(255), "last_sign_in_ip" varchar(255), "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL, "staff" boolean DEFAULT 'f') 
340
+  (19.0ms) CREATE UNIQUE INDEX "index_users_on_email" ON "users" ("email")
341
+  (24.1ms) CREATE UNIQUE INDEX "index_users_on_reset_password_token" ON "users" ("reset_password_token")
342
+  (24.7ms) CREATE TABLE "schema_migrations" ("version" varchar(255) NOT NULL)
343
+  (38.7ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
344
+  (0.3ms) SELECT version FROM "schema_migrations"
345
+  (31.9ms) INSERT INTO "schema_migrations" (version) VALUES ('20120914184123')
346
+  (36.1ms) INSERT INTO "schema_migrations" (version) VALUES ('20120914174453')
347
+  (0.3ms) begin transaction
348
+  (0.0ms) commit transaction
349
+  (0.0ms) begin transaction
350
+  (0.1ms) SAVEPOINT active_record_1
351
+ Fixture Delete (0.2ms) DELETE FROM "users"
352
+ Fixture Insert (0.1ms) INSERT INTO "users" ("id", "name", "email", "staff", "encrypted_password", "created_at", "updated_at") VALUES (1, 'Dr Nic Williams', 'drnicwilliams@gmail.com', 't', '$2a$10$HV6E2Hgk2z6hqow76r6IL.5gcnqCSqJYuOuOT.nbqdPffBLvwglzK', '2014-03-18 23:53:08', '2014-03-18 23:53:08')
353
+ Fixture Insert (0.1ms) INSERT INTO "users" ("id", "name", "email", "encrypted_password", "created_at", "updated_at") VALUES (2, 'Normal User', 'normaluser@gmail.com', '$2a$10$HV6E2Hgk2z6hqow76r6IL.5gcnqCSqJYuOuOT.nbqdPffBLvwglzK', '2014-03-18 23:53:08', '2014-03-18 23:53:08')
354
+  (0.0ms) RELEASE SAVEPOINT active_record_1
355
+ User Load (0.2ms) SELECT "users".* FROM "users" WHERE "users"."name" = 'Normal User' LIMIT 1
356
+ Started GET "/users/sign_in" for 127.0.0.1 at 2014-03-18 16:53:08 -0700
357
+ Processing by Devise::SessionsController#new as HTML
358
+ Rendered /home/rcook/.rbenv/versions/2.0.0-p451/lib/ruby/gems/2.0.0/gems/devise-3.2.2/app/views/devise/shared/_links.erb (1.4ms)
359
+ Rendered /home/rcook/.rbenv/versions/2.0.0-p451/lib/ruby/gems/2.0.0/gems/devise-3.2.2/app/views/devise/sessions/new.html.erb within layouts/application (47.5ms)
360
+ Completed 200 OK in 87ms (Views: 62.7ms | ActiveRecord: 0.0ms)
361
+ Started POST "/users/sign_in" for 127.0.0.1 at 2014-03-18 16:53:08 -0700
362
+ Processing by Devise::SessionsController#create as HTML
363
+ Parameters: {"utf8"=>"✓", "user"=>{"email"=>"normaluser@gmail.com", "password"=>"[FILTERED]", "remember_me"=>"0"}, "commit"=>"Sign in"}
364
+ User Load (0.2ms) SELECT "users".* FROM "users" WHERE "users"."email" = 'normaluser@gmail.com' ORDER BY "users"."id" ASC LIMIT 1
365
+ SQL (1.2ms) UPDATE "users" SET "last_sign_in_at" = ?, "current_sign_in_at" = ?, "last_sign_in_ip" = ?, "current_sign_in_ip" = ?, "sign_in_count" = ?, "updated_at" = ? WHERE "users"."id" = 2 [["last_sign_in_at", Tue, 18 Mar 2014 23:53:08 UTC +00:00], ["current_sign_in_at", Tue, 18 Mar 2014 23:53:08 UTC +00:00], ["last_sign_in_ip", "127.0.0.1"], ["current_sign_in_ip", "127.0.0.1"], ["sign_in_count", 1], ["updated_at", Tue, 18 Mar 2014 23:53:08 UTC +00:00]]
366
+ Redirected to http://www.example.com/
367
+ Completed 302 Found in 88ms (ActiveRecord: 1.3ms)
368
+ Started GET "/" for 127.0.0.1 at 2014-03-18 16:53:08 -0700
369
+ Processing by HomeController#index as HTML
370
+ User Load (0.2ms) SELECT "users".* FROM "users" WHERE "users"."id" = 2 ORDER BY "users"."id" ASC LIMIT 1
371
+ Rendered home/index.html.erb within layouts/application (2.0ms)
372
+ Completed 200 OK in 4ms (Views: 3.5ms | ActiveRecord: 0.2ms)
373
+ Started GET "/" for 127.0.0.1 at 2014-03-18 16:53:08 -0700
374
+ Processing by HomeController#index as HTML
375
+ User Load (0.1ms) SELECT "users".* FROM "users" WHERE "users"."id" = 2 ORDER BY "users"."id" ASC LIMIT 1
376
+ Rendered home/index.html.erb within layouts/application (0.9ms)
377
+ Completed 200 OK in 2ms (Views: 1.5ms | ActiveRecord: 0.1ms)
378
+ Started GET "/impersonate" for 127.0.0.1 at 2014-03-18 16:53:08 -0700
379
+ Processing by UserImpersonate::ImpersonateController#index as HTML
380
+ User Load (0.2ms) SELECT "users".* FROM "users" WHERE "users"."id" = 2 ORDER BY "users"."id" ASC LIMIT 1
381
+ Redirected to
382
+ Redirected to http://www.example.com/
383
+ Filter chain halted as :current_user_must_be_staff! rendered or redirected
384
+ Completed 302 Found in 2ms (ActiveRecord: 0.2ms)
385
+ Started GET "/" for 127.0.0.1 at 2014-03-18 16:53:08 -0700
386
+ Processing by HomeController#index as HTML
387
+ User Load (0.1ms) SELECT "users".* FROM "users" WHERE "users"."id" = 2 ORDER BY "users"."id" ASC LIMIT 1
388
+ Rendered home/index.html.erb within layouts/application (1.0ms)
389
+ Completed 200 OK in 2ms (Views: 1.6ms | ActiveRecord: 0.1ms)
390
+  (0.2ms) rollback transaction
391
+  (0.2ms) begin transaction
392
+  (0.0ms) commit transaction
393
+  (0.1ms) begin transaction
394
+  (0.1ms) SAVEPOINT active_record_1
395
+ Fixture Delete (0.1ms) DELETE FROM "users"
396
+ Fixture Insert (0.1ms) INSERT INTO "users" ("id", "name", "email", "staff", "encrypted_password", "created_at", "updated_at") VALUES (1, 'Dr Nic Williams', 'drnicwilliams@gmail.com', 't', '$2a$10$HV6E2Hgk2z6hqow76r6IL.5gcnqCSqJYuOuOT.nbqdPffBLvwglzK', '2014-03-18 23:53:08', '2014-03-18 23:53:08')
397
+ Fixture Insert (0.2ms) INSERT INTO "users" ("id", "name", "email", "encrypted_password", "created_at", "updated_at") VALUES (2, 'Normal User', 'normaluser@gmail.com', '$2a$10$HV6E2Hgk2z6hqow76r6IL.5gcnqCSqJYuOuOT.nbqdPffBLvwglzK', '2014-03-18 23:53:08', '2014-03-18 23:53:08')
398
+  (0.1ms) RELEASE SAVEPOINT active_record_1
399
+ User Load (0.2ms) SELECT "users".* FROM "users" WHERE "users"."name" = 'Dr Nic Williams' LIMIT 1
400
+ Started GET "/users/sign_in" for 127.0.0.1 at 2014-03-18 16:53:08 -0700
401
+ Processing by Devise::SessionsController#new as HTML
402
+ Rendered /home/rcook/.rbenv/versions/2.0.0-p451/lib/ruby/gems/2.0.0/gems/devise-3.2.2/app/views/devise/shared/_links.erb (0.4ms)
403
+ Rendered /home/rcook/.rbenv/versions/2.0.0-p451/lib/ruby/gems/2.0.0/gems/devise-3.2.2/app/views/devise/sessions/new.html.erb within layouts/application (2.7ms)
404
+ Completed 200 OK in 5ms (Views: 3.7ms | ActiveRecord: 0.0ms)
405
+ Started POST "/users/sign_in" for 127.0.0.1 at 2014-03-18 16:53:08 -0700
406
+ Processing by Devise::SessionsController#create as HTML
407
+ Parameters: {"utf8"=>"✓", "user"=>{"email"=>"drnicwilliams@gmail.com", "password"=>"[FILTERED]", "remember_me"=>"0"}, "commit"=>"Sign in"}
408
+ User Load (0.2ms) SELECT "users".* FROM "users" WHERE "users"."email" = 'drnicwilliams@gmail.com' ORDER BY "users"."id" ASC LIMIT 1
409
+ SQL (0.4ms) UPDATE "users" SET "last_sign_in_at" = ?, "current_sign_in_at" = ?, "last_sign_in_ip" = ?, "current_sign_in_ip" = ?, "sign_in_count" = ?, "updated_at" = ? WHERE "users"."id" = 1 [["last_sign_in_at", Tue, 18 Mar 2014 23:53:08 UTC +00:00], ["current_sign_in_at", Tue, 18 Mar 2014 23:53:08 UTC +00:00], ["last_sign_in_ip", "127.0.0.1"], ["current_sign_in_ip", "127.0.0.1"], ["sign_in_count", 1], ["updated_at", Tue, 18 Mar 2014 23:53:08 UTC +00:00]]
410
+ Redirected to http://www.example.com/
411
+ Completed 302 Found in 85ms (ActiveRecord: 0.5ms)
412
+ Started GET "/" for 127.0.0.1 at 2014-03-18 16:53:08 -0700
413
+ Processing by HomeController#index as HTML
414
+ User Load (0.1ms) SELECT "users".* FROM "users" WHERE "users"."id" = 1 ORDER BY "users"."id" ASC LIMIT 1
415
+ Rendered home/index.html.erb within layouts/application (1.8ms)
416
+ Completed 200 OK in 3ms (Views: 2.7ms | ActiveRecord: 0.1ms)
417
+ Started GET "/" for 127.0.0.1 at 2014-03-18 16:53:08 -0700
418
+ Processing by HomeController#index as HTML
419
+ User Load (0.2ms) SELECT "users".* FROM "users" WHERE "users"."id" = 1 ORDER BY "users"."id" ASC LIMIT 1
420
+ Rendered home/index.html.erb within layouts/application (1.5ms)
421
+ Completed 200 OK in 2ms (Views: 2.0ms | ActiveRecord: 0.2ms)
422
+ Started GET "/impersonate" for 127.0.0.1 at 2014-03-18 16:53:08 -0700
423
+ Processing by UserImpersonate::ImpersonateController#index as HTML
424
+ User Load (0.2ms) SELECT "users".* FROM "users" WHERE "users"."id" = 1 ORDER BY "users"."id" ASC LIMIT 1
425
+  (0.2ms) SELECT COUNT(*) FROM "users" WHERE ("users"."id" NOT IN (1))
426
+ User Load (0.1ms) SELECT "users".* FROM "users" WHERE ("users"."id" NOT IN (1)) ORDER BY updated_at DESC
427
+ Rendered /home/rcook/src/user_impersonate2/app/views/user_impersonate/impersonate/index.html.erb within layouts/user_impersonate/application (6.9ms)
428
+ Completed 200 OK in 16ms (Views: 13.9ms | ActiveRecord: 0.5ms)
429
+ Started GET "/impersonate/?utf8=%E2%9C%93&search=Normal+User" for 127.0.0.1 at 2014-03-18 16:53:08 -0700
430
+ Processing by UserImpersonate::ImpersonateController#index as HTML
431
+ Parameters: {"utf8"=>"✓", "search"=>"Normal User"}
432
+ User Load (0.2ms) SELECT "users".* FROM "users" WHERE "users"."id" = 1 ORDER BY "users"."id" ASC LIMIT 1
433
+  (0.1ms) SELECT COUNT(*) FROM "users" WHERE ("users"."id" NOT IN (1)) AND (name like '%Normal User%')
434
+ User Load (0.1ms) SELECT "users".* FROM "users" WHERE ("users"."id" NOT IN (1)) AND (name like '%Normal User%') ORDER BY updated_at DESC
435
+ Rendered /home/rcook/src/user_impersonate2/app/views/user_impersonate/impersonate/index.html.erb within layouts/user_impersonate/application (1.5ms)
436
+ Completed 200 OK in 5ms (Views: 2.1ms | ActiveRecord: 0.5ms)
437
+ Started GET "/impersonate/user/2" for 127.0.0.1 at 2014-03-18 16:53:08 -0700
438
+ Processing by UserImpersonate::ImpersonateController#create as HTML
439
+ Parameters: {"user_id"=>"2"}
440
+ User Load (0.1ms) SELECT "users".* FROM "users" WHERE "users"."id" = 1 ORDER BY "users"."id" ASC LIMIT 1
441
+ User Load (0.1ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT 1 [["id", "2"]]
442
+ SQL (0.2ms) UPDATE "users" SET "last_sign_in_at" = ?, "current_sign_in_at" = ?, "last_sign_in_ip" = ?, "current_sign_in_ip" = ?, "sign_in_count" = ?, "updated_at" = ? WHERE "users"."id" = 2 [["last_sign_in_at", Tue, 18 Mar 2014 23:53:08 UTC +00:00], ["current_sign_in_at", Tue, 18 Mar 2014 23:53:08 UTC +00:00], ["last_sign_in_ip", "127.0.0.1"], ["current_sign_in_ip", "127.0.0.1"], ["sign_in_count", 1], ["updated_at", Tue, 18 Mar 2014 23:53:08 UTC +00:00]]
443
+ Redirected to http://www.example.com/
444
+ Completed 302 Found in 3ms (ActiveRecord: 0.4ms)
445
+ Started GET "/" for 127.0.0.1 at 2014-03-18 16:53:08 -0700
446
+ Processing by HomeController#index as HTML
447
+ User Load (0.2ms) SELECT "users".* FROM "users" WHERE "users"."id" = 2 ORDER BY "users"."id" ASC LIMIT 1
448
+ Rendered home/index.html.erb within layouts/application (1.0ms)
449
+ User Load (0.1ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT 1 [["id", 1]]
450
+ Rendered user_impersonate/_header.html.erb (1.7ms)
451
+ Completed 200 OK in 5ms (Views: 4.7ms | ActiveRecord: 0.2ms)
452
+ Started DELETE "/impersonate/revert" for 127.0.0.1 at 2014-03-18 16:53:08 -0700
453
+ Processing by UserImpersonate::ImpersonateController#destroy as HTML
454
+ Parameters: {"utf8"=>"✓"}
455
+ User Load (0.1ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT 1 [["id", 1]]
456
+ User Load (0.1ms) SELECT "users".* FROM "users" WHERE "users"."id" = 2 ORDER BY "users"."id" ASC LIMIT 1
457
+ SQL (0.2ms) UPDATE "users" SET "current_sign_in_at" = ?, "sign_in_count" = ?, "updated_at" = ? WHERE "users"."id" = 1 [["current_sign_in_at", Tue, 18 Mar 2014 23:53:08 UTC +00:00], ["sign_in_count", 2], ["updated_at", Tue, 18 Mar 2014 23:53:08 UTC +00:00]]
458
+ Redirected to http://www.example.com/
459
+ Completed 302 Found in 4ms (ActiveRecord: 0.4ms)
460
+ Started GET "/" for 127.0.0.1 at 2014-03-18 16:53:08 -0700
461
+ Processing by HomeController#index as HTML
462
+ User Load (0.2ms) SELECT "users".* FROM "users" WHERE "users"."id" = 1 ORDER BY "users"."id" ASC LIMIT 1
463
+ Rendered home/index.html.erb within layouts/application (1.5ms)
464
+ Completed 200 OK in 2ms (Views: 2.1ms | ActiveRecord: 0.2ms)
465
+  (0.2ms) rollback transaction