knock 1.5 → 2.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (32) hide show
  1. checksums.yaml +8 -8
  2. data/Rakefile +2 -0
  3. data/app/controllers/knock/auth_token_controller.rb +4 -10
  4. data/app/model/knock/auth_token.rb +1 -6
  5. data/lib/generators/templates/knock.rb +0 -49
  6. data/lib/knock.rb +0 -10
  7. data/lib/knock/authenticable.rb +24 -19
  8. data/lib/knock/version.rb +1 -1
  9. data/test/dummy/app/controllers/custom_unauthorized_entity_controller.rb +13 -0
  10. data/test/dummy/app/controllers/protected_resources_controller.rb +1 -1
  11. data/test/dummy/config/application.rb +4 -2
  12. data/test/dummy/config/environments/test.rb +7 -2
  13. data/test/dummy/config/initializers/knock.rb +0 -2
  14. data/test/dummy/config/routes.rb +1 -0
  15. data/test/dummy/db/schema.rb +0 -1
  16. data/test/dummy/db/test.sqlite3 +0 -0
  17. data/test/dummy/log/test.log +372 -351
  18. data/test/dummy/test/controllers/admin_token_controller_test.rb +3 -3
  19. data/test/dummy/test/controllers/current_users_controller_test.rb +8 -0
  20. data/test/dummy/test/controllers/custom_unauthorized_entity_controller_test.rb +42 -0
  21. data/test/dummy/test/controllers/protected_resources_controller_test.rb +2 -2
  22. data/test/dummy/test/controllers/vendor_protected_controller_test.rb +1 -1
  23. data/test/dummy/test/controllers/vendor_token_controller_test.rb +3 -3
  24. data/test/model/knock/auth_token_test.rb +0 -1
  25. data/test/tmp/config/initializers/knock.rb +59 -0
  26. metadata +8 -14
  27. data/test/controllers/knock/auth_token_controller_test.rb +0 -39
  28. data/test/tmp/app/controllers/admin_token_controller.rb +0 -2
  29. data/test/tmp/app/controllers/admin_user_token_controller.rb +0 -2
  30. data/test/tmp/app/controllers/user_admin_token_controller.rb +0 -2
  31. data/test/tmp/app/controllers/user_token_controller.rb +0 -2
  32. data/test/tmp/config/routes.rb +0 -17
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- MzZjZmQ3ZDIxMmQ3NDBjMTc2NmU1NGUxNmQwNWM0NmMyNzc5ZGNkYw==
4
+ YmRmOTA3ZDVjNTA1ZjFiOWYwMmRlYjYwNzkyY2UzNTIzMWFhZGEyNQ==
5
5
  data.tar.gz: !binary |-
6
- YzcwZWUzNDRlYjFiOWIwMjdkZGI0NWFkY2RkZGMwMTBiYzgyYTIyMw==
6
+ ZGE1ZDRlNjhmMzY5Y2ZjMDc4Y2RkMjJkMGQxMWRkZDQ4NTczYzQ2MQ==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- YjYyMjJkZjM0ZDRmNzA4OTk4YTFiZTc3NTUzMDQzNWEwMmEyMmRjYzc1OTMw
10
- YzMzMTZhNzgzM2ZjZDhjZGIxNTAwZjdkMGEwZDIyZjVkMmYzZDI1ZWMxMWZj
11
- YTQ3MTE3OWY5YWRiODk1ZDkwMjZlZTkzM2ZjYzA5MjdhNzU5NjA=
9
+ ZWMxMmY2Y2IxNzZlNzQzYWZmNTUzNzI0ZjZiODBiNGEzMWVlZTNjNTI4Mzdh
10
+ NjU5MzgwMDcwMDNiOTI3NWNjZTczZjJlMjYwNjg4NDQxMzJlZDNmY2Y3NTI4
11
+ MDRjOGJjZDI5OWRhYzg2Mjg1NzY3MzZhZWQ0NzljMTY4NjI0Mjc=
12
12
  data.tar.gz: !binary |-
13
- NDM1NGRjNjlkYWM2NWY3YTVhZTNkNTFiNGYyY2M3NjdhMmVlNmJlMDE0MTc1
14
- ZTJhY2I0M2RlNTY4NDEzYzIzZGI2Mjk4NTkyNGVmODljOWYwNWNmMDYzNjgz
15
- OTFmMmU5OGY3MjQ3MTFlNWNlMDQyMDRlMWJhNzIxOTJlYjlmZWM=
13
+ ZWQ2Mjc4OWRiNGIxYjk2MTdiNWQyNWE2OTk5ZjZkMTIyMmI3OWIzMTIyYmIx
14
+ NGM0M2UyMDY0OGZiNDc4N2U1NTVhYmQ1MjIyY2I0MWFiYmFhYTEzMWQ0Yzc5
15
+ MDgxNTNiN2FiMDg4YmUxNzYwOTI0M2MwM2Y5YzEzNDY5OWYwNjY=
data/Rakefile CHANGED
@@ -1,3 +1,5 @@
1
+ require "rubygems"
2
+
1
3
  begin
2
4
  require 'bundler/setup'
3
5
  rescue LoadError
@@ -25,16 +25,10 @@ module Knock
25
25
 
26
26
  def entity
27
27
  @entity ||=
28
- if self.class.name == "Knock::AuthTokenController"
29
- warn "[DEPRECATION]: Routing to `AuthTokenController` directly is deprecated. Please use `<Entity Name>TokenController` inheriting from it instead. E.g. `UserTokenController`"
30
- warn "[DEPRECATION]: Relying on `Knock.current_user_from_handle` is deprecated. Please implement `User#from_token_request` instead."
31
- Knock.current_user_from_handle.call auth_params[Knock.handle_attr]
28
+ if entity_class.respond_to? :from_token_request
29
+ entity_class.from_token_request request
32
30
  else
33
- if entity_class.respond_to? :from_token_request
34
- entity_class.from_token_request request
35
- else
36
- entity_class.find_by email: auth_params[:email]
37
- end
31
+ entity_class.find_by email: auth_params[:email]
38
32
  end
39
33
  end
40
34
 
@@ -47,7 +41,7 @@ module Knock
47
41
  end
48
42
 
49
43
  def auth_params
50
- params.require(:auth).permit Knock.handle_attr, :password
44
+ params.require(:auth).permit :email, :password
51
45
  end
52
46
  end
53
47
  end
@@ -21,12 +21,7 @@ module Knock
21
21
  if entity_class.respond_to? :from_token_payload
22
22
  entity_class.from_token_payload @payload
23
23
  else
24
- if entity_class.to_s == "User" && Knock.respond_to?(:current_user_from_token)
25
- warn "[DEPRECATION]: `Knock.current_user_from_token` is deprecated. Please implement `User.from_token_payload` instead."
26
- Knock.current_user_from_token.call @payload
27
- else
28
- entity_class.find @payload['sub']
29
- end
24
+ entity_class.find @payload['sub']
30
25
  end
31
26
  end
32
27
 
@@ -1,54 +1,5 @@
1
1
  Knock.setup do |config|
2
2
 
3
- ## [DEPRECATED]
4
- ## This is deprecated in favor of `User.from_token_request`.
5
- ##
6
- ## User handle attribute
7
- ## ---------------------
8
- ##
9
- ## The attribute used to uniquely identify a user.
10
- ##
11
- ## Default:
12
- # config.handle_attr = :email
13
-
14
- ## [DEPRECATED]
15
- ## This is deprecated in favor of `User.from_token_request`.
16
- ##
17
- ## Current user retrieval from handle when signing in
18
- ## --------------------------------------------------
19
- ##
20
- ## This is where you can configure how to retrieve the current user when
21
- ## signing in.
22
- ##
23
- ## Knock uses the `handle_attr` variable to retrieve the handle from the
24
- ## AuthTokenController parameters. It also uses the same variable to enforce
25
- ## permitted values in the controller.
26
- ##
27
- ## You must raise an exception if the resource cannot be retrieved.
28
- ## The type of the exception is configured in config.not_found_exception_class_name,
29
- ## and it is ActiveRecord::RecordNotFound by default
30
- ##
31
- ## Default:
32
- # config.current_user_from_handle = -> (handle) { User.find_by! Knock.handle_attr => handle }
33
-
34
- ## [DEPRECATED]
35
- ## This is depreacted in favor of `User.from_token_payload`.
36
- ##
37
- ## Current user retrieval when validating token
38
- ## --------------------------------------------
39
- ##
40
- ## This is how you can tell Knock how to retrieve the current_user.
41
- ## By default, it assumes you have a model called `User` and that
42
- ## the user_id is stored in the 'sub' claim.
43
- ##
44
- ## You must raise an exception if the resource cannot be retrieved.
45
- ## The type of the exception is configured in config.not_found_exception_class_name,
46
- ## and it is ActiveRecord::RecordNotFound by default
47
- ##
48
- ## Default:
49
- # config.current_user_from_token = -> (claims) { User.find claims['sub'] }
50
-
51
-
52
3
  ## Expiration claim
53
4
  ## ----------------
54
5
  ##
@@ -1,16 +1,6 @@
1
1
  require "knock/engine"
2
2
 
3
3
  module Knock
4
-
5
- mattr_accessor :handle_attr
6
- self.handle_attr = :email
7
-
8
- mattr_accessor :current_user_from_handle
9
- self.current_user_from_handle = -> handle { User.find_by! Knock.handle_attr => handle }
10
-
11
- mattr_accessor :current_user_from_token
12
- self.current_user_from_token = -> claims { User.find claims['sub'] }
13
-
14
4
  mattr_accessor :token_lifetime
