friendly_slug 0.1.6 → 0.1.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (123) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +1 -1
  3. data/friendly_slug.gemspec +1 -1
  4. data/lib/friendly_slug/version.rb +1 -1
  5. metadata +1 -119
  6. data/friendly_slug_gem_test/.gitignore +0 -30
  7. data/friendly_slug_gem_test/.ruby-version +0 -1
  8. data/friendly_slug_gem_test/Gemfile +0 -32
  9. data/friendly_slug_gem_test/Gemfile.lock +0 -222
  10. data/friendly_slug_gem_test/README.md +0 -24
  11. data/friendly_slug_gem_test/Rakefile +0 -6
  12. data/friendly_slug_gem_test/app/assets/config/manifest.js +0 -3
  13. data/friendly_slug_gem_test/app/assets/images/.keep +0 -0
  14. data/friendly_slug_gem_test/app/assets/javascripts/application.js +0 -16
  15. data/friendly_slug_gem_test/app/assets/javascripts/blogs.coffee +0 -3
  16. data/friendly_slug_gem_test/app/assets/javascripts/cable.js +0 -13
  17. data/friendly_slug_gem_test/app/assets/javascripts/channels/.keep +0 -0
  18. data/friendly_slug_gem_test/app/assets/javascripts/topics.coffee +0 -3
  19. data/friendly_slug_gem_test/app/assets/stylesheets/application.css +0 -15
  20. data/friendly_slug_gem_test/app/assets/stylesheets/blogs.scss +0 -3
  21. data/friendly_slug_gem_test/app/assets/stylesheets/scaffolds.scss +0 -84
  22. data/friendly_slug_gem_test/app/assets/stylesheets/topics.scss +0 -3
  23. data/friendly_slug_gem_test/app/channels/application_cable/channel.rb +0 -4
  24. data/friendly_slug_gem_test/app/channels/application_cable/connection.rb +0 -4
  25. data/friendly_slug_gem_test/app/controllers/application_controller.rb +0 -2
  26. data/friendly_slug_gem_test/app/controllers/blogs_controller.rb +0 -60
  27. data/friendly_slug_gem_test/app/controllers/concerns/.keep +0 -0
  28. data/friendly_slug_gem_test/app/controllers/topics_controller.rb +0 -60
  29. data/friendly_slug_gem_test/app/helpers/application_helper.rb +0 -2
  30. data/friendly_slug_gem_test/app/helpers/blogs_helper.rb +0 -2
  31. data/friendly_slug_gem_test/app/helpers/topics_helper.rb +0 -2
  32. data/friendly_slug_gem_test/app/jobs/application_job.rb +0 -2
  33. data/friendly_slug_gem_test/app/mailers/application_mailer.rb +0 -4
  34. data/friendly_slug_gem_test/app/models/application_record.rb +0 -3
  35. data/friendly_slug_gem_test/app/models/blog.rb +0 -3
  36. data/friendly_slug_gem_test/app/models/concerns/.keep +0 -0
  37. data/friendly_slug_gem_test/app/models/topic.rb +0 -3
  38. data/friendly_slug_gem_test/app/views/blogs/_blog.json.jbuilder +0 -2
  39. data/friendly_slug_gem_test/app/views/blogs/_form.html.erb +0 -32
  40. data/friendly_slug_gem_test/app/views/blogs/edit.html.erb +0 -6
  41. data/friendly_slug_gem_test/app/views/blogs/index.html.erb +0 -31
  42. data/friendly_slug_gem_test/app/views/blogs/index.json.jbuilder +0 -1
  43. data/friendly_slug_gem_test/app/views/blogs/new.html.erb +0 -5
  44. data/friendly_slug_gem_test/app/views/blogs/show.html.erb +0 -19
  45. data/friendly_slug_gem_test/app/views/blogs/show.json.jbuilder +0 -1
  46. data/friendly_slug_gem_test/app/views/layouts/application.html.erb +0 -15
  47. data/friendly_slug_gem_test/app/views/layouts/mailer.html.erb +0 -13
  48. data/friendly_slug_gem_test/app/views/layouts/mailer.text.erb +0 -1
  49. data/friendly_slug_gem_test/app/views/topics/_form.html.erb +0 -37
  50. data/friendly_slug_gem_test/app/views/topics/_topic.json.jbuilder +0 -2
  51. data/friendly_slug_gem_test/app/views/topics/edit.html.erb +0 -6
  52. data/friendly_slug_gem_test/app/views/topics/index.html.erb +0 -33
  53. data/friendly_slug_gem_test/app/views/topics/index.json.jbuilder +0 -1
  54. data/friendly_slug_gem_test/app/views/topics/new.html.erb +0 -5
  55. data/friendly_slug_gem_test/app/views/topics/show.html.erb +0 -24
  56. data/friendly_slug_gem_test/app/views/topics/show.json.jbuilder +0 -1
  57. data/friendly_slug_gem_test/bin/bundle +0 -3
  58. data/friendly_slug_gem_test/bin/rails +0 -9
  59. data/friendly_slug_gem_test/bin/rake +0 -9
  60. data/friendly_slug_gem_test/bin/setup +0 -36
  61. data/friendly_slug_gem_test/bin/spring +0 -17
  62. data/friendly_slug_gem_test/bin/update +0 -31
  63. data/friendly_slug_gem_test/bin/yarn +0 -11
  64. data/friendly_slug_gem_test/config.ru +0 -5
  65. data/friendly_slug_gem_test/config/application.rb +0 -20
  66. data/friendly_slug_gem_test/config/boot.rb +0 -4
  67. data/friendly_slug_gem_test/config/cable.yml +0 -10
  68. data/friendly_slug_gem_test/config/credentials.yml.enc +0 -1
  69. data/friendly_slug_gem_test/config/database.yml +0 -25
  70. data/friendly_slug_gem_test/config/environment.rb +0 -5
  71. data/friendly_slug_gem_test/config/environments/development.rb +0 -61
  72. data/friendly_slug_gem_test/config/environments/production.rb +0 -94
  73. data/friendly_slug_gem_test/config/environments/test.rb +0 -46
  74. data/friendly_slug_gem_test/config/initializers/application_controller_renderer.rb +0 -8
  75. data/friendly_slug_gem_test/config/initializers/assets.rb +0 -14
  76. data/friendly_slug_gem_test/config/initializers/backtrace_silencers.rb +0 -7
  77. data/friendly_slug_gem_test/config/initializers/content_security_policy.rb +0 -25
  78. data/friendly_slug_gem_test/config/initializers/cookies_serializer.rb +0 -5
  79. data/friendly_slug_gem_test/config/initializers/filter_parameter_logging.rb +0 -4
  80. data/friendly_slug_gem_test/config/initializers/inflections.rb +0 -16
  81. data/friendly_slug_gem_test/config/initializers/mime_types.rb +0 -4
  82. data/friendly_slug_gem_test/config/initializers/wrap_parameters.rb +0 -14
  83. data/friendly_slug_gem_test/config/locales/en.yml +0 -33
  84. data/friendly_slug_gem_test/config/puma.rb +0 -34
  85. data/friendly_slug_gem_test/config/routes.rb +0 -5
  86. data/friendly_slug_gem_test/config/spring.rb +0 -6
  87. data/friendly_slug_gem_test/config/storage.yml +0 -34
  88. data/friendly_slug_gem_test/db/migrate/20180628233122_create_blogs.rb +0 -11
  89. data/friendly_slug_gem_test/db/migrate/20180630053922_create_topics.rb +0 -13
  90. data/friendly_slug_gem_test/db/schema.rb +0 -33
  91. data/friendly_slug_gem_test/db/seeds.rb +0 -9
  92. data/friendly_slug_gem_test/lib/assets/.keep +0 -0
  93. data/friendly_slug_gem_test/lib/tasks/.keep +0 -0
  94. data/friendly_slug_gem_test/log/.keep +0 -0
  95. data/friendly_slug_gem_test/package.json +0 -5
  96. data/friendly_slug_gem_test/public/404.html +0 -67
  97. data/friendly_slug_gem_test/public/422.html +0 -67
  98. data/friendly_slug_gem_test/public/500.html +0 -66
  99. data/friendly_slug_gem_test/public/apple-touch-icon-precomposed.png +0 -0
  100. data/friendly_slug_gem_test/public/apple-touch-icon.png +0 -0
  101. data/friendly_slug_gem_test/public/favicon.ico +0 -0
  102. data/friendly_slug_gem_test/public/robots.txt +0 -1
  103. data/friendly_slug_gem_test/test/application_system_test_case.rb +0 -5
  104. data/friendly_slug_gem_test/test/controllers/.keep +0 -0
  105. data/friendly_slug_gem_test/test/controllers/blogs_controller_test.rb +0 -48
  106. data/friendly_slug_gem_test/test/controllers/topics_controller_test.rb +0 -48
  107. data/friendly_slug_gem_test/test/fixtures/.keep +0 -0
  108. data/friendly_slug_gem_test/test/fixtures/blogs.yml +0 -17
  109. data/friendly_slug_gem_test/test/fixtures/files/.keep +0 -0
  110. data/friendly_slug_gem_test/test/fixtures/topics.yml +0 -27
  111. data/friendly_slug_gem_test/test/helpers/.keep +0 -0
  112. data/friendly_slug_gem_test/test/integration/.keep +0 -0
  113. data/friendly_slug_gem_test/test/integration/main_slug_test.rb +0 -34
  114. data/friendly_slug_gem_test/test/mailers/.keep +0 -0
  115. data/friendly_slug_gem_test/test/models/.keep +0 -0
  116. data/friendly_slug_gem_test/test/models/blog_test.rb +0 -19
  117. data/friendly_slug_gem_test/test/models/topic_test.rb +0 -18
  118. data/friendly_slug_gem_test/test/system/.keep +0 -0
  119. data/friendly_slug_gem_test/test/system/blogs_test.rb +0 -47
  120. data/friendly_slug_gem_test/test/system/topics_test.rb +0 -49
  121. data/friendly_slug_gem_test/test/test_helper.rb +0 -37
  122. data/friendly_slug_gem_test/tmp/.keep +0 -0
  123. data/friendly_slug_gem_test/vendor/.keep +0 -0
