require'spec_helper'describeBlobViewer::License,model: truedoincludeFakeBlobHelperslet(:project){create(:project,:repository)}let(:blob){fake_blob(path: 'LICENSE')}subject{described_class.new(blob)}describe'#license'doit'returns the blob project repository license'doexpect(subject.license).not_tobe_nilexpect(subject.license).toeq(project.repository.license)endenddescribe'#render_error'docontext'when there is no license'dobeforedoallow(project.repository).toreceive(:license).and_return(nil)endit'returns :unknown_license'doexpect(subject.render_error).toeq(:unknown_license)endendcontext'when there is a license'doit'returns nil'doexpect(subject.render_error).tobe_nilendendendend