diff options
author | Phil Hughes <me@iamphill.com> | 2019-06-04 14:38:18 +0100 |
---|---|---|
committer | Phil Hughes <me@iamphill.com> | 2019-06-05 08:46:32 +0100 |
commit | 4644a2daf5ec5e86e2b2989f04e99e4f081f6fef (patch) | |
tree | 40c9376ce43f2c2b9d964fb67b1c35cfb0077773 /spec/lib/gitlab/graphql/representation | |
parent | df549eb28c83b27500619ccb14c201a4ff87daa3 (diff) | |
download | gitlab-ce-4644a2daf5ec5e86e2b2989f04e99e4f081f6fef.tar.gz |
Add web_url to tree entry in GraphQL API
Diffstat (limited to 'spec/lib/gitlab/graphql/representation')
-rw-r--r-- | spec/lib/gitlab/graphql/representation/tree_entry_spec.rb | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/spec/lib/gitlab/graphql/representation/tree_entry_spec.rb b/spec/lib/gitlab/graphql/representation/tree_entry_spec.rb new file mode 100644 index 00000000000..d45e690160c --- /dev/null +++ b/spec/lib/gitlab/graphql/representation/tree_entry_spec.rb @@ -0,0 +1,20 @@ +# frozen_string_literal: true + +require 'spec_helper' + +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 |