#!perl
use Cassandane::Tiny;

sub test_calendarevent_get_organizer_bogusuri
    :min_version_3_4
    ($self)
{
    # As seen in the wild: an ORGANIZER/ATTENDEE with a value
    # that hasn't even an URI scheme.

    my ($id, $ical) = $self->icalfile('organizer_bogusuri');

    my $event = $self->putandget_vevent($id, $ical);

    my $wantParticipants = hashbag(
        ignore() => {
            '@type' => 'Participant',
            name => 'Organizer',
            roles => {
                'owner' => JSON::true,
            },
            calendarAddress => '/foo-bar/principal/',
        },
        ignore() => {
            '@type' => 'Participant',
            calendarAddress => 'mailto:attendee@local',
        },
    );
    $self->assert_cmp_deeply($wantParticipants, $event->{participants});
    $self->assert_str_equals('/foo-bar/principal/', $event->{organizerCalendarAddress});
}
