Sha256: da3f89544cf9e9ed1beaa988131fb888cd816c48f15c8352e567257abf24a8ee

Contents?: true

Size: 1.01 KB

Versions: 20

Compression:

Stored size: 1.01 KB

Contents

require 'test_helper'

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

  test ":tail is success" do
    get :tail, 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, 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, stack_id: @stack.to_param, sha: @commit.sha, since: 5
    assert_response :success
    assert_json 'output', 'r'
  end
end

Version data entries

20 entries across 20 versions & 1 rubygems

Version Path
shipit-engine-0.5.2 test/controllers/commit_checks_controller_test.rb
shipit-engine-0.5.1 test/controllers/commit_checks_controller_test.rb
shipit-engine-0.5.0 test/controllers/commit_checks_controller_test.rb
shipit-engine-0.4.10 test/controllers/commit_checks_controller_test.rb
shipit-engine-0.4.9 test/controllers/commit_checks_controller_test.rb
shipit-engine-0.4.8 test/controllers/commit_checks_controller_test.rb
shipit-engine-0.4.7 test/controllers/commit_checks_controller_test.rb
shipit-engine-0.4.6 test/controllers/commit_checks_controller_test.rb
shipit-engine-0.4.5 test/controllers/commit_checks_controller_test.rb
shipit-engine-0.4.4 test/controllers/commit_checks_controller_test.rb
shipit-engine-0.4.3 test/controllers/commit_checks_controller_test.rb
shipit-engine-0.4.2 test/controllers/commit_checks_controller_test.rb
shipit-engine-0.4.1 test/controllers/commit_checks_controller_test.rb
shipit-engine-0.4.0 test/controllers/commit_checks_controller_test.rb
shipit-engine-0.3.1 test/controllers/commit_checks_controller_test.rb
shipit-engine-0.3.0 test/controllers/commit_checks_controller_test.rb
shipit-engine-0.2.3 test/controllers/commit_checks_controller_test.rb
shipit-engine-0.2.2 test/controllers/commit_checks_controller_test.rb
shipit-engine-0.2.1 test/controllers/commit_checks_controller_test.rb
shipit-engine-0.2.0 test/controllers/commit_checks_controller_test.rb