adminish 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (78) hide show
  1. checksums.yaml +7 -0
  2. data/MIT-LICENSE +20 -0
  3. data/README.rdoc +3 -0
  4. data/Rakefile +34 -0
  5. data/lib/adminish.rb +58 -0
  6. data/lib/adminish/version.rb +3 -0
  7. data/lib/tasks/adminish_tasks.rake +4 -0
  8. data/test/adminish_test.rb +11 -0
  9. data/test/dummy/README.rdoc +28 -0
  10. data/test/dummy/Rakefile +6 -0
  11. data/test/dummy/app/assets/javascripts/application.js +13 -0
  12. data/test/dummy/app/assets/javascripts/categories.js +2 -0
  13. data/test/dummy/app/assets/javascripts/posts.js +2 -0
  14. data/test/dummy/app/assets/stylesheets/application.css +15 -0
  15. data/test/dummy/app/assets/stylesheets/categories.css +4 -0
  16. data/test/dummy/app/assets/stylesheets/posts.css +4 -0
  17. data/test/dummy/app/assets/stylesheets/scaffold.css +56 -0
  18. data/test/dummy/app/controllers/application_controller.rb +9 -0
  19. data/test/dummy/app/controllers/categories_controller.rb +58 -0
  20. data/test/dummy/app/controllers/posts_controller.rb +58 -0
  21. data/test/dummy/app/helpers/application_helper.rb +2 -0
  22. data/test/dummy/app/helpers/categories_helper.rb +2 -0
  23. data/test/dummy/app/helpers/posts_helper.rb +2 -0
  24. data/test/dummy/app/models/category.rb +2 -0
  25. data/test/dummy/app/models/post.rb +2 -0
  26. data/test/dummy/app/views/categories/_form.html.erb +21 -0
  27. data/test/dummy/app/views/categories/edit.html.erb +6 -0
  28. data/test/dummy/app/views/categories/index.html.erb +27 -0
  29. data/test/dummy/app/views/categories/new.html.erb +5 -0
  30. data/test/dummy/app/views/categories/show.html.erb +9 -0
  31. data/test/dummy/app/views/layouts/application.html.erb +14 -0
  32. data/test/dummy/app/views/posts/_form.html.erb +25 -0
  33. data/test/dummy/app/views/posts/edit.html.erb +6 -0
  34. data/test/dummy/app/views/posts/index.html.erb +29 -0
  35. data/test/dummy/app/views/posts/new.html.erb +5 -0
  36. data/test/dummy/app/views/posts/show.html.erb +14 -0
  37. data/test/dummy/bin/bundle +3 -0
  38. data/test/dummy/bin/rails +4 -0
  39. data/test/dummy/bin/rake +4 -0
  40. data/test/dummy/bin/setup +29 -0
  41. data/test/dummy/config.ru +4 -0
  42. data/test/dummy/config/application.rb +26 -0
  43. data/test/dummy/config/boot.rb +5 -0
  44. data/test/dummy/config/database.yml +25 -0
  45. data/test/dummy/config/environment.rb +5 -0
  46. data/test/dummy/config/environments/development.rb +41 -0
  47. data/test/dummy/config/environments/production.rb +79 -0
  48. data/test/dummy/config/environments/test.rb +42 -0
  49. data/test/dummy/config/initializers/assets.rb +11 -0
  50. data/test/dummy/config/initializers/backtrace_silencers.rb +7 -0
  51. data/test/dummy/config/initializers/cookies_serializer.rb +3 -0
  52. data/test/dummy/config/initializers/filter_parameter_logging.rb +4 -0
  53. data/test/dummy/config/initializers/inflections.rb +16 -0
  54. data/test/dummy/config/initializers/mime_types.rb +4 -0
  55. data/test/dummy/config/initializers/session_store.rb +3 -0
  56. data/test/dummy/config/initializers/wrap_parameters.rb +14 -0
  57. data/test/dummy/config/locales/en.yml +23 -0
  58. data/test/dummy/config/routes.rb +59 -0
  59. data/test/dummy/config/secrets.yml +22 -0
  60. data/test/dummy/db/development.sqlite3 +0 -0
  61. data/test/dummy/db/migrate/20160627200642_create_posts.rb +10 -0
  62. data/test/dummy/db/migrate/20160627201854_create_categories.rb +9 -0
  63. data/test/dummy/db/schema.rb +29 -0
  64. data/test/dummy/db/test.sqlite3 +0 -0
  65. data/test/dummy/log/development.log +217 -0
  66. data/test/dummy/log/test.log +139 -0
  67. data/test/dummy/public/404.html +67 -0
  68. data/test/dummy/public/422.html +67 -0
  69. data/test/dummy/public/500.html +66 -0
  70. data/test/dummy/public/favicon.ico +0 -0
  71. data/test/dummy/test/controllers/categories_controller_test.rb +49 -0
  72. data/test/dummy/test/controllers/posts_controller_test.rb +49 -0
  73. data/test/dummy/test/fixtures/categories.yml +7 -0
  74. data/test/dummy/test/fixtures/posts.yml +9 -0
  75. data/test/dummy/test/models/category_test.rb +7 -0
  76. data/test/dummy/test/models/post_test.rb +7 -0
  77. data/test/test_helper.rb +20 -0
  78. metadata +205 -0
