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-03-13 14:33:43 +0000
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
Commit
4656c12f6dafc9256cd3dd8de3065ec12feaa23f
4656c12f
1 parent
a0632167
Fixed bug causing editing notification to always show
Updated tests to prevent happening again
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
1 deletions
app/Repos/PageRepo.php
tests/Entity/PageDraftTest.php
app/Repos/PageRepo.php
View file @
4656c12
...
...
@@ -498,6 +498,7 @@ class PageRepo extends EntityRepo
private
function
activePageEditingQuery
(
Page
$page
,
$minRange
=
null
)
{
$query
=
$this
->
pageRevision
->
where
(
'type'
,
'='
,
'update_draft'
)
->
where
(
'page_id'
,
'='
,
$page
->
id
)
->
where
(
'updated_at'
,
'>'
,
$page
->
updated_at
)
->
where
(
'created_by'
,
'!='
,
auth
()
->
user
()
->
id
)
->
with
(
'createdBy'
);
...
...
tests/Entity/PageDraftTest.php
View file @
4656c12
...
...
@@ -48,6 +48,7 @@ class PageDraftTest extends TestCase
public
function
test_alert_message_shows_if_someone_else_editing
()
{
$nonEditedPage
=
\BookStack\Page
::
take
(
10
)
->
get
()
->
last
();
$addedContent
=
'<p>test message content</p>'
;
$this
->
asAdmin
()
->
visit
(
$this
->
page
->
getUrl
()
.
'/edit'
)
->
dontSeeInField
(
'html'
,
$addedContent
);
...
...
@@ -55,8 +56,13 @@ class PageDraftTest extends TestCase
$newContent
=
$this
->
page
->
html
.
$addedContent
;
$newUser
=
$this
->
getNewUser
();
$this
->
pageRepo
->
saveUpdateDraft
(
$this
->
page
,
[
'html'
=>
$newContent
]);
$this
->
actingAs
(
$newUser
)
->
visit
(
$this
->
page
->
getUrl
()
.
'/edit'
)
$this
->
actingAs
(
$newUser
)
->
visit
(
$this
->
page
->
getUrl
()
.
'/edit'
)
->
see
(
'Admin has started editing this page'
);
$this
->
flushSession
();
$this
->
visit
(
$nonEditedPage
->
getUrl
()
.
'/edit'
)
->
dontSeeInElement
(
'.notification'
,
'Admin has started editing this page'
);
}
public
function
test_draft_pages_show_on_homepage
()
...
...
Please
register
or
sign in
to post a comment