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.
- checksums.yaml +4 -4
- data/README.md +1 -1
- data/friendly_slug.gemspec +1 -1
- data/lib/friendly_slug/version.rb +1 -1
- metadata +1 -119
- data/friendly_slug_gem_test/.gitignore +0 -30
- data/friendly_slug_gem_test/.ruby-version +0 -1
- data/friendly_slug_gem_test/Gemfile +0 -32
- data/friendly_slug_gem_test/Gemfile.lock +0 -222
- data/friendly_slug_gem_test/README.md +0 -24
- data/friendly_slug_gem_test/Rakefile +0 -6
- data/friendly_slug_gem_test/app/assets/config/manifest.js +0 -3
- data/friendly_slug_gem_test/app/assets/images/.keep +0 -0
- data/friendly_slug_gem_test/app/assets/javascripts/application.js +0 -16
- data/friendly_slug_gem_test/app/assets/javascripts/blogs.coffee +0 -3
- data/friendly_slug_gem_test/app/assets/javascripts/cable.js +0 -13
- data/friendly_slug_gem_test/app/assets/javascripts/channels/.keep +0 -0
- data/friendly_slug_gem_test/app/assets/javascripts/topics.coffee +0 -3
- data/friendly_slug_gem_test/app/assets/stylesheets/application.css +0 -15
- data/friendly_slug_gem_test/app/assets/stylesheets/blogs.scss +0 -3
- data/friendly_slug_gem_test/app/assets/stylesheets/scaffolds.scss +0 -84
- data/friendly_slug_gem_test/app/assets/stylesheets/topics.scss +0 -3
- data/friendly_slug_gem_test/app/channels/application_cable/channel.rb +0 -4
- data/friendly_slug_gem_test/app/channels/application_cable/connection.rb +0 -4
- data/friendly_slug_gem_test/app/controllers/application_controller.rb +0 -2
- data/friendly_slug_gem_test/app/controllers/blogs_controller.rb +0 -60
- data/friendly_slug_gem_test/app/controllers/concerns/.keep +0 -0
- data/friendly_slug_gem_test/app/controllers/topics_controller.rb +0 -60
- data/friendly_slug_gem_test/app/helpers/application_helper.rb +0 -2
- data/friendly_slug_gem_test/app/helpers/blogs_helper.rb +0 -2
- data/friendly_slug_gem_test/app/helpers/topics_helper.rb +0 -2
- data/friendly_slug_gem_test/app/jobs/application_job.rb +0 -2
- data/friendly_slug_gem_test/app/mailers/application_mailer.rb +0 -4
- data/friendly_slug_gem_test/app/models/application_record.rb +0 -3
- data/friendly_slug_gem_test/app/models/blog.rb +0 -3
- data/friendly_slug_gem_test/app/models/concerns/.keep +0 -0
- data/friendly_slug_gem_test/app/models/topic.rb +0 -3
- data/friendly_slug_gem_test/app/views/blogs/_blog.json.jbuilder +0 -2
- data/friendly_slug_gem_test/app/views/blogs/_form.html.erb +0 -32
- data/friendly_slug_gem_test/app/views/blogs/edit.html.erb +0 -6
- data/friendly_slug_gem_test/app/views/blogs/index.html.erb +0 -31
- data/friendly_slug_gem_test/app/views/blogs/index.json.jbuilder +0 -1
- data/friendly_slug_gem_test/app/views/blogs/new.html.erb +0 -5
- data/friendly_slug_gem_test/app/views/blogs/show.html.erb +0 -19
- data/friendly_slug_gem_test/app/views/blogs/show.json.jbuilder +0 -1
- data/friendly_slug_gem_test/app/views/layouts/application.html.erb +0 -15
- data/friendly_slug_gem_test/app/views/layouts/mailer.html.erb +0 -13
- data/friendly_slug_gem_test/app/views/layouts/mailer.text.erb +0 -1
- data/friendly_slug_gem_test/app/views/topics/_form.html.erb +0 -37
- data/friendly_slug_gem_test/app/views/topics/_topic.json.jbuilder +0 -2
- data/friendly_slug_gem_test/app/views/topics/edit.html.erb +0 -6
- data/friendly_slug_gem_test/app/views/topics/index.html.erb +0 -33
- data/friendly_slug_gem_test/app/views/topics/index.json.jbuilder +0 -1
- data/friendly_slug_gem_test/app/views/topics/new.html.erb +0 -5
- data/friendly_slug_gem_test/app/views/topics/show.html.erb +0 -24
- data/friendly_slug_gem_test/app/views/topics/show.json.jbuilder +0 -1
- data/friendly_slug_gem_test/bin/bundle +0 -3
- data/friendly_slug_gem_test/bin/rails +0 -9
- data/friendly_slug_gem_test/bin/rake +0 -9
- data/friendly_slug_gem_test/bin/setup +0 -36
- data/friendly_slug_gem_test/bin/spring +0 -17
- data/friendly_slug_gem_test/bin/update +0 -31
- data/friendly_slug_gem_test/bin/yarn +0 -11
- data/friendly_slug_gem_test/config.ru +0 -5
- data/friendly_slug_gem_test/config/application.rb +0 -20
- data/friendly_slug_gem_test/config/boot.rb +0 -4
- data/friendly_slug_gem_test/config/cable.yml +0 -10
- data/friendly_slug_gem_test/config/credentials.yml.enc +0 -1
- data/friendly_slug_gem_test/config/database.yml +0 -25
- data/friendly_slug_gem_test/config/environment.rb +0 -5
- data/friendly_slug_gem_test/config/environments/development.rb +0 -61
- data/friendly_slug_gem_test/config/environments/production.rb +0 -94
- data/friendly_slug_gem_test/config/environments/test.rb +0 -46
- data/friendly_slug_gem_test/config/initializers/application_controller_renderer.rb +0 -8
- data/friendly_slug_gem_test/config/initializers/assets.rb +0 -14
- data/friendly_slug_gem_test/config/initializers/backtrace_silencers.rb +0 -7
- data/friendly_slug_gem_test/config/initializers/content_security_policy.rb +0 -25
- data/friendly_slug_gem_test/config/initializers/cookies_serializer.rb +0 -5
- data/friendly_slug_gem_test/config/initializers/filter_parameter_logging.rb +0 -4
- data/friendly_slug_gem_test/config/initializers/inflections.rb +0 -16
- data/friendly_slug_gem_test/config/initializers/mime_types.rb +0 -4
- data/friendly_slug_gem_test/config/initializers/wrap_parameters.rb +0 -14
- data/friendly_slug_gem_test/config/locales/en.yml +0 -33
- data/friendly_slug_gem_test/config/puma.rb +0 -34
- data/friendly_slug_gem_test/config/routes.rb +0 -5
- data/friendly_slug_gem_test/config/spring.rb +0 -6
- data/friendly_slug_gem_test/config/storage.yml +0 -34
- data/friendly_slug_gem_test/db/migrate/20180628233122_create_blogs.rb +0 -11
- data/friendly_slug_gem_test/db/migrate/20180630053922_create_topics.rb +0 -13
- data/friendly_slug_gem_test/db/schema.rb +0 -33
- data/friendly_slug_gem_test/db/seeds.rb +0 -9
- 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 +0 -5
- data/friendly_slug_gem_test/public/404.html +0 -67
- data/friendly_slug_gem_test/public/422.html +0 -67
- data/friendly_slug_gem_test/public/500.html +0 -66
- 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 +0 -1
- data/friendly_slug_gem_test/test/application_system_test_case.rb +0 -5
- data/friendly_slug_gem_test/test/controllers/.keep +0 -0
- data/friendly_slug_gem_test/test/controllers/blogs_controller_test.rb +0 -48
- data/friendly_slug_gem_test/test/controllers/topics_controller_test.rb +0 -48
- data/friendly_slug_gem_test/test/fixtures/.keep +0 -0
- data/friendly_slug_gem_test/test/fixtures/blogs.yml +0 -17
- data/friendly_slug_gem_test/test/fixtures/files/.keep +0 -0
- data/friendly_slug_gem_test/test/fixtures/topics.yml +0 -27
- 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 +0 -34
- 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 +0 -19
- data/friendly_slug_gem_test/test/models/topic_test.rb +0 -18
- data/friendly_slug_gem_test/test/system/.keep +0 -0
- data/friendly_slug_gem_test/test/system/blogs_test.rb +0 -47
- data/friendly_slug_gem_test/test/system/topics_test.rb +0 -49
- data/friendly_slug_gem_test/test/test_helper.rb +0 -37
- data/friendly_slug_gem_test/tmp/.keep +0 -0
- data/friendly_slug_gem_test/vendor/.keep +0 -0
@@ -1,18 +0,0 @@
|
|
1
|
-
require 'test_helper'
|
2
|
-
|
3
|
-
class TopicTest < ActiveSupport::TestCase
|
4
|
-
Topic.all.each do |topic|
|
5
|
-
test "friendly database slug filters out ##{topic.id} title" do
|
6
|
-
topic.slug = nil
|
7
|
-
assert_equal(TestAnswers::TOPIC_ONE_PARAM_ANSWERS[topic.id], topic.to_param)
|
8
|
-
end
|
9
|
-
end
|
10
|
-
|
11
|
-
test "friendly database slug filters out a new topic title" do
|
12
|
-
topic = Topic.create!(title: "Baby This Is a New Topic")
|
13
|
-
assert_equal(topic.to_param, "baby-this-is-a-new-topic")
|
14
|
-
|
15
|
-
topic.update(title: "My Newly Updated Title")
|
16
|
-
assert_equal(topic.to_param, "my-newly-updated-title")
|
17
|
-
end
|
18
|
-
end
|
File without changes
|
@@ -1,47 +0,0 @@
|
|
1
|
-
require "application_system_test_case"
|
2
|
-
|
3
|
-
class BlogsTest < ApplicationSystemTestCase
|
4
|
-
setup do
|
5
|
-
@blog = blogs(:one)
|
6
|
-
end
|
7
|
-
|
8
|
-
test "visiting the index" do
|
9
|
-
visit blogs_url
|
10
|
-
assert_selector "h1", text: "Blogs"
|
11
|
-
end
|
12
|
-
|
13
|
-
test "creating a Blog" do
|
14
|
-
visit blogs_url
|
15
|
-
click_on "New Blog"
|
16
|
-
|
17
|
-
fill_in "Body", with: @blog.body
|
18
|
-
fill_in "Title", with: @blog.title
|
19
|
-
fill_in "Views", with: @blog.views
|
20
|
-
click_on "Create Blog"
|
21
|
-
|
22
|
-
assert_text "Blog was successfully created"
|
23
|
-
click_on "Back"
|
24
|
-
end
|
25
|
-
|
26
|
-
test "updating a Blog" do
|
27
|
-
visit blogs_url
|
28
|
-
click_on "Edit", match: :first
|
29
|
-
|
30
|
-
fill_in "Body", with: @blog.body
|
31
|
-
fill_in "Title", with: @blog.title
|
32
|
-
fill_in "Views", with: @blog.views
|
33
|
-
click_on "Update Blog"
|
34
|
-
|
35
|
-
assert_text "Blog was successfully updated"
|
36
|
-
click_on "Back"
|
37
|
-
end
|
38
|
-
|
39
|
-
test "destroying a Blog" do
|
40
|
-
visit blogs_url
|
41
|
-
page.accept_confirm do
|
42
|
-
click_on "Destroy", match: :first
|
43
|
-
end
|
44
|
-
|
45
|
-
assert_text "Blog was successfully destroyed"
|
46
|
-
end
|
47
|
-
end
|
@@ -1,49 +0,0 @@
|
|
1
|
-
require "application_system_test_case"
|
2
|
-
|
3
|
-
class TopicsTest < ApplicationSystemTestCase
|
4
|
-
setup do
|
5
|
-
@topic = topics(:one)
|
6
|
-
end
|
7
|
-
|
8
|
-
test "visiting the index" do
|
9
|
-
visit topics_url
|
10
|
-
assert_selector "h1", text: "Topics"
|
11
|
-
end
|
12
|
-
|
13
|
-
test "creating a Topic" do
|
14
|
-
visit topics_url
|
15
|
-
click_on "New Topic"
|
16
|
-
|
17
|
-
fill_in "Slug", with: @topic.slug
|
18
|
-
fill_in "Title", with: @topic.title
|
19
|
-
fill_in "Type", with: @topic.type
|
20
|
-
fill_in "Views", with: @topic.views
|
21
|
-
click_on "Create Topic"
|
22
|
-
|
23
|
-
assert_text "Topic was successfully created"
|
24
|
-
click_on "Back"
|
25
|
-
end
|
26
|
-
|
27
|
-
test "updating a Topic" do
|
28
|
-
visit topics_url
|
29
|
-
click_on "Edit", match: :first
|
30
|
-
|
31
|
-
fill_in "Slug", with: @topic.slug
|
32
|
-
fill_in "Title", with: @topic.title
|
33
|
-
fill_in "Type", with: @topic.type
|
34
|
-
fill_in "Views", with: @topic.views
|
35
|
-
click_on "Update Topic"
|
36
|
-
|
37
|
-
assert_text "Topic was successfully updated"
|
38
|
-
click_on "Back"
|
39
|
-
end
|
40
|
-
|
41
|
-
test "destroying a Topic" do
|
42
|
-
visit topics_url
|
43
|
-
page.accept_confirm do
|
44
|
-
click_on "Destroy", match: :first
|
45
|
-
end
|
46
|
-
|
47
|
-
assert_text "Topic was successfully destroyed"
|
48
|
-
end
|
49
|
-
end
|
@@ -1,37 +0,0 @@
|
|
1
|
-
ENV['RAILS_ENV'] ||= 'test'
|
2
|
-
require_relative '../config/environment'
|
3
|
-
require 'rails/test_help'
|
4
|
-
require 'database_cleaner'
|
5
|
-
|
6
|
-
class ActiveSupport::TestCase
|
7
|
-
ActiveRecord::Migration.check_pending!
|
8
|
-
fixtures :all
|
9
|
-
end
|
10
|
-
|
11
|
-
class ActionDispatch::IntegrationTest
|
12
|
-
DatabaseCleaner.strategy = :truncation
|
13
|
-
end
|
14
|
-
|
15
|
-
module TestAnswers
|
16
|
-
ONE_PARAM_ANSWERS = [
|
17
|
-
"",
|
18
|
-
"1",
|
19
|
-
"2",
|
20
|
-
"3",
|
21
|
-
]
|
22
|
-
|
23
|
-
TWO_PARAM_ANSWERS = [
|
24
|
-
"",
|
25
|
-
"this-is-the-greatest-post-23_-asf-1",
|
26
|
-
"just-a-normal-for-15-test-string-2",
|
27
|
-
"just-george-normal-for-15-test-string-3",
|
28
|
-
]
|
29
|
-
|
30
|
-
TOPIC_ONE_PARAM_ANSWERS = [
|
31
|
-
"",
|
32
|
-
"my-string",
|
33
|
-
"my-string-2",
|
34
|
-
"mystring3",
|
35
|
-
"my-string-4",
|
36
|
-
]
|
37
|
-
end
|
File without changes
|
File without changes
|