File without changes
File without changes
File without changes
@@ -1,5 +0,0 @@
1
- {
2
- "name": "friendly_slug_gem_test",
3
- "private": true,
4
- "dependencies": {}
5
- }
@@ -1,67 +0,0 @@
1
- <!DOCTYPE html>
2
- <html>
3
- <head>
4
- <title>The page you were looking for doesn't exist (404)</title>
5
- <meta name="viewport" content="width=device-width,initial-scale=1">
6
- <style>
7
- .rails-default-error-page {
8
- background-color: #EFEFEF;
9
- color: #2E2F30;
10
- text-align: center;
11
- font-family: arial, sans-serif;
12
- margin: 0;
13
- }
14
-
15
- .rails-default-error-page div.dialog {
16
- width: 95%;
17
- max-width: 33em;
18
- margin: 4em auto 0;
19
- }
20
-
21
- .rails-default-error-page div.dialog > div {
22
- border: 1px solid #CCC;
23
- border-right-color: #999;
24
- border-left-color: #999;
25
- border-bottom-color: #BBB;
26
- border-top: #B00100 solid 4px;
27
- border-top-left-radius: 9px;
28
- border-top-right-radius: 9px;
29
- background-color: white;
30
- padding: 7px 12% 0;
31
- box-shadow: 0 3px 8px rgba(50, 50, 50, 0.17);
32
- }
33
-
34
- .rails-default-error-page h1 {
35
- font-size: 100%;
36
- color: #730E15;
37
- line-height: 1.5em;
38
- }
39
-
40
- .rails-default-error-page div.dialog > p {
41
- margin: 0 0 1em;
42
- padding: 1em;
43
- background-color: #F7F7F7;
44
- border: 1px solid #CCC;
45
- border-right-color: #999;
46
- border-left-color: #999;
47
- border-bottom-color: #999;
48
- border-bottom-left-radius: 4px;
49
- border-bottom-right-radius: 4px;
50
- border-top-color: #DADADA;
51
- color: #666;
52
- box-shadow: 0 3px 8px rgba(50, 50, 50, 0.17);
53
- }
54
- </style>
55
- </head>
56
-
57
- <body class="rails-default-error-page">
58
- <!-- This file lives in public/404.html -->
59
- <div class="dialog">
60
- <div>
61
- <h1>The page you were looking for doesn't exist.</h1>
62
- <p>You may have mistyped the address or the page may have moved.</p>
63
- </div>
64
- <p>If you are the application owner check the logs for more information.</p>
65
- </div>
66
- </body>
67
- </html>
@@ -1,67 +0,0 @@
1
- <!DOCTYPE html>
2
- <html>
3
- <head>
4
- <title>The change you wanted was rejected (422)</title>
5
- <meta name="viewport" content="width=device-width,initial-scale=1">
6
- <style>
7
- .rails-default-error-page {
8
- background-color: #EFEFEF;
9
- color: #2E2F30;
10
- text-align: center;
11
- font-family: arial, sans-serif;
12
- margin: 0;
13
- }
14
-
15
- .rails-default-error-page div.dialog {
16
- width: 95%;
17
- max-width: 33em;
18
- margin: 4em auto 0;
19
- }
20
-
21
- .rails-default-error-page div.dialog > div {
22
- border: 1px solid #CCC;
23
- border-right-color: #999;
24
- border-left-color: #999;
25
- border-bottom-color: #BBB;
26
- border-top: #B00100 solid 4px;
27
- border-top-left-radius: 9px;
28
- border-top-right-radius: 9px;
29
- background-color: white;
30
- padding: 7px 12% 0;
31
- box-shadow: 0 3px 8px rgba(50, 50, 50, 0.17);
32
- }
33
-
34
- .rails-default-error-page h1 {
35
- font-size: 100%;
36
- color: #730E15;
37
- line-height: 1.5em;
38
- }
39
-
40
- .rails-default-error-page div.dialog > p {
41
- margin: 0 0 1em;
42
- padding: 1em;
43
- background-color: #F7F7F7;
44
- border: 1px solid #CCC;
45
- border-right-color: #999;
46
- border-left-color: #999;
47
- border-bottom-color: #999;
48
- border-bottom-left-radius: 4px;
49
- border-bottom-right-radius: 4px;
50
- border-top-color: #DADADA;
51
- color: #666;
52
- box-shadow: 0 3px 8px rgba(50, 50, 50, 0.17);
53
- }
54
- </style>
55
- </head>
56
-
57
- <body class="rails-default-error-page">
58
- <!-- This file lives in public/422.html -->
59
- <div class="dialog">
60
- <div>
61
- <h1>The change you wanted was rejected.</h1>
62
- <p>Maybe you tried to change something you didn't have access to.</p>
63
- </div>
64
- <p>If you are the application owner check the logs for more information.</p>
65
- </div>
66
- </body>
67
- </html>
@@ -1,66 +0,0 @@
1
- <!DOCTYPE html>
2
- <html>
3
- <head>
4
- <title>We're sorry, but something went wrong (500)</title>
5
- <meta name="viewport" content="width=device-width,initial-scale=1">
6
- <style>
7
- .rails-default-error-page {
8
- background-color: #EFEFEF;
9
- color: #2E2F30;
10
- text-align: center;
11
- font-family: arial, sans-serif;
12
- margin: 0;
13
- }
14
-
15
- .rails-default-error-page div.dialog {
16
- width: 95%;
17
- max-width: 33em;
18
- margin: 4em auto 0;
19
- }
20
-
21
- .rails-default-error-page div.dialog > div {
22
- border: 1px solid #CCC;
23
- border-right-color: #999;
24
- border-left-color: #999;
25
- border-bottom-color: #BBB;
26
- border-top: #B00100 solid 4px;
27
- border-top-left-radius: 9px;
28
- border-top-right-radius: 9px;
29
- background-color: white;
30
- padding: 7px 12% 0;
31
- box-shadow: 0 3px 8px rgba(50, 50, 50, 0.17);
32
- }
33
-
34
- .rails-default-error-page h1 {
35
- font-size: 100%;
36
- color: #730E15;
37
- line-height: 1.5em;
38
- }
39
-
40
- .rails-default-error-page div.dialog > p {
41
- margin: 0 0 1em;
42
- padding: 1em;
43
- background-color: #F7F7F7;
44
- border: 1px solid #CCC;
45
- border-right-color: #999;
46
- border-left-color: #999;
47
- border-bottom-color: #999;
48
- border-bottom-left-radius: 4px;
49
- border-bottom-right-radius: 4px;
50
- border-top-color: #DADADA;
51
- color: #666;
52
- box-shadow: 0 3px 8px rgba(50, 50, 50, 0.17);
53
- }
54
- </style>
55
- </head>
56
-
57
- <body class="rails-default-error-page">
58
- <!-- This file lives in public/500.html -->
59
- <div class="dialog">
60
- <div>
61
- <h1>We're sorry, but something went wrong.</h1>
62
- </div>
63
- <p>If you are the application owner check the logs for more information.</p>
64
- </div>
65
- </body>
66
- </html>
File without changes
@@ -1 +0,0 @@
1
- # See http://www.robotstxt.org/robotstxt.html for documentation on how to use the robots.txt file
@@ -1,5 +0,0 @@
1
- require "test_helper"
2
-
3
- class ApplicationSystemTestCase < ActionDispatch::SystemTestCase
4
- driven_by :selenium, using: :chrome, screen_size: [1400, 1400]
5
- end
@@ -1,48 +0,0 @@
1
- require 'test_helper'
2
-
3
- class BlogsControllerTest < ActionDispatch::IntegrationTest
4
- setup do
5
- @blog = blogs(:one)
6
- end
7
-
8
- test "should get index" do
9
- get blogs_url
10
- assert_response :success
11
- end
12
-
13
- test "should get new" do
14
- get new_blog_url
15
- assert_response :success
16
- end
17
-
18
- test "should create blog" do
19
- assert_difference('Blog.count') do
20
- post blogs_url, params: { blog: { body: @blog.body, title: @blog.title, views: @blog.views } }
21
- end
22
-
23
- assert_redirected_to blog_url(Blog.last)
24
- end
25
-
26
- test "should show blog" do
27
- get blog_url(@blog)
28
- assert_response :success
29
- end
30
-
31
- test "should get edit" do
32
- get edit_blog_url(@blog)
33
- assert_response :success
34
- end
35
-
36
- test "should update blog" do
37
- patch blog_url(@blog), params: { blog: { body: @blog.body, title: @blog.title, views: @blog.views } }
38
- assert_redirected_to blog_url(@blog)
39
- end
40
-
41
- test "should destroy blog" do
42
- assert_difference('Blog.count', -1) do
43
- delete blog_url(@blog)
44
- end
45
-
46
- assert_redirected_to blogs_url
47
- end
48
- end
@@ -1,48 +0,0 @@
1
- require 'test_helper'
2
-
3
- class TopicsControllerTest < ActionDispatch::IntegrationTest
4
- setup do
5
- @topic = topics(:one)
6
- end
7
-
8
- test "should get index" do
9
- get topics_url
10
- assert_response :success
11
- end
12
-
13
- test "should get new" do
14
- get new_topic_url
15
- assert_response :success
16
- end
17
-
18
- test "should create topic" do
19
- assert_difference('Topic.count') do
20
- post topics_url, params: { topic: { slug: @topic.slug, title: @topic.title + "123", color: @topic.color, views: @topic.views } }
21
- end
22
-
23
- assert_redirected_to topic_url(Topic.last)
24
- end
25
-
26
- test "should show topic" do
27
- get topic_url(@topic)
28
- assert_response :success
29
- end
30
-
31
- test "should get edit" do
32
- get edit_topic_url(@topic)
33
- assert_response :success
34
- end
35
-
36
- test "should update topic" do
37
- patch topic_url(@topic), params: { topic: { slug: @topic.slug, title: @topic.title, color: @topic.color, views: @topic.views } }
38
- assert_redirected_to topic_url(@topic)
39
- end
40
-
41
- test "should destroy topic" do
42
- assert_difference('Topic.count', -1) do
43
- delete topic_url(@topic)
44
- end
45
-
46
- assert_redirected_to topics_url
47
- end
48
- end
@@ -1,17 +0,0 @@
1
- one:
2
- id: 1
3
- title: This is the greatest post !@#23_ &^asf
4
- body: MyText
5
- views: 12
6
-
7
- two:
8
- id: 2
9
- title: Just a normal for $15 test string!
10
- body: MyText
11
- views: 13
12
-
13
- three:
14
- id: 3
15
- title: Just george normal for $15 test string!
16
- body: MyText
17
- views: 14
@@ -1,27 +0,0 @@
1
- one:
2
- id: 1
3
- title: My String!!#$#@#%#
4
- slug: my-string
5
- color: Blue
6
- views: 1
7
-
8
- two:
9
- id: 2
10
- title: My String 2
11
- slug: my-string-2
12
- color: Red
13
- views: 2
14
-
15
- three:
16
- id: 3
17
- title: MyString3
18
- slug: mystring3
19
- color: White
20
- views: 3
21
-
22
- three:
23
- id: 4
24
- title: My .String--4
25
- slug: my-string-4
26
- color: White
27
- views: 4
File without changes
@@ -1,34 +0,0 @@
1
- require 'test_helper'
2
-
3
- class MainSlug
4
- end
5
-
6
- class MainSlugTest < ActionDispatch::IntegrationTest
7
- Blog.all.each do |blog|
8
- test "friendly slug vist the filtered out ##{blog.id} title" do
9
- get blog_url(blog)
10
- assert_response :success
11
- assert_equal("/blogs/#{TestAnswers::TWO_PARAM_ANSWERS[blog.id]}", request.env["REQUEST_URI"])
12
- end
13
- end
14
-
15
- class Blog < ApplicationRecord
16
- build_friendly_slug :id, use: :first
17
- end
18
-
19
- Blog.all.each do |blog|
20
- test "friendly slug vist the filtered out ##{blog.id}" do
21
- get blog_url(blog)
22
- assert_response :success
23
- assert_equal("/blogs/#{TestAnswers::ONE_PARAM_ANSWERS[blog.id]}", request.env["REQUEST_URI"])
24
- end
25
- end
26
-
27
- Topic.all.each do |topic|
28
- test "friendly database slug filters out ##{topic.id} title" do
29
- get topic_url(topic)
30
- assert_response :success
31
- assert_equal("/topics/#{TestAnswers::TOPIC_ONE_PARAM_ANSWERS[topic.id]}", request.env["REQUEST_URI"])
32
- end
33
- end
34
- end
File without changes
File without changes
@@ -1,19 +0,0 @@
1
- require 'test_helper'
2
-
3
- class BlogTest < ActiveSupport::TestCase
4
- Blog.all.each do |blog|
5
- test "friendly slug filters out ##{blog.id} title" do
6
- assert_equal(TestAnswers::TWO_PARAM_ANSWERS[blog.id], blog.to_param)
7
- end
8
- end
9
-
10
- class Blog < ApplicationRecord
11
- build_friendly_slug :id, use: :first
12
- end
13
-
14
- Blog.all.each do |blog|
15
- test "friendly slug filters out ##{blog.id}" do
16
- assert_equal(TestAnswers::ONE_PARAM_ANSWERS[blog.id], blog.to_param)
17
- end
18
- end
19
- end