Welcome to mirror list, hosted at ThFree Co, Russian Federation.

tree_entry_spec.rb « representation « graphql « gitlab « lib « spec - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: f4eb7b37774c3d6503a902829c38bddb7e5058dc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
# frozen_string_literal: true

require 'spec_helper'

RSpec.describe Gitlab::Graphql::Representation::TreeEntry do
  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