Sha256: a91cd152100c3a848bd8b32c5370786029b9feeb2a1c0764fe1213f52e2cd620

Contents?: true

Size: 931 Bytes

Versions: 10

Compression:

Stored size: 931 Bytes

Contents

# frozen_string_literal: true
require 'test_helper'

module Shipit
  class ReleaseStatusesTest < ActiveSupport::TestCase
    test "#create_status_on_github! calls GitHub API" do
      Shipit.github.api.expects(:create_status).once.with(
        'shopify/shipit-engine',
        shipit_commits(:canaries_fourth).sha,
        'pending',
        context: 'shipit/canaries',
        target_url: 'https://example.com/deploys/42',
        description: 'Deploy started',
      ).returns(resource(id: 42))

      @status = shipit_release_statuses(:to_be_created)
      assert_nil @status.github_id
      @status.create_status_on_github!
      assert_equal 42, @status.github_id
    end

    test "#create_status_on_github! does nothing if the github_id is alreayd recorded" do
      Shipit.github.api.expects(:create_status).never

      @status = shipit_release_statuses(:created)
      @status.create_status_on_github!
    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
shipit-engine-0.39.0 test/models/release_statuses_test.rb
shipit-engine-0.38.0 test/models/release_statuses_test.rb
shipit-engine-0.37.0 test/models/release_statuses_test.rb
shipit-engine-0.36.1 test/models/release_statuses_test.rb
shipit-engine-0.36.0 test/models/release_statuses_test.rb
shipit-engine-0.35.1 test/models/release_statuses_test.rb
shipit-engine-0.35.0 test/models/release_statuses_test.rb
shipit-engine-0.34.0 test/models/release_statuses_test.rb
shipit-engine-0.33.0 test/models/release_statuses_test.rb
shipit-engine-0.32.0 test/models/release_statuses_test.rb