Temporary State In Tests: Bloc(k) Party
02-Sep-2021 1989
Tests will sometimes require us to bend the truth and modify the state of the world in order to have repeatable, consistent results and feedback.We're building an application that sends a notification on Sunday. In order to test it sending a notification, we need it to be Sunday. The problem with that is I don't really like working on Sundays.If I'm writing code on Wednesday, I want to make sure I don't break notifications. Rather than waiting until Sunday to run my tests, I can trick my test into thinking it's Sunday. Rails has built-in helpers we can use to simulate that.
Temporary State In Tests: Bloc(k) Party #ruby #rubydeveloper #rubyonrails #Temporary #State #Tests: #Bloc(k) #Party #tests: https://rubyonrails.ba/link/temporary-state-in-tests-bloc-k-party