use Illuminate\Support\Facades\Hash;
use Illuminate\Support\Str;
use Mockery\MockInterface;
-use RuntimeException;
use Tests\TestCase;
class UserManagementTest extends TestCase
$this->assertTrue(Hash::check('newpassword', $userPassword));
}
+ public function test_user_can_be_updated_with_single_char_name()
+ {
+ $user = $this->users->viewer();
+ $this->asAdmin()->put("/settings/users/{$user->id}", [
+ 'name' => 'b'
+ ])->assertRedirect('/settings/users');
+
+ $this->assertEquals('b', $user->refresh()->name);
+ }
+
public function test_user_cannot_be_deleted_if_last_admin()
{
$adminRole = Role::getRole('admin');
public function test_guest_profile_shows_limited_form()
{
$guest = $this->users->guest();
+
$resp = $this->asAdmin()->get('/settings/users/' . $guest->id);
$resp->assertSee('Guest');
- $this->withHtml($resp)->assertElementNotExists('#password');
+ $html = $this->withHtml($resp);
+
+ $html->assertElementNotExists('#password');
+ $html->assertElementNotExists('[name="language"]');
}
public function test_guest_profile_cannot_be_deleted()