Sha256: 734a51435be9a46c116ce8524862b548f95049b361a8e7ed365cb5b607058208

Contents?: true

Size: 1.08 KB

Versions: 10

Compression:

Stored size: 1.08 KB

Contents

# frozen_string_literal: true
require 'test_helper'

module Shipit
  class CommitDeploymentTest < ActiveSupport::TestCase
    setup do
      @deployment = shipit_commit_deployments(:shipit_pending_fourth)
      @task = @deployment.task
      @stack = @task.stack
      @author = @deployment.author
    end

    test "creation on GitHub" do
      deployment_response = stub(id: 42, url: 'https://example.com')
      @author.github_api.expects(:create_deployment).with(
        'shopify/shipit-engine',
        @deployment.sha,
        auto_merge: false,
        required_contexts: [],
        description: "Via Shipit",
        environment: @stack.environment,
        payload: {
          shipit: {
            task_id: 4,
            from_sha: 'f890fd8b5f2be05d1fedb763a3605ee461c39074',
            to_sha: '467578b362bf2b4df5903e1c7960929361c3435a',
          },
        }.to_json,
      ).returns(deployment_response)

      @deployment.create_on_github!
      assert_equal deployment_response.id, @deployment.github_id
      assert_equal deployment_response.url, @deployment.api_url
    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

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