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.
- checksums.yaml +4 -4
- data/README.md +15 -12
- data/Rakefile +6 -4
- data/app/controllers/user_impersonate/impersonate_controller.rb +1 -1
- data/lib/user_impersonate/version.rb +1 -1
- data/test/{dummy → dummy-rails3}/README.rdoc +0 -0
- data/test/{dummy → dummy-rails3}/Rakefile +0 -0
- data/test/{dummy → dummy-rails3}/app/assets/javascripts/application.js +0 -0
- data/test/{dummy → dummy-rails3}/app/assets/javascripts/home.js +0 -0
- data/test/{dummy → dummy-rails3}/app/assets/stylesheets/application.css +0 -0
- data/test/{dummy → dummy-rails3}/app/assets/stylesheets/home.css +0 -0
- data/test/{dummy → dummy-rails3}/app/controllers/application_controller.rb +0 -0
- data/test/{dummy → dummy-rails3}/app/controllers/home_controller.rb +0 -0
- data/test/{dummy → dummy-rails3}/app/helpers/application_helper.rb +0 -0
- data/test/{dummy → dummy-rails3}/app/helpers/home_helper.rb +0 -0
- data/test/{dummy → dummy-rails3}/app/models/user.rb +0 -0
- data/test/{dummy → dummy-rails3}/app/views/home/index.html.erb +0 -0
- data/test/{dummy → dummy-rails3}/app/views/layouts/application.html.erb +0 -0
- data/test/{dummy → dummy-rails3}/app/views/user_impersonate/_header.html.erb +0 -0
- data/test/{dummy → dummy-rails3}/config.ru +0 -0
- data/test/{dummy → dummy-rails3}/config/application.rb +0 -0
- data/test/{dummy → dummy-rails3}/config/boot.rb +0 -0
- data/test/{dummy → dummy-rails3}/config/database.yml +0 -0
- data/test/{dummy → dummy-rails3}/config/environment.rb +0 -0
- data/test/{dummy → dummy-rails3}/config/environments/development.rb +0 -0
- data/test/{dummy → dummy-rails3}/config/environments/production.rb +0 -0
- data/test/{dummy → dummy-rails3}/config/environments/test.rb +0 -0
- data/test/{dummy → dummy-rails3}/config/initializers/backtrace_silencers.rb +0 -0
- data/test/{dummy → dummy-rails3}/config/initializers/devise.rb +0 -0
- data/test/{dummy → dummy-rails3}/config/initializers/inflections.rb +0 -0
- data/test/{dummy → dummy-rails3}/config/initializers/mime_types.rb +0 -0
- data/test/{dummy → dummy-rails3}/config/initializers/secret_token.rb +0 -0
- data/test/{dummy → dummy-rails3}/config/initializers/session_store.rb +0 -0
- data/test/{dummy → dummy-rails3}/config/initializers/user_impersonate.rb +0 -0
- data/test/{dummy → dummy-rails3}/config/initializers/wrap_parameters.rb +0 -0
- data/test/{dummy → dummy-rails3}/config/locales/devise.en.yml +0 -0
- data/test/{dummy → dummy-rails3}/config/locales/en.yml +0 -0
- data/test/{dummy → dummy-rails3}/config/routes.rb +0 -0
- data/test/{dummy → dummy-rails3}/db/development.sqlite3 +0 -0
- data/test/{dummy → dummy-rails3}/db/migrate/20120914174453_devise_create_users.rb +0 -0
- data/test/{dummy → dummy-rails3}/db/migrate/20120914184123_add_staff_flag_to_users.rb +0 -0
- data/test/{dummy → dummy-rails3}/db/schema.rb +0 -0
- data/test/{dummy → dummy-rails3}/db/test.sqlite3 +0 -0
- data/test/{dummy → dummy-rails3}/lib/tasks/cucumber.rake +0 -0
- data/test/dummy-rails3/log/development.log +262 -0
- data/test/dummy-rails3/log/test.log +1091 -0
- data/test/{dummy → dummy-rails3}/public/404.html +0 -0
- data/test/{dummy → dummy-rails3}/public/422.html +0 -0
- data/test/{dummy → dummy-rails3}/public/500.html +0 -0
- data/test/{dummy → dummy-rails3}/public/favicon.ico +0 -0
- data/test/{dummy → dummy-rails3}/script/rails +0 -0
- data/test/{dummy → dummy-rails3}/test/fixtures/users.yml +0 -0
- data/test/{dummy → dummy-rails3}/test/unit/helpers/home_helper_test.rb +0 -0
- data/test/{dummy → dummy-rails3}/test/unit/user_test.rb +0 -0
- data/test/dummy-rails4/README.rdoc +261 -0
- data/test/dummy-rails4/Rakefile +7 -0
- data/test/dummy-rails4/app/assets/javascripts/application.js +15 -0
- data/test/dummy-rails4/app/assets/javascripts/home.js +2 -0
- data/test/dummy-rails4/app/assets/stylesheets/application.css +16 -0
- data/test/dummy-rails4/app/assets/stylesheets/home.css +7 -0
- data/test/dummy-rails4/app/controllers/application_controller.rb +3 -0
- data/test/dummy-rails4/app/controllers/home_controller.rb +4 -0
- data/test/dummy-rails4/app/helpers/application_helper.rb +2 -0
- data/test/dummy-rails4/app/helpers/home_helper.rb +2 -0
- data/test/dummy-rails4/app/models/user.rb +17 -0
- data/test/dummy-rails4/app/views/home/index.html.erb +11 -0
- data/test/dummy-rails4/app/views/layouts/application.html.erb +22 -0
- data/test/dummy-rails4/app/views/user_impersonate/_header.html.erb +65 -0
- data/test/dummy-rails4/config.ru +4 -0
- data/test/dummy-rails4/config/application.rb +57 -0
- data/test/dummy-rails4/config/boot.rb +10 -0
- data/test/dummy-rails4/config/database.yml +25 -0
- data/test/dummy-rails4/config/environment.rb +5 -0
- data/test/dummy-rails4/config/environments/development.rb +36 -0
- data/test/dummy-rails4/config/environments/production.rb +69 -0
- data/test/dummy-rails4/config/environments/test.rb +33 -0
- data/test/dummy-rails4/config/initializers/backtrace_silencers.rb +7 -0
- data/test/dummy-rails4/config/initializers/devise.rb +234 -0
- data/test/dummy-rails4/config/initializers/inflections.rb +15 -0
- data/test/dummy-rails4/config/initializers/mime_types.rb +5 -0
- data/test/dummy-rails4/config/initializers/secret_token.rb +9 -0
- data/test/dummy-rails4/config/initializers/session_store.rb +8 -0
- data/test/dummy-rails4/config/initializers/user_impersonate.rb +18 -0
- data/test/dummy-rails4/config/initializers/wrap_parameters.rb +14 -0
- data/test/dummy-rails4/config/locales/devise.en.yml +58 -0
- data/test/dummy-rails4/config/locales/en.yml +5 -0
- data/test/dummy-rails4/config/routes.rb +8 -0
- data/test/dummy-rails4/db/development.sqlite3 +0 -0
- data/test/dummy-rails4/db/migrate/20120914174453_devise_create_users.rb +48 -0
- data/test/dummy-rails4/db/migrate/20120914184123_add_staff_flag_to_users.rb +5 -0
- data/test/dummy-rails4/db/schema.rb +36 -0
- data/test/dummy-rails4/db/test.sqlite3 +0 -0
- data/test/dummy-rails4/lib/tasks/cucumber.rake +65 -0
- data/test/dummy-rails4/log/development.log +27 -0
- data/test/dummy-rails4/log/test.log +465 -0
- data/test/dummy-rails4/public/404.html +26 -0
- data/test/dummy-rails4/public/422.html +26 -0
- data/test/dummy-rails4/public/500.html +25 -0
- data/test/dummy-rails4/public/favicon.ico +0 -0
- data/test/dummy-rails4/script/rails +6 -0
- data/test/dummy-rails4/test/fixtures/users.yml +14 -0
- data/test/dummy-rails4/test/unit/helpers/home_helper_test.rb +4 -0
- data/test/dummy-rails4/test/unit/user_test.rb +7 -0
- data/test/dummy-rails4/tmp/cache/assets/test/sprockets/13fe41fee1fe35b49d145bcc06610705 +0 -0
- data/test/dummy-rails4/tmp/cache/assets/test/sprockets/1c9faaf28d05409b88ad3113374d613c +0 -0
- data/test/dummy-rails4/tmp/cache/assets/test/sprockets/2625847957ecb8614efc9b58b07cabdf +0 -0
- data/test/dummy-rails4/tmp/cache/assets/test/sprockets/2f5173deea6c795b8fdde723bb4b63af +0 -0
- data/test/dummy-rails4/tmp/cache/assets/test/sprockets/357970feca3ac29060c1e3861e2c0953 +0 -0
- data/test/dummy-rails4/tmp/cache/assets/test/sprockets/35f33ae400a6b0b5bf527436a68133b5 +0 -0
- data/test/dummy-rails4/tmp/cache/assets/test/sprockets/3b83d2c20dfdb631259eb9d056ea4419 +0 -0
- data/test/dummy-rails4/tmp/cache/assets/test/sprockets/40fc2f3d2a468a00e463f1d313cb1683 +0 -0
- data/test/dummy-rails4/tmp/cache/assets/test/sprockets/5f1c168e97e274509aa4673eab0d86f6 +0 -0
- data/test/dummy-rails4/tmp/cache/assets/test/sprockets/681d1010f98d5ed273e67645c7cb454d +0 -0
- data/test/dummy-rails4/tmp/cache/assets/test/sprockets/7411b44628aea038332f13f5ed73e073 +0 -0
- data/test/dummy-rails4/tmp/cache/assets/test/sprockets/7f14251885cab31b58c878119cbdc199 +0 -0
- data/test/dummy-rails4/tmp/cache/assets/test/sprockets/8483b329d12e7e986bc5a2204bbcb4f8 +0 -0
- data/test/dummy-rails4/tmp/cache/assets/test/sprockets/8ff157af159f38d424ce1367e29760a2 +0 -0
- data/test/dummy-rails4/tmp/cache/assets/test/sprockets/b6f020b01a84691088a0c459a18f9c7e +0 -0
- data/test/dummy-rails4/tmp/cache/assets/test/sprockets/b878faf942403e313a5b103e5d80488e +0 -0
- data/test/dummy-rails4/tmp/cache/assets/test/sprockets/bdaaf186999b6b59a3063d23b589d307 +0 -0
- data/test/dummy-rails4/tmp/cache/assets/test/sprockets/cffd775d018f68ce5dba1ee0d951a994 +0 -0
- data/test/dummy-rails4/tmp/cache/assets/test/sprockets/d0cde4ef34755468270bb49c4a3689f1 +0 -0
- data/test/dummy-rails4/tmp/cache/assets/test/sprockets/d771ace226fc8215a3572e0aa35bb0d6 +0 -0
- data/test/dummy-rails4/tmp/cache/assets/test/sprockets/edbef6e0d0a4742346cf479f2c522eb0 +0 -0
- data/test/dummy-rails4/tmp/cache/assets/test/sprockets/f1aac9109f5dae028b3c56eb07311208 +0 -0
- data/test/dummy-rails4/tmp/cache/assets/test/sprockets/f7cbd26ba1d28d48de824f0e94586655 +0 -0
- data/test/dummy-rails4/tmp/cache/assets/test/sprockets/fd6c8e27b44aa2db77bf0a8b5118bdf8 +0 -0
- data/test/functional/impersonate_controller_test.rb +19 -0
- data/test/test_helper.rb +18 -4
- data/test/test_utils.rb +49 -0
- metadata +262 -112
- data/test/dummy/log/development.log +0 -751
- 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,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'
|
Binary file
|
@@ -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,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
|
+
[1m[36m (30.7ms)[0m [1mCREATE 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') [0m
|
2
|
+
[1m[35m (19.6ms)[0m CREATE UNIQUE INDEX "index_users_on_email" ON "users" ("email")
|
3
|
+
[1m[36m (16.2ms)[0m [1mCREATE UNIQUE INDEX "index_users_on_reset_password_token" ON "users" ("reset_password_token")[0m
|
4
|
+
[1m[35m (19.1ms)[0m CREATE TABLE "schema_migrations" ("version" varchar(255) NOT NULL)
|
5
|
+
[1m[36m (16.5ms)[0m [1mCREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")[0m
|
6
|
+
[1m[35m (0.1ms)[0m SELECT version FROM "schema_migrations"
|
7
|
+
[1m[36m (16.5ms)[0m [1mINSERT INTO "schema_migrations" (version) VALUES ('20120914184123')[0m
|
8
|
+
[1m[35m (16.5ms)[0m INSERT INTO "schema_migrations" (version) VALUES ('20120914174453')
|
9
|
+
[1m[36mActiveRecord::SchemaMigration Load (0.1ms)[0m [1mSELECT "schema_migrations".* FROM "schema_migrations"[0m
|
10
|
+
[1m[36m (25.9ms)[0m [1mCREATE 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') [0m
|
11
|
+
[1m[35m (14.9ms)[0m CREATE UNIQUE INDEX "index_users_on_email" ON "users" ("email")
|
12
|
+
[1m[36m (20.7ms)[0m [1mCREATE UNIQUE INDEX "index_users_on_reset_password_token" ON "users" ("reset_password_token")[0m
|
13
|
+
[1m[35m (15.8ms)[0m CREATE TABLE "schema_migrations" ("version" varchar(255) NOT NULL)
|
14
|
+
[1m[36m (15.7ms)[0m [1mCREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")[0m
|
15
|
+
[1m[35m (0.1ms)[0m SELECT version FROM "schema_migrations"
|
16
|
+
[1m[36m (15.4ms)[0m [1mINSERT INTO "schema_migrations" (version) VALUES ('20120914184123')[0m
|
17
|
+
[1m[35m (26.1ms)[0m INSERT INTO "schema_migrations" (version) VALUES ('20120914174453')
|
18
|
+
[1m[36mActiveRecord::SchemaMigration Load (0.1ms)[0m [1mSELECT "schema_migrations".* FROM "schema_migrations"[0m
|
19
|
+
[1m[36m (21.9ms)[0m [1mCREATE 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') [0m
|
20
|
+
[1m[35m (34.1ms)[0m CREATE UNIQUE INDEX "index_users_on_email" ON "users" ("email")
|
21
|
+
[1m[36m (33.1ms)[0m [1mCREATE UNIQUE INDEX "index_users_on_reset_password_token" ON "users" ("reset_password_token")[0m
|
22
|
+
[1m[35m (31.2ms)[0m CREATE TABLE "schema_migrations" ("version" varchar(255) NOT NULL)
|
23
|
+
[1m[36m (29.5ms)[0m [1mCREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")[0m
|
24
|
+
[1m[35m (0.1ms)[0m SELECT version FROM "schema_migrations"
|
25
|
+
[1m[36m (20.0ms)[0m [1mINSERT INTO "schema_migrations" (version) VALUES ('20120914184123')[0m
|
26
|
+
[1m[35m (25.0ms)[0m INSERT INTO "schema_migrations" (version) VALUES ('20120914174453')
|
27
|
+
[1m[36mActiveRecord::SchemaMigration Load (0.1ms)[0m [1mSELECT "schema_migrations".* FROM "schema_migrations"[0m
|
@@ -0,0 +1,465 @@
|
|
1
|
+
[1m[36m (0.3ms)[0m [1mbegin transaction[0m
|
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
|
+
[1m[35m (0.1ms)[0m rollback transaction
|
9
|
+
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
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
|
+
[1m[35m (0.1ms)[0m rollback transaction
|
17
|
+
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
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
|
+
[1m[35m (0.1ms)[0m rollback transaction
|
24
|
+
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
25
|
+
-------------------------------
|
26
|
+
UserImpersonateTest: test_truth
|
27
|
+
-------------------------------
|
28
|
+
[1m[35m (0.1ms)[0m rollback transaction
|
29
|
+
[1m[36m (27.3ms)[0m [1mCREATE 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') [0m
|
30
|
+
[1m[35m (15.4ms)[0m CREATE UNIQUE INDEX "index_users_on_email" ON "users" ("email")
|
31
|
+
[1m[36m (19.5ms)[0m [1mCREATE UNIQUE INDEX "index_users_on_reset_password_token" ON "users" ("reset_password_token")[0m
|
32
|
+
[1m[35m (22.6ms)[0m CREATE TABLE "schema_migrations" ("version" varchar(255) NOT NULL)
|
33
|
+
[1m[36m (21.2ms)[0m [1mCREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")[0m
|
34
|
+
[1m[35m (0.1ms)[0m SELECT version FROM "schema_migrations"
|
35
|
+
[1m[36m (16.0ms)[0m [1mINSERT INTO "schema_migrations" (version) VALUES ('20120914184123')[0m
|
36
|
+
[1m[35m (22.1ms)[0m INSERT INTO "schema_migrations" (version) VALUES ('20120914174453')
|
37
|
+
[1m[36m (0.3ms)[0m [1mbegin transaction[0m
|
38
|
+
[1m[35m (0.0ms)[0m commit transaction
|
39
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
40
|
+
[1m[35m (0.1ms)[0m SAVEPOINT active_record_1
|
41
|
+
[1m[36mFixture Delete (0.1ms)[0m [1mDELETE FROM "users"[0m
|
42
|
+
[1m[35mFixture Insert (0.1ms)[0m 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
|
+
[1m[36mFixture Insert (0.1ms)[0m [1mINSERT 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')[0m
|
44
|
+
[1m[35m (0.0ms)[0m RELEASE SAVEPOINT active_record_1
|
45
|
+
[1m[36mUser Load (0.1ms)[0m [1mSELECT "users".* FROM "users" WHERE "users"."name" = 'Normal User' LIMIT 1[0m
|
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
|
+
[1m[35mUser Load (0.2ms)[0m SELECT "users".* FROM "users" WHERE "users"."email" = 'normaluser@gmail.com' ORDER BY "users"."id" ASC LIMIT 1
|
55
|
+
[1m[36mSQL (0.9ms)[0m [1mUPDATE "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[0m [["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
|
+
[1m[35mUser Load (0.2ms)[0m 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
|
+
[1m[36mUser Load (0.2ms)[0m [1mSELECT "users".* FROM "users" WHERE "users"."id" = 2 ORDER BY "users"."id" ASC LIMIT 1[0m
|
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
|
+
[1m[35mUser Load (0.2ms)[0m 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
|
+
[1m[36mUser Load (0.1ms)[0m [1mSELECT "users".* FROM "users" WHERE "users"."id" = 2 ORDER BY "users"."id" ASC LIMIT 1[0m
|
78
|
+
Rendered home/index.html.erb within layouts/application (0.8ms)
|
79
|
+
Completed 200 OK in 2ms (Views: 1.5ms | ActiveRecord: 0.1ms)
|
80
|
+
[1m[35m (0.1ms)[0m rollback transaction
|
81
|
+
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
82
|
+
[1m[35m (0.0ms)[0m commit transaction
|
83
|
+
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
84
|
+
[1m[35m (0.1ms)[0m SAVEPOINT active_record_1
|
85
|
+
[1m[36mFixture Delete (0.1ms)[0m [1mDELETE FROM "users"[0m
|
86
|
+
[1m[35mFixture Insert (0.1ms)[0m 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
|
+
[1m[36mFixture Insert (0.1ms)[0m [1mINSERT 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')[0m
|
88
|
+
[1m[35m (0.0ms)[0m RELEASE SAVEPOINT active_record_1
|
89
|
+
[1m[36mUser Load (0.1ms)[0m [1mSELECT "users".* FROM "users" WHERE "users"."name" = 'Dr Nic Williams' LIMIT 1[0m
|
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
|
+
[1m[35mUser Load (0.2ms)[0m SELECT "users".* FROM "users" WHERE "users"."email" = 'drnicwilliams@gmail.com' ORDER BY "users"."id" ASC LIMIT 1
|
99
|
+
[1m[36mSQL (0.4ms)[0m [1mUPDATE "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[0m [["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
|
+
[1m[35mUser Load (0.1ms)[0m 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
|
+
[1m[36mUser Load (0.1ms)[0m [1mSELECT "users".* FROM "users" WHERE "users"."id" = 1 ORDER BY "users"."id" ASC LIMIT 1[0m
|
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
|
+
[1m[35mUser Load (0.1ms)[0m SELECT "users".* FROM "users" WHERE "users"."id" = 1 ORDER BY "users"."id" ASC LIMIT 1
|
115
|
+
[1m[36m (0.1ms)[0m [1mSELECT COUNT(*) FROM "users" WHERE ("users"."id" NOT IN (1))[0m
|
116
|
+
[1m[35mUser Load (0.1ms)[0m 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
|
+
[1m[36mUser Load (0.2ms)[0m [1mSELECT "users".* FROM "users" WHERE "users"."id" = 1 ORDER BY "users"."id" ASC LIMIT 1[0m
|
123
|
+
[1m[35m (0.1ms)[0m SELECT COUNT(*) FROM "users" WHERE ("users"."id" NOT IN (1)) AND (name like '%Normal User%')
|
124
|
+
[1m[36mUser Load (0.1ms)[0m [1mSELECT "users".* FROM "users" WHERE ("users"."id" NOT IN (1)) AND (name like '%Normal User%') ORDER BY updated_at DESC[0m
|
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
|
+
[1m[35mUser Load (0.1ms)[0m SELECT "users".* FROM "users" WHERE "users"."id" = 1 ORDER BY "users"."id" ASC LIMIT 1
|
131
|
+
[1m[36mUser Load (0.1ms)[0m [1mSELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT 1[0m [["id", "2"]]
|
132
|
+
[1m[35mSQL (0.2ms)[0m 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
|
+
[1m[36mUser Load (0.1ms)[0m [1mSELECT "users".* FROM "users" WHERE "users"."id" = 2 ORDER BY "users"."id" ASC LIMIT 1[0m
|
138
|
+
Rendered home/index.html.erb within layouts/application (0.8ms)
|
139
|
+
[1m[35mUser Load (0.0ms)[0m 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
|
+
[1m[36mUser Load (0.1ms)[0m [1mSELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT 1[0m [["id", 1]]
|
146
|
+
[1m[35mUser Load (0.1ms)[0m SELECT "users".* FROM "users" WHERE "users"."id" = 2 ORDER BY "users"."id" ASC LIMIT 1
|
147
|
+
[1m[36mSQL (0.2ms)[0m [1mUPDATE "users" SET "current_sign_in_at" = ?, "sign_in_count" = ?, "updated_at" = ? WHERE "users"."id" = 1[0m [["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
|
+
[1m[35mUser Load (0.1ms)[0m 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
|
+
[1m[36m (0.2ms)[0m [1mrollback transaction[0m
|
156
|
+
[1m[36m (0.3ms)[0m [1mbegin transaction[0m
|
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
|
+
[1m[35m (0.1ms)[0m rollback transaction
|
164
|
+
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
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
|
+
[1m[35m (0.1ms)[0m rollback transaction
|
172
|
+
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
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
|
+
[1m[35m (0.1ms)[0m rollback transaction
|
179
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
180
|
+
-------------------------------
|
181
|
+
UserImpersonateTest: test_truth
|
182
|
+
-------------------------------
|
183
|
+
[1m[35m (0.1ms)[0m rollback transaction
|
184
|
+
[1m[36m (24.2ms)[0m [1mCREATE 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') [0m
|
185
|
+
[1m[35m (21.7ms)[0m CREATE UNIQUE INDEX "index_users_on_email" ON "users" ("email")
|
186
|
+
[1m[36m (21.2ms)[0m [1mCREATE UNIQUE INDEX "index_users_on_reset_password_token" ON "users" ("reset_password_token")[0m
|
187
|
+
[1m[35m (21.5ms)[0m CREATE TABLE "schema_migrations" ("version" varchar(255) NOT NULL)
|
188
|
+
[1m[36m (21.2ms)[0m [1mCREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")[0m
|
189
|
+
[1m[35m (0.1ms)[0m SELECT version FROM "schema_migrations"
|
190
|
+
[1m[36m (16.0ms)[0m [1mINSERT INTO "schema_migrations" (version) VALUES ('20120914184123')[0m
|
191
|
+
[1m[35m (30.2ms)[0m INSERT INTO "schema_migrations" (version) VALUES ('20120914174453')
|
192
|
+
[1m[36m (0.3ms)[0m [1mbegin transaction[0m
|
193
|
+
[1m[35m (0.0ms)[0m commit transaction
|
194
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
195
|
+
[1m[35m (0.1ms)[0m SAVEPOINT active_record_1
|
196
|
+
[1m[36mFixture Delete (0.1ms)[0m [1mDELETE FROM "users"[0m
|
197
|
+
[1m[35mFixture Insert (0.1ms)[0m 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
|
+
[1m[36mFixture Insert (0.1ms)[0m [1mINSERT 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')[0m
|
199
|
+
[1m[35m (0.0ms)[0m RELEASE SAVEPOINT active_record_1
|
200
|
+
[1m[36mUser Load (0.1ms)[0m [1mSELECT "users".* FROM "users" WHERE "users"."name" = 'Normal User' LIMIT 1[0m
|
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
|
+
[1m[35mUser Load (0.2ms)[0m SELECT "users".* FROM "users" WHERE "users"."email" = 'normaluser@gmail.com' ORDER BY "users"."id" ASC LIMIT 1
|
210
|
+
[1m[36mSQL (0.9ms)[0m [1mUPDATE "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[0m [["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
|
+
[1m[35mUser Load (0.2ms)[0m 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
|
+
[1m[36mUser Load (0.1ms)[0m [1mSELECT "users".* FROM "users" WHERE "users"."id" = 2 ORDER BY "users"."id" ASC LIMIT 1[0m
|
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
|
+
[1m[35mUser Load (0.1ms)[0m 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
|
+
[1m[36mUser Load (0.1ms)[0m [1mSELECT "users".* FROM "users" WHERE "users"."id" = 2 ORDER BY "users"."id" ASC LIMIT 1[0m
|
233
|
+
Rendered home/index.html.erb within layouts/application (0.9ms)
|
234
|
+
Completed 200 OK in 2ms (Views: 1.5ms | ActiveRecord: 0.1ms)
|
235
|
+
[1m[35m (0.2ms)[0m rollback transaction
|
236
|
+
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
237
|
+
[1m[35m (0.0ms)[0m commit transaction
|
238
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
239
|
+
[1m[35m (0.0ms)[0m SAVEPOINT active_record_1
|
240
|
+
[1m[36mFixture Delete (0.1ms)[0m [1mDELETE FROM "users"[0m
|
241
|
+
[1m[35mFixture Insert (0.1ms)[0m 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
|
+
[1m[36mFixture Insert (0.1ms)[0m [1mINSERT 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')[0m
|
243
|
+
[1m[35m (0.0ms)[0m RELEASE SAVEPOINT active_record_1
|
244
|
+
[1m[36mUser Load (0.1ms)[0m [1mSELECT "users".* FROM "users" WHERE "users"."name" = 'Dr Nic Williams' LIMIT 1[0m
|
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
|
+
[1m[35mUser Load (0.2ms)[0m SELECT "users".* FROM "users" WHERE "users"."email" = 'drnicwilliams@gmail.com' ORDER BY "users"."id" ASC LIMIT 1
|
254
|
+
[1m[36mSQL (0.4ms)[0m [1mUPDATE "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[0m [["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
|
+
[1m[35mUser Load (0.1ms)[0m 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
|
+
[1m[36mUser Load (0.2ms)[0m [1mSELECT "users".* FROM "users" WHERE "users"."id" = 1 ORDER BY "users"."id" ASC LIMIT 1[0m
|
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
|
+
[1m[35mUser Load (0.1ms)[0m SELECT "users".* FROM "users" WHERE "users"."id" = 1 ORDER BY "users"."id" ASC LIMIT 1
|
270
|
+
[1m[36m (0.1ms)[0m [1mSELECT COUNT(*) FROM "users" WHERE ("users"."id" NOT IN (1))[0m
|
271
|
+
[1m[35mUser Load (0.1ms)[0m 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
|
+
[1m[36mUser Load (0.1ms)[0m [1mSELECT "users".* FROM "users" WHERE "users"."id" = 1 ORDER BY "users"."id" ASC LIMIT 1[0m
|
278
|
+
[1m[35m (0.1ms)[0m SELECT COUNT(*) FROM "users" WHERE ("users"."id" NOT IN (1)) AND (name like '%Normal User%')
|
279
|
+
[1m[36mUser Load (0.1ms)[0m [1mSELECT "users".* FROM "users" WHERE ("users"."id" NOT IN (1)) AND (name like '%Normal User%') ORDER BY updated_at DESC[0m
|
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
|
+
[1m[35mUser Load (0.2ms)[0m SELECT "users".* FROM "users" WHERE "users"."id" = 1 ORDER BY "users"."id" ASC LIMIT 1
|
286
|
+
[1m[36mUser Load (0.1ms)[0m [1mSELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT 1[0m [["id", "2"]]
|
287
|
+
[1m[35mSQL (0.2ms)[0m 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
|
+
[1m[36mUser Load (0.1ms)[0m [1mSELECT "users".* FROM "users" WHERE "users"."id" = 2 ORDER BY "users"."id" ASC LIMIT 1[0m
|
293
|
+
Rendered home/index.html.erb within layouts/application (1.0ms)
|
294
|
+
[1m[35mUser Load (0.1ms)[0m 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
|
+
[1m[36mUser Load (0.1ms)[0m [1mSELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT 1[0m [["id", 1]]
|
301
|
+
[1m[35mUser Load (0.2ms)[0m SELECT "users".* FROM "users" WHERE "users"."id" = 2 ORDER BY "users"."id" ASC LIMIT 1
|
302
|
+
[1m[36mSQL (0.2ms)[0m [1mUPDATE "users" SET "current_sign_in_at" = ?, "sign_in_count" = ?, "updated_at" = ? WHERE "users"."id" = 1[0m [["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
|
+
[1m[35mUser Load (0.1ms)[0m 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
|
+
[1m[36m (0.1ms)[0m [1mrollback transaction[0m
|
311
|
+
[1m[36m (0.5ms)[0m [1mbegin transaction[0m
|
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
|
+
[1m[35m (0.1ms)[0m rollback transaction
|
319
|
+
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
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
|
+
[1m[35m (0.1ms)[0m rollback transaction
|
327
|
+
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
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
|
+
[1m[35m (0.1ms)[0m rollback transaction
|
334
|
+
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
335
|
+
-------------------------------
|
336
|
+
UserImpersonateTest: test_truth
|
337
|
+
-------------------------------
|
338
|
+
[1m[35m (0.1ms)[0m rollback transaction
|
339
|
+
[1m[36m (15.8ms)[0m [1mCREATE 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') [0m
|
340
|
+
[1m[35m (19.0ms)[0m CREATE UNIQUE INDEX "index_users_on_email" ON "users" ("email")
|
341
|
+
[1m[36m (24.1ms)[0m [1mCREATE UNIQUE INDEX "index_users_on_reset_password_token" ON "users" ("reset_password_token")[0m
|
342
|
+
[1m[35m (24.7ms)[0m CREATE TABLE "schema_migrations" ("version" varchar(255) NOT NULL)
|
343
|
+
[1m[36m (38.7ms)[0m [1mCREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")[0m
|
344
|
+
[1m[35m (0.3ms)[0m SELECT version FROM "schema_migrations"
|
345
|
+
[1m[36m (31.9ms)[0m [1mINSERT INTO "schema_migrations" (version) VALUES ('20120914184123')[0m
|
346
|
+
[1m[35m (36.1ms)[0m INSERT INTO "schema_migrations" (version) VALUES ('20120914174453')
|
347
|
+
[1m[36m (0.3ms)[0m [1mbegin transaction[0m
|
348
|
+
[1m[35m (0.0ms)[0m commit transaction
|
349
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
350
|
+
[1m[35m (0.1ms)[0m SAVEPOINT active_record_1
|
351
|
+
[1m[36mFixture Delete (0.2ms)[0m [1mDELETE FROM "users"[0m
|
352
|
+
[1m[35mFixture Insert (0.1ms)[0m 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
|
+
[1m[36mFixture Insert (0.1ms)[0m [1mINSERT 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')[0m
|
354
|
+
[1m[35m (0.0ms)[0m RELEASE SAVEPOINT active_record_1
|
355
|
+
[1m[36mUser Load (0.2ms)[0m [1mSELECT "users".* FROM "users" WHERE "users"."name" = 'Normal User' LIMIT 1[0m
|
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
|
+
[1m[35mUser Load (0.2ms)[0m SELECT "users".* FROM "users" WHERE "users"."email" = 'normaluser@gmail.com' ORDER BY "users"."id" ASC LIMIT 1
|
365
|
+
[1m[36mSQL (1.2ms)[0m [1mUPDATE "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[0m [["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
|
+
[1m[35mUser Load (0.2ms)[0m 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
|
+
[1m[36mUser Load (0.1ms)[0m [1mSELECT "users".* FROM "users" WHERE "users"."id" = 2 ORDER BY "users"."id" ASC LIMIT 1[0m
|
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
|
+
[1m[35mUser Load (0.2ms)[0m 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
|
+
[1m[36mUser Load (0.1ms)[0m [1mSELECT "users".* FROM "users" WHERE "users"."id" = 2 ORDER BY "users"."id" ASC LIMIT 1[0m
|
388
|
+
Rendered home/index.html.erb within layouts/application (1.0ms)
|
389
|
+
Completed 200 OK in 2ms (Views: 1.6ms | ActiveRecord: 0.1ms)
|
390
|
+
[1m[35m (0.2ms)[0m rollback transaction
|
391
|
+
[1m[36m (0.2ms)[0m [1mbegin transaction[0m
|
392
|
+
[1m[35m (0.0ms)[0m commit transaction
|
393
|
+
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
394
|
+
[1m[35m (0.1ms)[0m SAVEPOINT active_record_1
|
395
|
+
[1m[36mFixture Delete (0.1ms)[0m [1mDELETE FROM "users"[0m
|
396
|
+
[1m[35mFixture Insert (0.1ms)[0m 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
|
+
[1m[36mFixture Insert (0.2ms)[0m [1mINSERT 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')[0m
|
398
|
+
[1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1
|
399
|
+
[1m[36mUser Load (0.2ms)[0m [1mSELECT "users".* FROM "users" WHERE "users"."name" = 'Dr Nic Williams' LIMIT 1[0m
|
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
|
+
[1m[35mUser Load (0.2ms)[0m SELECT "users".* FROM "users" WHERE "users"."email" = 'drnicwilliams@gmail.com' ORDER BY "users"."id" ASC LIMIT 1
|
409
|
+
[1m[36mSQL (0.4ms)[0m [1mUPDATE "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[0m [["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
|
+
[1m[35mUser Load (0.1ms)[0m 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
|
+
[1m[36mUser Load (0.2ms)[0m [1mSELECT "users".* FROM "users" WHERE "users"."id" = 1 ORDER BY "users"."id" ASC LIMIT 1[0m
|
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
|
+
[1m[35mUser Load (0.2ms)[0m SELECT "users".* FROM "users" WHERE "users"."id" = 1 ORDER BY "users"."id" ASC LIMIT 1
|
425
|
+
[1m[36m (0.2ms)[0m [1mSELECT COUNT(*) FROM "users" WHERE ("users"."id" NOT IN (1))[0m
|
426
|
+
[1m[35mUser Load (0.1ms)[0m 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
|
+
[1m[36mUser Load (0.2ms)[0m [1mSELECT "users".* FROM "users" WHERE "users"."id" = 1 ORDER BY "users"."id" ASC LIMIT 1[0m
|
433
|
+
[1m[35m (0.1ms)[0m SELECT COUNT(*) FROM "users" WHERE ("users"."id" NOT IN (1)) AND (name like '%Normal User%')
|
434
|
+
[1m[36mUser Load (0.1ms)[0m [1mSELECT "users".* FROM "users" WHERE ("users"."id" NOT IN (1)) AND (name like '%Normal User%') ORDER BY updated_at DESC[0m
|
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
|
+
[1m[35mUser Load (0.1ms)[0m SELECT "users".* FROM "users" WHERE "users"."id" = 1 ORDER BY "users"."id" ASC LIMIT 1
|
441
|
+
[1m[36mUser Load (0.1ms)[0m [1mSELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT 1[0m [["id", "2"]]
|
442
|
+
[1m[35mSQL (0.2ms)[0m 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
|
+
[1m[36mUser Load (0.2ms)[0m [1mSELECT "users".* FROM "users" WHERE "users"."id" = 2 ORDER BY "users"."id" ASC LIMIT 1[0m
|
448
|
+
Rendered home/index.html.erb within layouts/application (1.0ms)
|
449
|
+
[1m[35mUser Load (0.1ms)[0m 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
|
+
[1m[36mUser Load (0.1ms)[0m [1mSELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT 1[0m [["id", 1]]
|
456
|
+
[1m[35mUser Load (0.1ms)[0m SELECT "users".* FROM "users" WHERE "users"."id" = 2 ORDER BY "users"."id" ASC LIMIT 1
|
457
|
+
[1m[36mSQL (0.2ms)[0m [1mUPDATE "users" SET "current_sign_in_at" = ?, "sign_in_count" = ?, "updated_at" = ? WHERE "users"."id" = 1[0m [["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
|
+
[1m[35mUser Load (0.2ms)[0m 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
|
+
[1m[36m (0.2ms)[0m [1mrollback transaction[0m
|