In the last post, I talked about how RSpec is insufficient in testing codes that run in thread different than the one RSpec runs in. So I decided to try using MiniTest, and it kind of works. Yay!
Continue reading “Roses are Red, I Catch Flu; How I Succeed on Testing My Own Code (Part Two)”
Welcome back readers! Well, after creating 2 posts explaining about testing on frontend in a row, on this time I’ll also talk about testing! Lol. Actually this time will be more general. However, I applied this knowledge most of cases on frontend so I’ll give an example on frontend side too haha, forgive me plz. Yep, on this time I will talk about testing techniques which are spy, stub, and mock. I was really really starved to know what actually they are and now I want to end my curiosity. I’ll explain to you what actually they are! 😀
Continue reading “Understanding Spy, Stub, and Mock”
When developing an applications, developers need a way to save modify and query the data. The application may use the a database management system (DBMS) to store the data but how to modify and retrieve data in the DBMS? DBMS has a set of raw commands to run operations on the system, for example SQL commands. We could use it in raw but it will make the codes look dirty.
Continue reading “Connect to the Data”
In this post, I will guide you how to create a React Component step-by-step
Step 1: Create the Component
In rails, there are basically three ways to store server-side information in the client’s browser:
spoiler alert: they’re all actually just cookies
Continue reading “Rails: Behind the Sessions”
On my last post, I’ve talked about shallow rendering to test React components. This post is the sequel of that post since I’ll also talk about testing React components. The shallow rendering that I’ve done on the last post is using the help from
createRenderer function from React Addons Test Utils. Unfortunately, (until now) there are no function for traversing React element trees neatly just by using the help from React Addons Test Utils. If you want to check an element somewhere deep in the component tree, you will end up in a long chaining of
props.children.props.children… which it also happened to me and I think it’s not elegant.
Continue reading “Golden Way to Traverse React Components on Shallow Rendering Approach”