Temporary State In Tests: Bloc(k) Party

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 #tests: https://rubyonrails.ba/single/temporary-state-in-tests-bloc-k-party

Nezir Zahirovic

Contractor Ruby On Rails (8+ years) / MCPD .Net / C# / Asp.Net / CSS / SQL / (11 years)

related articles