defra_ruby_features 0.1.3 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (69) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +1 -1
  3. data/lib/defra_ruby_features/version.rb +1 -1
  4. metadata +21 -268
  5. data/spec/dummy/Rakefile +0 -8
  6. data/spec/dummy/app/assets/config/manifest.js +0 -3
  7. data/spec/dummy/app/assets/stylesheets/application.css +0 -15
  8. data/spec/dummy/app/channels/application_cable/channel.rb +0 -6
  9. data/spec/dummy/app/channels/application_cable/connection.rb +0 -6
  10. data/spec/dummy/app/controllers/application_controller.rb +0 -4
  11. data/spec/dummy/app/controllers/test_controller.rb +0 -7
  12. data/spec/dummy/app/helpers/application_helper.rb +0 -4
  13. data/spec/dummy/app/javascript/packs/application.js +0 -14
  14. data/spec/dummy/app/jobs/application_job.rb +0 -9
  15. data/spec/dummy/app/models/ability.rb +0 -9
  16. data/spec/dummy/app/models/application_record.rb +0 -5
  17. data/spec/dummy/app/models/feature_toggle.rb +0 -4
  18. data/spec/dummy/app/models/user.rb +0 -8
  19. data/spec/dummy/app/views/layouts/application.html.erb +0 -12
  20. data/spec/dummy/bin/rails +0 -4
  21. data/spec/dummy/bin/rake +0 -4
  22. data/spec/dummy/bin/setup +0 -25
  23. data/spec/dummy/config/application.rb +0 -29
  24. data/spec/dummy/config/boot.rb +0 -7
  25. data/spec/dummy/config/database.yml +0 -21
  26. data/spec/dummy/config/environment.rb +0 -7
  27. data/spec/dummy/config/environments/development.rb +0 -50
  28. data/spec/dummy/config/environments/test.rb +0 -41
  29. data/spec/dummy/config/initializers/application_controller_renderer.rb +0 -10
  30. data/spec/dummy/config/initializers/assets.rb +0 -14
  31. data/spec/dummy/config/initializers/backtrace_silencers.rb +0 -9
  32. data/spec/dummy/config/initializers/content_security_policy.rb +0 -30
  33. data/spec/dummy/config/initializers/cookies_serializer.rb +0 -7
  34. data/spec/dummy/config/initializers/defra_ruby_features.rb +0 -7
  35. data/spec/dummy/config/initializers/devise.rb +0 -311
  36. data/spec/dummy/config/initializers/filter_parameter_logging.rb +0 -6
  37. data/spec/dummy/config/initializers/inflections.rb +0 -18
  38. data/spec/dummy/config/initializers/mime_types.rb +0 -6
  39. data/spec/dummy/config/initializers/wrap_parameters.rb +0 -11
  40. data/spec/dummy/config/locales/devise.en.yml +0 -65
  41. data/spec/dummy/config/locales/en.yml +0 -33
  42. data/spec/dummy/config/routes.rb +0 -7
  43. data/spec/dummy/config.ru +0 -7
  44. data/spec/dummy/db/migrate/20200623125321_create_feature_toggles.rb +0 -12
  45. data/spec/dummy/db/migrate/20200624115316_devise_create_users.rb +0 -44
  46. data/spec/dummy/db/schema.rb +0 -34
  47. data/spec/dummy/db/test.sqlite3 +0 -0
  48. data/spec/dummy/log/test.log +0 -183
  49. data/spec/dummy/public/404.html +0 -67
  50. data/spec/dummy/public/422.html +0 -67
  51. data/spec/dummy/public/500.html +0 -66
  52. data/spec/dummy/public/apple-touch-icon-precomposed.png +0 -0
  53. data/spec/dummy/public/apple-touch-icon.png +0 -0
  54. data/spec/dummy/public/favicon.ico +0 -0
  55. data/spec/dummy/tmp/development_secret.txt +0 -1
  56. data/spec/examples.txt +0 -13
  57. data/spec/factories/feature_toggle.rb +0 -8
  58. data/spec/factories/user.rb +0 -11
  59. data/spec/lib/defra_ruby_mocks/configuration_spec.rb +0 -13
  60. data/spec/rails_helper.rb +0 -54
  61. data/spec/requests/defra_ruby_features/feature_toggles_spec.rb +0 -145
  62. data/spec/spec_helper.rb +0 -83
  63. data/spec/support/database_cleaner.rb +0 -19
  64. data/spec/support/devise.rb +0 -5
  65. data/spec/support/factory_bot.rb +0 -8
  66. data/spec/support/migrations.rb +0 -10
  67. data/spec/support/pry.rb +0 -7
  68. data/spec/support/rails_controller_testing.rb +0 -5
  69. data/spec/support/simplecov.rb +0 -17