15
5
  self.token_lifetime = 1.day
16
6
 
@@ -1,29 +1,21 @@
1
1
  module Knock::Authenticable
2
- def authenticate
3
- warn "[DEPRECATION]: `authenticate` is deprecated. Please use `authenticate_user` instead."
4
- head(:unauthorized) unless authenticate_for(User)
5
- end
6
-
7
2
  def authenticate_for entity_class
8
- token = params[:token] || token_from_request_headers
9
- return nil if token.nil?
10
-
11
- begin
12
- @entity = Knock::AuthToken.new(token: token).entity_for(entity_class)
13
- define_current_entity_getter(entity_class)
14
- @entity
15
- rescue
16
- nil
17
- end
3
+ getter_name = "current_#{entity_class.to_s.underscore}"
4
+ define_current_entity_getter(entity_class, getter_name)
5
+ public_send(getter_name)
18
6
  end
19
7
 
20
8
  private
21
9
 
10
+ def token
11
+ params[:token] || token_from_request_headers
12
+ end
13
+
22
14
  def method_missing(method, *args)
23
15
  prefix, entity_name = method.to_s.split('_', 2)
24
16
  case prefix
25
17
  when 'authenticate'
26
- head(:unauthorized) unless authenticate_entity(entity_name)
18
+ unauthorized_entity(entity_name) unless authenticate_entity(entity_name)
27
19
  when 'current'
28
20
  authenticate_entity(entity_name)
29
21
  else
@@ -36,17 +28,30 @@ module Knock::Authenticable
36
28
  send(:authenticate_for, entity_class)
37
29
  end
38
30
 
31
+ def unauthorized_entity(entity_name)
32
+ head(:unauthorized)
33
+ end
34
+
39
35
  def token_from_request_headers
40
36
  unless request.headers['Authorization'].nil?
41
37
  request.headers['Authorization'].split.last
42
38
  end
43
39
  end
44
40
 
45
- def define_current_entity_getter entity_class
46
- getter_name = "current_#{entity_class.to_s.underscore}"
41
+ def define_current_entity_getter entity_class, getter_name
47
42
  unless self.respond_to?(getter_name)
43
+ memoization_var_name = "@_#{getter_name}"
48
44
  self.class.send(:define_method, getter_name) do
49
- @entity ||= nil
45
+ unless instance_variable_defined?(memoization_var_name)
46
+ current =
47
+ begin
48
+ Knock::AuthToken.new(token: token).entity_for(entity_class)
49
+ rescue
50
+ nil
51
+ end
52
+ instance_variable_set(memoization_var_name, current)
53
+ end
54
+ instance_variable_get(memoization_var_name)
50
55
  end
51
56
  end
52
57
  end
@@ -1,3 +1,3 @@
1
1
  module Knock
2
- VERSION = "1.5"
2
+ VERSION = "2.0"
3
3
  end
@@ -0,0 +1,13 @@
1
+ class CustomUnauthorizedEntityController < ApplicationController
2
+ before_action :authenticate_user
3
+
4
+ def index
5
+ head :ok
6
+ end
7
+
8
+ private
9
+
10
+ def unauthorized_entity(entity)
11
+ head :not_found
12
+ end
13
+ end
@@ -1,5 +1,5 @@
1
1
  class ProtectedResourcesController < ApplicationController
2
- before_action :authenticate
2
+ before_action :authenticate_user
3
3
 
4
4
  def index
5
5
  head :ok
@@ -19,8 +19,10 @@ module Dummy
19
19
  # config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s]
20
20
  # config.i18n.default_locale = :de
21
21
 
22
- # Do not swallow errors in after_commit/after_rollback callbacks.
23
- config.active_record.raise_in_transactional_callbacks = true
22
+ unless Gem.loaded_specs["rails"].version.to_s =~ /^5/
23
+ # Do not swallow errors in after_commit/after_rollback callbacks.
24
+ config.active_record.raise_in_transactional_callbacks = true
25
+ end
24
26
  end
25
27
  end
26
28
 
@@ -13,8 +13,13 @@ Rails.application.configure do
13
13
  config.eager_load = false
14
14
 
15
15
  # Configure static file server for tests with Cache-Control for performance.
16
- config.serve_static_files = true
17
- config.static_cache_control = 'public, max-age=3600'
16
+ if Gem.loaded_specs["rails"].version.to_s.to_i >= 5
17
+ config.public_file_server.enabled = true
18
+ config.public_file_server.headers = { 'Cache-Control' => 'public, max-age=3600' }
19
+ else
20
+ config.serve_static_files = true
21
+ config.static_cache_control = 'public, max-age=3600'
22
+ end
18
23
 
19
24
  # Show full error reports and disable caching.
20
25
  config.consider_all_requests_local = true
@@ -4,7 +4,5 @@ Knock.setup do |config|
4
4
  config.token_public_key = nil
5
5
  config.token_audience = nil
6
6
 
7
- config.current_user_from_handle = -> handle { User.find_by(Knock.handle_attr => handle) || raise(Knock::MyCustomException) }
8
- config.current_user_from_token = -> claims { User.find_by(id: claims['sub']) || raise(Knock::MyCustomException) }
9
7
  config.not_found_exception_class_name = 'Knock::MyCustomException'
10
8
  end
@@ -8,6 +8,7 @@ Rails.application.routes.draw do
8
8
  resources :admin_protected
9
9
  resources :composite_name_entity_protected
10
10
  resources :vendor_protected
11
+ resources :custom_unauthorized_entity
11
12
 
12
13
  mount Knock::Engine => "/knock"
13
14
  end
@@ -1,4 +1,3 @@
1
- # encoding: UTF-8
2
1
  # This file is auto-generated from the current state of the database. Instead
3
2
  # of editing this file, please use the migrations feature of Active Record to
4
3
  # incrementally modify your database, and then regenerate this schema definition.
