1
0
mirror of https://github.com/BookStackApp/BookStack.git synced 2025-08-09 10:22:51 +03:00

Merge fixes from branch 'v0.12'

This commit is contained in:
Dan Brown
2016-11-12 11:40:54 +00:00
13 changed files with 115 additions and 6 deletions

View File

@@ -218,6 +218,37 @@ class AuthTest extends TestCase
->seePageIs('/login');
}
public function test_reset_password_flow()
{
$this->visit('/login')->click('Forgot Password?')
->seePageIs('/password/email')
->type('admin@admin.com', 'email')
->press('Send Reset Link')
->see('A password reset link has been sent to admin@admin.com');
$this->seeInDatabase('password_resets', [
'email' => 'admin@admin.com'
]);
$reset = DB::table('password_resets')->where('email', '=', 'admin@admin.com')->first();
$this->visit('/password/reset/' . $reset->token)
->see('Reset Password')
->submitForm('Reset Password', [
'email' => 'admin@admin.com',
'password' => 'randompass',
'password_confirmation' => 'randompass'
])->seePageIs('/')
->see('Your password has been successfully reset');
}
public function test_reset_password_page_shows_sign_links()
{
$this->setSettings(['registration-enabled' => 'true']);
$this->visit('/password/email')
->seeLink('Sign in')
->seeLink('Sign up');
}
/**
* Perform a login
* @param string $email

View File

@@ -91,6 +91,12 @@ class EntitySearchTest extends TestCase
->see('Book Search Results')->see('.entity-list', $book->name);
}
public function test_searching_hypen_doesnt_break()
{
$this->visit('/search/all?term=cat+-')
->seeStatusCode(200);
}
public function test_ajax_entity_search()
{
$page = \BookStack\Page::all()->last();

View File

@@ -57,7 +57,7 @@ class ImageTest extends TestCase
$relPath = $this->uploadImage($imageName, $page->id);
$this->assertResponseOk();
$this->assertTrue(file_exists(public_path($relPath)), 'Uploaded image exists');
$this->assertTrue(file_exists(public_path($relPath)), 'Uploaded image not found at path: '. public_path($relPath));
$this->deleteImage($relPath);
@@ -70,7 +70,6 @@ class ImageTest extends TestCase
'updated_by' => $admin->id,
'name' => $imageName
]);
}