Toggle navigation
Toggle navigation
This project
Loading...
Sign in
Зуев Егор
/
wiki.dev
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Snippets
Network
Create a new issue
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
Authored by
Dan Brown
2016-07-26 18:16:40 +0100
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
Commit
42976ca48c8de04726e62356f76f0bbb77b2ab15
42976ca4
1 parent
d05e85ef
Fixed revision-based redirect on new pages
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
1 deletions
app/Repos/PageRepo.php
tests/Entity/EntityTest.php
app/Repos/PageRepo.php
View file @
42976ca
...
...
@@ -157,6 +157,8 @@ class PageRepo extends EntityRepo
$draftPage
->
draft
=
false
;
$draftPage
->
save
();
$this
->
saveRevision
(
$draftPage
,
'Initial Publish'
);
return
$draftPage
;
}
...
...
tests/Entity/EntityTest.php
View file @
42976ca
...
...
@@ -216,13 +216,24 @@ class EntityTest extends TestCase
public
function
test_old_page_slugs_redirect_to_new_pages
()
{
$page
=
\BookStack\Page
::
all
()
->
first
();
$page
=
\BookStack\Page
::
first
();
$pageUrl
=
$page
->
getUrl
();
$newPageUrl
=
'/books/'
.
$page
->
book
->
slug
.
'/page/super-test-page'
;
// Need to save twice since revisions are not generated in seeder.
$this
->
asAdmin
()
->
visit
(
$pageUrl
)
->
clickInElement
(
'#content'
,
'Edit'
)
->
type
(
'super test'
,
'#name'
)
->
press
(
'Save Page'
);
$page
=
\BookStack\Page
::
first
();
$pageUrl
=
$page
->
getUrl
();
// Second Save
$this
->
visit
(
$pageUrl
)
->
clickInElement
(
'#content'
,
'Edit'
)
->
type
(
'super test page'
,
'#name'
)
->
press
(
'Save Page'
)
// Check redirect
->
seePageIs
(
$newPageUrl
)
->
visit
(
$pageUrl
)
->
seePageIs
(
$newPageUrl
);
...
...
Please
register
or
sign in
to post a comment