Troj's avatar
Level 4

Unit test keeps failing

I make use of laravel-boilerplate but i added some fields to the usertable, for example a username (required field) and some other additional fields. But now the UpdateUserTest keeps failing and i cant figure out what goes wrong. I dont understand the error either.

   FAIL  Tests\Feature\Backend\User\UpdateUserTest
  ✓ an admin can access the edit user page
  ✕ a user can be updated

  Tests:  1 failed, 55 passed, 55 pending

  Failed asserting that a row in the table [users] matches the attributes {     "id": 3,     "type": "admin",     "name": "John Doe",     "username": "JohnDoe",     "email": "[email protected]" }.  Found similar results: [     {         "id": "3",         "type": "user",         "name": "Dr. Cristopher Koss",         "username": "rau.meta",         "gender": "male",         "birthday": "2003-07-01 00:00:00",         "location": "Starkstad",         "description": "Tempore quo inventore ut natus molestiae ipsum. Deleniti vel neque alias consequatur occaecati.",         "email": "[email protected]",         "email_verified_at": "2020-09-01 13:51:22",         "password": "y$JZJyErTJskW93LINSX5L6u2nhyqxFVl7OkBnGbsiFV\/kD1EIKsjIi",         "password_changed_at": null,         "active": "1",         "timezone": null,         "last_login_at": null,         "last_login_ip": null,         "to_be_logged_out": "0",         "provider": null,         "provider_id": null,         "remember_token": "bJFcU0eD8d",         "created_at": "2020-09-01 13:51:22",         "updated_at": "2020-09-01 13:51:22",         "deleted_at": null     } ].

  at tests/Feature/Backend/User/UpdateUserTest.php:63
    59|             'id' => $user->id,
    60|             'type' => User::TYPE_ADMIN,
    61|             'name' => 'John Doe',
    62|             'username' => 'JohnDoe',
  > 63|             'email' => '[email protected]',
    64|         ]);
    65| 
    66|         $this->assertDatabaseHas('model_has_roles', [
    67|             'role_id' => Role::whereName(config('boilerplate.access.role.admin'))->first()->id,

Anyone a clue where to start looking. Actually in my adminpanel i cant update a user either, so it's not the test thats wrong, but somewhere i've probably forgotton something.

0 likes
19 replies
Troj's avatar
Level 4

UpdatUserTest

<?php

namespace Tests\Feature\Backend\User;

use App\Domains\Auth\Events\User\UserUpdated;
use App\Domains\Auth\Models\Role;
use App\Domains\Auth\Models\User;
use Illuminate\Foundation\Testing\RefreshDatabase;
use Illuminate\Support\Facades\Event;
use Tests\TestCase;

/**
 * Class UpdateUserTest.
 */
class UpdateUserTest extends TestCase
{
    use RefreshDatabase;

    /** @test */
    public function an_admin_can_access_the_edit_user_page()
    {
        $this->loginAsAdmin();

        $user = factory(User::class)->create();

        $response = $this->get('/admin/auth/user/'.$user->id.'/edit');

        $response->assertOk();
    }

    /** @test */
    public function a_user_can_be_updated()
    {
        Event::fake();

        $this->loginAsAdmin();

        $user = factory(User::class)->create();

        $this->assertDatabaseMissing('users', [
            'id' => $user->id,
            'type' => User::TYPE_ADMIN,
            'name' => 'John Doe',
            'username' => 'JohnDoe',
            'email' => '[email protected]',
        ]);

        $this->patch("/admin/auth/user/{$user->id}", [
            'type' => User::TYPE_ADMIN,
            'name' => 'John Doe',
            'username' => 'JohnDoe',
            'email' => '[email protected]',
            'roles' => [
                Role::whereName(config('boilerplate.access.role.admin'))->first()->id,
            ],
        ]);

        $this->assertDatabaseHas('users', [
            'id' => $user->id,
            'type' => User::TYPE_ADMIN,
            'name' => 'John Doe',
            'username' => 'JohnDoe',
            'email' => '[email protected]',
        ]);

        $this->assertDatabaseHas('model_has_roles', [
            'role_id' => Role::whereName(config('boilerplate.access.role.admin'))->first()->id,
            'model_type' => User::class,
            'model_id' => User::whereEmail('[email protected]')->first()->id,
        ]);

        Event::assertDispatched(UserUpdated::class);
    }

    /** @test */
    public function only_the_master_admin_can_edit_themselves()
    {
        $admin = $this->loginAsAdmin();

        $this->get("/admin/auth/user/{$admin->id}/edit")->assertOk();

        $this->logout();

        $otherAdmin = factory(User::class)->state('admin')->create();
        $otherAdmin->assignRole(config('boilerplate.access.role.admin'));

        $this->actingAs($otherAdmin);

        $response = $this->get("/admin/auth/user/{$admin->id}/edit");

        $response->assertSessionHas('flash_danger', __('Only the administrator can update this user.'));
    }

    /** @test */
    public function only_the_master_admin_can_update_themselves()
    {
        $admin = $this->loginAsAdmin();

        $this->assertDatabaseMissing('users', [
            'id' => $admin->id,
            'name' => 'John Doe',
            'email' => '[email protected]',
        ]);

        $this->patch("/admin/auth/user/{$admin->id}", [
            'name' => 'John Doe',
            'email' => '[email protected]',
        ]);

        $this->assertDatabaseHas('users', [
            'id' => $admin->id,
            'name' => 'John Doe',
            'email' => '[email protected]',
        ]);

        $this->logout();

        // Make sure other admins can not update the master admin

        $otherAdmin = factory(User::class)->state('admin')->create();
        $otherAdmin->assignRole(config('boilerplate.access.role.admin'));

        $this->actingAs($otherAdmin);

        $response = $this->patch("/admin/auth/user/{$admin->id}", [
            'id' => $admin->id,
            'name' => 'Changed Name',
            'email' => '[email protected]',
        ]);

        $response->assertSessionHas('flash_danger', __('Only the administrator can update this user.'));

        $this->assertDatabaseMissing('users', [
            'id' => $admin->id,
            'name' => 'Changed Name',
            'email' => '[email protected]',
        ]);
    }

    /** @test */
    public function the_master_admins_abilities_can_not_be_modified()
    {
        $admin = $this->loginAsAdmin();

        $role = factory(Role::class)->create();

        $this->assertDatabaseMissing('model_has_roles', [
            'role_id' => $role->id,
            'model_type' => User::class,
            'model_id' => $admin->id,
        ]);

        $this->patch("/admin/auth/user/{$admin->id}", [
            'name' => $admin->name,
            'email' => $admin->email,
            'roles' => [$role->id],
        ]);

        $this->assertDatabaseMissing('model_has_roles', [
            'role_id' => $role->id,
            'model_type' => User::class,
            'model_id' => $admin->id,
        ]);
    }

    /** @test */
    public function only_admin_can_update_roles()
    {
        $this->actingAs(factory(User::class)->state('admin')->create());

        $user = factory(User::class)->state('admin')->create(['name' => 'John Doe']);

        $response = $this->patch("/admin/auth/user/{$user->id}", [
            'type' => User::TYPE_USER,
            'name' => 'Jane Doe',
        ]);

        $response->assertSessionHas('flash_danger', __('You do not have access to do that.'));

        $this->assertDatabaseHas('users', [
            'id' => $user->id,
            'type' => User::TYPE_ADMIN,
            'name' => 'John Doe',
        ]);
    }
}
GeordieJackson's avatar

This here in a_user_can_be_updated():

$user = factory(User::class)->create();

        $this->assertDatabaseMissing('users', [
            'id' => $user->id,
            'type' => User::TYPE_ADMIN,
            'name' => 'John Doe',
            'username' => 'JohnDoe',
            'email' => '[email protected]',
        ]);

Will fail because you're creating a user (i.e. saving them to the database) and then checking that they're missing from the database.

If you use:

$user = factory(User::class)->make();

instead of create, it will create a user in memory but not save it in the database.

automica's avatar

@troj can you also post migration for UserTable?

have you added your new fields to UserFactory, and added them within the fillable fields array in your User model too?

Troj's avatar
Level 4

I'm getting the a slightly different error with "id": null

   FAIL  Tests\Feature\Backend\User\UpdateUserTest
  ✓ an admin can access the edit user page
  ✕ a user can be updated

  Tests:  1 failed, 55 passed, 55 pending

  Failed asserting that a row in the table [users] matches the attributes {     "id": null,     "type": "admin",     "name": "John Doe",     "username": "JohnDoe",     "email": "[email protected]" }.  Found: [     {         "id": "1",         "type": "admin",         "name": "Super Admin",         "username": "SuperAdmin",         "gender": "male",         "birthday": "2020-09-01 14:17:06",         "location": null,         "description": null,         "email": "[email protected]",         "email_verified_at": "2020-09-01 14:17:06",         "password": "yDwBSI3usYjxTCeKBOSljeCmtbsNDtf7rOlIbHKp8X6rXraK5nOx2",         "password_changed_at": null,         "active": "1",         "timezone": null,         "last_login_at": null,         "last_login_ip": null,         "to_be_logged_out": "0",         "provider": null,         "provider_id": null,         "remember_token": null,         "created_at": "2020-09-01 14:17:06",         "updated_at": "2020-09-01 14:17:06",         "deleted_at": null     },     {         "id": "2",         "type": "user",         "name": "Test User",         "username": "TestUser",         "gender": "female",         "birthday": "2020-09-01 14:17:06",         "location": null,         "description": null,         "email": "[email protected]",         "email_verified_at": "2020-09-01 14:17:06",         "password": "y$fQWiypab0w.Hy.Glb6cB1OGAmO2.lbGfC9WfmSYuDx1ksNP0UFGU2",         "password_changed_at": null,         "active": "1",         "timezone": null,         "last_login_at": null,         "last_login_ip": null,         "to_be_logged_out": "0",         "provider": null,         "provider_id": null,         "remember_token": null,         "created_at": "2020-09-01 14:17:06",         "updated_at": "2020-09-01 14:17:06",         "deleted_at": null     } ].

  at tests/Feature/Backend/User/UpdateUserTest.php:63
    59|             'id' => $user->id,
    60|             'type' => User::TYPE_ADMIN,
    61|             'name' => 'John Doe',
    62|             'username' => 'JohnDoe',
  > 63|             'email' => '[email protected]',
    64|         ]);
    65| 
    66|         $this->assertDatabaseHas('model_has_roles', [
    67|             'role_id' => Role::whereName(config('boilerplate.access.role.admin'))->first()->id,
automica's avatar

@troj you wont get a $user->id until you've saved it.

if your intent it to check if the user that isn't called john doe doesn't exist already, just check by username and the rest of the details.

Then you patch the id, update with new name and then check again to see if its updated.

    $user = factory(User::class)->create();

    $this->assertDatabaseMissing('users', [
        'type' => User::TYPE_ADMIN,
        'name' => 'John Doe',
        'username' => 'JohnDoe',
        'email' => '[email protected]',
    ]);

    $this->patch("/admin/auth/user/{$user->id}", [
        'type' => User::TYPE_ADMIN,
        'name' => 'John Doe',
        'username' => 'JohnDoe',
        'email' => '[email protected]',
        'roles' => [
            Role::whereName(config('boilerplate.access.role.admin'))->first()->id,
        ],
    ]);
Troj's avatar
Level 4

I think the problem is somewhere else. I'm using this github repository: https://github.com/rappasoft/laravel-boilerplate. But i added some fields, i think the problem has something to do with that

    public function update(User $user, array $data = []): User
    {
        DB::beginTransaction();

        try {
            $user->update([
                'type' => $user->isMasterAdmin() ? $this->model::TYPE_ADMIN : $data['type'] ?? $user->type,
                'name' => $data['name'],
                'username' => $data['username'],
                'gender' => $data['gender'],
                'birthday' => $data['birthday'],
                'location' => $data['location'],
                'description' => $data['description'],
                'email' => $data['email'],
            ]);

            if (! $user->isMasterAdmin()) {
                // Replace selected roles/permissions
                $user->syncRoles($data['roles'] ?? []);

                if (! config('boilerplate.access.user.only_roles')) {
                    $user->syncPermissions($data['permissions'] ?? []);
                }
            }
        } catch (Exception $e) {
            DB::rollBack();

            throw new GeneralException(__('There was a problem updating this user. Please try again.'));
        }

        event(new UserUpdated($user));

        DB::commit();

        return $user;
    }
Troj's avatar
Level 4

@automica

UserTable

<?php

use App\Domains\Auth\Models\User;
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreateUsersTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('users', function (Blueprint $table) {
            $table->bigIncrements('id');
            $table->enum('type', [User::TYPE_ADMIN, User::TYPE_USER])->default(User::TYPE_USER);
            $table->string('name');
            $table->string('username')->nullable()->unique();
            $table->string('gender', 8)->nullable();
            $table->date('birthday')->nullable();
            $table->string('location', 100)->nullable();
            $table->string('description', 5000)->nullable();
            $table->string('email')->unique()->nullable();
            $table->timestamp('email_verified_at')->nullable();
            $table->string('password')->nullable();
            $table->timestamp('password_changed_at')->nullable();
            $table->unsignedTinyInteger('active')->default(1);
            $table->string('timezone')->nullable();
            $table->timestamp('last_login_at')->nullable();
            $table->string('last_login_ip')->nullable();
            $table->boolean('to_be_logged_out')->default(false);
            $table->string('provider')->nullable();
            $table->string('provider_id')->nullable();
            $table->rememberToken();
            $table->timestamps();
            $table->softDeletes();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('users');
    }
}
Troj's avatar
Level 4

UserFactoy i added the new fields as well and also to the model

The new fields are username, gender, birthday, location and description

<?php

/** @var \Illuminate\Database\Eloquent\Factory $factory */
use App\Domains\Auth\Models\User;
use Faker\Generator as Faker;
use Illuminate\Support\Str;

/*
|--------------------------------------------------------------------------
| Model Factories
|--------------------------------------------------------------------------
|
| This directory should contain each of the model factory definitions for
| your application. Factories provide a convenient way to generate new
| model instances for testing / seeding your application's database.
|
*/

$factory->define(User::class, function (Faker $faker) {
    $gender = $faker->randomElement(['male', 'female', 'other']);

    return [
        'type' => $faker->randomElement([User::TYPE_ADMIN, User::TYPE_USER]),
        'name' => $faker->name,
        'username' => $faker->unique()->userName,
        'gender' => $gender,
        'birthday' => $faker->date($format = 'Y-m-d', $max = 'now'),
        'location' => $faker->city,
        'description' => $faker->paragraph,
        'email' => $faker->unique()->safeEmail,
        'email_verified_at' => now(),
        'password' => 'secret',
        'password_changed_at' => null,
        'remember_token' => Str::random(10),
        'active' => true,
    ];
});

$factory->state(User::class, 'admin', function () {
    return [
        'type' => User::TYPE_ADMIN,
    ];
});

$factory->state(User::class, 'user', function () {
    return [
        'type' => User::TYPE_USER,
    ];
});

$factory->state(User::class, 'active', function () {
    return [
        'active' => true,
    ];
});

$factory->state(User::class, 'inactive', function () {
    return [
        'active' => false,
    ];
});

$factory->state(User::class, 'confirmed', function () {
    return [
        'email_verified_at' => now(),
    ];
});

$factory->state(User::class, 'unconfirmed', function () {
    return [
        'email_verified_at' => null,
    ];
});

$factory->state(User::class, 'password_expired', function () {
    return [
        'password_changed_at' => now()->subYears(5),
    ];
});

$factory->state(User::class, 'deleted', function () {
    return [
        'deleted_at' => now(),
    ];
});
<?php

namespace App\Domains\Auth\Models;

use App\Domains\Auth\Models\Traits\Attribute\UserAttribute;
use App\Domains\Auth\Models\Traits\Method\UserMethod;
use App\Domains\Auth\Models\Traits\Relationship\UserRelationship;
use App\Domains\Auth\Models\Traits\Scope\UserScope;
use App\Domains\Auth\Notifications\Frontend\ResetPasswordNotification;
use App\Domains\Auth\Notifications\Frontend\VerifyEmail;
use DarkGhostHunter\Laraguard\Contracts\TwoFactorAuthenticatable;
use DarkGhostHunter\Laraguard\TwoFactorAuthentication;
use Illuminate\Auth\MustVerifyEmail as MustVerifyEmailTrait;
use Illuminate\Contracts\Auth\MustVerifyEmail;
use Illuminate\Database\Eloquent\SoftDeletes;
use Illuminate\Foundation\Auth\User as Authenticatable;
use Illuminate\Notifications\Notifiable;
use Lab404\Impersonate\Models\Impersonate;
use Spatie\Permission\Traits\HasRoles;

/**
 * Class User.
 */
class User extends Authenticatable implements MustVerifyEmail, TwoFactorAuthenticatable
{
    use HasRoles,
        Impersonate,
        MustVerifyEmailTrait,
        Notifiable,
        SoftDeletes,
        TwoFactorAuthentication,
        UserAttribute,
        UserMethod,
        UserRelationship,
        UserScope;

    public const TYPE_ADMIN = 'admin';
    public const TYPE_USER = 'user';

    /**
     * The attributes that are mass assignable.
     *
     * @var array
     */
    protected $fillable = [
        'type',
        'name',
        'username',
        'gender',
        'birthday',
        'location',
        'description',
        'email',
        'email_verified_at',
        'password',
        'password_changed_at',
        'active',
        'timezone',
        'last_login_at',
        'last_login_ip',
        'to_be_logged_out',
        'provider',
        'provider_id',
    ];

    /**
     * The attributes that should be hidden for arrays.
     *
     * @var array
     */
    protected $hidden = [
        'password',
        'remember_token',
    ];

    /**
     * @var array
     */
    protected $dates = [
        'birthday',
        'last_login_at',
        'email_verified_at',
        'password_changed_at',
    ];

    /**
     * The attributes that should be cast to native types.
     *
     * @var array
     */
    protected $casts = [
        'active' => 'boolean',
        'last_login_at' => 'datetime',
        'email_verified_at' => 'datetime',
        'to_be_logged_out' => 'boolean',
    ];

    /**
     * @var array
     */
    protected $appends = [
        'avatar',
    ];

    /**
     * @var string[]
     */
    protected $with = [
        'permissions',
        'roles',
    ];

    /**
     * Send the password reset notification.
     *
     * @param  string  $token
     * @return void
     */
    public function sendPasswordResetNotification($token): void
    {
        $this->notify(new ResetPasswordNotification($token));
    }

    /**
     * Send the registration verification email.
     */
    public function sendEmailVerificationNotification(): void
    {
        $this->notify(new VerifyEmail);
    }

    /**
     * Return true or false if the user can impersonate an other user.
     *
     * @param void
     * @return  bool
     */
    public function canImpersonate(): bool
    {
        return $this->can('admin.access.user.impersonate');
    }

    /**
     * Return true or false if the user can be impersonate.
     *
     * @param void
     * @return  bool
     */
    public function canBeImpersonated(): bool
    {
        return ! $this->isMasterAdmin();
    }
}
automica's avatar

@troj If your form isn't saving from UI, are you getting any errors either in the error bag or within the logs?

Troj's avatar
Level 4

@automica What logs should i look for? I checked storage->logs but there are no new logfiles since i ran into this error. And whats the error bag? Where can i find that?

The only feedback i see frontend is: "There was a problem updating this user. Please try again." And that comes from the UserService file

    public function update(User $user, array $data = []): User
    {
        DB::beginTransaction();

        try {
            $user->update([
                'type' => $user->isMasterAdmin() ? $this->model::TYPE_ADMIN : $data['type'] ?? $user->type,
                'name' => $data['name'],
                'username' => $data['username'],
                'gender' => $data['gender'],
                'birthday' => $data['birthday'],
                'location' => $data['location'],
                'description' => $data['description'],
                'email' => $data['email'],
            ]);

            if (! $user->isMasterAdmin()) {
                // Replace selected roles/permissions
                $user->syncRoles($data['roles'] ?? []);

                if (! config('boilerplate.access.user.only_roles')) {
                    $user->syncPermissions($data['permissions'] ?? []);
                }
            }
        } catch (Exception $e) {
            DB::rollBack();

            throw new GeneralException(__('There was a problem updating this user. Please try again.'));
        }

        event(new UserUpdated($user));

        DB::commit();

        return $user;
    }

But when i log in as the user i can update the user profile of the one i logged in with.

automica's avatar
automica
Best Answer
Level 54

@troj ok. looks like its throwing an exception.

drop in

Log::error($e);

after DB::rollBack();

and you should be able to see what the error is.

Troj's avatar
Level 4

Ok nice, this might be helpful: local.ERROR: ErrorException: Undefined index: gender in /app/Domains/Auth/Services/UserService.php:171

Still not sure what the problem is exactly, but I need to go now, but i will look into it tonight when i come back.

automica's avatar

@troj sweet. that hopefully should be easy to solve then.

looks like a separate issue to your test error, but placing a gender select in your form should allow that to work.

Troj's avatar
Level 4

I think the problem is in the select.

this is in my edit form. I should probably use a foreach here, right?

                    <div class="form-group row">
                        <label for="gender" class="col-md-2 col-form-label">@lang('Gender')</label>

                        <div class="col-md-10">
                            <select name="gender" class="form-control">
                              <option value="null" disabled selected>Select</option>
                              <option value="Male" {{ $user->gender == 'Male' ? 'selected' : ''}}>Male</option>
                              <option value="Female" {{ $user->gender == 'Female' ? 'selected' : ''}}>Female</option>
                              <option value="Other" {{ $user->gender == 'Other' ? 'selected' : ''}}>Other</option>
                            </select>
                        </div>
                    </div><!--form-group-->
automica's avatar

@troj setting

  <option value="" disabled selected>Select</option>

instead of null is probably better.

using a foreach to check the selected is neater but doesn't look like the problem.

Troj's avatar
Level 4

Still not working, i removed the gender select from the edit page. That should fix the problem i thought, but it's still giving me the same error in the logfile and the test obviously also still fails.

local.ERROR: ErrorException: Undefined index: gender in /app/Domains/Auth/Services/UserService.php:171

                   <div class="form-group row">
                        <label for="name" class="col-md-2 col-form-label">@lang('Name')</label>

                        <div class="col-md-10">
                            <input type="text" name="name" class="form-control" placeholder="{{ __('Name') }}" value="{{ old('name') ?? $user->name }}" maxlength="100" required />
                        </div>
                    </div><!--form-group-->

                    <div class="form-group row">
                        <label for="username" class="col-md-2 col-form-label">@lang('Username')</label>

                        <div class="col-md-10">
                            <input type="text" name="username" class="form-control" placeholder="{{ __('Username') }}" value="{{ old('username') ?? $user->username }}" maxlength="100" required />
                        </div>
                    </div><!--form-group-->

<!--                     <div class="form-group row">
                        <label for="gender" class="col-md-2 col-form-label">@lang('Gender')</label>

                        <div class="col-md-10">
                            <select name="gender" class="form-control">
                              <option value="" disabled selected>Select</option>
                              <option value="Male" name="gender" {{ $user->gender == 'Male' ? 'selected' : ''}}>Male</option>
                              <option value="Female" name="gender" {{ $user->gender == 'Female' ? 'selected' : ''}}>Female</option>
                              <option value="Other" name="gender" {{ $user->gender == 'Other' ? 'selected' : ''}}>Other</option>
                            </select>
                        </div>
                    </div>

                    <div class="form-group row">
                        <label for="birthday" class="col-md-2 col-form-label">@lang('Birthday')</label>
                        <div class="col-md-10">
                            <input type="date" id="birthday" name="birthday" placeholder="dd/mm/yyyy" class="form-control" value="{{ old('birthday') ?? $user->birthday }}">
                        </div>
                    </div> -->

                    <div class="form-group row">
                        <label for="location" class="col-md-2 col-form-label">@lang('Location')</label>
                        <div class="col-md-10">
                            <input id="location" name="location" class="form-control" placeholder="{{ __('Hometown, Country') }}" value="{{ old('location') ?? $user->location }}">
                        </div>
                    </div><!--form-group-->

                    <div class="form-group row">
                        <label for="description" class="col-md-2 col-form-label">@lang('Description')</label>
                        <div class="col-md-10">
                            <textarea type="textarea" id="description" name="description" class="form-control" placeholder="{{ __('Your Description') }}" value="{{ old('description') ?? $user->description }}">{{ $user->description }}</textarea>
                        </div>
                    </div><!--form-group-->
Troj's avatar
Level 4

@automica I'm giving you the best answer because you helped me in the right direction. Didn't found the complete solution yet. But ruling somethings out gave me at least a direction to look for. Removing the gender, birthday, location and description made all tests pass. Thanks for that! I probably can find the solution now.

update:

Found the solution, in my validation rules i had to add "nullable" to extra fields i added.

Please or to participate in this conversation.