require'spec_helper'describeBanzai::ReferenceParser::LabelParser,lib: truedoincludeReferenceParserHelperslet(:project){create(:empty_project,:public)}let(:user){create(:user)}let(:label){create(:label,project: project)}subject{described_class.new(project,user)}let(:link){empty_html_link}describe'#referenced_by'dodescribe'when the link has a data-label attribute'docontext'using an existing label ID'doit'returns an Array of labels'dolink['data-label']=label.id.to_sexpect(subject.referenced_by([link])).toeq([label])endendcontext'using a non-existing label ID'doit'returns an empty Array'dolink['data-label']=''expect(subject.referenced_by([link])).toeq([])endendendendend