spark_plugs 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +15 -0
- data/MIT-LICENSE +20 -0
- data/Rakefile +26 -0
- data/app/assets/javascripts/spark_plugs/application.js +13 -0
- data/app/assets/javascripts/spark_plugs/static_pages.js +2 -0
- data/app/assets/stylesheets/spark_plugs/application.css +15 -0
- data/app/assets/stylesheets/spark_plugs/static_pages.css +4 -0
- data/app/controllers/spark_plugs/application_controller.rb +2 -0
- data/app/controllers/spark_plugs/static_pages_controller.rb +23 -0
- data/app/helpers/spark_plugs/application_helper.rb +4 -0
- data/app/helpers/spark_plugs/static_pages_helper.rb +7 -0
- data/app/models/spark_plugs/static_page.rb +27 -0
- data/app/views/spark_plugs/static_pages/show.html.erb +4 -0
- data/config/initializers/spark_plugs.rb +11 -0
- data/config/routes.rb +3 -0
- data/db/migrate/20150306172808_create_spark_plugs_static_pages.rb +11 -0
- data/lib/generators/spark_plugs/install_generator.rb +18 -0
- data/lib/generators/spark_plugs/templates/initializer.erb +13 -0
- data/lib/generators/spark_plugs/views_generator.rb +22 -0
- data/lib/spark_plugs.rb +4 -0
- data/lib/spark_plugs/engine.rb +16 -0
- data/lib/spark_plugs/version.rb +3 -0
- data/lib/tasks/spark_plugs_tasks.rake +20 -0
- data/spec/controllers/spark_plugs/static_pages_controller_spec.rb +29 -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/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.ru +4 -0
- data/spec/dummy/config/application.rb +33 -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 +3 -0
- data/spec/dummy/config/secrets.yml +22 -0
- data/spec/dummy/db/schema.rb +24 -0
- data/spec/dummy/db/test.sqlite3 +0 -0
- data/spec/dummy/log/test.log +83 -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/factories/spark_plugs_static_pages.rb +22 -0
- data/spec/helpers/spark_plugs/static_pages_helper_spec.rb +25 -0
- data/spec/models/spark_plugs/static_page_spec.rb +48 -0
- data/spec/rails_helper.rb +65 -0
- data/spec/routing/spark_plugs/static_pages_routing_spec.rb +19 -0
- data/spec/spec_helper.rb +42 -0
- metadata +187 -0
@@ -0,0 +1,24 @@
|
|
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: 20150306172808) do
|
15
|
+
|
16
|
+
create_table "spark_plugs_static_pages", force: :cascade do |t|
|
17
|
+
t.string "page", null: false
|
18
|
+
t.string "title", null: false
|
19
|
+
t.text "content"
|
20
|
+
t.datetime "created_at", null: false
|
21
|
+
t.datetime "updated_at", null: false
|
22
|
+
end
|
23
|
+
|
24
|
+
end
|
Binary file
|
@@ -0,0 +1,83 @@
|
|
1
|
+
[1m[36m (0.4ms)[0m [1mCREATE TABLE "schema_migrations" ("version" varchar NOT NULL) [0m
|
2
|
+
[1m[35m (0.1ms)[0m select sqlite_version(*)
|
3
|
+
[1m[36m (0.2ms)[0m [1mCREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")[0m
|
4
|
+
[1m[35mActiveRecord::SchemaMigration Load (0.1ms)[0m SELECT "schema_migrations".* FROM "schema_migrations"
|
5
|
+
Migrating to CreateSparkPlugsStaticPages (20150306172808)
|
6
|
+
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
7
|
+
[1m[35m (0.3ms)[0m CREATE TABLE "spark_plugs_static_pages" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "page" varchar NOT NULL, "title" varchar NOT NULL, "content" text, "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL)
|
8
|
+
[1m[36mSQL (0.2ms)[0m [1mINSERT INTO "schema_migrations" ("version") VALUES (?)[0m [["version", "20150306172808"]]
|
9
|
+
[1m[35m (0.1ms)[0m commit transaction
|
10
|
+
[1m[36mActiveRecord::SchemaMigration Load (0.1ms)[0m [1mSELECT "schema_migrations".* FROM "schema_migrations"[0m
|
11
|
+
[1m[36mActiveRecord::SchemaMigration Load (0.1ms)[0m [1mSELECT "schema_migrations".* FROM "schema_migrations"[0m
|
12
|
+
[1m[35mActiveRecord::SchemaMigration Load (0.1ms)[0m SELECT "schema_migrations".* FROM "schema_migrations"
|
13
|
+
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
14
|
+
[1m[35mSparkPlugs::StaticPage Exists (0.2ms)[0m SELECT 1 AS one FROM "spark_plugs_static_pages" WHERE "spark_plugs_static_pages"."page" = '11ac8ny7f5xa42penonndmpjkj' LIMIT 1
|
15
|
+
[1m[36mSQL (0.3ms)[0m [1mINSERT INTO "spark_plugs_static_pages" ("page", "title", "content", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?)[0m [["page", "11ac8ny7f5xa42penonndmpjkj"], ["title", "f1yjetbee0faj5r69ssm0ltqj05i5b"], ["content", "Debitis doloribus iusto aperiam. Quia modi adipisci reprehenderit saepe vero fugit quia. Sint et sapiente corrupti a. Modi et esse ipsa nemo illo consequatur. Debitis incidunt ut explicabo cumque aut iste accusantium. Tempore aliquid molestiae. Omnis et qui dolore hic labore ut. Velit nam tempora voluptatem voluptatem quasi. Distinctio accusamus sit possimus consequuntur. Voluptas ea architecto quisquam quia dolorem. Doloribus aut similique et. Aut tenetur et dolor aut magnam sed. Expedita et laborum quos aut est ipsa minima. Non autem explicabo deleniti sed dolor. Et natus vel veniam blanditiis quasi. Ut corporis enim molestiae. Amet sunt expedita aut nesciunt laudantium deserunt. Eaque voluptatem repellendus officia. Fuga quo ipsa eligendi dolore. Odio sint autem suscipit rerum molestiae qui. Odio ipsum odit harum. Quas deserunt debitis quo officia aut qui cum. Nemo reiciendis odio quam. Quae accusamus eos est qui dolorum quaerat. Aut et voluptatem. Doloribus consequatur et aliquid eaque et perferendis voluptas. Dolor voluptatem esse. Placeat incidunt quisquam mollitia quo aliquam. Suscipit sint dolorum sed dolor autem maiores veniam. Maiores dolor qui. Distinctio sapiente temporibus vero doloribus explicabo."], ["created_at", "2015-03-11 21:15:09.765122"], ["updated_at", "2015-03-11 21:15:09.765122"]]
|
16
|
+
[1m[35m (0.1ms)[0m commit transaction
|
17
|
+
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
18
|
+
[1m[35mSparkPlugs::StaticPage Exists (0.2ms)[0m SELECT 1 AS one FROM "spark_plugs_static_pages" WHERE ("spark_plugs_static_pages"."page" = '11ac8ny7f5xa42penonndmpjkj' AND "spark_plugs_static_pages"."id" != 1) LIMIT 1
|
19
|
+
[1m[36m (0.1ms)[0m [1mcommit transaction[0m
|
20
|
+
[1m[35m (0.2ms)[0m begin transaction
|
21
|
+
[1m[36mSparkPlugs::StaticPage Exists (0.2ms)[0m [1mSELECT 1 AS one FROM "spark_plugs_static_pages" WHERE "spark_plugs_static_pages"."page" = '1xrpgum2vyqg1p8hkvw78uzmbd' LIMIT 1[0m
|
22
|
+
[1m[35mSQL (0.1ms)[0m INSERT INTO "spark_plugs_static_pages" ("page", "title", "content", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?) [["page", "1xrpgum2vyqg1p8hkvw78uzmbd"], ["title", "uy3wljfg57luwc721gqpfg0x6n10mi"], ["content", "Dignissimos in temporibus id. Quos quibusdam odio velit laboriosam reiciendis alias. Esse dicta atque ipsa et. Nulla velit qui atque distinctio molestiae aut facere. Voluptas qui maxime sed quis laboriosam voluptatem. Sint consequatur voluptatem rerum. Iure nostrum voluptas debitis qui quas necessitatibus. Quo perferendis eos voluptates eius et eum. Fugit expedita sequi. Nesciunt dolor nostrum eum doloremque voluptas dolores exercitationem. Molestias deserunt sit illo voluptas veniam. Cumque in recusandae. Aliquid et et repellendus non dolorum. Veniam et accusamus nam perferendis recusandae eveniet. Rem aspernatur sed debitis nam numquam. Quia voluptatem aut dolorum et. Cupiditate ducimus sit. Est cumque delectus rerum. Quos impedit dolorem facilis ut dolore. Dolores et occaecati. Fuga nam tempore error magni sed. Eius et maxime est. Quo odio architecto. Et facere veniam earum sit voluptatem aspernatur. Facere quisquam qui eius. Ratione voluptatibus molestiae id. Qui accusamus quae. Natus perferendis ab excepturi quisquam quo quas. Neque dignissimos ut minima. Dolore laboriosam aliquam."], ["created_at", "2015-03-11 21:15:09.783147"], ["updated_at", "2015-03-11 21:15:09.783147"]]
|
23
|
+
[1m[36m (0.1ms)[0m [1mcommit transaction[0m
|
24
|
+
[1m[35m (0.1ms)[0m begin transaction
|
25
|
+
Processing by SparkPlugs::StaticPagesController#show as HTML
|
26
|
+
Parameters: {"id"=>"2", "page"=>"invalidinvalid"}
|
27
|
+
[1m[36mSparkPlugs::StaticPage Load (0.2ms)[0m [1mSELECT "spark_plugs_static_pages".* FROM "spark_plugs_static_pages" WHERE "spark_plugs_static_pages"."page" = ? LIMIT 1[0m [["page", "invalidinvalid"]]
|
28
|
+
Completed 404 Not Found in 7ms
|
29
|
+
[1m[35m (0.1ms)[0m rollback transaction
|
30
|
+
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
31
|
+
Processing by SparkPlugs::StaticPagesController#show as HTML
|
32
|
+
Parameters: {"id"=>"2", "page"=>"1xrpgum2vyqg1p8hkvw78uzmbd"}
|
33
|
+
[1m[35mSparkPlugs::StaticPage Load (0.2ms)[0m SELECT "spark_plugs_static_pages".* FROM "spark_plugs_static_pages" WHERE "spark_plugs_static_pages"."page" = ? LIMIT 1 [["page", "1xrpgum2vyqg1p8hkvw78uzmbd"]]
|
34
|
+
Rendered /home/travis/build/whatisinternet/spark_plugs/app/views/spark_plugs/static_pages/show.html.erb within layouts/application (0.4ms)
|
35
|
+
Completed 200 OK in 14ms (Views: 12.8ms | ActiveRecord: 0.2ms)
|
36
|
+
[1m[36m (0.1ms)[0m [1mrollback transaction[0m
|
37
|
+
[1m[35m (0.1ms)[0m begin transaction
|
38
|
+
[1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m
|
39
|
+
[1m[35mSparkPlugs::StaticPage Exists (0.2ms)[0m SELECT 1 AS one FROM "spark_plugs_static_pages" WHERE "spark_plugs_static_pages"."page" = '2p3v5azk05cvcmsxbfgw3ew4sl' LIMIT 1
|
40
|
+
[1m[36mSQL (0.1ms)[0m [1mINSERT INTO "spark_plugs_static_pages" ("page", "title", "content", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?)[0m [["page", "2p3v5azk05cvcmsxbfgw3ew4sl"], ["title", "uy3wljfg57luwc721gqpfg0x6n10mi"], ["content", "Dignissimos in temporibus id. Quos quibusdam odio velit laboriosam reiciendis alias. Esse dicta atque ipsa et. Nulla velit qui atque distinctio molestiae aut facere. Voluptas qui maxime sed quis laboriosam voluptatem. Sint consequatur voluptatem rerum. Iure nostrum voluptas debitis qui quas necessitatibus. Quo perferendis eos voluptates eius et eum. Fugit expedita sequi. Nesciunt dolor nostrum eum doloremque voluptas dolores exercitationem. Molestias deserunt sit illo voluptas veniam. Cumque in recusandae. Aliquid et et repellendus non dolorum. Veniam et accusamus nam perferendis recusandae eveniet. Rem aspernatur sed debitis nam numquam. Quia voluptatem aut dolorum et. Cupiditate ducimus sit. Est cumque delectus rerum. Quos impedit dolorem facilis ut dolore. Dolores et occaecati. Fuga nam tempore error magni sed. Eius et maxime est. Quo odio architecto. Et facere veniam earum sit voluptatem aspernatur. Facere quisquam qui eius. Ratione voluptatibus molestiae id. Qui accusamus quae. Natus perferendis ab excepturi quisquam quo quas. Neque dignissimos ut minima. Dolore laboriosam aliquam."], ["created_at", "2015-03-11 21:15:09.829697"], ["updated_at", "2015-03-11 21:15:09.829697"]]
|
41
|
+
[1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1
|
42
|
+
[1m[36m (0.2ms)[0m [1mrollback transaction[0m
|
43
|
+
[1m[35m (0.1ms)[0m begin transaction
|
44
|
+
[1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m
|
45
|
+
[1m[35mSparkPlugs::StaticPage Exists (0.2ms)[0m SELECT 1 AS one FROM "spark_plugs_static_pages" WHERE "spark_plugs_static_pages"."page" = '3rwg1523v6qvcznfy9n05q2phe' LIMIT 1
|
46
|
+
[1m[36mSQL (0.1ms)[0m [1mINSERT INTO "spark_plugs_static_pages" ("page", "title", "content", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?)[0m [["page", "3rwg1523v6qvcznfy9n05q2phe"], ["title", "uy3wljfg57luwc721gqpfg0x6n10mi"], ["content", "Dignissimos in temporibus id. Quos quibusdam odio velit laboriosam reiciendis alias. Esse dicta atque ipsa et. Nulla velit qui atque distinctio molestiae aut facere. Voluptas qui maxime sed quis laboriosam voluptatem. Sint consequatur voluptatem rerum. Iure nostrum voluptas debitis qui quas necessitatibus. Quo perferendis eos voluptates eius et eum. Fugit expedita sequi. Nesciunt dolor nostrum eum doloremque voluptas dolores exercitationem. Molestias deserunt sit illo voluptas veniam. Cumque in recusandae. Aliquid et et repellendus non dolorum. Veniam et accusamus nam perferendis recusandae eveniet. Rem aspernatur sed debitis nam numquam. Quia voluptatem aut dolorum et. Cupiditate ducimus sit. Est cumque delectus rerum. Quos impedit dolorem facilis ut dolore. Dolores et occaecati. Fuga nam tempore error magni sed. Eius et maxime est. Quo odio architecto. Et facere veniam earum sit voluptatem aspernatur. Facere quisquam qui eius. Ratione voluptatibus molestiae id. Qui accusamus quae. Natus perferendis ab excepturi quisquam quo quas. Neque dignissimos ut minima. Dolore laboriosam aliquam."], ["created_at", "2015-03-11 21:15:09.838199"], ["updated_at", "2015-03-11 21:15:09.838199"]]
|
47
|
+
[1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1
|
48
|
+
[1m[36m (0.1ms)[0m [1mrollback transaction[0m
|
49
|
+
[1m[35m (0.1ms)[0m begin transaction
|
50
|
+
[1m[36mSparkPlugs::StaticPage Load (0.1ms)[0m [1mSELECT "spark_plugs_static_pages".* FROM "spark_plugs_static_pages" WHERE "spark_plugs_static_pages"."page" = ? LIMIT 1[0m [["page", "fail"]]
|
51
|
+
[1m[35m (0.1ms)[0m rollback transaction
|
52
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
53
|
+
[1m[35mSparkPlugs::StaticPage Load (0.1ms)[0m SELECT "spark_plugs_static_pages".* FROM "spark_plugs_static_pages" WHERE "spark_plugs_static_pages"."page" = ? LIMIT 1 [["page", ""]]
|
54
|
+
[1m[36m (0.1ms)[0m [1mrollback transaction[0m
|
55
|
+
[1m[35m (0.1ms)[0m begin transaction
|
56
|
+
[1m[36mSparkPlugs::StaticPage Exists (0.2ms)[0m [1mSELECT 1 AS one FROM "spark_plugs_static_pages" WHERE "spark_plugs_static_pages"."page" IS NULL LIMIT 1[0m
|
57
|
+
[1m[35mSparkPlugs::StaticPage Exists (0.1ms)[0m SELECT 1 AS one FROM "spark_plugs_static_pages" WHERE "spark_plugs_static_pages"."page" IS NULL LIMIT 1
|
58
|
+
[1m[36m (0.1ms)[0m [1mrollback transaction[0m
|
59
|
+
[1m[35m (0.1ms)[0m begin transaction
|
60
|
+
[1m[36mSparkPlugs::StaticPage Exists (0.1ms)[0m [1mSELECT 1 AS one FROM "spark_plugs_static_pages" WHERE "spark_plugs_static_pages"."page" IS NULL LIMIT 1[0m
|
61
|
+
[1m[35m (0.1ms)[0m rollback transaction
|
62
|
+
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
63
|
+
[1m[35mSparkPlugs::StaticPage Exists (0.1ms)[0m SELECT 1 AS one FROM "spark_plugs_static_pages" WHERE "spark_plugs_static_pages"."page" = 'xx' LIMIT 1
|
64
|
+
[1m[36mSparkPlugs::StaticPage Exists (0.1ms)[0m [1mSELECT 1 AS one FROM "spark_plugs_static_pages" WHERE "spark_plugs_static_pages"."page" = 'xxx' LIMIT 1[0m
|
65
|
+
[1m[35m (0.1ms)[0m rollback transaction
|
66
|
+
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
67
|
+
[1m[35mSparkPlugs::StaticPage Exists (0.1ms)[0m SELECT 1 AS one FROM "spark_plugs_static_pages" WHERE "spark_plugs_static_pages"."page" IS NULL LIMIT 1
|
68
|
+
[1m[36m (0.1ms)[0m [1mrollback transaction[0m
|
69
|
+
[1m[35m (0.1ms)[0m begin transaction
|
70
|
+
[1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m
|
71
|
+
[1m[35mSparkPlugs::StaticPage Exists (0.1ms)[0m SELECT 1 AS one FROM "spark_plugs_static_pages" WHERE "spark_plugs_static_pages"."page" = '48ma0schrbea9lvc662p0x56if' LIMIT 1
|
72
|
+
[1m[36mSQL (0.1ms)[0m [1mINSERT INTO "spark_plugs_static_pages" ("page", "title", "content", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?)[0m [["page", "48ma0schrbea9lvc662p0x56if"], ["title", "uy3wljfg57luwc721gqpfg0x6n10mi"], ["content", "Dignissimos in temporibus id. Quos quibusdam odio velit laboriosam reiciendis alias. Esse dicta atque ipsa et. Nulla velit qui atque distinctio molestiae aut facere. Voluptas qui maxime sed quis laboriosam voluptatem. Sint consequatur voluptatem rerum. Iure nostrum voluptas debitis qui quas necessitatibus. Quo perferendis eos voluptates eius et eum. Fugit expedita sequi. Nesciunt dolor nostrum eum doloremque voluptas dolores exercitationem. Molestias deserunt sit illo voluptas veniam. Cumque in recusandae. Aliquid et et repellendus non dolorum. Veniam et accusamus nam perferendis recusandae eveniet. Rem aspernatur sed debitis nam numquam. Quia voluptatem aut dolorum et. Cupiditate ducimus sit. Est cumque delectus rerum. Quos impedit dolorem facilis ut dolore. Dolores et occaecati. Fuga nam tempore error magni sed. Eius et maxime est. Quo odio architecto. Et facere veniam earum sit voluptatem aspernatur. Facere quisquam qui eius. Ratione voluptatibus molestiae id. Qui accusamus quae. Natus perferendis ab excepturi quisquam quo quas. Neque dignissimos ut minima. Dolore laboriosam aliquam."], ["created_at", "2015-03-11 21:15:09.885564"], ["updated_at", "2015-03-11 21:15:09.885564"]]
|
73
|
+
[1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1
|
74
|
+
[1m[36mSparkPlugs::StaticPage Load (0.1ms)[0m [1mSELECT "spark_plugs_static_pages".* FROM "spark_plugs_static_pages" ORDER BY "spark_plugs_static_pages"."id" ASC LIMIT 1[0m
|
75
|
+
[1m[35mSparkPlugs::StaticPage Exists (0.1ms)[0m SELECT 1 AS one FROM "spark_plugs_static_pages" WHERE "spark_plugs_static_pages"."page" = '11ac8ny7f5xa42penonndmpjkj' LIMIT 1
|
76
|
+
[1m[36m (0.1ms)[0m [1mrollback transaction[0m
|
77
|
+
[1m[35m (0.1ms)[0m begin transaction
|
78
|
+
[1m[36mSparkPlugs::StaticPage Exists (0.1ms)[0m [1mSELECT 1 AS one FROM "spark_plugs_static_pages" WHERE "spark_plugs_static_pages"."page" IS NULL LIMIT 1[0m
|
79
|
+
[1m[35mSparkPlugs::StaticPage Exists (0.1ms)[0m SELECT 1 AS one FROM "spark_plugs_static_pages" WHERE "spark_plugs_static_pages"."page" IS NULL LIMIT 1
|
80
|
+
[1m[36m (0.1ms)[0m [1mrollback transaction[0m
|
81
|
+
[1m[35m (0.0ms)[0m begin transaction
|
82
|
+
[1m[36mSparkPlugs::StaticPage Exists (0.1ms)[0m [1mSELECT 1 AS one FROM "spark_plugs_static_pages" WHERE "spark_plugs_static_pages"."page" IS NULL LIMIT 1[0m
|
83
|
+
[1m[35m (0.1ms)[0m rollback transaction
|
@@ -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,22 @@
|
|
1
|
+
# == Schema Information
|
2
|
+
#
|
3
|
+
# Table name: spark_plugs_static_pages
|
4
|
+
#
|
5
|
+
# id :integer not null, primary key
|
6
|
+
# page :string not null
|
7
|
+
# title :string not null
|
8
|
+
# content :text
|
9
|
+
# created_at :datetime not null
|
10
|
+
# updated_at :datetime not null
|
11
|
+
#
|
12
|
+
|
13
|
+
require 'faker'
|
14
|
+
|
15
|
+
FactoryGirl.define do
|
16
|
+
factory :spark_plugs_static_page, :class => 'SparkPlugs::StaticPage' do
|
17
|
+
sequence(:page){|n| "#{n}#{Faker::Lorem.characters(25)}"}
|
18
|
+
title Faker::Lorem.characters(30)
|
19
|
+
content Faker::Lorem.paragraph(30)
|
20
|
+
end
|
21
|
+
|
22
|
+
end
|
@@ -0,0 +1,25 @@
|
|
1
|
+
require 'rails_helper'
|
2
|
+
|
3
|
+
# Specs in this file have access to a helper object that includes
|
4
|
+
# the StaticPagesHelper. For example:
|
5
|
+
#
|
6
|
+
# describe StaticPagesHelper do
|
7
|
+
# describe "string concat" do
|
8
|
+
# it "concats two strings with spaces" do
|
9
|
+
# expect(helper.concat_strings("this","that")).to eq("this that")
|
10
|
+
# end
|
11
|
+
# end
|
12
|
+
# end
|
13
|
+
module SparkPlugs
|
14
|
+
RSpec.describe StaticPagesHelper, type: :helper do
|
15
|
+
before :each do
|
16
|
+
@page = FactoryGirl.create(:spark_plugs_static_page)
|
17
|
+
end
|
18
|
+
describe "set_title" do
|
19
|
+
it "sets the @title variable for compatibility" do
|
20
|
+
assign(:static_page, @page)
|
21
|
+
expect(helper.set_title).to eq(@page.title)
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
@@ -0,0 +1,48 @@
|
|
1
|
+
# == Schema Information
|
2
|
+
#
|
3
|
+
# Table name: spark_plugs_static_pages
|
4
|
+
#
|
5
|
+
# id :integer not null, primary key
|
6
|
+
# page :string not null
|
7
|
+
# title :string not null
|
8
|
+
# content :text
|
9
|
+
# created_at :datetime not null
|
10
|
+
# updated_at :datetime not null
|
11
|
+
#
|
12
|
+
|
13
|
+
require 'rails_helper'
|
14
|
+
|
15
|
+
module SparkPlugs
|
16
|
+
RSpec.describe StaticPage, type: :model do
|
17
|
+
|
18
|
+
describe 'validations' do
|
19
|
+
context 'page' do
|
20
|
+
it { should validate_presence_of(:page) }
|
21
|
+
it { should validate_length_of(:page).is_at_least(3) }
|
22
|
+
it do
|
23
|
+
FactoryGirl.create(:spark_plugs_static_page)
|
24
|
+
should validate_uniqueness_of(:page)
|
25
|
+
end
|
26
|
+
end
|
27
|
+
context 'title' do
|
28
|
+
it { should validate_presence_of(:title) }
|
29
|
+
it { should validate_length_of(:title).is_at_least(5) }
|
30
|
+
end
|
31
|
+
context 'content' do
|
32
|
+
it { should validate_presence_of(:content) }
|
33
|
+
it { should validate_length_of(:content).is_at_least(5) }
|
34
|
+
end
|
35
|
+
end
|
36
|
+
|
37
|
+
describe 'get_page' do
|
38
|
+
@static_page = FactoryGirl.create(:spark_plugs_static_page).save!
|
39
|
+
it 'should return a valid page' do
|
40
|
+
expect(StaticPage.get_page(@static_page)).to eq(@static_page)
|
41
|
+
end
|
42
|
+
it 'should return nil on invlid page' do
|
43
|
+
expect(StaticPage.get_page('fail')).to be_nil
|
44
|
+
end
|
45
|
+
end
|
46
|
+
|
47
|
+
end
|
48
|
+
end
|
@@ -0,0 +1,65 @@
|
|
1
|
+
# spec/spec_helper.rb
|
2
|
+
|
3
|
+
# This file is copied to spec/ when you run 'rails generate rspec:install'
|
4
|
+
require "codeclimate-test-reporter"
|
5
|
+
CodeClimate::TestReporter.start
|
6
|
+
|
7
|
+
ENV["RAILS_ENV"] ||= 'test'
|
8
|
+
|
9
|
+
################################################################
|
10
|
+
# Change this
|
11
|
+
# require File.expand_path("../../config/environment", __FILE__)
|
12
|
+
#
|
13
|
+
# to this
|
14
|
+
require File.expand_path("../dummy/config/environment", __FILE__)
|
15
|
+
################################################################
|
16
|
+
|
17
|
+
require 'rspec/rails'
|
18
|
+
require 'factory_girl_rails'
|
19
|
+
require 'shoulda/matchers'
|
20
|
+
|
21
|
+
# Requires supporting ruby files with custom matchers and macros, etc,
|
22
|
+
# in spec/support/ and its subdirectories.
|
23
|
+
|
24
|
+
################################################################
|
25
|
+
# Change this
|
26
|
+
# Dir[Rails.root.join("spec/support/**/*.rb")].each { |f| require f }
|
27
|
+
# To this
|
28
|
+
#ENGINE_RAILS_ROOT=File.join(File.dirname(__FILE__), '../')
|
29
|
+
Dir[File.join(ENGINE_RAILS_ROOT, "spec/support/**/*.rb")].each {|f| require f }
|
30
|
+
################################################################
|
31
|
+
|
32
|
+
# Checks for pending migrations before tests are run.
|
33
|
+
# If you are not using ActiveRecord, you can remove this line.
|
34
|
+
ActiveRecord::Migration.check_pending! if defined?(ActiveRecord::Migration)
|
35
|
+
|
36
|
+
RSpec.configure do |config|
|
37
|
+
# ## Mock Framework
|
38
|
+
#
|
39
|
+
# If you prefer to use mocha, flexmock or RR, uncomment the
|
40
|
+
# appropriate line:
|
41
|
+
#
|
42
|
+
# config.mock_with :mocha
|
43
|
+
# config.mock_with :flexmock
|
44
|
+
# config.mock_with :rr
|
45
|
+
config.before(:suite) { FactoryGirl.reload }
|
46
|
+
# Remove this line if you're not using ActiveRecord or ActiveRecord
|
47
|
+
# fixtures
|
48
|
+
config.fixture_path = "#{::Rails.root}/spec/fixtures"
|
49
|
+
|
50
|
+
# If you're not using ActiveRecord, or you'd prefer not to run each of
|
51
|
+
# your examples within a transaction, remove the following line or
|
52
|
+
# assign false instead of true.
|
53
|
+
config.use_transactional_fixtures = true
|
54
|
+
|
55
|
+
# If true, the base class of anonymous controllers will be inferred
|
56
|
+
# automatically. This will be the default behavior in future versions of
|
57
|
+
# rspec-rails.
|
58
|
+
config.infer_base_class_for_anonymous_controllers = false
|
59
|
+
|
60
|
+
# Run specs in random order to surface order dependencies. If you find
|
61
|
+
# an order dependency and want to debug it, you can fix the order by
|
62
|
+
# providing the seed, which is printed after each run.
|
63
|
+
# --seed 1234
|
64
|
+
config.order = "random"
|
65
|
+
end
|