Developer’s update 03/10/17 – Thong

Hi everyone, I’m Thong. I’m one of the new team members with Charlie and Alex. This sprint was planned with backdrop as a focus with issue 212, 213 and 214 and writing some unit tests. The issues were dependent on the completion of the previous issue, so we could work together.

Charlie and I started with Issue 212 where the user can upload media item as a backdrop. Charlie added a fix to the create button where the backdrop is out of reach before starting on this issue. It did not take us long to implement this because we had other classes like sound and avatar to reference to. We also need to write some unit tests for it, so I wrote a few unit tests for some of the models. But later found out that we only need unit tests specific to the backdrop, those were removed. We also encountered a deprecations warning when running the test for ActiveSupport.halt_callback_chains_on_return_false, we just commented it out to get rid of the warning because we’re not too sure if we should remove it entirely. I also ran into trouble when writing the BackdropTag unit test where I need to scope the uniqueness validation to tag and backdrop. I fixed it by changing it to tag_id and backdrop_id for both model and the unit test.

We also worked on backdrop controller unit test using Rspec. We had issue with verifying the rendering template from each action, because it requires a user login and we were not sure how to simulate that in Rspec. The fix we had for that after studying the code was that we created a user and a cookie using the user authentication token. We were not able to finish it in this sprint. There were still failing tests for different valid and invalid inputs.

Next, we worked on Issue 213 where players can assign backdrops to stages. We also sort the list when added to a stage. We discovered that the remove button for each backdrop is not properly aligned when window is resized to smaller one. Initially, we used css to fix it. But later Paul pointed out that we could’ve just used the different classes for the col like xs, sm, md, lg to make it adjust to different screen sizes. We also found out that list in avatars and sounds are not sorted, hence, a separate issue was created for that.

We were not too sure of what to use for displaying the backdrops at first. Later, carousel was used. We also found out that we could use thumbnail version of the images by adding the style in the model. The implementation for 214 was completed on the last week of the sprint, but it’s still under testing. From the testing, it seems like the clicking is not always working. Backdrop images also need to maintain the aspect ratio when it’s drawn onto the stage, so a new issue was created for that. This issue is carried onto the next sprint.

We had some challenges for this sprint. Firstly, code review is something we didn’t really do previously, so we could only look for mistakes or extras in the code. But in fact, we should also look for areas to improve in the code. This is particularly difficult for us because it requires strong foundation knowledge on the code to be able to make judgement. Since we’re really new to ruby on rails, this would only get better the more we do it. Another challenge is the controller testing. Sometimes the tests had unexpected output that we were not sure why, we need to spend a bit more time investigating it.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.