debian-mirror-gitlab/spec/lib/gitlab/graphql/representation/tree_entry_spec.rb

21 lines
540 B
Ruby
Raw Normal View History

2019-09-04 21:01:54 +05:30
# frozen_string_literal: true
require 'spec_helper'
2020-07-28 23:09:34 +05:30
RSpec.describe Gitlab::Graphql::Representation::TreeEntry do
2019-09-04 21:01:54 +05:30
let(:project) { create(:project, :repository) }
let(:repository) { project.repository }
describe '.decorate' do
it 'returns NilClass when given nil' do
expect(described_class.decorate(nil, repository)).to be_nil
end
it 'returns array of TreeEntry' do
entries = described_class.decorate(repository.tree.blobs, repository)
expect(entries.first).to be_a(described_class)
end
end
end