hash_ids 0.0.3 → 0.0.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/{LICENSE.txt → MIT-LICENSE} +1 -3
- data/Rakefile +23 -4
- data/lib/hash_ids/obfuscate.rb +6 -5
- data/lib/hash_ids/version.rb +1 -1
- data/lib/hash_ids.rb +1 -0
- data/lib/tasks/hash_ids_tasks.rake +4 -0
- data/spec/dummy/README.rdoc +28 -0
- data/spec/dummy/Rakefile +6 -0
- data/spec/dummy/app/assets/javascripts/application.js +13 -0
- data/spec/dummy/app/assets/stylesheets/application.css +15 -0
- data/spec/dummy/app/controllers/application_controller.rb +5 -0
- data/spec/dummy/app/helpers/application_helper.rb +2 -0
- data/spec/dummy/app/models/user.rb +3 -0
- data/spec/dummy/app/views/layouts/application.html.erb +14 -0
- data/spec/dummy/bin/bundle +3 -0
- data/spec/dummy/bin/rails +4 -0
- data/spec/dummy/bin/rake +4 -0
- data/spec/dummy/bin/setup +29 -0
- data/spec/dummy/config/application.rb +32 -0
- data/spec/dummy/config/boot.rb +5 -0
- data/spec/dummy/config/database.yml +25 -0
- data/spec/dummy/config/environment.rb +5 -0
- data/spec/dummy/config/environments/development.rb +41 -0
- data/spec/dummy/config/environments/production.rb +79 -0
- data/spec/dummy/config/environments/test.rb +42 -0
- data/spec/dummy/config/initializers/assets.rb +11 -0
- data/spec/dummy/config/initializers/backtrace_silencers.rb +7 -0
- data/spec/dummy/config/initializers/cookies_serializer.rb +3 -0
- data/spec/dummy/config/initializers/filter_parameter_logging.rb +4 -0
- data/spec/dummy/config/initializers/inflections.rb +16 -0
- data/spec/dummy/config/initializers/mime_types.rb +4 -0
- data/spec/dummy/config/initializers/session_store.rb +3 -0
- data/spec/dummy/config/initializers/wrap_parameters.rb +14 -0
- data/spec/dummy/config/locales/en.yml +23 -0
- data/spec/dummy/config/routes.rb +57 -0
- data/spec/dummy/config/secrets.yml +22 -0
- data/spec/dummy/config.ru +4 -0
- data/spec/dummy/db/development.sqlite3 +0 -0
- data/spec/dummy/db/migrate/20150204045322_create_users.rb +10 -0
- data/spec/dummy/db/schema.rb +23 -0
- data/spec/dummy/db/test.sqlite3 +0 -0
- data/spec/dummy/log/development.log +16 -0
- data/spec/dummy/log/test.log +125 -0
- data/spec/dummy/public/404.html +67 -0
- data/spec/dummy/public/422.html +67 -0
- data/spec/dummy/public/500.html +66 -0
- data/spec/dummy/public/favicon.ico +0 -0
- data/spec/models/user_spec.rb +31 -0
- data/spec/spec_helper.rb +17 -0
- data/spec/views/users_routes_spec.rb +19 -0
- metadata +100 -21
- data/.gitignore +0 -14
- data/.rspec +0 -2
- data/.travis.yml +0 -3
- data/Gemfile +0 -5
- data/README.md +0 -60
- data/hash_ids.gemspec +0 -25
- data/spec/hash_ids_spec.rb +0 -55
@@ -0,0 +1,22 @@
|
|
1
|
+
# Be sure to restart your server when you modify this file.
|
2
|
+
|
3
|
+
# Your secret key is used for verifying the integrity of signed cookies.
|
4
|
+
# If you change this key, all old signed cookies will become invalid!
|
5
|
+
|
6
|
+
# Make sure the secret is at least 30 characters and all random,
|
7
|
+
# no regular words or you'll be exposed to dictionary attacks.
|
8
|
+
# You can use `rake secret` to generate a secure secret key.
|
9
|
+
|
10
|
+
# Make sure the secrets in this file are kept private
|
11
|
+
# if you're sharing your code publicly.
|
12
|
+
|
13
|
+
development:
|
14
|
+
secret_key_base: f69d6b689a3335877f4342851dd07b46432f6bf38718cecd92629e19f754dbe57822cec989677dbf86a4640d8eef42a047059a4cc9a6e5c3655ca56531912f72
|
15
|
+
|
16
|
+
test:
|
17
|
+
secret_key_base: 7334349326931028fc8ea4a566aeb8a6b468bafaebaf3c6f4c19290dad9a6c22233d4ca46ff28251a151a46425aa9e0e79de3aa2fa4c95e659ee5426467321cb
|
18
|
+
|
19
|
+
# Do not keep production secrets in the repository,
|
20
|
+
# instead read values from the environment.
|
21
|
+
production:
|
22
|
+
secret_key_base: <%= ENV["SECRET_KEY_BASE"] %>
|
Binary file
|
@@ -0,0 +1,23 @@
|
|
1
|
+
# encoding: UTF-8
|
2
|
+
# This file is auto-generated from the current state of the database. Instead
|
3
|
+
# of editing this file, please use the migrations feature of Active Record to
|
4
|
+
# incrementally modify your database, and then regenerate this schema definition.
|
5
|
+
#
|
6
|
+
# Note that this schema.rb definition is the authoritative source for your
|
7
|
+
# database schema. If you need to create the application database on another
|
8
|
+
# system, you should be using db:schema:load, not running all the migrations
|
9
|
+
# from scratch. The latter is a flawed and unsustainable approach (the more migrations
|
10
|
+
# you'll amass, the slower it'll run and the greater likelihood for issues).
|
11
|
+
#
|
12
|
+
# It's strongly recommended that you check this file into your version control system.
|
13
|
+
|
14
|
+
ActiveRecord::Schema.define(version: 20150204045322) do
|
15
|
+
|
16
|
+
create_table "users", force: :cascade do |t|
|
17
|
+
t.string "name"
|
18
|
+
t.integer "age"
|
19
|
+
t.datetime "created_at", null: false
|
20
|
+
t.datetime "updated_at", null: false
|
21
|
+
end
|
22
|
+
|
23
|
+
end
|
Binary file
|
@@ -0,0 +1,16 @@
|
|
1
|
+
[1m[36m (145.2ms)[0m [1mCREATE TABLE "schema_migrations" ("version" varchar NOT NULL) [0m
|
2
|
+
[1m[35m (0.1ms)[0m select sqlite_version(*)
|
3
|
+
[1m[36m (132.7ms)[0m [1mCREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")[0m
|
4
|
+
[1m[35mActiveRecord::SchemaMigration Load (0.2ms)[0m SELECT "schema_migrations".* FROM "schema_migrations"
|
5
|
+
Migrating to CreateUsers (20150204045322)
|
6
|
+
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
7
|
+
[1m[35m (0.7ms)[0m CREATE TABLE "users" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar, "age" integer, "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL)
|
8
|
+
[1m[36mSQL (0.3ms)[0m [1mINSERT INTO "schema_migrations" ("version") VALUES (?)[0m [["version", "20150204045322"]]
|
9
|
+
[1m[35m (136.9ms)[0m commit transaction
|
10
|
+
[1m[36mActiveRecord::SchemaMigration Load (0.2ms)[0m [1mSELECT "schema_migrations".* FROM "schema_migrations"[0m
|
11
|
+
[1m[36m (115.7ms)[0m [1mCREATE TABLE "users" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar, "age" integer, "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL) [0m
|
12
|
+
[1m[35m (126.2ms)[0m CREATE TABLE "schema_migrations" ("version" varchar NOT NULL)
|
13
|
+
[1m[36m (0.1ms)[0m [1mselect sqlite_version(*)[0m
|
14
|
+
[1m[35m (132.9ms)[0m CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
|
15
|
+
[1m[36m (0.2ms)[0m [1mSELECT version FROM "schema_migrations"[0m
|
16
|
+
[1m[35m (124.7ms)[0m INSERT INTO "schema_migrations" (version) VALUES ('20150204045322')
|
@@ -0,0 +1,125 @@
|
|
1
|
+
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
2
|
+
[1m[35mSQL (0.4ms)[0m INSERT INTO "users" ("name", "age", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["name", "gqyp"], ["age", 55], ["created_at", "2015-02-04 06:23:41.652374"], ["updated_at", "2015-02-04 06:23:41.652374"]]
|
3
|
+
[1m[36m (124.9ms)[0m [1mcommit transaction[0m
|
4
|
+
[1m[35m (0.1ms)[0m begin transaction
|
5
|
+
[1m[36m (0.1ms)[0m [1mrollback transaction[0m
|
6
|
+
[1m[35m (0.1ms)[0m begin transaction
|
7
|
+
[1m[36m (0.2ms)[0m [1mrollback transaction[0m
|
8
|
+
[1m[35m (0.1ms)[0m begin transaction
|
9
|
+
[1m[36mSQL (0.4ms)[0m [1mINSERT INTO "users" ("name", "age", "created_at", "updated_at") VALUES (?, ?, ?, ?)[0m [["name", "akwf"], ["age", 41], ["created_at", "2015-02-04 06:23:41.790383"], ["updated_at", "2015-02-04 06:23:41.790383"]]
|
10
|
+
[1m[35m (122.1ms)[0m commit transaction
|
11
|
+
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
12
|
+
[1m[35mSQL (0.3ms)[0m INSERT INTO "users" ("name", "age", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["name", "akwf"], ["age", 98], ["created_at", "2015-02-04 06:23:41.915735"], ["updated_at", "2015-02-04 06:23:41.915735"]]
|
13
|
+
[1m[36m (164.3ms)[0m [1mcommit transaction[0m
|
14
|
+
[1m[35m (0.1ms)[0m begin transaction
|
15
|
+
[1m[36mUser Load (0.3ms)[0m [1mSELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT 1[0m [["id", 3]]
|
16
|
+
[1m[35mUser Load (0.1ms)[0m SELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT 1 [["id", 3]]
|
17
|
+
[1m[36m (0.1ms)[0m [1mrollback transaction[0m
|
18
|
+
[1m[35m (0.1ms)[0m begin transaction
|
19
|
+
[1m[36m (0.1ms)[0m [1mrollback transaction[0m
|
20
|
+
[1m[35m (0.1ms)[0m begin transaction
|
21
|
+
[1m[36mUser Load (0.4ms)[0m [1mSELECT "users".* FROM "users" WHERE "users"."id" IN (2, 3)[0m
|
22
|
+
[1m[35mUser Load (0.3ms)[0m SELECT "users".* FROM "users" WHERE "users"."id" IN (2, 3)
|
23
|
+
[1m[36mUser Load (0.2ms)[0m [1mSELECT "users".* FROM "users" WHERE "users"."id" IN (2, 3)[0m
|
24
|
+
[1m[35mUser Load (0.2ms)[0m SELECT "users".* FROM "users" WHERE "users"."id" IN (2, 3)
|
25
|
+
[1m[36m (0.1ms)[0m [1mrollback transaction[0m
|
26
|
+
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
27
|
+
[1m[35mSQL (0.4ms)[0m INSERT INTO "users" ("name", "age", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["name", "pktg"], ["age", 15], ["created_at", "2015-02-04 06:30:33.725892"], ["updated_at", "2015-02-04 06:30:33.725892"]]
|
28
|
+
[1m[36m (156.7ms)[0m [1mcommit transaction[0m
|
29
|
+
[1m[35m (0.1ms)[0m begin transaction
|
30
|
+
[1m[36m (0.1ms)[0m [1mrollback transaction[0m
|
31
|
+
[1m[35m (0.1ms)[0m begin transaction
|
32
|
+
[1m[36m (0.1ms)[0m [1mrollback transaction[0m
|
33
|
+
[1m[35m (0.1ms)[0m begin transaction
|
34
|
+
[1m[36mSQL (0.3ms)[0m [1mINSERT INTO "users" ("name", "age", "created_at", "updated_at") VALUES (?, ?, ?, ?)[0m [["name", "wzrg"], ["age", 81], ["created_at", "2015-02-04 06:30:33.894656"], ["updated_at", "2015-02-04 06:30:33.894656"]]
|
35
|
+
[1m[35m (140.6ms)[0m commit transaction
|
36
|
+
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
37
|
+
[1m[35mSQL (0.3ms)[0m INSERT INTO "users" ("name", "age", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["name", "wzrg"], ["age", 40], ["created_at", "2015-02-04 06:30:34.037976"], ["updated_at", "2015-02-04 06:30:34.037976"]]
|
38
|
+
[1m[36m (139.2ms)[0m [1mcommit transaction[0m
|
39
|
+
[1m[35m (0.1ms)[0m begin transaction
|
40
|
+
[1m[36mUser Load (0.3ms)[0m [1mSELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT 1[0m [["id", 6]]
|
41
|
+
[1m[35mUser Load (0.1ms)[0m SELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT 1 [["id", 6]]
|
42
|
+
[1m[36m (0.1ms)[0m [1mrollback transaction[0m
|
43
|
+
[1m[35m (0.1ms)[0m begin transaction
|
44
|
+
[1m[36mUser Load (0.5ms)[0m [1mSELECT "users".* FROM "users" WHERE "users"."id" IN (5, 6)[0m
|
45
|
+
[1m[35mUser Load (0.3ms)[0m SELECT "users".* FROM "users" WHERE "users"."id" IN (5, 6)
|
46
|
+
[1m[36mUser Load (0.2ms)[0m [1mSELECT "users".* FROM "users" WHERE "users"."id" IN (5, 6)[0m
|
47
|
+
[1m[35mUser Load (0.3ms)[0m SELECT "users".* FROM "users" WHERE "users"."id" IN (5, 6)
|
48
|
+
[1m[36m (0.1ms)[0m [1mrollback transaction[0m
|
49
|
+
[1m[35m (0.1ms)[0m begin transaction
|
50
|
+
[1m[36m (0.1ms)[0m [1mrollback transaction[0m
|
51
|
+
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
52
|
+
[1m[35mSQL (0.4ms)[0m INSERT INTO "users" ("name", "age", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["name", "heig"], ["age", 14], ["created_at", "2015-02-04 06:30:41.102233"], ["updated_at", "2015-02-04 06:30:41.102233"]]
|
53
|
+
[1m[36m (125.7ms)[0m [1mcommit transaction[0m
|
54
|
+
[1m[35m (0.1ms)[0m begin transaction
|
55
|
+
[1m[36m (0.1ms)[0m [1mrollback transaction[0m
|
56
|
+
[1m[35m (0.1ms)[0m begin transaction
|
57
|
+
[1m[36m (0.1ms)[0m [1mrollback transaction[0m
|
58
|
+
[1m[35m (0.1ms)[0m begin transaction
|
59
|
+
[1m[36mSQL (0.3ms)[0m [1mINSERT INTO "users" ("name", "age", "created_at", "updated_at") VALUES (?, ?, ?, ?)[0m [["name", "sial"], ["age", 71], ["created_at", "2015-02-04 06:30:41.238867"], ["updated_at", "2015-02-04 06:30:41.238867"]]
|
60
|
+
[1m[35m (141.7ms)[0m commit transaction
|
61
|
+
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
62
|
+
[1m[35mSQL (0.3ms)[0m INSERT INTO "users" ("name", "age", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["name", "sial"], ["age", 14], ["created_at", "2015-02-04 06:30:41.383032"], ["updated_at", "2015-02-04 06:30:41.383032"]]
|
63
|
+
[1m[36m (123.2ms)[0m [1mcommit transaction[0m
|
64
|
+
[1m[35m (0.1ms)[0m begin transaction
|
65
|
+
[1m[36m (0.2ms)[0m [1mrollback transaction[0m
|
66
|
+
[1m[35m (0.1ms)[0m begin transaction
|
67
|
+
[1m[36mUser Load (0.2ms)[0m [1mSELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT 1[0m [["id", 9]]
|
68
|
+
[1m[35mUser Load (0.1ms)[0m SELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT 1 [["id", 9]]
|
69
|
+
[1m[36m (0.1ms)[0m [1mrollback transaction[0m
|
70
|
+
[1m[35m (0.1ms)[0m begin transaction
|
71
|
+
[1m[36mUser Load (0.3ms)[0m [1mSELECT "users".* FROM "users" WHERE "users"."id" IN (8, 9)[0m
|
72
|
+
[1m[35mUser Load (0.3ms)[0m SELECT "users".* FROM "users" WHERE "users"."id" IN (8, 9)
|
73
|
+
[1m[36mUser Load (0.2ms)[0m [1mSELECT "users".* FROM "users" WHERE "users"."id" IN (8, 9)[0m
|
74
|
+
[1m[35mUser Load (0.2ms)[0m SELECT "users".* FROM "users" WHERE "users"."id" IN (8, 9)
|
75
|
+
[1m[36m (0.1ms)[0m [1mrollback transaction[0m
|
76
|
+
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
77
|
+
[1m[35mSQL (0.5ms)[0m INSERT INTO "users" ("name", "age", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["name", "azkm"], ["age", 62], ["created_at", "2015-02-04 06:41:33.364103"], ["updated_at", "2015-02-04 06:41:33.364103"]]
|
78
|
+
[1m[36m (145.6ms)[0m [1mcommit transaction[0m
|
79
|
+
[1m[35m (0.1ms)[0m begin transaction
|
80
|
+
[1m[36m (0.1ms)[0m [1mrollback transaction[0m
|
81
|
+
[1m[35m (0.1ms)[0m begin transaction
|
82
|
+
[1m[36m (0.1ms)[0m [1mrollback transaction[0m
|
83
|
+
[1m[35m (0.1ms)[0m begin transaction
|
84
|
+
[1m[36mSQL (0.3ms)[0m [1mINSERT INTO "users" ("name", "age", "created_at", "updated_at") VALUES (?, ?, ?, ?)[0m [["name", "jkgt"], ["age", 69], ["created_at", "2015-02-04 06:41:33.521292"], ["updated_at", "2015-02-04 06:41:33.521292"]]
|
85
|
+
[1m[35m (150.5ms)[0m commit transaction
|
86
|
+
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
87
|
+
[1m[35mSQL (0.3ms)[0m INSERT INTO "users" ("name", "age", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["name", "jkgt"], ["age", 57], ["created_at", "2015-02-04 06:41:33.674588"], ["updated_at", "2015-02-04 06:41:33.674588"]]
|
88
|
+
[1m[36m (139.7ms)[0m [1mcommit transaction[0m
|
89
|
+
[1m[35m (0.1ms)[0m begin transaction
|
90
|
+
[1m[36mUser Load (0.3ms)[0m [1mSELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT 1[0m [["id", 12]]
|
91
|
+
[1m[35mUser Load (0.1ms)[0m SELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT 1 [["id", 12]]
|
92
|
+
[1m[36m (0.1ms)[0m [1mrollback transaction[0m
|
93
|
+
[1m[35m (0.1ms)[0m begin transaction
|
94
|
+
[1m[36m (0.1ms)[0m [1mrollback transaction[0m
|
95
|
+
[1m[35m (0.1ms)[0m begin transaction
|
96
|
+
[1m[36mUser Load (0.3ms)[0m [1mSELECT "users".* FROM "users" WHERE "users"."id" IN (11, 12)[0m
|
97
|
+
[1m[35mUser Load (0.4ms)[0m SELECT "users".* FROM "users" WHERE "users"."id" IN (11, 12)
|
98
|
+
[1m[36mUser Load (0.3ms)[0m [1mSELECT "users".* FROM "users" WHERE "users"."id" IN (11, 12)[0m
|
99
|
+
[1m[35mUser Load (0.3ms)[0m SELECT "users".* FROM "users" WHERE "users"."id" IN (11, 12)
|
100
|
+
[1m[36m (0.1ms)[0m [1mrollback transaction[0m
|
101
|
+
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
102
|
+
[1m[35mSQL (0.5ms)[0m INSERT INTO "users" ("name", "age", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["name", "jpal"], ["age", 93], ["created_at", "2015-02-04 06:53:33.481151"], ["updated_at", "2015-02-04 06:53:33.481151"]]
|
103
|
+
[1m[36m (122.0ms)[0m [1mcommit transaction[0m
|
104
|
+
[1m[35m (0.1ms)[0m begin transaction
|
105
|
+
[1m[36mSQL (0.3ms)[0m [1mINSERT INTO "users" ("name", "age", "created_at", "updated_at") VALUES (?, ?, ?, ?)[0m [["name", "jpal"], ["age", 67], ["created_at", "2015-02-04 06:53:33.608658"], ["updated_at", "2015-02-04 06:53:33.608658"]]
|
106
|
+
[1m[35m (130.6ms)[0m commit transaction
|
107
|
+
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
108
|
+
[1m[35m (0.1ms)[0m rollback transaction
|
109
|
+
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
110
|
+
[1m[35mUser Load (0.2ms)[0m SELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT 1 [["id", 14]]
|
111
|
+
[1m[36mUser Load (0.1ms)[0m [1mSELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT 1[0m [["id", 14]]
|
112
|
+
[1m[35m (0.2ms)[0m rollback transaction
|
113
|
+
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
114
|
+
[1m[35mUser Load (0.3ms)[0m SELECT "users".* FROM "users" WHERE "users"."id" IN (13, 14)
|
115
|
+
[1m[36mUser Load (0.3ms)[0m [1mSELECT "users".* FROM "users" WHERE "users"."id" IN (13, 14)[0m
|
116
|
+
[1m[35mUser Load (0.2ms)[0m SELECT "users".* FROM "users" WHERE "users"."id" IN (13, 14)
|
117
|
+
[1m[36mUser Load (0.2ms)[0m [1mSELECT "users".* FROM "users" WHERE "users"."id" IN (13, 14)[0m
|
118
|
+
[1m[35m (0.1ms)[0m rollback transaction
|
119
|
+
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
120
|
+
[1m[35mSQL (0.3ms)[0m INSERT INTO "users" ("name", "age", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["name", "xsjt"], ["age", 28], ["created_at", "2015-02-04 06:53:33.774392"], ["updated_at", "2015-02-04 06:53:33.774392"]]
|
121
|
+
[1m[36m (148.9ms)[0m [1mcommit transaction[0m
|
122
|
+
[1m[35m (0.1ms)[0m begin transaction
|
123
|
+
[1m[36m (0.1ms)[0m [1mrollback transaction[0m
|
124
|
+
[1m[35m (0.1ms)[0m begin transaction
|
125
|
+
[1m[36m (0.1ms)[0m [1mrollback transaction[0m
|
@@ -0,0 +1,67 @@
|
|
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
|
+
body {
|
8
|
+
background-color: #EFEFEF;
|
9
|
+
color: #2E2F30;
|
10
|
+
text-align: center;
|
11
|
+
font-family: arial, sans-serif;
|
12
|
+
margin: 0;
|
13
|
+
}
|
14
|
+
|
15
|
+
div.dialog {
|
16
|
+
width: 95%;
|
17
|
+
max-width: 33em;
|
18
|
+
margin: 4em auto 0;
|
19
|
+
}
|
20
|
+
|
21
|
+
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
|
+
h1 {
|
35
|
+
font-size: 100%;
|
36
|
+
color: #730E15;
|
37
|
+
line-height: 1.5em;
|
38
|
+
}
|
39
|
+
|
40
|
+
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>
|
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>
|
@@ -0,0 +1,67 @@
|
|
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
|
+
body {
|
8
|
+
background-color: #EFEFEF;
|
9
|
+
color: #2E2F30;
|
10
|
+
text-align: center;
|
11
|
+
font-family: arial, sans-serif;
|
12
|
+
margin: 0;
|
13
|
+
}
|
14
|
+
|
15
|
+
div.dialog {
|
16
|
+
width: 95%;
|
17
|
+
max-width: 33em;
|
18
|
+
margin: 4em auto 0;
|
19
|
+
}
|
20
|
+
|
21
|
+
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
|
+
h1 {
|
35
|
+
font-size: 100%;
|
36
|
+
color: #730E15;
|
37
|
+
line-height: 1.5em;
|
38
|
+
}
|
39
|
+
|
40
|
+
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>
|
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>
|
@@ -0,0 +1,66 @@
|
|
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
|
+
body {
|
8
|
+
background-color: #EFEFEF;
|
9
|
+
color: #2E2F30;
|
10
|
+
text-align: center;
|
11
|
+
font-family: arial, sans-serif;
|
12
|
+
margin: 0;
|
13
|
+
}
|
14
|
+
|
15
|
+
div.dialog {
|
16
|
+
width: 95%;
|
17
|
+
max-width: 33em;
|
18
|
+
margin: 4em auto 0;
|
19
|
+
}
|
20
|
+
|
21
|
+
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
|
+
h1 {
|
35
|
+
font-size: 100%;
|
36
|
+
color: #730E15;
|
37
|
+
line-height: 1.5em;
|
38
|
+
}
|
39
|
+
|
40
|
+
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>
|
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
|
@@ -0,0 +1,31 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
require 'spec_helper'
|
3
|
+
|
4
|
+
describe 'User model' do
|
5
|
+
before :all do
|
6
|
+
@name = ('a'..'z').to_a.sample(4).join ''
|
7
|
+
@user_jim = User.create name: @name, :age => Random.new.rand(10..100)
|
8
|
+
@user_tom = User.create name: @name, :age => Random.new.rand(10..100)
|
9
|
+
end
|
10
|
+
|
11
|
+
it 'hashable' do
|
12
|
+
hash = @user_jim.to_param
|
13
|
+
expect(@user_jim.id).to eq User.hash_ids_decode(hash).first
|
14
|
+
end
|
15
|
+
|
16
|
+
it '#find single' do
|
17
|
+
id = @user_tom.id
|
18
|
+
hash_id = @user_tom.to_param
|
19
|
+
|
20
|
+
expect(User.find(hash_id)).to eq User.find(id)
|
21
|
+
end
|
22
|
+
|
23
|
+
it '#find multiple' do
|
24
|
+
ids = [@user_jim.id, @user_tom.id]
|
25
|
+
hash_ids = [@user_jim.to_param, @user_tom.to_param]
|
26
|
+
|
27
|
+
expect(User.find(ids)).to eq User.find(hash_ids)
|
28
|
+
expect(User.find(ids.first, ids.last)).to eq User.find(hash_ids.first, hash_ids.last)
|
29
|
+
end
|
30
|
+
|
31
|
+
end
|
data/spec/spec_helper.rb
CHANGED
@@ -1,2 +1,19 @@
|
|
1
|
+
# coding: utf-8
|
1
2
|
$LOAD_PATH.unshift File.expand_path('../../lib', __FILE__)
|
2
3
|
require 'hash_ids'
|
4
|
+
|
5
|
+
ENV['RAILS_ENV'] ||= 'test'
|
6
|
+
|
7
|
+
require File.expand_path("../dummy/config/environment.rb", __FILE__)
|
8
|
+
require 'rspec/rails'
|
9
|
+
|
10
|
+
Rails.backtrace_cleaner.remove_silencers!
|
11
|
+
|
12
|
+
RSpec.configure do |config|
|
13
|
+
config.include Rails.application.routes.url_helpers
|
14
|
+
|
15
|
+
config.mock_with :rspec
|
16
|
+
config.use_transactional_fixtures = true
|
17
|
+
config.infer_base_class_for_anonymous_controllers = false
|
18
|
+
config.order = "random"
|
19
|
+
end
|
@@ -0,0 +1,19 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
require 'spec_helper'
|
3
|
+
|
4
|
+
describe 'User routes' do
|
5
|
+
before :all do
|
6
|
+
@name = ('a'..'z').to_a.sample(4).join ''
|
7
|
+
@user_jim = User.create name: @name, :age => Random.new.rand(10..100)
|
8
|
+
end
|
9
|
+
|
10
|
+
it 'user show path' do
|
11
|
+
path = user_path @user_jim
|
12
|
+
expect(path).to eq "/users/#{@user_jim.to_param}"
|
13
|
+
end
|
14
|
+
|
15
|
+
it 'use edit path' do
|
16
|
+
path = edit_user_path @user_jim
|
17
|
+
expect(path).to eq "/users/#{@user_jim.to_param}/edit"
|
18
|
+
end
|
19
|
+
end
|