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