@@ -0,0 +1,139 @@
1
+  (19.8ms) CREATE TABLE "posts" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "title" varchar, "body" text, "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL) 
2
+  (1.2ms) CREATE TABLE "schema_migrations" ("version" varchar NOT NULL)
3
+  (0.1ms) select sqlite_version(*)
4
+  (1.1ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
5
+  (0.1ms) SELECT version FROM "schema_migrations"
6
+  (1.0ms) INSERT INTO "schema_migrations" (version) VALUES ('20160627200642')
7
+ ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
8
+  (0.1ms) begin transaction
9
+ -----------------------------------
10
+ AdminishTest: test_can_create_model
11
+ -----------------------------------
12
+  (0.0ms) rollback transaction
13
+ ActiveRecord::SchemaMigration Load (0.3ms) SELECT "schema_migrations".* FROM "schema_migrations"
14
+  (0.1ms) begin transaction
15
+ -----------------------------------
16
+ AdminishTest: test_can_create_model
17
+ -----------------------------------
18
+  (0.1ms) rollback transaction
19
+ ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
20
+  (0.1ms) begin transaction
21
+ -----------------------------------
22
+ AdminishTest: test_can_create_model
23
+ -----------------------------------
24
+  (0.1ms) rollback transaction
25
+ ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations"
26
+  (0.1ms) begin transaction
27
+ -----------------------------------
28
+ AdminishTest: test_can_create_model
29
+ -----------------------------------
30
+  (0.1ms) rollback transaction
31
+ ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
32
+  (0.1ms) begin transaction
33
+ -----------------------------------
34
+ AdminishTest: test_can_create_model
35
+ -----------------------------------
36
+  (0.1ms) rollback transaction
37
+ ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations"
38
+  (0.1ms) begin transaction
39
+ -----------------------------------
40
+ AdminishTest: test_can_create_model
41
+ -----------------------------------
42
+  (0.1ms) rollback transaction
43
+ ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
44
+  (0.1ms) begin transaction
45
+ -----------------------------------
46
+ AdminishTest: test_can_create_admin
47
+ -----------------------------------
48
+  (0.1ms) rollback transaction
49
+  (0.0ms) begin transaction
50
+ -----------------------------------
51
+ AdminishTest: test_can_create_model
52
+ -----------------------------------
53
+  (0.1ms) rollback transaction
54
+ ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
55
+  (0.1ms) begin transaction
56
+ -----------------------------------
57
+ AdminishTest: test_can_create_model
58
+ -----------------------------------
59
+  (0.1ms) rollback transaction
60
+  (0.1ms) begin transaction
61
+ -----------------------------------
62
+ AdminishTest: test_can_create_admin
63
+ -----------------------------------
64
+  (0.0ms) rollback transaction
65
+ ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
66
+  (0.1ms) begin transaction
67
+ -----------------------------------
68
+ AdminishTest: test_can_create_admin
69
+ -----------------------------------
70
+  (0.0ms) rollback transaction
71
+  (0.1ms) begin transaction
72
+ -----------------------------------
73
+ AdminishTest: test_can_create_model
74
+ -----------------------------------
75
+  (0.2ms) rollback transaction
76
+ ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
77
+  (0.1ms) begin transaction
78
+ -----------------------------------
79
+ AdminishTest: test_can_create_admin
80
+ -----------------------------------
81
+  (0.1ms) rollback transaction
82
+  (0.1ms) begin transaction
83
+ -----------------------------------
84
+ AdminishTest: test_can_create_model
85
+ -----------------------------------
86
+  (0.1ms) rollback transaction
87
+ ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
88
+  (0.1ms) begin transaction
89
+ -----------------------------------
90
+ AdminishTest: test_can_create_admin
91
+ -----------------------------------
92
+  (0.1ms) rollback transaction
93
+  (0.1ms) begin transaction
94
+ -----------------------------------
95
+ AdminishTest: test_can_create_model
96
+ -----------------------------------
97
+  (0.1ms) rollback transaction
98
+ ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations"
99
+  (0.1ms) begin transaction
100
+ -----------------------------------
101
+ AdminishTest: test_can_create_admin
102
+ -----------------------------------
103
+  (0.2ms) rollback transaction
104
+  (0.1ms) begin transaction
105
+ -----------------------------------
106
+ AdminishTest: test_can_create_model
107
+ -----------------------------------
108
+  (1.2ms) rollback transaction
109
+ ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
110
+  (1.4ms) CREATE TABLE "categories" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "title" varchar, "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL) 
111
+  (1.2ms) CREATE TABLE "posts" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "title" varchar, "body" text, "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL)
112
+  (1.4ms) CREATE TABLE "schema_migrations" ("version" varchar NOT NULL) 
113
+  (0.1ms) select sqlite_version(*)
114
+  (1.2ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
115
+  (0.1ms) SELECT version FROM "schema_migrations"
116
+  (1.7ms) INSERT INTO "schema_migrations" (version) VALUES ('20160627201854')
117
+  (1.3ms) INSERT INTO "schema_migrations" (version) VALUES ('20160627200642')
118
+ ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
119
+  (0.1ms) begin transaction
120
+ -----------------------------------
121
+ AdminishTest: test_can_create_model
122
+ -----------------------------------
123
+  (0.1ms) rollback transaction
124
+  (0.1ms) begin transaction
125
+ -----------------------------------
126
+ AdminishTest: test_can_create_admin
127
+ -----------------------------------
128
+  (0.1ms) rollback transaction
129
+ ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
130
+  (0.1ms) begin transaction
131
+ -----------------------------------
132
+ AdminishTest: test_can_create_admin
133
+ -----------------------------------
134
+  (0.1ms) rollback transaction
135
+  (0.1ms) begin transaction
136
+ -----------------------------------
137
+ AdminishTest: test_can_create_model
138
+ -----------------------------------
139
+  (0.0ms) 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,49 @@
1
+ require 'test_helper'
2
+
3
+ class CategoriesControllerTest < ActionController::TestCase
4
+ setup do
5
+ @category = categories(:one)
6
+ end
7
+
8
+ test "should get index" do
9
+ get :index
10
+ assert_response :success
11
+ assert_not_nil assigns(:categories)
12
+ end
13
+
14
+ test "should get new" do
15
+ get :new
16
+ assert_response :success
17
+ end
18
+
19
+ test "should create category" do
20
+ assert_difference('Category.count') do
21
+ post :create, category: { title: @category.title }
22
+ end
23
+
24
+ assert_redirected_to category_path(assigns(:category))
25
+ end
26
+
27
+ test "should show category" do
28
+ get :show, id: @category
29
+ assert_response :success
30
+ end
31
+
32
+ test "should get edit" do
33
+ get :edit, id: @category
34
+ assert_response :success
35
+ end
36
+
37
+ test "should update category" do
38
+ patch :update, id: @category, category: { title: @category.title }
39
+ assert_redirected_to category_path(assigns(:category))
40
+ end
41
+
42
+ test "should destroy category" do
43
+ assert_difference('Category.count', -1) do
44
+ delete :destroy, id: @category
45
+ end
46
+
47
+ assert_redirected_to categories_path
48
+ end
49
+ end
@@ -0,0 +1,49 @@
1
+ require 'test_helper'
2
+
3
+ class PostsControllerTest < ActionController::TestCase
4
+ setup do
5
+ @post = posts(:one)
6
+ end
7
+
8
+ test "should get index" do
9
+ get :index
10
+ assert_response :success
11
+ assert_not_nil assigns(:posts)
12
+ end
13
+
14
+ test "should get new" do
15
+ get :new
16
+ assert_response :success
17
+ end
18
+
19
+ test "should create post" do
20
+ assert_difference('Post.count') do
21
+ post :create, post: { body: @post.body, title: @post.title }
22
+ end
23
+
24
+ assert_redirected_to post_path(assigns(:post))
25
+ end
26
+
27
+ test "should show post" do
28
+ get :show, id: @post
29
+ assert_response :success
30
+ end
31
+
32
+ test "should get edit" do
33
+ get :edit, id: @post
34
+ assert_response :success
35
+ end
36
+
37
+ test "should update post" do
38
+ patch :update, id: @post, post: { body: @post.body, title: @post.title }
39
+ assert_redirected_to post_path(assigns(:post))
40
+ end
41
+
42
+ test "should destroy post" do
43
+ assert_difference('Post.count', -1) do
44
+ delete :destroy, id: @post
45
+ end
46
+
47
+ assert_redirected_to posts_path
48
+ end
49
+ end
@@ -0,0 +1,7 @@
1
+ # Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html
2
+
3
+ one:
4
+ title: MyString
5
+
6
+ two:
7
+ title: MyString