You don't need to have a unit test to test your feature. The test I showed you are more integration tests, they test more then just a functionality, since they also check the database and insert in the database.
You can for example write a unit test for an example, but your feature is also covering that if you associate the models and check that in the database.
I would probably write tests like this
public function it_tests_if_an_address_can_be_added_to_a_user()
{
$this->visit('users/create')
->fillField('username', 'username');
->fillField('password', 'password');
->fillField('address[street]', 'Randomstreet');
->fillField('address[number]', '123');
->fillField('address[city]', 'Randomtown');
->click('Submit');
$this->seeInDatabase('users', ['username' => 'username']);
// This might be a custom helper
$user = $this->grabUserByUsername('username');
$this->seeInDatabase('address', [
'street' => 'Randomstreet'
'user_id' => $user->id,
]);
}
This is a really basic example for an integration tests, but you still need to do some stuff in your controllers to get it to green. Additionally you can create extra unit tests. Something like this might work for you
public function can_assign_address_to_user()
{
$user = factory(User::class)->create();
$address = [
'street' => 'Randomstreet',
'number' => 123,
'city' => 'Randomtown',
];
// This might be a method on your user model that you call in your controller.
// In your controller $address would be request('address');
$user->assignAddress($address);
$this->assertNotNull($user->address);
$this->assertEquals('Randomstreet', $user->address->street);
}