Sha256: 3e1d327c3db5774a645d35be91b4b8f1a6f9f75d08280c15ce25a8e570dda334

Contents?: true

Size: 1.43 KB

Versions: 18

Compression:

Stored size: 1.43 KB

Contents

require 'test_helper'

class CheckResultTest < ChilloutTestCase
  def test_successful_for_response_with_200_code
    response = stub(:code => "200")
    check_result = CheckResult.new(response)
    assert check_result.successful?
  end

  def test_not_successful_for_response_with_other_code
    response = stub(:code => "304")
    check_result = CheckResult.new(response)
    refute check_result.successful?
  end

  def test_not_successful_for_response_that_dont_respond_to_code
    response = stub
    check_result = CheckResult.new(response)
    refute check_result.successful?
  end

  def test_dont_have_problem_with_authorization_for_response_with_200_code
    response = stub(:code => "200")
    check_result = CheckResult.new(response)
    refute check_result.has_problem_with_authorization?
  end

  def test_have_problem_with_authorization_for_response_with_401_code
    response = stub(:code => "401")
    check_result = CheckResult.new(response)
    assert check_result.has_problem_with_authorization?
  end

  def test_dont_have_problem_with_authorization_for_response_with_other_code
    response = stub(:code => "501")
    check_result = CheckResult.new(response)
    refute check_result.has_problem_with_authorization?
  end

  def test_dont_have_problem_with_authorization_for_response_that_dont_respond_to_code
    response = stub
    check_result = CheckResult.new(response)
    refute check_result.has_problem_with_authorization?
  end
end

Version data entries

18 entries across 18 versions & 1 rubygems

Version Path
chillout-0.8.9 test/check_result_test.rb
chillout-0.8.5.1 test/check_result_test.rb
chillout-0.8.8 test/check_result_test.rb
chillout-0.8.7 test/check_result_test.rb
chillout-0.8.6 test/check_result_test.rb
chillout-0.8.5 test/check_result_test.rb
chillout-0.8.4 test/check_result_test.rb
chillout-0.8.3 test/check_result_test.rb
chillout-0.8.2 test/check_result_test.rb
chillout-0.8.1 test/check_result_test.rb
chillout-0.8.0 test/check_result_test.rb
chillout-0.6.0 test/check_result_test.rb
chillout-0.5.4 test/check_result_test.rb
chillout-0.5.3 test/check_result_test.rb
chillout-0.5.2 test/check_result_test.rb
chillout-0.5.1 test/check_result_test.rb
chillout-0.5.0 test/check_result_test.rb
chillout-0.4.1 test/check_result_test.rb