Methods
T
Included Modules
Constants
FakeResponse = Struct.new(:response_code) do [:success, :missing, :redirect, :error].each do |sym| define_method("#{sym}?") do sym == response_code end end end
 
Instance Public methods
test_assert_response_fixnum()
# File actionpack/test/assertions/response_assertions_test.rb, line 28
def test_assert_response_fixnum
  @response = FakeResponse.new 400
  assert_response 400

  assert_raises(Minitest::Assertion) {
    assert_response :unauthorized
  }

  assert_raises(Minitest::Assertion) {
    assert_response 500
  }
end
test_assert_response_predicate_methods()
# File actionpack/test/assertions/response_assertions_test.rb, line 17
def test_assert_response_predicate_methods
  [:success, :missing, :redirect, :error].each do |sym|
    @response = FakeResponse.new sym
    assert_response sym

    assert_raises(Minitest::Assertion) {
      assert_response :unauthorized
    }
  end
end
test_assert_response_sym_status()
# File actionpack/test/assertions/response_assertions_test.rb, line 41
def test_assert_response_sym_status
  @response = FakeResponse.new 401
  assert_response :unauthorized

  assert_raises(Minitest::Assertion) {
    assert_response :ok
  }

  assert_raises(Minitest::Assertion) {
    assert_response :success
  }
end
test_assert_response_sym_typo()
# File actionpack/test/assertions/response_assertions_test.rb, line 54
def test_assert_response_sym_typo
  @response = FakeResponse.new 200

  assert_raises(ArgumentError) {
    assert_response :succezz
  }
end