Sha256: 32bbfce5da9e370414a658f9cd56b77277d0248d4f395232e11c9905d22ad7f4

Contents?: true

Size: 1.13 KB

Versions: 27

Compression:

Stored size: 1.13 KB

Contents

require 'test_helper'

module Shipit
  class CommitChecksControllerTest < ActionController::TestCase
    setup do
      @commit = shipit_commits(:fifth)
      @checks = @commit.checks
      @stack = @commit.stack
      @checks.write('foobar')
      @checks.status = 'running'
      session[:user_id] = shipit_users(:walrus).id
    end

    test ":tail is success" do
      get :tail, params: {stack_id: @stack.to_param, sha: @commit.sha}
      assert_response :success
      assert_json 'output', 'foobar'
      assert_json 'url', stack_tail_commit_checks_path(@stack, sha: @commit.sha, since: 6)
      assert_json 'status', 'running'
    end

    test ":tail doesn't provide another url if the task is finished" do
      @checks.status = 'success'
      get :tail, params: {stack_id: @stack.to_param, sha: @commit.sha}
      assert_response :success
      assert_json 'url', nil
    end

    test ":tail returns only the output after the provided offset" do
      @checks.status = 'success'
      get :tail, params: {stack_id: @stack.to_param, sha: @commit.sha, since: 5}
      assert_response :success
      assert_json 'output', 'r'
    end
  end
end

Version data entries

27 entries across 27 versions & 1 rubygems

Version Path
shipit-engine-0.31.0 test/controllers/commit_checks_controller_test.rb
shipit-engine-0.30.0 test/controllers/commit_checks_controller_test.rb
shipit-engine-0.29.0 test/controllers/commit_checks_controller_test.rb
shipit-engine-0.28.1 test/controllers/commit_checks_controller_test.rb
shipit-engine-0.28.0 test/controllers/commit_checks_controller_test.rb
shipit-engine-0.27.1 test/controllers/commit_checks_controller_test.rb
shipit-engine-0.27.0 test/controllers/commit_checks_controller_test.rb
shipit-engine-0.26.0 test/controllers/commit_checks_controller_test.rb
shipit-engine-0.25.1 test/controllers/commit_checks_controller_test.rb
shipit-engine-0.25.0 test/controllers/commit_checks_controller_test.rb
shipit-engine-0.24.0 test/controllers/commit_checks_controller_test.rb
shipit-engine-0.23.1 test/controllers/commit_checks_controller_test.rb
shipit-engine-0.23.0 test/controllers/commit_checks_controller_test.rb
shipit-engine-0.22.0 test/controllers/commit_checks_controller_test.rb
shipit-engine-0.21.0 test/controllers/commit_checks_controller_test.rb
shipit-engine-0.20.1 test/controllers/commit_checks_controller_test.rb
shipit-engine-0.20.0 test/controllers/commit_checks_controller_test.rb
shipit-engine-0.19.0 test/controllers/commit_checks_controller_test.rb
shipit-engine-0.18.1 test/controllers/commit_checks_controller_test.rb
shipit-engine-0.18.0 test/controllers/commit_checks_controller_test.rb