File: namespaces_spec.rb

package info (click to toggle)
ruby-gitlab 5.1.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 2,660 kB
  • sloc: ruby: 12,582; makefile: 7; sh: 4
file content (24 lines) | stat: -rw-r--r-- 603 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
# frozen_string_literal: true

require 'spec_helper'

RSpec.describe Gitlab::Client do
  it { is_expected.to respond_to :namespaces }

  describe '.namespaces' do
    before do
      stub_get('/namespaces', 'namespaces')
      @namespaces = Gitlab.namespaces
    end

    it 'gets the correct resource' do
      expect(a_get('/namespaces')).to have_been_made
    end

    it 'returns a paginated response of namespaces' do
      expect(@namespaces).to be_a Gitlab::PaginatedResponse
      expect(@namespaces.first.path).to eq('john')
      expect(@namespaces.first.kind).to eq('user')
    end
  end
end