Weekly Report #12 — Unit Test— Firza
- learning how to do testing in Ruby on Rails from http://guides.rubyonrails.org/testing.html , http://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html
- Database: happystock_db. To connect to database, enter `psql -d happystock_db` in terminal. Table: `\dt`to view all database lists
- code Threshold.yml to test Threshold model
- add bug backlog in Pivotal
- deployment using Capistrano
Last week I asked by Bu Maya where and what is our database. She asked this question because I want to claim some points, those are: DBMS, refactoring, Framework. Unfortunately, I cant answer her question. But after I find out our database which use PSQL. Our database is ‘happystock_db’ and table Thresholds.
Bug / Ticket Tracking
Also, few weeks ago I solved some bugs related to query trend which most of them are already solved and already merged. Bug that hasnt solved yet is the graph is not shown. So I report this bug at Pivotal.
Last week, I started to learn how to test in Ruby on Rails. I refer to http://guides.rubyonrails.org/testing.html and http://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html. What I learned is that there is a folder called ‘test’ where the developer create testing for controllers, models, etc. Because last 2 weeks I worked on query trend which involve Threshold model, I started to code on threshold.yml (which I already pushed to Master). But, I just get suggestion from @irfan3 that it’s better to refer to this https://www.relishapp.com/rspec/rspec-rails/docs/gettingstarted
Applying Algorithm and Data Structure
Data structure which I usually used is Active record, a data structur that represent relational database in rails. I use it since the first time I code Trend. The Active Record has class/model and object. Class that I used is Treshold and other used SpreeInventoryUnit, SpreeStockItem, etc. And the example of object is a tuple in table database represent one object. Some method that I usually used are .all, .find(:id), where(condition), .last. Also I add applied simple algorithm to query and show the Threshold data in Trend.
I did deployment by enter command ‘cap production deploy’ in terminal. I refer to this link about Capistrano https://github.com/capistrano/capistrano/blob/master/README.md