@@ -1,44 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- class DeviseCreateUsers < ActiveRecord::Migration[6.0]
4
- def change
5
- create_table :users do |t|
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, null: false
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, null: false # 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
-
36
- t.timestamps null: false
37
- end
38
-
39
- add_index :users, :email, unique: true
40
- add_index :users, :reset_password_token, unique: true
41
- # add_index :users, :confirmation_token, unique: true
42
- # add_index :users, :unlock_token, unique: true
43
- end
44
- end
@@ -1,34 +0,0 @@
1
- # This file is auto-generated from the current state of the database. Instead
2
- # of editing this file, please use the migrations feature of Active Record to
3
- # incrementally modify your database, and then regenerate this schema definition.
4
- #
5
- # This file is the source Rails uses to define your schema when running `rails
6
- # db:schema:load`. When creating a new database, `rails db:schema:load` tends to
7
- # be faster and is potentially less error prone than running all of your
8
- # migrations from scratch. Old migrations may fail to apply correctly if those
9
- # migrations use external dependencies or application code.
10
- #
11
- # It's strongly recommended that you check this file into your version control system.
12
-
13
- ActiveRecord::Schema.define(version: 2020_06_24_115316) do
14
-
15
- create_table "feature_toggles", force: :cascade do |t|
16
- t.string "key"
17
- t.boolean "active"
18
- t.datetime "created_at", precision: 6, null: false
19
- t.datetime "updated_at", precision: 6, null: false
20
- end
21
-
22
- create_table "users", force: :cascade do |t|
23
- t.string "email", default: "", null: false
24
- t.string "encrypted_password", default: "", null: false
25
- t.string "reset_password_token"
26
- t.datetime "reset_password_sent_at"
27
- t.datetime "remember_created_at"
28
- t.datetime "created_at", precision: 6, null: false
29
- t.datetime "updated_at", precision: 6, null: false
30
- t.index ["email"], name: "index_users_on_email", unique: true
31
- t.index ["reset_password_token"], name: "index_users_on_reset_password_token", unique: true
32
- end
33
-
34
- end
Binary file
@@ -1,183 +0,0 @@
1
-  (4.1ms) SELECT sqlite_version(*)
2
-  (2.8ms) SELECT sqlite_version(*)
3
-  (0.1ms) SELECT sqlite_version(*)
4
-  (0.1ms) SELECT sqlite_version(*)
5
-  (0.8ms) DROP TABLE IF EXISTS "feature_toggles"
6
-  (5.2ms) CREATE TABLE "feature_toggles" ("id" integer PRIMARY KEY AUTOINCREMENT NOT NULL, "key" varchar, "active" boolean, "created_at" datetime(6) NOT NULL, "updated_at" datetime(6) NOT NULL)
7
-  (1.3ms) DROP TABLE IF EXISTS "users"
8
-  (3.5ms) CREATE TABLE "users" ("id" integer PRIMARY KEY AUTOINCREMENT NOT NULL, "email" varchar DEFAULT '' NOT NULL, "encrypted_password" varchar DEFAULT '' NOT NULL, "reset_password_token" varchar, "reset_password_sent_at" datetime, "remember_created_at" datetime, "created_at" datetime(6) NOT NULL, "updated_at" datetime(6) NOT NULL)
9
-  (3.4ms) CREATE UNIQUE INDEX "index_users_on_email" ON "users" ("email")
10
-  (5.0ms) CREATE UNIQUE INDEX "index_users_on_reset_password_token" ON "users" ("reset_password_token")
11
-  (5.5ms) CREATE TABLE "schema_migrations" ("version" varchar NOT NULL PRIMARY KEY)
12
-  (0.8ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC
13
-  (7.3ms) INSERT INTO "schema_migrations" (version) VALUES (20200624115316)
14
-  (4.3ms) INSERT INTO "schema_migrations" (version) VALUES
15
- (20200623125321);
16
-
17
- 
18
-  (3.6ms) CREATE TABLE "ar_internal_metadata" ("key" varchar NOT NULL PRIMARY KEY, "value" varchar, "created_at" datetime(6) NOT NULL, "updated_at" datetime(6) NOT NULL)
19
- ActiveRecord::InternalMetadata Load (0.5ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = ? LIMIT ? [["key", "environment"], ["LIMIT", 1]]
20
-  (0.0ms) begin transaction
21
- ActiveRecord::InternalMetadata Create (4.7ms) INSERT INTO "ar_internal_metadata" ("key", "value", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["key", "environment"], ["value", "test"], ["created_at", "2021-08-06 12:51:19.473267"], ["updated_at", "2021-08-06 12:51:19.473267"]]
22
-  (2.2ms) commit transaction
23
- ActiveRecord::InternalMetadata Load (0.4ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = ? LIMIT ? [["key", "environment"], ["LIMIT", 1]]
24
- ActiveRecord::InternalMetadata Load (0.4ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = ? LIMIT ? [["key", "schema_sha1"], ["LIMIT", 1]]
25
-  (0.0ms) begin transaction
26
- ActiveRecord::InternalMetadata Create (1.6ms) INSERT INTO "ar_internal_metadata" ("key", "value", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["key", "schema_sha1"], ["value", "8dfe9119086661dc796fa00452dc81ff692523f5"], ["created_at", "2021-08-06 12:51:19.484405"], ["updated_at", "2021-08-06 12:51:19.484405"]]
27
-  (1.7ms) commit transaction
28
-  (0.1ms) SELECT sqlite_version(*)
29
-  (0.9ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC
30
-  (0.1ms) PRAGMA foreign_keys
31
-  (0.2ms) PRAGMA defer_foreign_keys
32
-  (0.1ms) PRAGMA defer_foreign_keys = ON
33
-  (0.1ms) PRAGMA foreign_keys = OFF
34
-  (0.2ms) TRUNCATE TABLE "feature_toggles"
35
-  (4.2ms) DELETE FROM "feature_toggles"
36
-  (0.8ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';
37
-  (0.8ms) DELETE FROM sqlite_sequence where name = 'feature_toggles';
38
-  (0.1ms) TRUNCATE TABLE "users"
39
-  (3.8ms) DELETE FROM "users"
40
-  (1.0ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';
41
-  (0.7ms) DELETE FROM sqlite_sequence where name = 'users';
42
-  (0.1ms) PRAGMA defer_foreign_keys = 0
43
-  (0.0ms) PRAGMA foreign_keys = 1
44
-  (0.1ms) begin transaction
45
-  (0.2ms) SAVEPOINT active_record_1
46
- Started POST "/feature-toggles" for 127.0.0.1 at 2021-08-06 13:51:20 +0100
47
- Processing by DefraRubyFeatures::FeatureTogglesController#create as HTML
48
- Completed 401 Unauthorized in 20ms (ActiveRecord: 0.0ms | Allocations: 1299)
49
-  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1
50
-  (0.0ms) rollback transaction
51
-  (0.1ms) begin transaction
52
-  (0.1ms) SAVEPOINT active_record_1
53
-  (0.1ms) SAVEPOINT active_record_2
54
- User Exists? (0.1ms) SELECT 1 AS one FROM "users" WHERE "users"."email" = ? LIMIT ? [["email", "user1@example.com"], ["LIMIT", 1]]
55
- User Create (3.7ms) INSERT INTO "users" ("email", "encrypted_password", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["email", "user1@example.com"], ["encrypted_password", "$2a$04$iUS5.qGdog4sXCgsYakmOei.FTHwOT7IkxG4yQHodGAGOW77izwMO"], ["created_at", "2021-08-06 12:51:20.976768"], ["updated_at", "2021-08-06 12:51:20.976768"]]
56
-  (0.1ms) RELEASE SAVEPOINT active_record_2
57
-  (0.1ms) SELECT COUNT(*) FROM "feature_toggles"
58
- Started POST "/feature-toggles" for 127.0.0.1 at 2021-08-06 13:51:20 +0100
59
- Processing by DefraRubyFeatures::FeatureTogglesController#create as HTML
60
- Parameters: {"feature_toggle"=>{"key"=>"test", "active"=>"1"}}
61
-  (0.1ms) SAVEPOINT active_record_2
62
- FeatureToggle Create (0.6ms) INSERT INTO "feature_toggles" ("key", "active", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["key", "test"], ["active", 1], ["created_at", "2021-08-06 12:51:21.038144"], ["updated_at", "2021-08-06 12:51:21.038144"]]
63
-  (0.1ms) RELEASE SAVEPOINT active_record_2
64
- Redirected to http://www.example.com/feature-toggles
65
- Completed 302 Found in 16ms (ActiveRecord: 1.0ms | Allocations: 3345)
66
- FeatureToggle Load (0.1ms) SELECT "feature_toggles".* FROM "feature_toggles" ORDER BY "feature_toggles"."id" DESC LIMIT ? [["LIMIT", 1]]
67
-  (0.1ms) SELECT COUNT(*) FROM "feature_toggles"
68
-  (2.4ms) ROLLBACK TO SAVEPOINT active_record_1
69
-  (3.5ms) rollback transaction
70
-  (0.1ms) begin transaction
71
-  (0.2ms) SAVEPOINT active_record_1
72
-  (0.1ms) SAVEPOINT active_record_2
73
- User Exists? (1.3ms) SELECT 1 AS one FROM "users" WHERE "users"."email" = ? LIMIT ? [["email", "user2@example.com"], ["LIMIT", 1]]
74
- User Create (3.2ms) INSERT INTO "users" ("email", "encrypted_password", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["email", "user2@example.com"], ["encrypted_password", "$2a$04$jsi1p0/0Ar0y7fGP1/zHyeZPObwDM2dqc3gU.L7hC4nRz8LCMNrmG"], ["created_at", "2021-08-06 12:51:21.088987"], ["updated_at", "2021-08-06 12:51:21.088987"]]
75
-  (0.1ms) RELEASE SAVEPOINT active_record_2
76
-  (0.1ms) SAVEPOINT active_record_2
77
- FeatureToggle Create (0.4ms) INSERT INTO "feature_toggles" ("key", "active", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["key", "a_feature_toggle"], ["active", 0], ["created_at", "2021-08-06 12:51:21.094840"], ["updated_at", "2021-08-06 12:51:21.094840"]]
78
-  (0.1ms) RELEASE SAVEPOINT active_record_2
79
- Started GET "/feature-toggles" for 127.0.0.1 at 2021-08-06 13:51:21 +0100
80
- Processing by DefraRubyFeatures::FeatureTogglesController#index as HTML
81
- Rendering /vagrant/defra-ruby-features/app/views/defra_ruby_features/feature_toggles/index.html.erb within layouts/application
82
- FeatureToggle Load (0.2ms) SELECT "feature_toggles".* FROM "feature_toggles" ORDER BY "feature_toggles"."key" ASC
83
- Rendered /vagrant/defra-ruby-features/app/views/defra_ruby_features/feature_toggles/index.html.erb within layouts/application (Duration: 34.8ms | Allocations: 2970)
84
- Completed 200 OK in 83ms (Views: 54.0ms | ActiveRecord: 0.2ms | Allocations: 5489)
85
-  (1.2ms) ROLLBACK TO SAVEPOINT active_record_1
86
-  (3.4ms) rollback transaction
87
-  (0.1ms) begin transaction
88
-  (0.1ms) SAVEPOINT active_record_1
89
- Started GET "/feature-toggles" for 127.0.0.1 at 2021-08-06 13:51:21 +0100
90
- Processing by DefraRubyFeatures::FeatureTogglesController#index as HTML
91
- Completed 401 Unauthorized in 0ms (ActiveRecord: 0.0ms | Allocations: 142)
92
-  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1
93
-  (0.4ms) rollback transaction
94
-  (0.1ms) begin transaction
95
-  (0.1ms) SAVEPOINT active_record_1
96
- Started GET "/feature-toggles/new" for 127.0.0.1 at 2021-08-06 13:51:21 +0100
97
- Processing by DefraRubyFeatures::FeatureTogglesController#new as HTML
98
- Completed 401 Unauthorized in 2ms (ActiveRecord: 0.0ms | Allocations: 142)
99
-  (0.2ms) ROLLBACK TO SAVEPOINT active_record_1
100
-  (0.3ms) rollback transaction
101
-  (0.1ms) begin transaction
102
-  (0.1ms) SAVEPOINT active_record_1
103
-  (0.2ms) SAVEPOINT active_record_2
104
- User Exists? (3.3ms) SELECT 1 AS one FROM "users" WHERE "users"."email" = ? LIMIT ? [["email", "user3@example.com"], ["LIMIT", 1]]
105
- User Create (5.9ms) INSERT INTO "users" ("email", "encrypted_password", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["email", "user3@example.com"], ["encrypted_password", "$2a$04$nHdYInVG3xbiDtw4Jw.bLe4P0uZkJZe3uNxRisaeyOPph6PzFPzmq"], ["created_at", "2021-08-06 12:51:21.358235"], ["updated_at", "2021-08-06 12:51:21.358235"]]
106
-  (0.3ms) RELEASE SAVEPOINT active_record_2
107
- Started GET "/feature-toggles/new" for 127.0.0.1 at 2021-08-06 13:51:21 +0100
108
- Processing by DefraRubyFeatures::FeatureTogglesController#new as HTML
109
- Rendering /vagrant/defra-ruby-features/app/views/defra_ruby_features/feature_toggles/new.html.erb within layouts/application
110
- Rendered /vagrant/defra-ruby-features/app/views/shared/_back.html.erb (Duration: 2.4ms | Allocations: 155)
111
- Rendered /vagrant/defra-ruby-features/app/views/defra_ruby_features/feature_toggles/new.html.erb within layouts/application (Duration: 36.3ms | Allocations: 1838)
112
- Completed 200 OK in 42ms (Views: 37.3ms | ActiveRecord: 0.0ms | Allocations: 2492)
113
-  (1.8ms) ROLLBACK TO SAVEPOINT active_record_1
114
-  (3.2ms) rollback transaction
115
-  (0.1ms) begin transaction
116
-  (0.1ms) SAVEPOINT active_record_1
117
-  (0.1ms) SAVEPOINT active_record_2
118
- User Exists? (2.4ms) SELECT 1 AS one FROM "users" WHERE "users"."email" = ? LIMIT ? [["email", "user4@example.com"], ["LIMIT", 1]]
119
- User Create (5.1ms) INSERT INTO "users" ("email", "encrypted_password", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["email", "user4@example.com"], ["encrypted_password", "$2a$04$UMVahNCaBWKqX6A4gjPIT.7DooXuOcbGucB7VJuXbMKmW/GWLaGDa"], ["created_at", "2021-08-06 12:51:21.476921"], ["updated_at", "2021-08-06 12:51:21.476921"]]
120
-  (0.1ms) RELEASE SAVEPOINT active_record_2
121
-  (0.1ms) SAVEPOINT active_record_2
122
- FeatureToggle Create (0.6ms) INSERT INTO "feature_toggles" ("key", "active", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["key", "test-feature"], ["active", 0], ["created_at", "2021-08-06 12:51:21.484143"], ["updated_at", "2021-08-06 12:51:21.484143"]]
123
-  (0.1ms) RELEASE SAVEPOINT active_record_2
124
- Started PUT "/feature-toggles/1" for 127.0.0.1 at 2021-08-06 13:51:21 +0100
125
- Processing by DefraRubyFeatures::FeatureTogglesController#update as HTML
126
- Parameters: {"feature_toggle"=>{"active"=>"1"}, "id"=>"1"}
127
- FeatureToggle Load (0.2ms) SELECT "feature_toggles".* FROM "feature_toggles" WHERE "feature_toggles"."id" = ? LIMIT ? [["id", 1], ["LIMIT", 1]]
128
-  (0.1ms) SAVEPOINT active_record_2
129
- FeatureToggle Update (0.2ms) UPDATE "feature_toggles" SET "active" = ?, "updated_at" = ? WHERE "feature_toggles"."id" = ? [["active", 1], ["updated_at", "2021-08-06 12:51:21.527368"], ["id", 1]]
130
-  (0.1ms) RELEASE SAVEPOINT active_record_2
131
- Redirected to http://www.example.com/feature-toggles
132
- Completed 302 Found in 5ms (ActiveRecord: 0.5ms | Allocations: 954)
133
- FeatureToggle Load (0.1ms) SELECT "feature_toggles".* FROM "feature_toggles" WHERE "feature_toggles"."id" = ? LIMIT ? [["id", 1], ["LIMIT", 1]]
134
-  (2.1ms) ROLLBACK TO SAVEPOINT active_record_1
135
-  (5.2ms) rollback transaction
136
-  (0.1ms) begin transaction
137
-  (0.1ms) SAVEPOINT active_record_1
138
-  (0.1ms) SAVEPOINT active_record_2
139
- FeatureToggle Create (6.6ms) INSERT INTO "feature_toggles" ("key", "active", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["key", "test-feature"], ["active", 0], ["created_at", "2021-08-06 12:51:21.543758"], ["updated_at", "2021-08-06 12:51:21.543758"]]
140
-  (0.2ms) RELEASE SAVEPOINT active_record_2
141
- Started PUT "/feature-toggles/1" for 127.0.0.1 at 2021-08-06 13:51:21 +0100
142
- Processing by DefraRubyFeatures::FeatureTogglesController#update as HTML
143
- Parameters: {"id"=>"1"}
144
- Completed 401 Unauthorized in 0ms (ActiveRecord: 0.0ms | Allocations: 142)
145
-  (1.2ms) ROLLBACK TO SAVEPOINT active_record_1
146
-  (4.0ms) rollback transaction
147
-  (0.1ms) begin transaction
148
-  (0.1ms) SAVEPOINT active_record_1
149
-  (0.1ms) SAVEPOINT active_record_2
150
- FeatureToggle Create (4.9ms) INSERT INTO "feature_toggles" ("key", "active", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["key", "test-feature"], ["active", 0], ["created_at", "2021-08-06 12:51:21.608479"], ["updated_at", "2021-08-06 12:51:21.608479"]]
151
-  (0.1ms) RELEASE SAVEPOINT active_record_2
152
-  (0.2ms) SAVEPOINT active_record_2
153
- User Exists? (0.2ms) SELECT 1 AS one FROM "users" WHERE "users"."email" = ? LIMIT ? [["email", "user5@example.com"], ["LIMIT", 1]]
154
- User Create (1.9ms) INSERT INTO "users" ("email", "encrypted_password", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["email", "user5@example.com"], ["encrypted_password", "$2a$04$VdY5k.4NFNeiRIbPU8g9AuIqdowe1uhKR3iJpD5dfAoe6d3iDAcKS"], ["created_at", "2021-08-06 12:51:21.619986"], ["updated_at", "2021-08-06 12:51:21.619986"]]
155
-  (0.2ms) RELEASE SAVEPOINT active_record_2
156
-  (0.2ms) SELECT COUNT(*) FROM "feature_toggles"
157
- Started DELETE "/feature-toggles/1" for 127.0.0.1 at 2021-08-06 13:51:21 +0100
158
- Processing by DefraRubyFeatures::FeatureTogglesController#destroy as HTML
159
- Parameters: {"id"=>"1"}
160
- FeatureToggle Load (0.1ms) SELECT "feature_toggles".* FROM "feature_toggles" WHERE "feature_toggles"."id" = ? LIMIT ? [["id", 1], ["LIMIT", 1]]
161
-  (0.1ms) SAVEPOINT active_record_2
162
- FeatureToggle Destroy (0.1ms) DELETE FROM "feature_toggles" WHERE "feature_toggles"."id" = ? [["id", 1]]
163
-  (0.1ms) RELEASE SAVEPOINT active_record_2
164
- Redirected to http://www.example.com/feature-toggles
165
- Completed 302 Found in 3ms (ActiveRecord: 0.4ms | Allocations: 538)
166
-  (0.1ms) SELECT COUNT(*) FROM "feature_toggles"
167
-  (2.4ms) ROLLBACK TO SAVEPOINT active_record_1
168
-  (5.0ms) rollback transaction
169
-  (0.1ms) begin transaction
170
-  (0.1ms) SAVEPOINT active_record_1
171
-  (0.1ms) SAVEPOINT active_record_2
172
- FeatureToggle Create (7.4ms) INSERT INTO "feature_toggles" ("key", "active", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["key", "test-feature"], ["active", 0], ["created_at", "2021-08-06 12:51:21.703601"], ["updated_at", "2021-08-06 12:51:21.703601"]]
173
-  (0.1ms) RELEASE SAVEPOINT active_record_2
174
- Started DELETE "/feature-toggles/1" for 127.0.0.1 at 2021-08-06 13:51:21 +0100
175
- Processing by DefraRubyFeatures::FeatureTogglesController#destroy as HTML
176
- Parameters: {"id"=>"1"}
177
- Completed 401 Unauthorized in 0ms (ActiveRecord: 0.0ms | Allocations: 142)
178
-  (0.9ms) ROLLBACK TO SAVEPOINT active_record_1
179
-  (3.5ms) rollback transaction
180
-  (0.1ms) begin transaction
181
-  (0.2ms) SAVEPOINT active_record_1
182
-  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1
183
-  (0.1ms) rollback transaction
@@ -1,67 +0,0 @@
1
- <!DOCTYPE html>
2
- <html>
3
- <head>
4
- <title>The page you were looking for doesn't exist (404)</title>
5
- <meta name="viewport" content="width=device-width,initial-scale=1">
6
- <style>
7
- .rails-default-error-page {
8
- background-color: #EFEFEF;
9
- color: #2E2F30;
10
- text-align: center;
11
- font-family: arial, sans-serif;
12
- margin: 0;
13
- }
14
-
15
- .rails-default-error-page div.dialog {
16
- width: 95%;
17
- max-width: 33em;
18
- margin: 4em auto 0;
19
- }
20
-
21
- .rails-default-error-page div.dialog > div {
22
- border: 1px solid #CCC;
23
- border-right-color: #999;
24
- border-left-color: #999;
25
- border-bottom-color: #BBB;
26
- border-top: #B00100 solid 4px;
27
- border-top-left-radius: 9px;
28
- border-top-right-radius: 9px;
29
- background-color: white;
30
- padding: 7px 12% 0;
31
- box-shadow: 0 3px 8px rgba(50, 50, 50, 0.17);
32
- }
33
-
34
- .rails-default-error-page h1 {
35
- font-size: 100%;
36
- color: #730E15;
37
- line-height: 1.5em;
38
- }
39
-
40
- .rails-default-error-page div.dialog > p {
41
- margin: 0 0 1em;
42
- padding: 1em;
43
- background-color: #F7F7F7;
44
- border: 1px solid #CCC;
45
- border-right-color: #999;
46
- border-left-color: #999;
47
- border-bottom-color: #999;
48
- border-bottom-left-radius: 4px;
49
- border-bottom-right-radius: 4px;
50
- border-top-color: #DADADA;
51
- color: #666;
52
- box-shadow: 0 3px 8px rgba(50, 50, 50, 0.17);
53
- }
54
- </style>
55
- </head>
56
-
57
- <body class="rails-default-error-page">
58
- <!-- This file lives in public/404.html -->
59
- <div class="dialog">
60
- <div>
61
- <h1>The page you were looking for doesn't exist.</h1>
62
- <p>You may have mistyped the address or the page may have moved.</p>
63
- </div>
64
- <p>If you are the application owner check the logs for more information.</p>
65
- </div>
66
- </body>
67
- </html>
@@ -1,67 +0,0 @@
1
- <!DOCTYPE html>
2
- <html>
3
- <head>
4
- <title>The change you wanted was rejected (422)</title>
5
- <meta name="viewport" content="width=device-width,initial-scale=1">
6
- <style>
7
- .rails-default-error-page {
8
- background-color: #EFEFEF;
9
- color: #2E2F30;
10
- text-align: center;
11
- font-family: arial, sans-serif;
12
- margin: 0;
13
- }
14
-
15
- .rails-default-error-page div.dialog {
16
- width: 95%;
17
- max-width: 33em;
18
- margin: 4em auto 0;
19
- }
20
-
21
- .rails-default-error-page div.dialog > div {
22
- border: 1px solid #CCC;
23
- border-right-color: #999;
24
- border-left-color: #999;
25
- border-bottom-color: #BBB;
26
- border-top: #B00100 solid 4px;
27
- border-top-left-radius: 9px;
28
- border-top-right-radius: 9px;
29
- background-color: white;
30
- padding: 7px 12% 0;
31
- box-shadow: 0 3px 8px rgba(50, 50, 50, 0.17);
32
- }
33
-
34
- .rails-default-error-page h1 {
35
- font-size: 100%;
36
- color: #730E15;
37
- line-height: 1.5em;
38
- }
39
-
40
- .rails-default-error-page div.dialog > p {
41
- margin: 0 0 1em;
42
- padding: 1em;
43
- background-color: #F7F7F7;
44
- border: 1px solid #CCC;
45
- border-right-color: #999;
46
- border-left-color: #999;
47
- border-bottom-color: #999;
48
- border-bottom-left-radius: 4px;
49
- border-bottom-right-radius: 4px;
50
- border-top-color: #DADADA;
51
- color: #666;
52
- box-shadow: 0 3px 8px rgba(50, 50, 50, 0.17);
53
- }
54
- </style>
55
- </head>
56
-
57
- <body class="rails-default-error-page">
58
- <!-- This file lives in public/422.html -->
59
- <div class="dialog">
60
- <div>
61
- <h1>The change you wanted was rejected.</h1>
62
- <p>Maybe you tried to change something you didn't have access to.</p>
63
- </div>
64
- <p>If you are the application owner check the logs for more information.</p>
65
- </div>
66
- </body>
67
- </html>
@@ -1,66 +0,0 @@
1
- <!DOCTYPE html>
2
- <html>
3
- <head>
4
- <title>We're sorry, but something went wrong (500)</title>
5
- <meta name="viewport" content="width=device-width,initial-scale=1">
6
- <style>
7
- .rails-default-error-page {
8
- background-color: #EFEFEF;
9
- color: #2E2F30;
10
- text-align: center;
11
- font-family: arial, sans-serif;
12
- margin: 0;
13
- }
14
-
15
- .rails-default-error-page div.dialog {
16
- width: 95%;
17
- max-width: 33em;
18
- margin: 4em auto 0;
19
- }
20
-
21
- .rails-default-error-page div.dialog > div {
22
- border: 1px solid #CCC;
23
- border-right-color: #999;
24
- border-left-color: #999;
25
- border-bottom-color: #BBB;
26
- border-top: #B00100 solid 4px;
27
- border-top-left-radius: 9px;
28
- border-top-right-radius: 9px;
29
- background-color: white;
30
- padding: 7px 12% 0;
31
- box-shadow: 0 3px 8px rgba(50, 50, 50, 0.17);
32
- }
33
-
34
- .rails-default-error-page h1 {
35
- font-size: 100%;
36
- color: #730E15;
37
- line-height: 1.5em;
38
- }
39
-
40
- .rails-default-error-page div.dialog > p {
41
- margin: 0 0 1em;
42
- padding: 1em;
43
- background-color: #F7F7F7;
44
- border: 1px solid #CCC;
45
- border-right-color: #999;
46
- border-left-color: #999;
47
- border-bottom-color: #999;
48
- border-bottom-left-radius: 4px;
49
- border-bottom-right-radius: 4px;
50
- border-top-color: #DADADA;
51
- color: #666;
52
- box-shadow: 0 3px 8px rgba(50, 50, 50, 0.17);
53
- }
54
- </style>
55
- </head>
56
-
57
- <body class="rails-default-error-page">
58
- <!-- This file lives in public/500.html -->
59
- <div class="dialog">
60
- <div>
61
- <h1>We're sorry, but something went wrong.</h1>
62
- </div>
63
- <p>If you are the application owner check the logs for more information.</p>
64
- </div>
65
- </body>
66
- </html>
File without changes
File without changes
File without changes
@@ -1 +0,0 @@
1
- f532ac46f80b1fb4c4c481203b97d17571f80ddaf2e63a84b21ef6c57c452a82a8d5c7c443dba51d41adcb9234c4ba3de3a3493d897915e463ca98fe6cb418b0
data/spec/examples.txt DELETED
@@ -1,13 +0,0 @@
1
- example_id | status | run_time |
2
- -------------------------------------------------------------------- | ------ | --------------- |
3
- ./spec/lib/defra_ruby_mocks/configuration_spec.rb[1:1] | passed | 0.00337 seconds |
4
- ./spec/requests/defra_ruby_features/feature_toggles_spec.rb[1:1:1:1] | passed | 0.17293 seconds |
5
- ./spec/requests/defra_ruby_features/feature_toggles_spec.rb[1:1:2:1] | passed | 0.0334 seconds |
6
- ./spec/requests/defra_ruby_features/feature_toggles_spec.rb[1:2:1:1] | passed | 0.16187 seconds |
7
- ./spec/requests/defra_ruby_features/feature_toggles_spec.rb[1:2:2:1] | passed | 0.15559 seconds |
8
- ./spec/requests/defra_ruby_features/feature_toggles_spec.rb[1:3:1:1] | passed | 0.07179 seconds |
9
- ./spec/requests/defra_ruby_features/feature_toggles_spec.rb[1:3:2:1] | passed | 0.0641 seconds |
10
- ./spec/requests/defra_ruby_features/feature_toggles_spec.rb[1:4:1:1] | passed | 0.12075 seconds |
11
- ./spec/requests/defra_ruby_features/feature_toggles_spec.rb[1:4:2:1] | passed | 0.05853 seconds |
12
- ./spec/requests/defra_ruby_features/feature_toggles_spec.rb[1:5:1:1] | passed | 0.09376 seconds |
13
- ./spec/requests/defra_ruby_features/feature_toggles_spec.rb[1:5:2:1] | passed | 0.05941 seconds |
@@ -1,8 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- FactoryBot.define do
4
- factory :feature_toggle do
5
- key { "test-feature" }
6
- active { false }
7
- end
8
- end
@@ -1,11 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- FactoryBot.define do
4
- factory :user do
5
- sequence :email do |n|
6
- "user#{n}@example.com"
7
- end
8
-
9
- password { "Secret123" }
10
- end
11
- end
@@ -1,13 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require "rails_helper"
4
-
5
- module DefraRubyFeatures
6
- RSpec.describe Configuration do
7
- let(:subject) { described_class.new }
8
-
9
- it "sets the appropriate default config settings" do
10
- expect(subject.feature_toggle_model_name).to be_nil
11
- end
12
- end
13
- end
data/spec/rails_helper.rb DELETED
@@ -1,54 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- # This file is copied to spec/ when you run 'rails generate rspec:install'
4
- require "spec_helper"
5
- ENV["RAILS_ENV"] ||= "test"
6
- require File.expand_path("dummy/config/environment", __dir__)
7
-
8
- # Prevent database truncation if the environment is production
9
- abort("The Rails environment is running in production mode!") if Rails.env.production?
10
- require "rspec/rails"
11
- # Add additional requires below this line. Rails is not loaded until this point!
12
-
13
- # Requires supporting ruby files with custom matchers and macros, etc, in
14
- # spec/support/ and its subdirectories. Files matching `spec/**/*_spec.rb` are
15
- # run as spec files by default. This means that files in spec/support that end
16
- # in _spec.rb will both be required and run as specs, causing the specs to be
17
- # run twice. It is recommended that you do not name files matching this glob to
18
- # end with _spec.rb. You can configure this pattern with the --pattern
19
- # option on the command line or in ~/.rspec, .rspec or `.rspec-local`.
20
- #
21
- # We make an exception for simplecov because that will already have been
22
- # required and run at the very top of spec_helper.rb
23
- support_files = Dir["./spec/support/**/*.rb"].reject { |file| file == "./spec/support/simplecov.rb" }
24
- support_files.each { |f| require f }
25
-
26
- RSpec.configure do |config|
27
- # If you're not using ActiveRecord, or you'd prefer not to run each of your
28
- # examples within a transaction, remove the following line or assign false
29
- # instead of true.
30
- config.use_transactional_fixtures = true
31
-
32
- # You can uncomment this line to turn off ActiveRecord support entirely.
33
- # config.use_active_record = false
34
-
35
- # RSpec Rails can automatically mix in different behaviours to your tests
36
- # based on their file location, for example enabling you to call `get` and
37
- # `post` in specs under `spec/controllers`.
38
- #
39
- # You can disable this behaviour by removing the line below, and instead
40
- # explicitly tag your specs with their type, e.g.:
41
- #
42
- # RSpec.describe UsersController, type: :controller do
43
- # # ...
44
- # end
45
- #
46
- # The different available types are documented in the features, such as in
47
- # https://relishapp.com/rspec/rspec-rails/docs
48
- config.infer_spec_type_from_file_location!
49
-
50
- # Filter lines from Rails gems in backtraces.
51
- config.filter_rails_from_backtrace!
52
- # arbitrary gems may also be filtered via:
53
- # config.filter_gems_from_backtrace("gem name")
54
- end