장기현장실습
PLSnote 컨트롤러 테스트 관련 학습하기
Plus-server repository에 있는 테스트 코드를 보면서 ruby 공식 문서 읽음 -> 관련 내용 정리
1. test controller 에 있는 require'test-helper' 는 테스트를 하기 위해 꼭 필요한 것 같다.
By requiring this file, test_helper.rb the default configuration to run our tests is loaded. We will include this with all the tests we write, so any methods added to this file are available to all our tests.
2. class 선언 방식
- class 클래스명 ex) classMapsControllerTestTest
- class 클래스명 < 상속하는 클래스..? ex) classMapsControllerTestTest<ActionDispatch::IntegrationTest
The MapsControllerTestTest class defines a test case because it inherits from ActionDispatch::IntegrationTest. MapsControllerTestTest thus has all the methods available from ActionDispatch::IntegrationTest. Later in this guide, we'll see some of the methods it gives us.
ActionDispatch::IntegrationTest 를 상속 받아 integration test 에서 더 다양한 helper 들을 사용할 수 있다.
3. test 선언 방식
test "the truth" do // test "테스트 이름" do
assert true // 테스트 내용
end // end
def test_the_truth // def 테스트 이름
assert true // 테스트 내용
end // end
위의 두 코드는 같은 의미로 추정: Which is approximately the same as writing this...
4. ruby에서의 null : nil
nil is a special Ruby data type that means "nothing". It's equivalent to null or None in other programming languages.
웹 구조 학습하기
모든 개발자를 위한 HTTP 웹 기본 지식 강의 (15/41)
[인프런] 모든 개발자를 위한 HTTP 웹 기본 지식 (HTTP 메세지)
HTTP 메세지에 대해 알아보자. HTTP 메세지 HTTP 메세지는 요청 메세지와 응답 메시지로 나뉜다. HTTP 메시지 구조는 다음과 같으며, 요청 메세지와 응답 메세지의 차이는 시작 라인이다. 그리고 공
dass-develop.tistory.com
'TIL' 카테고리의 다른 글
# 210915 TIL (0) | 2021.09.24 |
---|---|
# 210914 TIL (0) | 2021.09.24 |
# 210910 TIL (0) | 2021.09.23 |
# 210909 TIL (0) | 2021.09.17 |
# 210908 TIL (0) | 2021.09.17 |