friendly_slug 0.1.4 → 0.1.5
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.
- checksums.yaml +4 -4
- data/README.md +9 -10
- data/friendly_slug_gem_test/.gitignore +30 -0
- data/friendly_slug_gem_test/.ruby-version +1 -0
- data/friendly_slug_gem_test/Gemfile +32 -0
- data/friendly_slug_gem_test/Gemfile.lock +222 -0
- data/friendly_slug_gem_test/README.md +24 -0
- data/friendly_slug_gem_test/Rakefile +6 -0
- data/friendly_slug_gem_test/app/assets/config/manifest.js +3 -0
- data/friendly_slug_gem_test/app/assets/images/.keep +0 -0
- data/friendly_slug_gem_test/app/assets/javascripts/application.js +16 -0
- data/friendly_slug_gem_test/app/assets/javascripts/blogs.coffee +3 -0
- data/friendly_slug_gem_test/app/assets/javascripts/cable.js +13 -0
- data/friendly_slug_gem_test/app/assets/javascripts/channels/.keep +0 -0
- data/friendly_slug_gem_test/app/assets/stylesheets/application.css +15 -0
- data/friendly_slug_gem_test/app/assets/stylesheets/blogs.scss +3 -0
- data/friendly_slug_gem_test/app/assets/stylesheets/scaffolds.scss +84 -0
- data/friendly_slug_gem_test/app/channels/application_cable/channel.rb +4 -0
- data/friendly_slug_gem_test/app/channels/application_cable/connection.rb +4 -0
- data/friendly_slug_gem_test/app/controllers/application_controller.rb +2 -0
- data/friendly_slug_gem_test/app/controllers/blogs_controller.rb +60 -0
- data/friendly_slug_gem_test/app/controllers/concerns/.keep +0 -0
- data/friendly_slug_gem_test/app/helpers/application_helper.rb +2 -0
- data/friendly_slug_gem_test/app/helpers/blogs_helper.rb +2 -0
- data/friendly_slug_gem_test/app/jobs/application_job.rb +2 -0
- data/friendly_slug_gem_test/app/mailers/application_mailer.rb +4 -0
- data/friendly_slug_gem_test/app/models/application_record.rb +3 -0
- data/friendly_slug_gem_test/app/models/blog.rb +3 -0
- data/friendly_slug_gem_test/app/models/concerns/.keep +0 -0
- data/friendly_slug_gem_test/app/views/blogs/_blog.json.jbuilder +2 -0
- data/friendly_slug_gem_test/app/views/blogs/_form.html.erb +32 -0
- data/friendly_slug_gem_test/app/views/blogs/edit.html.erb +6 -0
- data/friendly_slug_gem_test/app/views/blogs/index.html.erb +31 -0
- data/friendly_slug_gem_test/app/views/blogs/index.json.jbuilder +1 -0
- data/friendly_slug_gem_test/app/views/blogs/new.html.erb +5 -0
- data/friendly_slug_gem_test/app/views/blogs/show.html.erb +19 -0
- data/friendly_slug_gem_test/app/views/blogs/show.json.jbuilder +1 -0
- data/friendly_slug_gem_test/app/views/layouts/application.html.erb +15 -0
- data/friendly_slug_gem_test/app/views/layouts/mailer.html.erb +13 -0
- data/friendly_slug_gem_test/app/views/layouts/mailer.text.erb +1 -0
- data/friendly_slug_gem_test/bin/bundle +3 -0
- data/friendly_slug_gem_test/bin/rails +9 -0
- data/friendly_slug_gem_test/bin/rake +9 -0
- data/friendly_slug_gem_test/bin/setup +36 -0
- data/friendly_slug_gem_test/bin/spring +17 -0
- data/friendly_slug_gem_test/bin/update +31 -0
- data/friendly_slug_gem_test/bin/yarn +11 -0
- data/friendly_slug_gem_test/config.ru +5 -0
- data/friendly_slug_gem_test/config/application.rb +20 -0
- data/friendly_slug_gem_test/config/boot.rb +4 -0
- data/friendly_slug_gem_test/config/cable.yml +10 -0
- data/friendly_slug_gem_test/config/credentials.yml.enc +1 -0
- data/friendly_slug_gem_test/config/database.yml +25 -0
- data/friendly_slug_gem_test/config/environment.rb +5 -0
- data/friendly_slug_gem_test/config/environments/development.rb +61 -0
- data/friendly_slug_gem_test/config/environments/production.rb +94 -0
- data/friendly_slug_gem_test/config/environments/test.rb +46 -0
- data/friendly_slug_gem_test/config/initializers/application_controller_renderer.rb +8 -0
- data/friendly_slug_gem_test/config/initializers/assets.rb +14 -0
- data/friendly_slug_gem_test/config/initializers/backtrace_silencers.rb +7 -0
- data/friendly_slug_gem_test/config/initializers/content_security_policy.rb +25 -0
- data/friendly_slug_gem_test/config/initializers/cookies_serializer.rb +5 -0
- data/friendly_slug_gem_test/config/initializers/filter_parameter_logging.rb +4 -0
- data/friendly_slug_gem_test/config/initializers/inflections.rb +16 -0
- data/friendly_slug_gem_test/config/initializers/mime_types.rb +4 -0
- data/friendly_slug_gem_test/config/initializers/wrap_parameters.rb +14 -0
- data/friendly_slug_gem_test/config/locales/en.yml +33 -0
- data/friendly_slug_gem_test/config/puma.rb +34 -0
- data/friendly_slug_gem_test/config/routes.rb +4 -0
- data/friendly_slug_gem_test/config/spring.rb +6 -0
- data/friendly_slug_gem_test/config/storage.yml +34 -0
- data/friendly_slug_gem_test/db/migrate/20180628233122_create_blogs.rb +11 -0
- data/friendly_slug_gem_test/db/schema.rb +23 -0
- data/friendly_slug_gem_test/db/seeds.rb +7 -0
- data/friendly_slug_gem_test/lib/assets/.keep +0 -0
- data/friendly_slug_gem_test/lib/tasks/.keep +0 -0
- data/friendly_slug_gem_test/log/.keep +0 -0
- data/friendly_slug_gem_test/package.json +5 -0
- data/friendly_slug_gem_test/public/404.html +67 -0
- data/friendly_slug_gem_test/public/422.html +67 -0
- data/friendly_slug_gem_test/public/500.html +66 -0
- data/friendly_slug_gem_test/public/apple-touch-icon-precomposed.png +0 -0
- data/friendly_slug_gem_test/public/apple-touch-icon.png +0 -0
- data/friendly_slug_gem_test/public/favicon.ico +0 -0
- data/friendly_slug_gem_test/public/robots.txt +1 -0
- data/friendly_slug_gem_test/test/application_system_test_case.rb +5 -0
- data/friendly_slug_gem_test/test/controllers/.keep +0 -0
- data/friendly_slug_gem_test/test/controllers/blogs_controller_test.rb +48 -0
- data/friendly_slug_gem_test/test/fixtures/.keep +0 -0
- data/friendly_slug_gem_test/test/fixtures/blogs.yml +17 -0
- data/friendly_slug_gem_test/test/fixtures/files/.keep +0 -0
- data/friendly_slug_gem_test/test/helpers/.keep +0 -0
- data/friendly_slug_gem_test/test/integration/.keep +0 -0
- data/friendly_slug_gem_test/test/integration/main_slug_test.rb +14 -0
- data/friendly_slug_gem_test/test/mailers/.keep +0 -0
- data/friendly_slug_gem_test/test/models/.keep +0 -0
- data/friendly_slug_gem_test/test/models/blog_test.rb +9 -0
- data/friendly_slug_gem_test/test/system/.keep +0 -0
- data/friendly_slug_gem_test/test/system/blogs_test.rb +47 -0
- data/friendly_slug_gem_test/test/test_helper.rb +22 -0
- data/friendly_slug_gem_test/tmp/.keep +0 -0
- data/friendly_slug_gem_test/vendor/.keep +0 -0
- data/lib/friendly_slug/active_record/base.rb +10 -1
- data/lib/friendly_slug/version.rb +1 -1
- metadata +102 -2
@@ -0,0 +1,34 @@
|
|
1
|
+
# Puma can serve each request in a thread from an internal thread pool.
|
2
|
+
# The `threads` method setting takes two numbers: a minimum and maximum.
|
3
|
+
# Any libraries that use thread pools should be configured to match
|
4
|
+
# the maximum value specified for Puma. Default is set to 5 threads for minimum
|
5
|
+
# and maximum; this matches the default thread size of Active Record.
|
6
|
+
#
|
7
|
+
threads_count = ENV.fetch("RAILS_MAX_THREADS") { 5 }
|
8
|
+
threads threads_count, threads_count
|
9
|
+
|
10
|
+
# Specifies the `port` that Puma will listen on to receive requests; default is 3000.
|
11
|
+
#
|
12
|
+
port ENV.fetch("PORT") { 3000 }
|
13
|
+
|
14
|
+
# Specifies the `environment` that Puma will run in.
|
15
|
+
#
|
16
|
+
environment ENV.fetch("RAILS_ENV") { "development" }
|
17
|
+
|
18
|
+
# Specifies the number of `workers` to boot in clustered mode.
|
19
|
+
# Workers are forked webserver processes. If using threads and workers together
|
20
|
+
# the concurrency of the application would be max `threads` * `workers`.
|
21
|
+
# Workers do not work on JRuby or Windows (both of which do not support
|
22
|
+
# processes).
|
23
|
+
#
|
24
|
+
# workers ENV.fetch("WEB_CONCURRENCY") { 2 }
|
25
|
+
|
26
|
+
# Use the `preload_app!` method when specifying a `workers` number.
|
27
|
+
# This directive tells Puma to first boot the application and load code
|
28
|
+
# before forking the application. This takes advantage of Copy On Write
|
29
|
+
# process behavior so workers use less memory.
|
30
|
+
#
|
31
|
+
# preload_app!
|
32
|
+
|
33
|
+
# Allow puma to be restarted by `rails restart` command.
|
34
|
+
plugin :tmp_restart
|
@@ -0,0 +1,34 @@
|
|
1
|
+
test:
|
2
|
+
service: Disk
|
3
|
+
root: <%= Rails.root.join("tmp/storage") %>
|
4
|
+
|
5
|
+
local:
|
6
|
+
service: Disk
|
7
|
+
root: <%= Rails.root.join("storage") %>
|
8
|
+
|
9
|
+
# Use rails credentials:edit to set the AWS secrets (as aws:access_key_id|secret_access_key)
|
10
|
+
# amazon:
|
11
|
+
# service: S3
|
12
|
+
# access_key_id: <%= Rails.application.credentials.dig(:aws, :access_key_id) %>
|
13
|
+
# secret_access_key: <%= Rails.application.credentials.dig(:aws, :secret_access_key) %>
|
14
|
+
# region: us-east-1
|
15
|
+
# bucket: your_own_bucket
|
16
|
+
|
17
|
+
# Remember not to checkin your GCS keyfile to a repository
|
18
|
+
# google:
|
19
|
+
# service: GCS
|
20
|
+
# project: your_project
|
21
|
+
# credentials: <%= Rails.root.join("path/to/gcs.keyfile") %>
|
22
|
+
# bucket: your_own_bucket
|
23
|
+
|
24
|
+
# Use rails credentials:edit to set the Azure Storage secret (as azure_storage:storage_access_key)
|
25
|
+
# microsoft:
|
26
|
+
# service: AzureStorage
|
27
|
+
# storage_account_name: your_account_name
|
28
|
+
# storage_access_key: <%= Rails.application.credentials.dig(:azure_storage, :storage_access_key) %>
|
29
|
+
# container: your_container_name
|
30
|
+
|
31
|
+
# mirror:
|
32
|
+
# service: Mirror
|
33
|
+
# primary: local
|
34
|
+
# mirrors: [ amazon, google, microsoft ]
|
@@ -0,0 +1,23 @@
|
|
1
|
+
# This file is auto-generated from the current state of the database. Instead
|
2
|
+
# of editing this file, please use the migrations feature of Active Record to
|
3
|
+
# incrementally modify your database, and then regenerate this schema definition.
|
4
|
+
#
|
5
|
+
# Note that this schema.rb definition is the authoritative source for your
|
6
|
+
# database schema. If you need to create the application database on another
|
7
|
+
# system, you should be using db:schema:load, not running all the migrations
|
8
|
+
# from scratch. The latter is a flawed and unsustainable approach (the more migrations
|
9
|
+
# you'll amass, the slower it'll run and the greater likelihood for issues).
|
10
|
+
#
|
11
|
+
# It's strongly recommended that you check this file into your version control system.
|
12
|
+
|
13
|
+
ActiveRecord::Schema.define(version: 2018_06_28_233122) do
|
14
|
+
|
15
|
+
create_table "blogs", force: :cascade do |t|
|
16
|
+
t.string "title"
|
17
|
+
t.text "body"
|
18
|
+
t.bigint "views"
|
19
|
+
t.datetime "created_at", null: false
|
20
|
+
t.datetime "updated_at", null: false
|
21
|
+
end
|
22
|
+
|
23
|
+
end
|
@@ -0,0 +1,7 @@
|
|
1
|
+
# This file should contain all the record creation needed to seed the database with its default values.
|
2
|
+
# The data can then be loaded with the rails db:seed command (or created alongside the database with db:setup).
|
3
|
+
#
|
4
|
+
# Examples:
|
5
|
+
#
|
6
|
+
# movies = Movie.create([{ name: 'Star Wars' }, { name: 'Lord of the Rings' }])
|
7
|
+
# Character.create(name: 'Luke', movie: movies.first)
|
File without changes
|
File without changes
|
File without changes
|
@@ -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
|
+
.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>
|
@@ -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
|
+
.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>
|
@@ -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
|
+
.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
|
File without changes
|
File without changes
|
@@ -0,0 +1 @@
|
|
1
|
+
# See http://www.robotstxt.org/robotstxt.html for documentation on how to use the robots.txt file
|
File without changes
|
@@ -0,0 +1,48 @@
|
|
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
|
File without changes
|
@@ -0,0 +1,17 @@
|
|
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
|
File without changes
|
File without changes
|
File without changes
|
@@ -0,0 +1,14 @@
|
|
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(request.env["REQUEST_URI"], "/blogs/#{TestAnswers::TEST_ANSWERS[blog.id]}")
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|