Binary file
@@ -1,406 +1,427 @@
1
-  (4.6ms) CREATE TABLE "admins" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "email" varchar, "password_digest" varchar, "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL) 
2
-  (1.8ms) CREATE TABLE "composite_name_entities" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "email" varchar, "password_digest" varchar, "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL)
3
-  (1.9ms) CREATE TABLE "users" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "email" varchar NOT NULL, "password_digest" varchar NOT NULL, "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL) 
4
-  (1.7ms) CREATE TABLE "vendors" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "email" varchar, "password_digest" varchar, "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL)
5
-  (1.9ms) CREATE TABLE "schema_migrations" ("version" varchar NOT NULL) 
6
-  (0.1ms) select sqlite_version(*)
7
-  (3.2ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
8
-  (0.1ms) SELECT version FROM "schema_migrations"
9
-  (1.9ms) INSERT INTO "schema_migrations" (version) VALUES ('20160522181712')
10
-  (1.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20150713101607')
11
-  (1.8ms) INSERT INTO "schema_migrations" (version) VALUES ('20160519075733')
12
-  (1.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20160522051816')
13
- ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
14
-  (0.1ms) begin transaction
15
- Fixture Delete (0.2ms) DELETE FROM "admins"
16
- Fixture Insert (0.1ms) INSERT INTO "admins" ("email", "password_digest", "created_at", "updated_at", "id") VALUES ('admin.one@example.net', '$2a$04$A5FrTmvQlWisxRF39Z9ThOxtvxEv3sskQ8Cvu7pMyJOdxKe2.yGQK', '2016-05-29 13:50:27', '2016-05-29 13:50:27', 980190962)
17
- Fixture Delete (0.1ms) DELETE FROM "composite_name_entities"
18
- Fixture Insert (0.1ms) INSERT INTO "composite_name_entities" ("email", "password_digest", "created_at", "updated_at", "id") VALUES ('composite_name_entity.one@example.net', '$2a$04$btcUJSIV8A1I4v/PGOzg9uwbne073esS6ASsIe.d8w3GoPwv.gali', '2016-05-29 13:50:27', '2016-05-29 13:50:27', 980190962)
19
- Fixture Delete (0.1ms) DELETE FROM "users"
20
- Fixture Insert (0.1ms) INSERT INTO "users" ("email", "password_digest", "created_at", "updated_at", "id") VALUES ('one@example.net', '$2a$04$AaJIO4VQSLrEs0Tr4MSc4euqVbJvlKEfWoM7VtwzSIqg3wmlw2bdK', '2016-05-29 13:50:27', '2016-05-29 13:50:27', 980190962)
21
- Fixture Insert (0.1ms) INSERT INTO "users" ("email", "password_digest", "created_at", "updated_at", "id") VALUES ('two@example.net', '$2a$04$g2QbsDNtx7EXGF9oW/HyuOdMaCz9lkRM0dPCuGVVY32MSDkT5syaO', '2016-05-29 13:50:27', '2016-05-29 13:50:27', 298486374)
22
- Fixture Delete (0.1ms) DELETE FROM "vendors"
23
- Fixture Insert (0.1ms) INSERT INTO "vendors" ("email", "password_digest", "created_at", "updated_at", "id") VALUES ('vendor.one@example.net', '$2a$04$jrsErgp1FpPx4Yoh0AVvFOQW6W3SixzpKgG54MDx4OLhEKl09Xc4W', '2016-05-29 13:50:27', '2016-05-29 13:50:27', 980190962)
24
-  (1.9ms) commit transaction
25
-  (0.0ms) begin transaction
26
- -----------------------------------------------------------------------------
27
- VendorProtectedControllerTest: test_raises_method_missing_error_appropriately
28
- -----------------------------------------------------------------------------
29
- Processing by VendorProtectedController#show as HTML
30
- Parameters: {"id"=>"1"}
31
- Completed 500 Internal Server Error in 1ms (ActiveRecord: 0.0ms)
32
-  (0.1ms) rollback transaction
33
-  (0.0ms) begin transaction
34
- --------------------------------------------------------------
35
- VendorProtectedControllerTest: test_responds_with_unauthorized
36
- --------------------------------------------------------------
37
- Processing by VendorProtectedController#index as HTML
38
- Filter chain halted as :authenticate_vendor rendered or redirected
39
- Completed 401 Unauthorized in 0ms (ActiveRecord: 0.0ms)
40
-  (0.1ms) rollback transaction
41
-  (0.1ms) begin transaction
42
- -----------------------------------------------------------------------------
43
- VendorProtectedControllerTest: test_has_a_current_vendor_after_authentication
44
- -----------------------------------------------------------------------------
45
- Vendor Load (0.2ms) SELECT "vendors".* FROM "vendors" WHERE "vendors"."id" = ? LIMIT 1 [["id", 980190962]]
46
- Processing by VendorProtectedController#index as HTML
47
- Vendor Load (0.1ms) SELECT "vendors".* FROM "vendors" WHERE "vendors"."id" = ? LIMIT 1 [["id", 980190962]]
48
- Completed 200 OK in 2ms (ActiveRecord: 0.1ms)
49
-  (0.1ms) rollback transaction
50
-  (0.1ms) begin transaction
51
- -------------------------------------------------------------------------------
52
- VendorProtectedControllerTest: test_responds_with_unauthorized_to_invalid_token
53
- -------------------------------------------------------------------------------
54
- Processing by VendorProtectedController#index as HTML
55
- Filter chain halted as :authenticate_vendor rendered or redirected
56
- Completed 401 Unauthorized in 0ms (ActiveRecord: 0.0ms)
57
-  (0.1ms) rollback transaction
58
-  (0.1ms) begin transaction
59
- --------------------------------------------------------------------------------
60
- VendorProtectedControllerTest: test_responds_with_unauthorized_to_invalid_entity
61
- --------------------------------------------------------------------------------
62
- Processing by VendorProtectedController#index as HTML
63
- Vendor Load (0.1ms) SELECT "vendors".* FROM "vendors" WHERE "vendors"."id" = ? LIMIT 1 [["id", 0]]
64
- Filter chain halted as :authenticate_vendor rendered or redirected
65
- Completed 401 Unauthorized in 1ms (ActiveRecord: 0.1ms)
66
-  (0.1ms) rollback transaction
67
-  (0.0ms) begin transaction
68
- --------------------------------------------------------------------------
69
- VendorProtectedControllerTest: test_responds_with_success_if_authenticated
70
- --------------------------------------------------------------------------
71
- Vendor Load (0.1ms) SELECT "vendors".* FROM "vendors" WHERE "vendors"."id" = ? LIMIT 1 [["id", 980190962]]
72
- Processing by VendorProtectedController#index as HTML
73
- Vendor Load (0.0ms) SELECT "vendors".* FROM "vendors" WHERE "vendors"."id" = ? LIMIT 1 [["id", 980190962]]
74
- Completed 200 OK in 1ms (ActiveRecord: 0.0ms)
75
-  (0.1ms) rollback transaction
76
-  (0.1ms) begin transaction
77
- --------------------------------------------------------------------------------------------
78
- CompositeNameEntityProtectedControllerTest: test_responds_with_unauthorized_to_invalid_token
79
- --------------------------------------------------------------------------------------------
80
- Processing by CompositeNameEntityProtectedController#index as HTML
81
- Filter chain halted as :authenticate_composite_name_entity rendered or redirected
82
- Completed 401 Unauthorized in 0ms (ActiveRecord: 0.0ms)
83
-  (0.1ms) rollback transaction
84
-  (0.0ms) begin transaction
85
- ---------------------------------------------------------------------------------------------
86
- CompositeNameEntityProtectedControllerTest: test_responds_with_unauthorized_to_invalid_entity
87
- ---------------------------------------------------------------------------------------------
88
- Processing by CompositeNameEntityProtectedController#index as HTML
89
- CompositeNameEntity Load (0.1ms) SELECT "composite_name_entities".* FROM "composite_name_entities" WHERE "composite_name_entities"."id" = ? LIMIT 1 [["id", 0]]
90
- Filter chain halted as :authenticate_composite_name_entity rendered or redirected
91
- Completed 401 Unauthorized in 1ms (ActiveRecord: 0.1ms)
92
-  (0.1ms) rollback transaction
93
-  (0.0ms) begin transaction
94
- ---------------------------------------------------------------------------------------------------------
95
- CompositeNameEntityProtectedControllerTest: test_has_a_current_composite_name_entity_after_authentication
96
- ---------------------------------------------------------------------------------------------------------
97
- CompositeNameEntity Load (0.1ms) SELECT "composite_name_entities".* FROM "composite_name_entities" WHERE "composite_name_entities"."id" = ? LIMIT 1 [["id", 980190962]]
98
- Processing by CompositeNameEntityProtectedController#index as HTML
99
- CompositeNameEntity Load (0.1ms) SELECT "composite_name_entities".* FROM "composite_name_entities" WHERE "composite_name_entities"."id" = ? LIMIT 1 [["id", 980190962]]
100
- Completed 200 OK in 1ms (ActiveRecord: 0.1ms)
101
-  (0.1ms) rollback transaction
102
-  (0.0ms) begin transaction
103
- ---------------------------------------------------------------------------------------
104
- CompositeNameEntityProtectedControllerTest: test_responds_with_success_if_authenticated
105
- ---------------------------------------------------------------------------------------
106
- CompositeNameEntity Load (0.1ms) SELECT "composite_name_entities".* FROM "composite_name_entities" WHERE "composite_name_entities"."id" = ? LIMIT 1 [["id", 980190962]]
107
- Processing by CompositeNameEntityProtectedController#index as HTML
108
- CompositeNameEntity Load (0.0ms) SELECT "composite_name_entities".* FROM "composite_name_entities" WHERE "composite_name_entities"."id" = ? LIMIT 1 [["id", 980190962]]
109
- Completed 200 OK in 1ms (ActiveRecord: 0.0ms)
110
-  (0.1ms) rollback transaction
111
-  (0.0ms) begin transaction
112
- ---------------------------------------------------------------------------
113
- CompositeNameEntityProtectedControllerTest: test_responds_with_unauthorized
114
- ---------------------------------------------------------------------------
115
- Processing by CompositeNameEntityProtectedController#index as HTML
116
- Filter chain halted as :authenticate_composite_name_entity rendered or redirected
117
- Completed 401 Unauthorized in 0ms (ActiveRecord: 0.0ms)
118
-  (0.1ms) rollback transaction
119
-  (0.1ms) begin transaction
120
- -------------------------------------------------------------------------
121
- Knock::AuthTokenTest: test_verify_audience_when_token_audience_is_present
122
- -------------------------------------------------------------------------
123
-  (0.0ms) rollback transaction
124
-  (0.0ms) begin transaction
125
- ---------------------------------------------------------------
126
- Knock::AuthTokenTest: test_validate_expiration_claim_by_default
127
- ---------------------------------------------------------------
128
-  (0.1ms) rollback transaction
129
-  (0.1ms) begin transaction
130
- ----------------------------------------------------
131
- Knock::AuthTokenTest: test_decode_RSA_encoded_tokens
132
- ----------------------------------------------------
133
-  (0.1ms) rollback transaction
134
-  (0.1ms) begin transaction
135
- ---------------------------------------------------------------------------------------
136
- Knock::AuthTokenTest: test_does_not_validate_expiration_claim_with_a_nil_token_lifetime
137
- ---------------------------------------------------------------------------------------
138
-  (0.1ms) rollback transaction
139
-  (0.0ms) begin transaction
140
- -------------------------------------------------
141
- Knock::AuthTokenTest: test_encode_tokens_with_RSA
142
- -------------------------------------------------
143
-  (0.1ms) rollback transaction
144
-  (0.1ms) begin transaction
145
- -------------------------------------------
146
- Knock::AuthTokenTest: test_verify_algorithm
147
- -------------------------------------------
148
-  (0.1ms) rollback transaction
149
-  (0.0ms) begin transaction
150
- ------------------------------------------
151
- Knock::AuthTokenTest: test_is_serializable
152
- ------------------------------------------
153
-  (0.0ms) rollback transaction
154
-  (0.1ms) begin transaction
155
- ----------------------------------------------------------------------------------------------
156
- ProtectedResourcesControllerTest: test_responds_with_unauthorized_with_invalid_token_in_header
157
- ----------------------------------------------------------------------------------------------
158
- User Load (0.2ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT 1 [["id", 980190962]]
159
- Processing by ProtectedResourcesController#index as HTML
160
- Filter chain halted as :authenticate rendered or redirected
161
- Completed 401 Unauthorized in 0ms (ActiveRecord: 0.0ms)
162
-  (0.1ms) rollback transaction
163
-  (0.0ms) begin transaction
1
+  (7.3ms) CREATE TABLE "schema_migrations" ("version" varchar NOT NULL PRIMARY KEY)
2
+  (7.4ms) CREATE TABLE "ar_internal_metadata" ("key" varchar NOT NULL PRIMARY KEY, "value" varchar, "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL)
3
+ ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
4
+ Migrating to CreateUsers (20150713101607)
5
+  (0.1ms) begin transaction
6
+  (0.3ms) CREATE TABLE "users" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "email" varchar NOT NULL, "password_digest" varchar NOT NULL, "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL)
7
+ SQL (0.1ms) INSERT INTO "schema_migrations" ("version") VALUES (?) [["version", "20150713101607"]]
8
+  (2.0ms) commit transaction
9
+ Migrating to CreateAdmins (20160519075733)
10
+  (0.0ms) begin transaction
11
+  (0.2ms) CREATE TABLE "admins" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "email" varchar, "password_digest" varchar, "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL)
12
+ SQL (0.1ms) INSERT INTO "schema_migrations" ("version") VALUES (?) [["version", "20160519075733"]]
13
+  (6.8ms) commit transaction
14
+ Migrating to CreateVendors (20160522051816)
15
+  (0.0ms) begin transaction
16
+  (0.2ms) CREATE TABLE "vendors" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "email" varchar, "password_digest" varchar, "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL)
17
+ SQL (0.1ms) INSERT INTO "schema_migrations" ("version") VALUES (?) [["version", "20160522051816"]]
18
+  (6.9ms) commit transaction
19
+ Migrating to CreateCompositeNameEntities (20160522181712)
20
+  (0.0ms) begin transaction
21
+  (0.2ms) CREATE TABLE "composite_name_entities" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "email" varchar, "password_digest" varchar, "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL)
22
+ SQL (0.1ms) INSERT INTO "schema_migrations" ("version") VALUES (?) [["version", "20160522181712"]]
23
+  (6.8ms) commit transaction
24
+ ActiveRecord::InternalMetadata Load (0.1ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = ? LIMIT ? [["key", :environment], ["LIMIT", 1]]
25
+  (0.0ms) begin transaction
26
+ SQL (0.1ms) INSERT INTO "ar_internal_metadata" ("key", "value", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["key", "environment"], ["value", "test"], ["created_at", 2016-10-23 11:46:54 UTC], ["updated_at", 2016-10-23 11:46:54 UTC]]
27
+  (9.4ms) commit transaction
28
+ ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
29
+ ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations"
30
+  (0.1ms) begin transaction
31
+ Fixture Delete (0.2ms) DELETE FROM "admins"
32
+ Fixture Insert (0.1ms) INSERT INTO "admins" ("email", "password_digest", "created_at", "updated_at", "id") VALUES ('admin.one@example.net', '$2a$04$L0e6QDD.KUi7.R484p7.CuLHnDQ1237SVHPBXc1TuVkJkK22jpKVS', '2016-10-23 11:46:57.543558', '2016-10-23 11:46:57.543558', 980190962)
33
+ Fixture Delete (0.1ms) DELETE FROM "composite_name_entities"
34
+ Fixture Insert (0.1ms) INSERT INTO "composite_name_entities" ("email", "password_digest", "created_at", "updated_at", "id") VALUES ('composite_name_entity.one@example.net', '$2a$04$C3CqIofHrsAY14.9KrzXceL/bYXVODgVNloqhRiYYJek3Pak5ABhW', '2016-10-23 11:46:57.547469', '2016-10-23 11:46:57.547469', 980190962)
35
+ Fixture Delete (0.1ms) DELETE FROM "users"
36
+ Fixture Insert (0.1ms) INSERT INTO "users" ("email", "password_digest", "created_at", "updated_at", "id") VALUES ('one@example.net', '$2a$04$7Z3pv.bB1PLx4/uSlbmwBe98I/G.MYZT8I0SMEZY.WXHtFiJctThG', '2016-10-23 11:46:57.549261', '2016-10-23 11:46:57.549261', 980190962)
37
+ Fixture Insert (0.1ms) INSERT INTO "users" ("email", "password_digest", "created_at", "updated_at", "id") VALUES ('two@example.net', '$2a$04$Rdgg23Sm9JHF9v6igZBGbODJ3sF2Q2Isa3AOZa7AeC2X02nu9VZI6', '2016-10-23 11:46:57.549261', '2016-10-23 11:46:57.549261', 298486374)
38
+ Fixture Delete (0.1ms) DELETE FROM "vendors"
39
+ Fixture Insert (0.1ms) INSERT INTO "vendors" ("email", "password_digest", "created_at", "updated_at", "id") VALUES ('vendor.one@example.net', '$2a$04$c6LF45dpUDzY4pDnbxipb.DzdalR.IBnD84VgVHmA9w9QG1p6szZy', '2016-10-23 11:46:57.551369', '2016-10-23 11:46:57.551369', 980190962)
40
+  (2.1ms) commit transaction
41
+  (0.0ms) begin transaction
164
42
  ----------------------------------------------------------------------------------
165
43
  ProtectedResourcesControllerTest: test_accepts_authorization_header_without_prefix
166
44
  ----------------------------------------------------------------------------------
167
- User Load (0.1ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT 1 [["id", 980190962]]
45
+ User Load (0.3ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT ? [["id", 980190962], ["LIMIT", 1]]
168
46
  Processing by ProtectedResourcesController#index as HTML
169
- User Load (0.1ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT 1 [["id", 980190962]]
170
- Completed 200 OK in 1ms (ActiveRecord: 0.1ms)
171
-  (0.1ms) rollback transaction
172
-  (0.1ms) begin transaction
47
+ User Load (0.1ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT ? [["id", 980190962], ["LIMIT", 1]]
48
+ Completed 200 OK in 4ms (ActiveRecord: 0.1ms)
49
+  (0.1ms) rollback transaction
50
+  (0.1ms) begin transaction
51
+ ----------------------------------------------------------------------------------------------
52
+ ProtectedResourcesControllerTest: test_responds_with_unauthorized_with_invalid_token_in_header
53
+ ----------------------------------------------------------------------------------------------
54
+ User Load (0.1ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT ? [["id", 980190962], ["LIMIT", 1]]
55
+ Processing by ProtectedResourcesController#index as HTML
56
+ Filter chain halted as :authenticate_user rendered or redirected
57
+ Completed 401 Unauthorized in 1ms (ActiveRecord: 0.0ms)
58
+  (0.1ms) rollback transaction
59
+  (0.1ms) begin transaction
173
60
  -------------------------------------------------------------------------------------------
174
61
  ProtectedResourcesControllerTest: test_responds_with_unauthorized_with_invalid_token_in_url
175
62
  -------------------------------------------------------------------------------------------
176
- User Load (0.1ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT 1 [["id", 980190962]]
63
+ User Load (0.1ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT ? [["id", 980190962], ["LIMIT", 1]]
177
64
  Processing by ProtectedResourcesController#index as HTML
178
65
  Parameters: {"token"=>"invalid"}
179
- Filter chain halted as :authenticate rendered or redirected
66
+ Filter chain halted as :authenticate_user rendered or redirected
180
67
  Completed 401 Unauthorized in 0ms (ActiveRecord: 0.0ms)
181
-  (0.1ms) rollback transaction
182
-  (0.0ms) begin transaction
68
+  (0.1ms) rollback transaction
69
+  (0.1ms) begin transaction
183
70
  ------------------------------------------------------------------------------
184
- ProtectedResourcesControllerTest: test_responds_with_success_with_token_in_url
71
+ ProtectedResourcesControllerTest: test_has_a_current_user_after_authentication
185
72
  ------------------------------------------------------------------------------
186
- User Load (0.1ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT 1 [["id", 980190962]]
73
+ User Load (0.1ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT ? [["id", 980190962], ["LIMIT", 1]]
187
74
  Processing by ProtectedResourcesController#index as HTML
188
- Parameters: {"token"=>"eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJleHAiOjE0NjQ2MTYyMjcsInN1YiI6OTgwMTkwOTYyfQ.ZioYbBATphHQTR5V7AbQ3XE9C-Y2AwSlJwIbFeMJAxA"}
189
- User Load (0.0ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT 1 [["id", 980190962]]
190
- Completed 200 OK in 1ms (ActiveRecord: 0.0ms)
191
-  (0.1ms) rollback transaction
192
-  (0.0ms) begin transaction
193
- -----------------------------------------------------------------
194
- ProtectedResourcesControllerTest: test_responds_with_unauthorized
195
- -----------------------------------------------------------------
196
- User Load (0.1ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT 1 [["id", 980190962]]
75
+ User Load (0.1ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT ? [["id", 980190962], ["LIMIT", 1]]
76
+ Completed 200 OK in 1ms (ActiveRecord: 0.1ms)
77
+  (0.1ms) rollback transaction
78
+  (0.1ms) begin transaction
79
+ ---------------------------------------------------------------------------------------
80
+ ProtectedResourcesControllerTest: test_responds_with_success_with_valid_token_in_header
81
+ ---------------------------------------------------------------------------------------
82
+ User Load (0.1ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT ? [["id", 980190962], ["LIMIT", 1]]
197
83
  Processing by ProtectedResourcesController#index as HTML
198
- Filter chain halted as :authenticate rendered or redirected
199
- Completed 401 Unauthorized in 0ms (ActiveRecord: 0.0ms)
200
-  (0.1ms) rollback transaction
201
-  (0.0ms) begin transaction
84
+ User Load (0.0ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT ? [["id", 980190962], ["LIMIT", 1]]
85
+ Completed 200 OK in 1ms (ActiveRecord: 0.0ms)
86
+  (0.1ms) rollback transaction
87
+  (0.0ms) begin transaction
202
88
  -------------------------------------------------------------------------------------
203
89
  ProtectedResourcesControllerTest: test_accepts_any_prefix_in_the_authorization_header
204
90
  -------------------------------------------------------------------------------------
205
- User Load (0.1ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT 1 [["id", 980190962]]
91
+ User Load (0.1ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT ? [["id", 980190962], ["LIMIT", 1]]
206
92
  Processing by ProtectedResourcesController#index as HTML
207
- User Load (0.1ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT 1 [["id", 980190962]]
208
- Completed 200 OK in 1ms (ActiveRecord: 0.1ms)
209
-  (0.1ms) rollback transaction
210
-  (0.0ms) begin transaction
93
+ User Load (0.0ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT ? [["id", 980190962], ["LIMIT", 1]]
94
+ Completed 200 OK in 1ms (ActiveRecord: 0.0ms)
95
+  (0.1ms) rollback transaction
96
+  (0.1ms) begin transaction
97
+ -----------------------------------------------------------------
98
+ ProtectedResourcesControllerTest: test_responds_with_unauthorized
99
+ -----------------------------------------------------------------
100
+ User Load (0.1ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT ? [["id", 980190962], ["LIMIT", 1]]
101
+ Processing by ProtectedResourcesController#index as HTML
102
+ User Load (0.1ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT ? [["id", nil], ["LIMIT", 1]]
103
+ Filter chain halted as :authenticate_user rendered or redirected
104
+ Completed 401 Unauthorized in 1ms (ActiveRecord: 0.1ms)
105
+  (0.1ms) rollback transaction
106
+  (0.1ms) begin transaction
211
107
  ------------------------------------------------------------------------------
212
- ProtectedResourcesControllerTest: test_has_a_current_user_after_authentication
108
+ ProtectedResourcesControllerTest: test_responds_with_success_with_token_in_url
213
109
  ------------------------------------------------------------------------------
214
- User Load (0.1ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT 1 [["id", 980190962]]
215
- Processing by ProtectedResourcesController#index as HTML
216
- User Load (0.0ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT 1 [["id", 980190962]]
217
- Completed 200 OK in 1ms (ActiveRecord: 0.0ms)
218
-  (0.1ms) rollback transaction
219
-  (0.0ms) begin transaction
220
- ---------------------------------------------------------------------------------------
221
- ProtectedResourcesControllerTest: test_responds_with_success_with_valid_token_in_header
222
- ---------------------------------------------------------------------------------------
223
- User Load (0.1ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT 1 [["id", 980190962]]
110
+ User Load (0.1ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT ? [["id", 980190962], ["LIMIT", 1]]
224
111
  Processing by ProtectedResourcesController#index as HTML
225
- User Load (0.0ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT 1 [["id", 980190962]]
226
- Completed 200 OK in 1ms (ActiveRecord: 0.0ms)
227
-  (0.1ms) rollback transaction
228
-  (0.1ms) begin transaction
229
- --------------------------------------------------
230
- CurrentUsersControllerTest: test_responds_with_200
231
- --------------------------------------------------
232
- User Load (0.1ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT 1 [["id", 980190962]]
233
- Processing by CurrentUsersController#show as HTML
234
- User Load (0.1ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT 1 [["id", 980190962]]
112
+ Parameters: {"token"=>"eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJleHAiOjE0NzczMDk2MTcsInN1YiI6OTgwMTkwOTYyfQ.Q04ydbtUVZsmqb3dfESRqBJKBfbiomA4XZXFO35kNv8"}
113
+ User Load (0.1ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT ? [["id", 980190962], ["LIMIT", 1]]
235
114
  Completed 200 OK in 1ms (ActiveRecord: 0.1ms)
236
-  (0.1ms) rollback transaction
237
-  (0.0ms) begin transaction
238
- ---------------------------------------------------------------------------
239
- CurrentUsersControllerTest: test_responds_with_404_if_user_is_not_logged_in
240
- ---------------------------------------------------------------------------
241
- User Load (0.1ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT 1 [["id", 980190962]]
242
- Processing by CurrentUsersController#show as HTML
243
- Completed 404 Not Found in 0ms (ActiveRecord: 0.0ms)
244
-  (0.1ms) rollback transaction
245
-  (0.1ms) begin transaction
246
- ----------------------------------------------------------------
247
- InstallGeneratorTest: test_Assert_all_files_are_properly_created
248
- ----------------------------------------------------------------
249
-  (0.1ms) rollback transaction
250
-  (0.1ms) begin transaction
251
- ---------------------------------------
252
- KnockTest: test_setup_block_yields_self
253
- ---------------------------------------
254
-  (0.0ms) rollback transaction
255
-  (0.1ms) begin transaction
115
+  (0.1ms) rollback transaction
116
+  (0.0ms) begin transaction
256
117
  ------------------------------------------------------------------------
257
118
  VendorTokenControllerTest: test_responds_with_404_if_user_does_not_exist
258
119
  ------------------------------------------------------------------------
259
- Vendor Load (0.1ms) SELECT "vendors".* FROM "vendors" WHERE "vendors"."id" = ? LIMIT 1 [["id", 980190962]]
120
+ Vendor Load (0.2ms) SELECT "vendors".* FROM "vendors" WHERE "vendors"."id" = ? LIMIT ? [["id", 980190962], ["LIMIT", 1]]
260
121
  Processing by VendorTokenController#create as HTML
261
122
  Parameters: {"auth"=>{"email"=>"wrong@example.net", "password"=>"[FILTERED]"}}
262
- Vendor Load (0.1ms) SELECT "vendors".* FROM "vendors" WHERE "vendors"."email" = ? LIMIT 1 [["email", "wrong@example.net"]]
263
- Completed 404 Not Found in 1ms (ActiveRecord: 0.1ms)
264
-  (0.1ms) rollback transaction
265
-  (0.0ms) begin transaction
123
+ Vendor Load (0.3ms) SELECT "vendors".* FROM "vendors" WHERE "vendors"."email" = ? LIMIT ? [["email", "wrong@example.net"], ["LIMIT", 1]]
124
+ Completed 404 Not Found in 3ms (ActiveRecord: 0.3ms)
125
+  (0.1ms) rollback transaction
126
+  (0.1ms) begin transaction
127
+ -------------------------------------------------
128
+ VendorTokenControllerTest: test_responds_with_201
129
+ -------------------------------------------------
130
+ Vendor Load (0.1ms) SELECT "vendors".* FROM "vendors" WHERE "vendors"."id" = ? LIMIT ? [["id", 980190962], ["LIMIT", 1]]
131
+ Processing by VendorTokenController#create as HTML
132
+ Parameters: {"auth"=>{"email"=>"vendor.one@example.net", "password"=>"[FILTERED]"}}
133
+ Vendor Load (0.1ms) SELECT "vendors".* FROM "vendors" WHERE "vendors"."email" = ? LIMIT ? [["email", "vendor.one@example.net"], ["LIMIT", 1]]
134
+ Completed 201 Created in 4ms (Views: 0.4ms | ActiveRecord: 0.1ms)
135
+  (0.1ms) rollback transaction
136
+  (0.1ms) begin transaction
266
137
  ------------------------------------------------------------------------
267
138
  VendorTokenControllerTest: test_responds_with_404_if_password_is_invalid
268
139
  ------------------------------------------------------------------------
269
- Vendor Load (0.1ms) SELECT "vendors".* FROM "vendors" WHERE "vendors"."id" = ? LIMIT 1 [["id", 980190962]]
140
+ Vendor Load (0.1ms) SELECT "vendors".* FROM "vendors" WHERE "vendors"."id" = ? LIMIT ? [["id", 980190962], ["LIMIT", 1]]
270
141
  Processing by VendorTokenController#create as HTML
271
142
  Parameters: {"auth"=>{"email"=>"vendor.one@example.net", "password"=>"[FILTERED]"}}
272
- Vendor Load (0.1ms) SELECT "vendors".* FROM "vendors" WHERE "vendors"."email" = ? LIMIT 1 [["email", "vendor.one@example.net"]]
273
- Completed 404 Not Found in 2ms (ActiveRecord: 0.1ms)
274
-  (0.1ms) rollback transaction
275
-  (0.0ms) begin transaction
143
+ Vendor Load (0.1ms) SELECT "vendors".* FROM "vendors" WHERE "vendors"."email" = ? LIMIT ? [["email", "vendor.one@example.net"], ["LIMIT", 1]]
144
+ Completed 404 Not Found in 3ms (ActiveRecord: 0.1ms)
145
+  (0.1ms) rollback transaction
146
+  (0.1ms) begin transaction
147
+ ---------------------------------------------------------------------------------------
148
+ Knock::AuthTokenTest: test_does_not_validate_expiration_claim_with_a_nil_token_lifetime
149
+ ---------------------------------------------------------------------------------------
150
+  (0.1ms) rollback transaction
151
+  (0.1ms) begin transaction
152
+ ---------------------------------------------------------------
153
+ Knock::AuthTokenTest: test_validate_expiration_claim_by_default
154
+ ---------------------------------------------------------------
155
+  (0.1ms) rollback transaction
156
+  (0.1ms) begin transaction
157
+ -------------------------------------------
158
+ Knock::AuthTokenTest: test_verify_algorithm
159
+ -------------------------------------------
160
+  (0.1ms) rollback transaction
161
+  (0.1ms) begin transaction
162
+ ----------------------------------------------------
163
+ Knock::AuthTokenTest: test_decode_RSA_encoded_tokens
164
+ ----------------------------------------------------
165
+  (0.1ms) rollback transaction
166
+  (0.1ms) begin transaction
276
167
  -------------------------------------------------
277
- VendorTokenControllerTest: test_responds_with_201
168
+ Knock::AuthTokenTest: test_encode_tokens_with_RSA
278
169
  -------------------------------------------------
279
- Vendor Load (0.1ms) SELECT "vendors".* FROM "vendors" WHERE "vendors"."id" = ? LIMIT 1 [["id", 980190962]]
280
- Processing by VendorTokenController#create as HTML
281
- Parameters: {"auth"=>{"email"=>"vendor.one@example.net", "password"=>"[FILTERED]"}}
282
- Vendor Load (0.0ms) SELECT "vendors".* FROM "vendors" WHERE "vendors"."email" = ? LIMIT 1 [["email", "vendor.one@example.net"]]
283
- Completed 201 Created in 2ms (Views: 0.2ms | ActiveRecord: 0.0ms)
284
-  (0.1ms) rollback transaction
285
-  (0.1ms) begin transaction
286
- -------------------------------------------------------------------------------
287
- AdminProtectedControllerTest: test_responds_with_unauthorized_to_invalid_entity
288
- -------------------------------------------------------------------------------
289
- Processing by AdminProtectedController#index as HTML
290
- Admin Load (0.1ms) SELECT "admins".* FROM "admins" WHERE "admins"."id" = ? LIMIT 1 [["id", 0]]
291
- Filter chain halted as :authenticate_admin rendered or redirected
292
- Completed 401 Unauthorized in 1ms (ActiveRecord: 0.1ms)
293
-  (0.1ms) rollback transaction
294
-  (0.0ms) begin transaction
170
+  (0.1ms) rollback transaction
171
+  (0.1ms) begin transaction
172
+ ------------------------------------------
173
+ Knock::AuthTokenTest: test_is_serializable
174
+ ------------------------------------------
175
+  (0.0ms) rollback transaction
176
+  (0.0ms) begin transaction
295
177
  -------------------------------------------------------------------------
296
- AdminProtectedControllerTest: test_responds_with_success_if_authenticated
178
+ Knock::AuthTokenTest: test_verify_audience_when_token_audience_is_present
297
179
  -------------------------------------------------------------------------
298
- Admin Load (0.1ms) SELECT "admins".* FROM "admins" WHERE "admins"."id" = ? LIMIT 1 [["id", 980190962]]
299
- Processing by AdminProtectedController#index as HTML
300
- Admin Load (0.0ms) SELECT "admins".* FROM "admins" WHERE "admins"."id" = ? LIMIT 1 [["id", 980190962]]
301
- Completed 200 OK in 1ms (ActiveRecord: 0.0ms)
302
-  (0.1ms) rollback transaction
303
-  (0.0ms) begin transaction
304
- ------------------------------------------------------------------------------
305
- AdminProtectedControllerTest: test_responds_with_unauthorized_to_invalid_token
306
- ------------------------------------------------------------------------------
307
- Processing by AdminProtectedController#index as HTML
308
- Filter chain halted as :authenticate_admin rendered or redirected
309
- Completed 401 Unauthorized in 0ms (ActiveRecord: 0.0ms)
310
-  (0.1ms) rollback transaction
311
-  (0.1ms) begin transaction
312
- -------------------------------------------------------------
313
- AdminProtectedControllerTest: test_responds_with_unauthorized
314
- -------------------------------------------------------------
315
- Processing by AdminProtectedController#index as HTML
316
- Filter chain halted as :authenticate_admin rendered or redirected
317
- Completed 401 Unauthorized in 0ms (ActiveRecord: 0.0ms)
318
-  (0.1ms) rollback transaction
319
-  (0.0ms) begin transaction
320
- ---------------------------------------------------------------------------
321
- AdminProtectedControllerTest: test_has_a_current_admin_after_authentication
322
- ---------------------------------------------------------------------------
323
- Admin Load (0.1ms) SELECT "admins".* FROM "admins" WHERE "admins"."id" = ? LIMIT 1 [["id", 980190962]]
324
- Processing by AdminProtectedController#index as HTML
325
- Admin Load (0.1ms) SELECT "admins".* FROM "admins" WHERE "admins"."id" = ? LIMIT 1 [["id", 980190962]]
326
- Completed 200 OK in 1ms (ActiveRecord: 0.1ms)
327
-  (0.1ms) rollback transaction
328
-  (0.1ms) begin transaction
180
+  (0.0ms) rollback transaction
181
+  (0.1ms) begin transaction
182
+ -----------------------------------------------------------------------
183
+ AdminTokenControllerTest: test_responds_with_404_if_user_does_not_exist
184
+ -----------------------------------------------------------------------
185
+ Admin Load (0.2ms) SELECT "admins".* FROM "admins" WHERE "admins"."id" = ? LIMIT ? [["id", 980190962], ["LIMIT", 1]]
186
+ Processing by AdminTokenController#create as HTML
187
+ Parameters: {"auth"=>{"email"=>"wrong@example.net", "password"=>"[FILTERED]"}}
188
+ Admin Load (0.1ms) SELECT "admins".* FROM "admins" WHERE "admins"."email" = ? LIMIT ? [["email", "wrong@example.net"], ["LIMIT", 1]]
189
+ Completed 404 Not Found in 1ms (ActiveRecord: 0.1ms)
190
+  (0.1ms) rollback transaction
191
+  (0.1ms) begin transaction
329
192
  ------------------------------------------------
330
193
  AdminTokenControllerTest: test_responds_with_201
331
194
  ------------------------------------------------
332
- Admin Load (0.1ms) SELECT "admins".* FROM "admins" WHERE "admins"."id" = ? LIMIT 1 [["id", 980190962]]
195
+ Admin Load (0.1ms) SELECT "admins".* FROM "admins" WHERE "admins"."id" = ? LIMIT ? [["id", 980190962], ["LIMIT", 1]]
333
196
  Processing by AdminTokenController#create as HTML
334
197
  Parameters: {"auth"=>{"email"=>"admin.one@example.net", "password"=>"[FILTERED]"}}
335
- Admin Load (0.1ms) SELECT "admins".* FROM "admins" WHERE "admins"."email" = ? LIMIT 1 [["email", "admin.one@example.net"]]
198
+ Admin Load (0.1ms) SELECT "admins".* FROM "admins" WHERE "admins"."email" = ? LIMIT ? [["email", "admin.one@example.net"], ["LIMIT", 1]]
336
199
  Completed 201 Created in 3ms (Views: 0.2ms | ActiveRecord: 0.1ms)
337
-  (0.1ms) rollback transaction
338
-  (0.0ms) begin transaction
200
+  (0.1ms) rollback transaction
201
+  (0.0ms) begin transaction
339
202
  -----------------------------------------------------------------------
340
203
  AdminTokenControllerTest: test_responds_with_404_if_password_is_invalid
341
204
  -----------------------------------------------------------------------
342
- Admin Load (0.1ms) SELECT "admins".* FROM "admins" WHERE "admins"."id" = ? LIMIT 1 [["id", 980190962]]
205
+ Admin Load (0.1ms) SELECT "admins".* FROM "admins" WHERE "admins"."id" = ? LIMIT ? [["id", 980190962], ["LIMIT", 1]]
343
206
  Processing by AdminTokenController#create as HTML
344
207
  Parameters: {"auth"=>{"email"=>"admin.one@example.net", "password"=>"[FILTERED]"}}
345
- Admin Load (0.0ms) SELECT "admins".* FROM "admins" WHERE "admins"."email" = ? LIMIT 1 [["email", "admin.one@example.net"]]
346
- Completed 404 Not Found in 2ms (ActiveRecord: 0.0ms)
347
-  (0.1ms) rollback transaction
348
-  (0.0ms) begin transaction
349
- -----------------------------------------------------------------------
350
- AdminTokenControllerTest: test_responds_with_404_if_user_does_not_exist
351
- -----------------------------------------------------------------------
352
- Admin Load (0.1ms) SELECT "admins".* FROM "admins" WHERE "admins"."id" = ? LIMIT 1 [["id", 980190962]]
353
- Processing by AdminTokenController#create as HTML
354
- Parameters: {"auth"=>{"email"=>"wrong@example.net", "password"=>"[FILTERED]"}}
355
- Admin Load (0.0ms) SELECT "admins".* FROM "admins" WHERE "admins"."email" = ? LIMIT 1 [["email", "wrong@example.net"]]
356
- Completed 404 Not Found in 0ms (ActiveRecord: 0.0ms)
357
-  (0.1ms) rollback transaction
358
-  (0.1ms) begin transaction
208
+ Admin Load (0.1ms) SELECT "admins".* FROM "admins" WHERE "admins"."email" = ? LIMIT ? [["email", "admin.one@example.net"], ["LIMIT", 1]]
209
+ Completed 404 Not Found in 2ms (ActiveRecord: 0.1ms)
210
+  (0.1ms) rollback transaction
211
+  (0.0ms) begin transaction
212
+ --------------------------------------------------
213
+ CurrentUsersControllerTest: test_responds_with_200
214
+ --------------------------------------------------
215
+ User Load (0.1ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT ? [["id", 980190962], ["LIMIT", 1]]
216
+ Processing by CurrentUsersController#show as HTML
217
+ User Load (0.0ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT ? [["id", 980190962], ["LIMIT", 1]]
218
+ Completed 200 OK in 1ms (ActiveRecord: 0.0ms)
219
+  (0.1ms) rollback transaction
220
+  (0.0ms) begin transaction
221
+ -----------------------------------------------------
222
+ CurrentUsersControllerTest: test_responds_with_200_#2
223
+ -----------------------------------------------------
224
+ User Load (0.1ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT ? [["id", 980190962], ["LIMIT", 1]]
225
+ Processing by CurrentUsersController#show as HTML
226
+ User Load (0.1ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT ? [["id", 980190962], ["LIMIT", 1]]
227
+ Completed 200 OK in 1ms (ActiveRecord: 0.1ms)
228
+  (0.1ms) rollback transaction
229
+  (0.1ms) begin transaction
230
+ ---------------------------------------------------------------------------
231
+ CurrentUsersControllerTest: test_responds_with_404_if_user_is_not_logged_in
232
+ ---------------------------------------------------------------------------
233
+ User Load (0.1ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT ? [["id", 980190962], ["LIMIT", 1]]
234
+ Processing by CurrentUsersController#show as HTML
235
+ User Load (0.0ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT ? [["id", nil], ["LIMIT", 1]]
236
+ Completed 404 Not Found in 1ms (ActiveRecord: 0.0ms)
237
+  (0.1ms) rollback transaction
238
+  (0.0ms) begin transaction
359
239
  -----------------------------------------------------------------------------
360
- Knock::AuthTokenControllerTest: test_responds_with_404_if_password_is_invalid
240
+ VendorProtectedControllerTest: test_raises_method_missing_error_appropriately
361
241
  -----------------------------------------------------------------------------
362
- User Load (0.1ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT 1 [["id", 980190962]]
363
- Processing by Knock::AuthTokenController#create as HTML
364
- Parameters: {"auth"=>{"email"=>"one@example.net", "password"=>"[FILTERED]"}}
365
- User Load (0.1ms) SELECT "users".* FROM "users" WHERE "users"."email" = ? LIMIT 1 [["email", "one@example.net"]]
366
- Completed 404 Not Found in 2ms (ActiveRecord: 0.1ms)
367
-  (0.1ms) rollback transaction
368
-  (0.1ms) begin transaction
369
- ------------------------------------------------------
370
- Knock::AuthTokenControllerTest: test_responds_with_201
371
- ------------------------------------------------------
372
- User Load (0.1ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT 1 [["id", 980190962]]
373
- Processing by Knock::AuthTokenController#create as HTML
374
- Parameters: {"auth"=>{"email"=>"one@example.net", "password"=>"[FILTERED]"}}
375
- User Load (0.1ms) SELECT "users".* FROM "users" WHERE "users"."email" = ? LIMIT 1 [["email", "one@example.net"]]
376
- Completed 201 Created in 3ms (Views: 0.2ms | ActiveRecord: 0.1ms)
377
-  (0.1ms) rollback transaction
378
-  (0.0ms) begin transaction
242
+ Processing by VendorProtectedController#show as HTML
243
+ Parameters: {"id"=>"1"}
244
+ Completed 500 Internal Server Error in 1ms (ActiveRecord: 0.0ms)
245
+  (0.1ms) rollback transaction
246
+  (0.0ms) begin transaction
379
247
  -----------------------------------------------------------------------------
380
- Knock::AuthTokenControllerTest: test_responds_with_404_if_user_does_not_exist
248
+ VendorProtectedControllerTest: test_has_a_current_vendor_after_authentication
381
249
  -----------------------------------------------------------------------------
382
- Processing by Knock::AuthTokenController#create as HTML
383
- Parameters: {"auth"=>{"email"=>"wrong@example.net", "password"=>"[FILTERED]"}}
384
- User Load (0.1ms) SELECT "users".* FROM "users" WHERE "users"."email" = ? LIMIT 1 [["email", "wrong@example.net"]]
250
+ Vendor Load (0.1ms) SELECT "vendors".* FROM "vendors" WHERE "vendors"."id" = ? LIMIT ? [["id", 980190962], ["LIMIT", 1]]
251
+ Processing by VendorProtectedController#index as HTML
252
+ Vendor Load (0.0ms) SELECT "vendors".* FROM "vendors" WHERE "vendors"."id" = ? LIMIT ? [["id", 980190962], ["LIMIT", 1]]
253
+ Completed 200 OK in 1ms (ActiveRecord: 0.0ms)
254
+  (0.1ms) rollback transaction
255
+  (0.0ms) begin transaction
256
+ --------------------------------------------------------------------------------
257
+ VendorProtectedControllerTest: test_responds_with_unauthorized_to_invalid_entity
258
+ --------------------------------------------------------------------------------
259
+ Processing by VendorProtectedController#index as HTML
260
+ Vendor Load (0.1ms) SELECT "vendors".* FROM "vendors" WHERE "vendors"."id" = ? LIMIT ? [["id", 0], ["LIMIT", 1]]
261
+ Filter chain halted as :authenticate_vendor rendered or redirected
262
+ Completed 401 Unauthorized in 1ms (ActiveRecord: 0.1ms)
263
+  (0.1ms) rollback transaction
264
+  (0.0ms) begin transaction
265
+ --------------------------------------------------------------------------
266
+ VendorProtectedControllerTest: test_responds_with_success_if_authenticated
267
+ --------------------------------------------------------------------------
268
+ Vendor Load (0.1ms) SELECT "vendors".* FROM "vendors" WHERE "vendors"."id" = ? LIMIT ? [["id", 980190962], ["LIMIT", 1]]
269
+ Processing by VendorProtectedController#index as HTML
270
+ Vendor Load (0.0ms) SELECT "vendors".* FROM "vendors" WHERE "vendors"."id" = ? LIMIT ? [["id", 980190962], ["LIMIT", 1]]
271
+ Completed 200 OK in 1ms (ActiveRecord: 0.0ms)
272
+  (0.1ms) rollback transaction
273
+  (0.0ms) begin transaction
274
+ --------------------------------------------------------------
275
+ VendorProtectedControllerTest: test_responds_with_unauthorized
276
+ --------------------------------------------------------------
277
+ Processing by VendorProtectedController#index as HTML
278
+ Vendor Load (0.1ms) SELECT "vendors".* FROM "vendors" WHERE "vendors"."id" = ? LIMIT ? [["id", nil], ["LIMIT", 1]]
279
+ Filter chain halted as :authenticate_vendor rendered or redirected
280
+ Completed 401 Unauthorized in 1ms (ActiveRecord: 0.1ms)
281
+  (0.1ms) rollback transaction
282
+  (0.1ms) begin transaction
283
+ -------------------------------------------------------------------------------
284
+ VendorProtectedControllerTest: test_responds_with_unauthorized_to_invalid_token
285
+ -------------------------------------------------------------------------------
286
+ Processing by VendorProtectedController#index as HTML
287
+ Filter chain halted as :authenticate_vendor rendered or redirected
288
+ Completed 401 Unauthorized in 0ms (ActiveRecord: 0.0ms)
289
+  (0.1ms) rollback transaction
290
+  (0.1ms) begin transaction
291
+ --------------------------------------------------------------------
292
+ CustomUnauthorizedEntityControllerTest: test_responds_with_not_found
293
+ --------------------------------------------------------------------
294
+ Processing by CustomUnauthorizedEntityController#index as HTML
295
+ User Load (0.1ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT ? [["id", nil], ["LIMIT", 1]]
296
+ Filter chain halted as :authenticate_user rendered or redirected
385
297
  Completed 404 Not Found in 1ms (ActiveRecord: 0.1ms)
386
-  (0.1ms) rollback transaction
387
-  (0.0ms) begin transaction
388
- ---------------------------------------------------------------------------
389
- Knock::AuthTokenControllerTest: test_it's_using_configured_custom_exception
390
- ---------------------------------------------------------------------------
391
-  (0.1ms) rollback transaction
392
-  (0.0ms) begin transaction
393
- ------------------------------------------------------------
394
- Knock::AuthTokenControllerTest: test_response_contains_token
395
- ------------------------------------------------------------
396
- User Load (0.1ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT 1 [["id", 980190962]]
397
- Processing by Knock::AuthTokenController#create as HTML
398
- Parameters: {"auth"=>{"email"=>"one@example.net", "password"=>"[FILTERED]"}}
399
- User Load (0.1ms) SELECT "users".* FROM "users" WHERE "users"."email" = ? LIMIT 1 [["email", "one@example.net"]]
400
- Completed 201 Created in 2ms (Views: 0.2ms | ActiveRecord: 0.1ms)
401
-  (0.1ms) rollback transaction
402
-  (0.1ms) begin transaction
298
+  (0.1ms) rollback transaction
299
+  (0.0ms) begin transaction
300
+ --------------------------------------------------------------------------------------
301
+ CustomUnauthorizedEntityControllerTest: test_responds_with_not_found_to_invalid_entity
302
+ --------------------------------------------------------------------------------------
303
+ Processing by CustomUnauthorizedEntityController#index as HTML
304
+ User Load (0.1ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT ? [["id", 0], ["LIMIT", 1]]
305
+ Filter chain halted as :authenticate_user rendered or redirected
306
+ Completed 404 Not Found in 1ms (ActiveRecord: 0.1ms)
307
+  (0.1ms) rollback transaction
308
+  (0.0ms) begin transaction
309
+ -----------------------------------------------------------------------------------
310
+ CustomUnauthorizedEntityControllerTest: test_responds_with_success_if_authenticated
311
+ -----------------------------------------------------------------------------------
312
+ User Load (0.1ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT ? [["id", 980190962], ["LIMIT", 1]]
313
+ Processing by CustomUnauthorizedEntityController#index as HTML
314
+ User Load (0.0ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT ? [["id", 980190962], ["LIMIT", 1]]
315
+ Completed 200 OK in 1ms (ActiveRecord: 0.0ms)
316
+  (0.1ms) rollback transaction
317
+  (0.0ms) begin transaction
318
+ -------------------------------------------------------------------------------------
319
+ CustomUnauthorizedEntityControllerTest: test_responds_with_not_found_to_invalid_token
320
+ -------------------------------------------------------------------------------------
321
+ Processing by CustomUnauthorizedEntityController#index as HTML
322
+ Filter chain halted as :authenticate_user rendered or redirected
323
+ Completed 404 Not Found in 0ms (ActiveRecord: 0.0ms)
324
+  (0.1ms) rollback transaction
325
+  (0.1ms) begin transaction
403
326
  ------------------------------------------------------------------------
404
327
  TokenControllerGeneratorTest: test_assert_all_files_are_properly_created
405
328
  ------------------------------------------------------------------------
406
-  (0.1ms) rollback transaction
329
+  (0.1ms) rollback transaction
330
+  (0.0ms) begin transaction
331
+ ---------------------------------------------------------------------------
332
+ CompositeNameEntityProtectedControllerTest: test_responds_with_unauthorized
333
+ ---------------------------------------------------------------------------
334
+ Processing by CompositeNameEntityProtectedController#index as HTML
335
+ CompositeNameEntity Load (0.1ms) SELECT "composite_name_entities".* FROM "composite_name_entities" WHERE "composite_name_entities"."id" = ? LIMIT ? [["id", nil], ["LIMIT", 1]]
336
+ Filter chain halted as :authenticate_composite_name_entity rendered or redirected
337
+ Completed 401 Unauthorized in 2ms (ActiveRecord: 0.1ms)
338
+  (0.1ms) rollback transaction
339
+  (0.0ms) begin transaction
340
+ --------------------------------------------------------------------------------------------
341
+ CompositeNameEntityProtectedControllerTest: test_responds_with_unauthorized_to_invalid_token
342
+ --------------------------------------------------------------------------------------------
343
+ Processing by CompositeNameEntityProtectedController#index as HTML
344
+ Filter chain halted as :authenticate_composite_name_entity rendered or redirected
345
+ Completed 401 Unauthorized in 0ms (ActiveRecord: 0.0ms)
346
+  (0.1ms) rollback transaction
347
+  (0.0ms) begin transaction
348
+ ---------------------------------------------------------------------------------------------------------
349
+ CompositeNameEntityProtectedControllerTest: test_has_a_current_composite_name_entity_after_authentication
350
+ ---------------------------------------------------------------------------------------------------------
351
+ CompositeNameEntity Load (0.1ms) SELECT "composite_name_entities".* FROM "composite_name_entities" WHERE "composite_name_entities"."id" = ? LIMIT ? [["id", 980190962], ["LIMIT", 1]]
352
+ Processing by CompositeNameEntityProtectedController#index as HTML
353
+ CompositeNameEntity Load (0.0ms) SELECT "composite_name_entities".* FROM "composite_name_entities" WHERE "composite_name_entities"."id" = ? LIMIT ? [["id", 980190962], ["LIMIT", 1]]
354
+ Completed 200 OK in 1ms (ActiveRecord: 0.0ms)
355
+  (0.1ms) rollback transaction
356
+  (0.0ms) begin transaction
357
+ ---------------------------------------------------------------------------------------------
358
+ CompositeNameEntityProtectedControllerTest: test_responds_with_unauthorized_to_invalid_entity
359
+ ---------------------------------------------------------------------------------------------
360
+ Processing by CompositeNameEntityProtectedController#index as HTML
361
+ CompositeNameEntity Load (0.1ms) SELECT "composite_name_entities".* FROM "composite_name_entities" WHERE "composite_name_entities"."id" = ? LIMIT ? [["id", 0], ["LIMIT", 1]]
362
+ Filter chain halted as :authenticate_composite_name_entity rendered or redirected
363
+ Completed 401 Unauthorized in 1ms (ActiveRecord: 0.1ms)
364
+  (0.1ms) rollback transaction
365
+  (0.0ms) begin transaction
366
+ ---------------------------------------------------------------------------------------
367
+ CompositeNameEntityProtectedControllerTest: test_responds_with_success_if_authenticated
368
+ ---------------------------------------------------------------------------------------
369
+ CompositeNameEntity Load (0.1ms) SELECT "composite_name_entities".* FROM "composite_name_entities" WHERE "composite_name_entities"."id" = ? LIMIT ? [["id", 980190962], ["LIMIT", 1]]
370
+ Processing by CompositeNameEntityProtectedController#index as HTML
371
+ CompositeNameEntity Load (0.0ms) SELECT "composite_name_entities".* FROM "composite_name_entities" WHERE "composite_name_entities"."id" = ? LIMIT ? [["id", 980190962], ["LIMIT", 1]]
372
+ Completed 200 OK in 1ms (ActiveRecord: 0.0ms)
373
+  (0.1ms) rollback transaction
374
+  (0.0ms) begin transaction
375
+ ----------------------------------------------------------------
376
+ InstallGeneratorTest: test_Assert_all_files_are_properly_created
377
+ ----------------------------------------------------------------
378
+  (0.0ms) rollback transaction
379
+  (0.0ms) begin transaction
380
+ -------------------------------------------------------------
381
+ AdminProtectedControllerTest: test_responds_with_unauthorized
382
+ -------------------------------------------------------------
383
+ Processing by AdminProtectedController#index as HTML
384
+ Admin Load (0.1ms) SELECT "admins".* FROM "admins" WHERE "admins"."id" = ? LIMIT ? [["id", nil], ["LIMIT", 1]]
385
+ Filter chain halted as :authenticate_admin rendered or redirected
386
+ Completed 401 Unauthorized in 1ms (ActiveRecord: 0.1ms)
387
+  (0.1ms) rollback transaction
388
+  (0.0ms) begin transaction
389
+ ------------------------------------------------------------------------------
390
+ AdminProtectedControllerTest: test_responds_with_unauthorized_to_invalid_token
391
+ ------------------------------------------------------------------------------
392
+ Processing by AdminProtectedController#index as HTML
393
+ Filter chain halted as :authenticate_admin rendered or redirected
394
+ Completed 401 Unauthorized in 0ms (ActiveRecord: 0.0ms)
395
+  (0.0ms) rollback transaction
396
+  (0.0ms) begin transaction
397
+ ---------------------------------------------------------------------------
398
+ AdminProtectedControllerTest: test_has_a_current_admin_after_authentication
399
+ ---------------------------------------------------------------------------
400
+ Admin Load (0.1ms) SELECT "admins".* FROM "admins" WHERE "admins"."id" = ? LIMIT ? [["id", 980190962], ["LIMIT", 1]]
401
+ Processing by AdminProtectedController#index as HTML
402
+ Admin Load (0.0ms) SELECT "admins".* FROM "admins" WHERE "admins"."id" = ? LIMIT ? [["id", 980190962], ["LIMIT", 1]]
403
+ Completed 200 OK in 1ms (ActiveRecord: 0.0ms)
404
+  (0.1ms) rollback transaction
405
+  (0.0ms) begin transaction
406
+ -------------------------------------------------------------------------
407
+ AdminProtectedControllerTest: test_responds_with_success_if_authenticated
408
+ -------------------------------------------------------------------------
409
+ Admin Load (0.1ms) SELECT "admins".* FROM "admins" WHERE "admins"."id" = ? LIMIT ? [["id", 980190962], ["LIMIT", 1]]
410
+ Processing by AdminProtectedController#index as HTML
411
+ Admin Load (0.0ms) SELECT "admins".* FROM "admins" WHERE "admins"."id" = ? LIMIT ? [["id", 980190962], ["LIMIT", 1]]
412
+ Completed 200 OK in 1ms (ActiveRecord: 0.0ms)
413
+  (0.1ms) rollback transaction
414
+  (0.0ms) begin transaction
415
+ -------------------------------------------------------------------------------
416
+ AdminProtectedControllerTest: test_responds_with_unauthorized_to_invalid_entity
417
+ -------------------------------------------------------------------------------
418
+ Processing by AdminProtectedController#index as HTML
419
+ Admin Load (0.1ms) SELECT "admins".* FROM "admins" WHERE "admins"."id" = ? LIMIT ? [["id", 0], ["LIMIT", 1]]
420
+ Filter chain halted as :authenticate_admin rendered or redirected
421
+ Completed 401 Unauthorized in 1ms (ActiveRecord: 0.1ms)
422
+  (0.1ms) rollback transaction
423
+  (0.0ms) begin transaction
424
+ ---------------------------------------
425
+ KnockTest: test_setup_block_yields_self
426
+ ---------------------------------------
427
+  (0.0ms) rollback transaction