defra_ruby_features 0.1.3 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +1 -1
- data/lib/defra_ruby_features/version.rb +1 -1
- metadata +21 -268
- data/spec/dummy/Rakefile +0 -8
- data/spec/dummy/app/assets/config/manifest.js +0 -3
- data/spec/dummy/app/assets/stylesheets/application.css +0 -15
- data/spec/dummy/app/channels/application_cable/channel.rb +0 -6
- data/spec/dummy/app/channels/application_cable/connection.rb +0 -6
- data/spec/dummy/app/controllers/application_controller.rb +0 -4
- data/spec/dummy/app/controllers/test_controller.rb +0 -7
- data/spec/dummy/app/helpers/application_helper.rb +0 -4
- data/spec/dummy/app/javascript/packs/application.js +0 -14
- data/spec/dummy/app/jobs/application_job.rb +0 -9
- data/spec/dummy/app/models/ability.rb +0 -9
- data/spec/dummy/app/models/application_record.rb +0 -5
- data/spec/dummy/app/models/feature_toggle.rb +0 -4
- data/spec/dummy/app/models/user.rb +0 -8
- data/spec/dummy/app/views/layouts/application.html.erb +0 -12
- data/spec/dummy/bin/rails +0 -4
- data/spec/dummy/bin/rake +0 -4
- data/spec/dummy/bin/setup +0 -25
- data/spec/dummy/config/application.rb +0 -29
- data/spec/dummy/config/boot.rb +0 -7
- data/spec/dummy/config/database.yml +0 -21
- data/spec/dummy/config/environment.rb +0 -7
- data/spec/dummy/config/environments/development.rb +0 -50
- data/spec/dummy/config/environments/test.rb +0 -41
- data/spec/dummy/config/initializers/application_controller_renderer.rb +0 -10
- data/spec/dummy/config/initializers/assets.rb +0 -14
- data/spec/dummy/config/initializers/backtrace_silencers.rb +0 -9
- data/spec/dummy/config/initializers/content_security_policy.rb +0 -30
- data/spec/dummy/config/initializers/cookies_serializer.rb +0 -7
- data/spec/dummy/config/initializers/defra_ruby_features.rb +0 -7
- data/spec/dummy/config/initializers/devise.rb +0 -311
- data/spec/dummy/config/initializers/filter_parameter_logging.rb +0 -6
- data/spec/dummy/config/initializers/inflections.rb +0 -18
- data/spec/dummy/config/initializers/mime_types.rb +0 -6
- data/spec/dummy/config/initializers/wrap_parameters.rb +0 -11
- data/spec/dummy/config/locales/devise.en.yml +0 -65
- data/spec/dummy/config/locales/en.yml +0 -33
- data/spec/dummy/config/routes.rb +0 -7
- data/spec/dummy/config.ru +0 -7
- data/spec/dummy/db/migrate/20200623125321_create_feature_toggles.rb +0 -12
- data/spec/dummy/db/migrate/20200624115316_devise_create_users.rb +0 -44
- data/spec/dummy/db/schema.rb +0 -34
- data/spec/dummy/db/test.sqlite3 +0 -0
- data/spec/dummy/log/test.log +0 -183
- data/spec/dummy/public/404.html +0 -67
- data/spec/dummy/public/422.html +0 -67
- data/spec/dummy/public/500.html +0 -66
- data/spec/dummy/public/apple-touch-icon-precomposed.png +0 -0
- data/spec/dummy/public/apple-touch-icon.png +0 -0
- data/spec/dummy/public/favicon.ico +0 -0
- data/spec/dummy/tmp/development_secret.txt +0 -1
- data/spec/examples.txt +0 -13
- data/spec/factories/feature_toggle.rb +0 -8
- data/spec/factories/user.rb +0 -11
- data/spec/lib/defra_ruby_mocks/configuration_spec.rb +0 -13
- data/spec/rails_helper.rb +0 -54
- data/spec/requests/defra_ruby_features/feature_toggles_spec.rb +0 -145
- data/spec/spec_helper.rb +0 -83
- data/spec/support/database_cleaner.rb +0 -19
- data/spec/support/devise.rb +0 -5
- data/spec/support/factory_bot.rb +0 -8
- data/spec/support/migrations.rb +0 -10
- data/spec/support/pry.rb +0 -7
- data/spec/support/rails_controller_testing.rb +0 -5
- 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
|
data/spec/dummy/db/schema.rb
DELETED
@@ -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
|
data/spec/dummy/db/test.sqlite3
DELETED
Binary file
|
data/spec/dummy/log/test.log
DELETED
@@ -1,183 +0,0 @@
|
|
1
|
-
[1m[35m (4.1ms)[0m [1m[34mSELECT sqlite_version(*)[0m
|
2
|
-
[1m[35m (2.8ms)[0m [1m[34mSELECT sqlite_version(*)[0m
|
3
|
-
[1m[35m (0.1ms)[0m [1m[34mSELECT sqlite_version(*)[0m
|
4
|
-
[1m[35m (0.1ms)[0m [1m[34mSELECT sqlite_version(*)[0m
|
5
|
-
[1m[35m (0.8ms)[0m [1m[35mDROP TABLE IF EXISTS "feature_toggles"[0m
|
6
|
-
[1m[35m (5.2ms)[0m [1m[35mCREATE 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)[0m
|
7
|
-
[1m[35m (1.3ms)[0m [1m[35mDROP TABLE IF EXISTS "users"[0m
|
8
|
-
[1m[35m (3.5ms)[0m [1m[35mCREATE 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)[0m
|
9
|
-
[1m[35m (3.4ms)[0m [1m[35mCREATE UNIQUE INDEX "index_users_on_email" ON "users" ("email")[0m
|
10
|
-
[1m[35m (5.0ms)[0m [1m[35mCREATE UNIQUE INDEX "index_users_on_reset_password_token" ON "users" ("reset_password_token")[0m
|
11
|
-
[1m[35m (5.5ms)[0m [1m[35mCREATE TABLE "schema_migrations" ("version" varchar NOT NULL PRIMARY KEY)[0m
|
12
|
-
[1m[35m (0.8ms)[0m [1m[34mSELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC[0m
|
13
|
-
[1m[35m (7.3ms)[0m [1m[32mINSERT INTO "schema_migrations" (version) VALUES (20200624115316)[0m
|
14
|
-
[1m[35m (4.3ms)[0m [1m[32mINSERT INTO "schema_migrations" (version) VALUES
|
15
|
-
(20200623125321);
|
16
|
-
|
17
|
-
[0m
|
18
|
-
[1m[35m (3.6ms)[0m [1m[35mCREATE TABLE "ar_internal_metadata" ("key" varchar NOT NULL PRIMARY KEY, "value" varchar, "created_at" datetime(6) NOT NULL, "updated_at" datetime(6) NOT NULL)[0m
|
19
|
-
[1m[36mActiveRecord::InternalMetadata Load (0.5ms)[0m [1m[34mSELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = ? LIMIT ?[0m [["key", "environment"], ["LIMIT", 1]]
|
20
|
-
[1m[35m (0.0ms)[0m [1m[36mbegin transaction[0m
|
21
|
-
[1m[36mActiveRecord::InternalMetadata Create (4.7ms)[0m [1m[32mINSERT INTO "ar_internal_metadata" ("key", "value", "created_at", "updated_at") VALUES (?, ?, ?, ?)[0m [["key", "environment"], ["value", "test"], ["created_at", "2021-08-06 12:51:19.473267"], ["updated_at", "2021-08-06 12:51:19.473267"]]
|
22
|
-
[1m[35m (2.2ms)[0m [1m[36mcommit transaction[0m
|
23
|
-
[1m[36mActiveRecord::InternalMetadata Load (0.4ms)[0m [1m[34mSELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = ? LIMIT ?[0m [["key", "environment"], ["LIMIT", 1]]
|
24
|
-
[1m[36mActiveRecord::InternalMetadata Load (0.4ms)[0m [1m[34mSELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = ? LIMIT ?[0m [["key", "schema_sha1"], ["LIMIT", 1]]
|
25
|
-
[1m[35m (0.0ms)[0m [1m[36mbegin transaction[0m
|
26
|
-
[1m[36mActiveRecord::InternalMetadata Create (1.6ms)[0m [1m[32mINSERT INTO "ar_internal_metadata" ("key", "value", "created_at", "updated_at") VALUES (?, ?, ?, ?)[0m [["key", "schema_sha1"], ["value", "8dfe9119086661dc796fa00452dc81ff692523f5"], ["created_at", "2021-08-06 12:51:19.484405"], ["updated_at", "2021-08-06 12:51:19.484405"]]
|
27
|
-
[1m[35m (1.7ms)[0m [1m[36mcommit transaction[0m
|
28
|
-
[1m[35m (0.1ms)[0m [1m[34mSELECT sqlite_version(*)[0m
|
29
|
-
[1m[35m (0.9ms)[0m [1m[34mSELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC[0m
|
30
|
-
[1m[35m (0.1ms)[0m [1m[35mPRAGMA foreign_keys[0m
|
31
|
-
[1m[35m (0.2ms)[0m [1m[35mPRAGMA defer_foreign_keys[0m
|
32
|
-
[1m[35m (0.1ms)[0m [1m[35mPRAGMA defer_foreign_keys = ON[0m
|
33
|
-
[1m[35m (0.1ms)[0m [1m[35mPRAGMA foreign_keys = OFF[0m
|
34
|
-
[1m[35m (0.2ms)[0m [1m[35mTRUNCATE TABLE "feature_toggles"[0m
|
35
|
-
[1m[35m (4.2ms)[0m [1m[31mDELETE FROM "feature_toggles"[0m
|
36
|
-
[1m[35m (0.8ms)[0m [1m[34mSELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';[0m
|
37
|
-
[1m[35m (0.8ms)[0m [1m[31mDELETE FROM sqlite_sequence where name = 'feature_toggles';[0m
|
38
|
-
[1m[35m (0.1ms)[0m [1m[35mTRUNCATE TABLE "users"[0m
|
39
|
-
[1m[35m (3.8ms)[0m [1m[31mDELETE FROM "users"[0m
|
40
|
-
[1m[35m (1.0ms)[0m [1m[34mSELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';[0m
|
41
|
-
[1m[35m (0.7ms)[0m [1m[31mDELETE FROM sqlite_sequence where name = 'users';[0m
|
42
|
-
[1m[35m (0.1ms)[0m [1m[35mPRAGMA defer_foreign_keys = 0[0m
|
43
|
-
[1m[35m (0.0ms)[0m [1m[35mPRAGMA foreign_keys = 1[0m
|
44
|
-
[1m[35m (0.1ms)[0m [1m[36mbegin transaction[0m
|
45
|
-
[1m[35m (0.2ms)[0m [1m[35mSAVEPOINT active_record_1[0m
|
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
|
-
[1m[35m (0.1ms)[0m [1m[31mROLLBACK TO SAVEPOINT active_record_1[0m
|
50
|
-
[1m[35m (0.0ms)[0m [1m[31mrollback transaction[0m
|
51
|
-
[1m[35m (0.1ms)[0m [1m[36mbegin transaction[0m
|
52
|
-
[1m[35m (0.1ms)[0m [1m[35mSAVEPOINT active_record_1[0m
|
53
|
-
[1m[35m (0.1ms)[0m [1m[35mSAVEPOINT active_record_2[0m
|
54
|
-
[1m[36mUser Exists? (0.1ms)[0m [1m[34mSELECT 1 AS one FROM "users" WHERE "users"."email" = ? LIMIT ?[0m [["email", "user1@example.com"], ["LIMIT", 1]]
|
55
|
-
[1m[36mUser Create (3.7ms)[0m [1m[32mINSERT INTO "users" ("email", "encrypted_password", "created_at", "updated_at") VALUES (?, ?, ?, ?)[0m [["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
|
-
[1m[35m (0.1ms)[0m [1m[35mRELEASE SAVEPOINT active_record_2[0m
|
57
|
-
[1m[35m (0.1ms)[0m [1m[34mSELECT COUNT(*) FROM "feature_toggles"[0m
|
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
|
-
[1m[35m (0.1ms)[0m [1m[35mSAVEPOINT active_record_2[0m
|
62
|
-
[1m[36mFeatureToggle Create (0.6ms)[0m [1m[32mINSERT INTO "feature_toggles" ("key", "active", "created_at", "updated_at") VALUES (?, ?, ?, ?)[0m [["key", "test"], ["active", 1], ["created_at", "2021-08-06 12:51:21.038144"], ["updated_at", "2021-08-06 12:51:21.038144"]]
|
63
|
-
[1m[35m (0.1ms)[0m [1m[35mRELEASE SAVEPOINT active_record_2[0m
|
64
|
-
Redirected to http://www.example.com/feature-toggles
|
65
|
-
Completed 302 Found in 16ms (ActiveRecord: 1.0ms | Allocations: 3345)
|
66
|
-
[1m[36mFeatureToggle Load (0.1ms)[0m [1m[34mSELECT "feature_toggles".* FROM "feature_toggles" ORDER BY "feature_toggles"."id" DESC LIMIT ?[0m [["LIMIT", 1]]
|
67
|
-
[1m[35m (0.1ms)[0m [1m[34mSELECT COUNT(*) FROM "feature_toggles"[0m
|
68
|
-
[1m[35m (2.4ms)[0m [1m[31mROLLBACK TO SAVEPOINT active_record_1[0m
|
69
|
-
[1m[35m (3.5ms)[0m [1m[31mrollback transaction[0m
|
70
|
-
[1m[35m (0.1ms)[0m [1m[36mbegin transaction[0m
|
71
|
-
[1m[35m (0.2ms)[0m [1m[35mSAVEPOINT active_record_1[0m
|
72
|
-
[1m[35m (0.1ms)[0m [1m[35mSAVEPOINT active_record_2[0m
|
73
|
-
[1m[36mUser Exists? (1.3ms)[0m [1m[34mSELECT 1 AS one FROM "users" WHERE "users"."email" = ? LIMIT ?[0m [["email", "user2@example.com"], ["LIMIT", 1]]
|
74
|
-
[1m[36mUser Create (3.2ms)[0m [1m[32mINSERT INTO "users" ("email", "encrypted_password", "created_at", "updated_at") VALUES (?, ?, ?, ?)[0m [["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
|
-
[1m[35m (0.1ms)[0m [1m[35mRELEASE SAVEPOINT active_record_2[0m
|
76
|
-
[1m[35m (0.1ms)[0m [1m[35mSAVEPOINT active_record_2[0m
|
77
|
-
[1m[36mFeatureToggle Create (0.4ms)[0m [1m[32mINSERT INTO "feature_toggles" ("key", "active", "created_at", "updated_at") VALUES (?, ?, ?, ?)[0m [["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
|
-
[1m[35m (0.1ms)[0m [1m[35mRELEASE SAVEPOINT active_record_2[0m
|
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
|
-
[1m[36mFeatureToggle Load (0.2ms)[0m [1m[34mSELECT "feature_toggles".* FROM "feature_toggles" ORDER BY "feature_toggles"."key" ASC[0m
|
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
|
-
[1m[35m (1.2ms)[0m [1m[31mROLLBACK TO SAVEPOINT active_record_1[0m
|
86
|
-
[1m[35m (3.4ms)[0m [1m[31mrollback transaction[0m
|
87
|
-
[1m[35m (0.1ms)[0m [1m[36mbegin transaction[0m
|
88
|
-
[1m[35m (0.1ms)[0m [1m[35mSAVEPOINT active_record_1[0m
|
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
|
-
[1m[35m (0.1ms)[0m [1m[31mROLLBACK TO SAVEPOINT active_record_1[0m
|
93
|
-
[1m[35m (0.4ms)[0m [1m[31mrollback transaction[0m
|
94
|
-
[1m[35m (0.1ms)[0m [1m[36mbegin transaction[0m
|
95
|
-
[1m[35m (0.1ms)[0m [1m[35mSAVEPOINT active_record_1[0m
|
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
|
-
[1m[35m (0.2ms)[0m [1m[31mROLLBACK TO SAVEPOINT active_record_1[0m
|
100
|
-
[1m[35m (0.3ms)[0m [1m[31mrollback transaction[0m
|
101
|
-
[1m[35m (0.1ms)[0m [1m[36mbegin transaction[0m
|
102
|
-
[1m[35m (0.1ms)[0m [1m[35mSAVEPOINT active_record_1[0m
|
103
|
-
[1m[35m (0.2ms)[0m [1m[35mSAVEPOINT active_record_2[0m
|
104
|
-
[1m[36mUser Exists? (3.3ms)[0m [1m[34mSELECT 1 AS one FROM "users" WHERE "users"."email" = ? LIMIT ?[0m [["email", "user3@example.com"], ["LIMIT", 1]]
|
105
|
-
[1m[36mUser Create (5.9ms)[0m [1m[32mINSERT INTO "users" ("email", "encrypted_password", "created_at", "updated_at") VALUES (?, ?, ?, ?)[0m [["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
|
-
[1m[35m (0.3ms)[0m [1m[35mRELEASE SAVEPOINT active_record_2[0m
|
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
|
-
[1m[35m (1.8ms)[0m [1m[31mROLLBACK TO SAVEPOINT active_record_1[0m
|
114
|
-
[1m[35m (3.2ms)[0m [1m[31mrollback transaction[0m
|
115
|
-
[1m[35m (0.1ms)[0m [1m[36mbegin transaction[0m
|
116
|
-
[1m[35m (0.1ms)[0m [1m[35mSAVEPOINT active_record_1[0m
|
117
|
-
[1m[35m (0.1ms)[0m [1m[35mSAVEPOINT active_record_2[0m
|
118
|
-
[1m[36mUser Exists? (2.4ms)[0m [1m[34mSELECT 1 AS one FROM "users" WHERE "users"."email" = ? LIMIT ?[0m [["email", "user4@example.com"], ["LIMIT", 1]]
|
119
|
-
[1m[36mUser Create (5.1ms)[0m [1m[32mINSERT INTO "users" ("email", "encrypted_password", "created_at", "updated_at") VALUES (?, ?, ?, ?)[0m [["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
|
-
[1m[35m (0.1ms)[0m [1m[35mRELEASE SAVEPOINT active_record_2[0m
|
121
|
-
[1m[35m (0.1ms)[0m [1m[35mSAVEPOINT active_record_2[0m
|
122
|
-
[1m[36mFeatureToggle Create (0.6ms)[0m [1m[32mINSERT INTO "feature_toggles" ("key", "active", "created_at", "updated_at") VALUES (?, ?, ?, ?)[0m [["key", "test-feature"], ["active", 0], ["created_at", "2021-08-06 12:51:21.484143"], ["updated_at", "2021-08-06 12:51:21.484143"]]
|
123
|
-
[1m[35m (0.1ms)[0m [1m[35mRELEASE SAVEPOINT active_record_2[0m
|
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
|
-
[1m[36mFeatureToggle Load (0.2ms)[0m [1m[34mSELECT "feature_toggles".* FROM "feature_toggles" WHERE "feature_toggles"."id" = ? LIMIT ?[0m [["id", 1], ["LIMIT", 1]]
|
128
|
-
[1m[35m (0.1ms)[0m [1m[35mSAVEPOINT active_record_2[0m
|
129
|
-
[1m[36mFeatureToggle Update (0.2ms)[0m [1m[33mUPDATE "feature_toggles" SET "active" = ?, "updated_at" = ? WHERE "feature_toggles"."id" = ?[0m [["active", 1], ["updated_at", "2021-08-06 12:51:21.527368"], ["id", 1]]
|
130
|
-
[1m[35m (0.1ms)[0m [1m[35mRELEASE SAVEPOINT active_record_2[0m
|
131
|
-
Redirected to http://www.example.com/feature-toggles
|
132
|
-
Completed 302 Found in 5ms (ActiveRecord: 0.5ms | Allocations: 954)
|
133
|
-
[1m[36mFeatureToggle Load (0.1ms)[0m [1m[34mSELECT "feature_toggles".* FROM "feature_toggles" WHERE "feature_toggles"."id" = ? LIMIT ?[0m [["id", 1], ["LIMIT", 1]]
|
134
|
-
[1m[35m (2.1ms)[0m [1m[31mROLLBACK TO SAVEPOINT active_record_1[0m
|
135
|
-
[1m[35m (5.2ms)[0m [1m[31mrollback transaction[0m
|
136
|
-
[1m[35m (0.1ms)[0m [1m[36mbegin transaction[0m
|
137
|
-
[1m[35m (0.1ms)[0m [1m[35mSAVEPOINT active_record_1[0m
|
138
|
-
[1m[35m (0.1ms)[0m [1m[35mSAVEPOINT active_record_2[0m
|
139
|
-
[1m[36mFeatureToggle Create (6.6ms)[0m [1m[32mINSERT INTO "feature_toggles" ("key", "active", "created_at", "updated_at") VALUES (?, ?, ?, ?)[0m [["key", "test-feature"], ["active", 0], ["created_at", "2021-08-06 12:51:21.543758"], ["updated_at", "2021-08-06 12:51:21.543758"]]
|
140
|
-
[1m[35m (0.2ms)[0m [1m[35mRELEASE SAVEPOINT active_record_2[0m
|
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
|
-
[1m[35m (1.2ms)[0m [1m[31mROLLBACK TO SAVEPOINT active_record_1[0m
|
146
|
-
[1m[35m (4.0ms)[0m [1m[31mrollback transaction[0m
|
147
|
-
[1m[35m (0.1ms)[0m [1m[36mbegin transaction[0m
|
148
|
-
[1m[35m (0.1ms)[0m [1m[35mSAVEPOINT active_record_1[0m
|
149
|
-
[1m[35m (0.1ms)[0m [1m[35mSAVEPOINT active_record_2[0m
|
150
|
-
[1m[36mFeatureToggle Create (4.9ms)[0m [1m[32mINSERT INTO "feature_toggles" ("key", "active", "created_at", "updated_at") VALUES (?, ?, ?, ?)[0m [["key", "test-feature"], ["active", 0], ["created_at", "2021-08-06 12:51:21.608479"], ["updated_at", "2021-08-06 12:51:21.608479"]]
|
151
|
-
[1m[35m (0.1ms)[0m [1m[35mRELEASE SAVEPOINT active_record_2[0m
|
152
|
-
[1m[35m (0.2ms)[0m [1m[35mSAVEPOINT active_record_2[0m
|
153
|
-
[1m[36mUser Exists? (0.2ms)[0m [1m[34mSELECT 1 AS one FROM "users" WHERE "users"."email" = ? LIMIT ?[0m [["email", "user5@example.com"], ["LIMIT", 1]]
|
154
|
-
[1m[36mUser Create (1.9ms)[0m [1m[32mINSERT INTO "users" ("email", "encrypted_password", "created_at", "updated_at") VALUES (?, ?, ?, ?)[0m [["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
|
-
[1m[35m (0.2ms)[0m [1m[35mRELEASE SAVEPOINT active_record_2[0m
|
156
|
-
[1m[35m (0.2ms)[0m [1m[34mSELECT COUNT(*) FROM "feature_toggles"[0m
|
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
|
-
[1m[36mFeatureToggle Load (0.1ms)[0m [1m[34mSELECT "feature_toggles".* FROM "feature_toggles" WHERE "feature_toggles"."id" = ? LIMIT ?[0m [["id", 1], ["LIMIT", 1]]
|
161
|
-
[1m[35m (0.1ms)[0m [1m[35mSAVEPOINT active_record_2[0m
|
162
|
-
[1m[36mFeatureToggle Destroy (0.1ms)[0m [1m[31mDELETE FROM "feature_toggles" WHERE "feature_toggles"."id" = ?[0m [["id", 1]]
|
163
|
-
[1m[35m (0.1ms)[0m [1m[35mRELEASE SAVEPOINT active_record_2[0m
|
164
|
-
Redirected to http://www.example.com/feature-toggles
|
165
|
-
Completed 302 Found in 3ms (ActiveRecord: 0.4ms | Allocations: 538)
|
166
|
-
[1m[35m (0.1ms)[0m [1m[34mSELECT COUNT(*) FROM "feature_toggles"[0m
|
167
|
-
[1m[35m (2.4ms)[0m [1m[31mROLLBACK TO SAVEPOINT active_record_1[0m
|
168
|
-
[1m[35m (5.0ms)[0m [1m[31mrollback transaction[0m
|
169
|
-
[1m[35m (0.1ms)[0m [1m[36mbegin transaction[0m
|
170
|
-
[1m[35m (0.1ms)[0m [1m[35mSAVEPOINT active_record_1[0m
|
171
|
-
[1m[35m (0.1ms)[0m [1m[35mSAVEPOINT active_record_2[0m
|
172
|
-
[1m[36mFeatureToggle Create (7.4ms)[0m [1m[32mINSERT INTO "feature_toggles" ("key", "active", "created_at", "updated_at") VALUES (?, ?, ?, ?)[0m [["key", "test-feature"], ["active", 0], ["created_at", "2021-08-06 12:51:21.703601"], ["updated_at", "2021-08-06 12:51:21.703601"]]
|
173
|
-
[1m[35m (0.1ms)[0m [1m[35mRELEASE SAVEPOINT active_record_2[0m
|
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
|
-
[1m[35m (0.9ms)[0m [1m[31mROLLBACK TO SAVEPOINT active_record_1[0m
|
179
|
-
[1m[35m (3.5ms)[0m [1m[31mrollback transaction[0m
|
180
|
-
[1m[35m (0.1ms)[0m [1m[36mbegin transaction[0m
|
181
|
-
[1m[35m (0.2ms)[0m [1m[35mSAVEPOINT active_record_1[0m
|
182
|
-
[1m[35m (0.1ms)[0m [1m[31mROLLBACK TO SAVEPOINT active_record_1[0m
|
183
|
-
[1m[35m (0.1ms)[0m [1m[31mrollback transaction[0m
|
data/spec/dummy/public/404.html
DELETED
@@ -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>
|
data/spec/dummy/public/422.html
DELETED
@@ -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>
|
data/spec/dummy/public/500.html
DELETED
@@ -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 |
|
data/spec/factories/user.rb
DELETED
@@ -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
|