File: deployments_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 (40 lines) | stat: -rw-r--r-- 1,076 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
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
# frozen_string_literal: true

require 'spec_helper'

RSpec.describe Gitlab::Client do
  describe '.deployments' do
    before do
      stub_get('/projects/3/deployments', 'deployments')
      @deployments = Gitlab.deployments(3)
    end

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

    it "returns a paginated response of project's deployments" do
      expect(@deployments).to be_a Gitlab::PaginatedResponse
    end
  end

  describe '.deployment' do
    before do
      stub_get('/projects/3/deployments/42', 'deployment')
      @deployment = Gitlab.deployment(3, 42)
    end

    it 'gets the correct resource' do
      expect(a_get('/projects/3/deployments/42')).to have_been_made
    end

    it 'returns a single deployment' do
      expect(@deployment).to be_a Gitlab::ObjectifiedHash
    end

    it 'returns information about an deployment' do
      expect(@deployment.id).to eq(42)
      expect(@deployment.deployable.commit.id).to eq('a91957a858320c0e17f3a0eca7cfacbff50ea29a')
    end
  end
end