domingo, 29 de mayo de 2016

When the system fails...

For these 2 weeks I was not available by many time also I do not feel really well on this moment . Then this blog maybe gonna be some short, my apologies about that. On the first day I completed the feature about email, but I needed the password to do it (When I tried without password the program ran but the email never sent). I was investigate for severals minutes other way, but I discovered that needed an password for gmail. I was investigating with diferent way, but I did not had success. To the Monday I preferred take free morning because the last night I could not sleep working into a university course. If my performance gonna fail during the tracking time I prefer no work. When I arrived to Pernix Cardoce and me had a meeting. In this meeting we talk about how important it is inform toTristan when I went to absent.
When I finish the meeting I went to inspect the clean code and fix the conflicts, to make a pull request that day.
On the same day at the night, Tristan sent a email with an error. The error was about the path. Inmediately I went to check my code on my PC, but the code worked. On this moment I was really nervous because I do not had idea how fix it. The Thuesday I asked for help to Cardoce and Jesus. Jesus during the day suggestme that I needed create a stating to the project. In the night I was investigate What was this?. The next day I began to investigate about the heroku, a new tool for me. When i tried to set up, I could not do it. Then, I find a diferent way to use the path, which I has successful.
To this time I complete the feature but i did not want to make pull request because I did not had the email, and without the email the program did not worked.
To the friday as Tristan did not answered I decided make the PR. But the next day Sirias a tell me that I was out of the project...

sábado, 14 de mayo de 2016

How i got my first merge to master

To this two week I was very busy, I began the week making the testing from all the classes. And again the project of ICS was really helpful to do that. I try to made all the cases that i could think. The some test was easy to do, but other not that much. A difficult test was of the controller, in the past i was make the test from the controller with the view but this time I needed test if i was creating the instance of the importation. Also I needed test if the file had the correct parameter. At the beginning I just need help, then I asked for help to Cardoce and Jesus, but they were too busy. To don't delay them I searched help in slack. Almost immediately Macho and Arnoldo bring me your help. Thanks to this help I saw my error and could make the test from the controller.
This is code to do the instance of the controller and check the file:

   let(:catalog_path) do
      Rails.root.join('spec/fixtures/transaction_catalog.csv')
    end
    let(:file) { Rack::Test::UploadedFile.new(catalog_path, 'csv') }

    it 'calls Import::Catalog with correct params' do
      sign_in
      expect(Import::Transactions).to receive(:new).with(file).and_call_original

      post :import, file: file
    end

    it ' imports the uploaded catalog' do
      sign_in
      expect_any_instance_of(Import::Transactions).to receive(:import!)

      post :import, file: file
    end
First declare a file to be loaded and in the test I load the file and compared with the the same but without the original, the other test i only check if some instance was created in the function