]> BookStack Code Mirror - bookstack/commitdiff
Fixed chapter breadcrumbs and testing issues
authorDan Brown <redacted>
Sat, 22 Apr 2017 13:08:12 +0000 (14:08 +0100)
committerDan Brown <redacted>
Sat, 22 Apr 2017 13:08:12 +0000 (14:08 +0100)
composer.json
database/factories/ModelFactory.php
resources/views/chapters/_breadcrumbs.blade.php
tests/BrowserKitTest.php

index 396a9babd739a60ea27e9419bb1cd10c52a25ff3..2381c534bbc035f03b544918d5d1122ae5554161 100644 (file)
         "post-update-cmd": [
             "Illuminate\\Foundation\\ComposerScripts::postUpdate",
             "php artisan optimize"
+        ],
+        "refresh-test-database": [
+            "php artisan migrate:refresh --database=mysql_testing",
+            "php artisan db:seed --class=DummyContentSeeder --database=mysql_testing"
         ]
     },
     "config": {
index 43e2143868dd0c48ecc83d45cf53837d180111bb..ebf78d1fa4665251b4b0f570bc287f3f84e31093 100644 (file)
@@ -43,7 +43,8 @@ $factory->define(BookStack\Page::class, function ($faker) {
         'name' => $faker->sentence,
         'slug' => str_random(10),
         'html' => $html,
-        'text' => strip_tags($html)
+        'text' => strip_tags($html),
+        'revision_count' => 1
     ];
 });
 
index 1e090759ac2df0b632a48ea2c29265e8ab4002c8..418168461aff815aa4b4ca3c9b79194349dda991 100644 (file)
@@ -1,5 +1,5 @@
 <div class="breadcrumbs">
-    @if (userCan('view', $book))
+    @if (userCan('view', $chapter->book))
     <a href="{{ $chapter->book->getUrl() }}" class="text-book text-button"><i class="zmdi zmdi-book"></i>{{ $chapter->book->getShortName() }}</a>
     <span class="sep">&raquo;</span>
     @endif
index 8e02cb5f106b60e780963bffd089f56e6831e8df..62fa4a1907e272600b2932cff919ed00521e838e 100644 (file)
@@ -22,6 +22,12 @@ abstract class BrowserKitTest extends TestCase
     private $admin;
     private $editor;
 
+    public function tearDown()
+    {
+        \DB::disconnect('mysql_testing');
+        parent::tearDown();
+    }
+
     /**
      * Creates the application.
      *