Sha256: 63716965273990f55e21846751ba554215d8ec8964c4fdfeb84a1c0760a232b2

Contents?: true

Size: 1.41 KB

Versions: 10

Compression:

Stored size: 1.41 KB

Contents

# frozen_string_literal: true
require 'test_helper'

module Shipit
  class ReleaseStatusesControllerTest < ActionController::TestCase
    setup do
      @stack = shipit_stacks(:shipit_canaries)
      @deploy = shipit_deploys(:canaries_validating)
      session[:user_id] = shipit_users(:walrus).id
    end

    test ":create allow users to append release statuses and mark the deploy as success" do
      assert_difference -> { ReleaseStatus.count }, +1 do
        post :create, params: { stack_id: @stack, deploy_id: @deploy.id, status: 'success' }
        assert_response :created
      end

      status = ReleaseStatus.last
      assert_equal 'success', status.state
      assert_equal '@walrus signaled this release as healthy.', status.description
      assert_equal @deploy.permalink, status.target_url
      assert_equal 'success', @deploy.reload.status
    end

    test ":create allow users to append release statuses and mark the deploy as faulty" do
      assert_difference -> { ReleaseStatus.count }, +1 do
        post :create, params: { stack_id: @stack, deploy_id: @deploy.id, status: 'failure' }
        assert_response :created
      end

      status = ReleaseStatus.last
      assert_equal 'failure', status.state
      assert_equal '@walrus signaled this release as faulty.', status.description
      assert_equal @deploy.permalink, status.target_url
      assert_equal 'faulty', @deploy.reload.status
    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

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