Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
Pressr
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Stephen D
Pressr
Commits
10e549ae
Commit
10e549ae
authored
5 years ago
by
Stephen D
Browse files
Options
Downloads
Patches
Plain Diff
Fixed no title pages
parent
103f9108
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
app/models/page.rb
+1
-0
1 addition, 0 deletions
app/models/page.rb
test/controllers/page_controller_test.rb
+13
-0
13 additions, 0 deletions
test/controllers/page_controller_test.rb
with
14 additions
and
0 deletions
app/models/page.rb
+
1
−
0
View file @
10e549ae
...
...
@@ -10,6 +10,7 @@ class Page < ApplicationRecord
def
refresh_path
self
.
path
=
self
.
title
.
parameterize
self
.
path
=
"no-title"
if
self
.
path
.
empty?
end
def
friendly_title
...
...
This diff is collapsed.
Click to expand it.
test/controllers/page_controller_test.rb
+
13
−
0
View file @
10e549ae
...
...
@@ -267,4 +267,17 @@ class PageControllerTest < ActionDispatch::IntegrationTest
assert_redirected_to
manage_page_path
(
"blog_two"
)
assert_nil
Page
.
find_by
(
id:
pages
(
:two
).
id
)
end
test
"Can create page with no title"
do
post
login_path
(
login:
{
username:
"user_one"
,
password:
"password1"
})
post
new_page_path
(
blog_name:
"blog_one"
,
page:
{
body:
"This post has no title"
})
new_page
=
Page
.
last
assert_equal
""
,
new_page
.
title
get
page_path
(
blog_name:
"blog_one"
,
id:
new_page
.
id
,
path:
new_page
.
path
)
assert_response
:success
assert_select
"title"
,
"| "
+
new_page
.
blog
.
title
end
end
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment