require'spec_helper'describeRemoveExpiredGroupLinksWorkerdodescribe'#perform'dolet!(:expired_project_group_link){create(:project_group_link,expires_at: 1.hour.ago)}let!(:project_group_link_expiring_in_future){create(:project_group_link,expires_at: 10.days.from_now)}let!(:non_expiring_project_group_link){create(:project_group_link,expires_at: nil)}it'removes expired group links'doexpect{subject.perform}.tochange{ProjectGroupLink.count}.by(-1)expect(ProjectGroupLink.find_by(id: expired_project_group_link.id)).tobe_nilendit'leaves group links that expire in the future'dosubject.performexpect(project_group_link_expiring_in_future.reload).tobe_presentendit'leaves group links that do not expire at all'dosubject.performexpect(non_expiring_project_group_link.reload).tobe_presentendendend