<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[luvotels - Medium]]></title>
        <description><![CDATA[The first instant booking solution for love hotels - Medium]]></description>
        <link>https://medium.com/luvotels?source=rss----646cefa00486---4</link>
        <image>
            <url>https://cdn-images-1.medium.com/proxy/1*TGH72Nnw24QL3iV9IOm4VA.png</url>
            <title>luvotels - Medium</title>
            <link>https://medium.com/luvotels?source=rss----646cefa00486---4</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Mon, 16 Nov 2026 18:30:04 GMT</lastBuildDate>
        <atom:link href="https://medium.com/feed/luvotels" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Como levamos nossa startup para Portugal]]></title>
            <link>https://medium.com/luvotels/como-levamos-nossa-startup-para-portugal-b65af61113dc?source=rss----646cefa00486---4</link>
            <guid isPermaLink="false">https://medium.com/p/b65af61113dc</guid>
            <category><![CDATA[investment]]></category>
            <category><![CDATA[portugal]]></category>
            <category><![CDATA[accelerator]]></category>
            <category><![CDATA[lisboa]]></category>
            <category><![CDATA[startup]]></category>
            <dc:creator><![CDATA[Rodrigo Ruas]]></dc:creator>
            <pubDate>Mon, 13 Aug 2018 15:32:23 GMT</pubDate>
            <atom:updated>2018-08-13T15:35:18.673Z</atom:updated>
            <content:encoded><![CDATA[<p>Você já deve ter ouvido que Portugal está bombando e que Lisboa é a nova São Francisco. E é verdade.</p><p>Ano passado, a <a href="http://luvotels.com/">Luvotels</a> (startup que co-fundei em 2017) foi acelerada e investida pela <a href="http://beta-i.com/">Beta-i </a>— uma das maiores incubadoras e aceleradoras de startups da Europa. Seu principal programa de aceleração é o <a href="http://www.lisbon-challenge.com/">Lisbon Challenge</a>, que está com inscrições abertas até 9 de setembro de 2018.</p><p>A ideia deste artigo é contar como foi nossa aceleração em Portugal e te convencer a participar do processo seletivo. Além disso, vou falar um pouco sobre o ecossistema português de startups que tive a oportunidade de conhecer de perto.</p><h3>O que é Luvotels?</h3><p>Antes de tudo, vou contar um pouco da nossa startup Você provavelmente já foi a algum Motel no Brasil, certo? Todos os anos 90 milhões de suítes são utilizadas nos quase 5.000 Motéis em todo o paísO curioso é que em pleno ano de 2017, ainda não existia nenhuma plataforma de reservas online para este mercado de 1.5 bilhão de dolares.</p><p>Por isso, criamos o Luvotels — uma solução simples para buscar, escolher e reservar suítes na hora que a vontade bater. É um Uber das suítes de Motéis!</p><p>A história completa pode ser lida aqui:<a href="https://www.lewagon.com/stories/2018-07-25-from-le-wagon-to-a-1-million-euros-in-9-months"> From Le Wagon to a €1M in 9 months</a></p><h3>Como fomos parar em Portugal?</h3><p>Na verdade, foi um conjunto de coincidências. Eu estava indo cursar um mestrado em Portugal e concomitantemente, buscando algum trabalho por lá. O Luvotels já era um embrião, porém com um MVP ainda não funcional. Algumas semanas antes de viajar, descobrimos atrávés da comunidade dos alumni do LeWagon (bootcamp de programação) que o Lisbon Challenge (programa de aceleração de startups de Portugal) estava com as aplicações abertas. Mas o que era isso, afinal?</p><p><a href="http://www.lisbon-challenge.com/">O Lisbon Challenge</a>, organizado pela Beta-i, é o maior programa de aceleração de startups de Portugal e um dos melhores da Europa.</p><p>Quando descobrimos o programa, estávamos há poucos dias do encerramento do processo seletivo. Fizemos uma força tarefa e conseguimos finalizar a aplicação a tempo. Estávamos no meio de outras 258 startups aplicantes.</p><p>Algumas semanas mais tarde, depois de entrevistas e pitches pela internet, fomos convidados à participar da última semana de seleção em Lisboa junto de outras 14 startups finalistas em Lisboa. Ao final desta semana, fomos uma das 8 startups selecionadas para serem aceleradas durante as 10 semanas de Lisbon Challenge.</p><p>As outras startups selecionadas foram: <a href="https://www.parkio.eu/">Parkio</a>, <a href="http://sparkl.pt/">Sparkl</a>, <a href="https://www.tigertime.io/">TigerTime</a>,<a href="https://placeme.pl/en/"> PlaceMe</a>, <a href="http://www.citycheckapp.com/">City Check</a>, <a href="http://www.monitorfish.com/">MonitorFish</a> e <a href="https://www.winemnt.com/">WineMNT</a>.</p><h3>A Aceleração</h3><p>As startups selecionadas receberam €10.000 por 1,5% e ao final das 10 semanas, até 4 startups poderiam ser selecionadas para receberem mais €50.000 em investimento.</p><p>O dia a dia da aceleração é composto por palestras e office hours, onde estivemos em contato com inúmeros mentores de grandes startups europeias. Por meio da Beta-i, tivemos acesso à toda a rede portuguesa de startups.</p><p>O programa é dividido em 4 partes:</p><p><strong>Parte 1: Validation (3 semanas)</strong></p><p>Nesta primeira etapa, para que nosso modelo de negócios fosse validado, tivemos que conhecer a fundo a dor do nosso potencial cliente para saber se nossa solução era realmente a adequada. Estudamos profundamente o mercado paulista de Motéis, conversamos com donos, recepcionistas e clientes. O que os Motéis realmente precisam? Quais são os passos que o cliente dá antes de ir ao Motel? Qual nosso target? Essas foram algumas das perguntas que tivemos que responder durante esta etapa.</p><p><strong>Parte 2: Product (2 semanas)</strong></p><p>Após conhecer melhor nossos clientes e definir qual nosso target inicial, estava na hora de desenvolver o produto ideal para atendê-los. Nesta etapa, estudamos Product Design, UX, UI e definimos como seria nosso primeiro MVP. Tivemos mentorias de experts em experiência de usuário e produto. Vale lembrar que produtos sempre serão estudados e melhorados. O melhor produto é aquele que o cliente valida.</p><p><strong>Parte 3: Launch (3 semanas)</strong></p><p>Agora estava na hora de colocar o MVP para funcionar, de ganhar as ruas e de mostrar o valor da solução. Nesta fase, tivemos palestras e mentorias sobre vendas, estratégias de marketing e sobre como lançar o produto. Tivemos também o prazer de receber mentores do Google, que compartilharam conhecimentos sobre SEO, AdWords e diversas possíveis estratégias. Colocamos o MVP online e conseguimos nossos primeiros motéis e nossas primeiras reservas!</p><p><strong>Parte 4: Investment (2 semanas)</strong></p><p>O programa é finalizado com um evento chamado Investors Day, onde vários investidores são convidados para assistir piches das startups aceleradas e escolherem quais receberiam investimento. Deixa assim: Nesta fase final, o foco estava totalmente voltado para nos preparar para esse contato com os investidores, ou seja, o preparo estava em como nos apresentar para os investidores, como abordá-los e como criar um deck de investimento.</p><p>O programa foi encerrado no dia 6 de dezembro com o Investors Day e o Luvotels foi uma das 3 startups vencedoras! <a href="https://www.dinheirovivo.pt/fazedores/lisbon-challenge-procura-startups-para-nova-edicao-apos-investir-175-mil-euros/">Leia mais aqui</a>:</p><h3>Faça as malas</h3><p>Sem o Lisbon Challenge, provavelmente demoraríamos demoraríamos um tempo consideravelmente maior, provavelmente anos, para conseguir atingir um patamar próximo ao que conseguimos no final da aceleração.</p><p>Na minha opinião, além das excelentes palestras, mentorias e workshops, um fator importantíssimo de todo o Lisbon Challenge é a rede de contatos. A Beta-i te coloca frente a frente com os maiores empreendedores do país. Alguns deles tornaram-se nossos amigos e mentores e nos ajudam até hoje. Isso não tem preço.</p><p>O que está esperando? Inscreva sua startup no Lisbon Challenge e vá para Lisboa!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/900/1*_hZ9WkHKJUKNaY7JaYAvBg.jpeg" /><figcaption>Google Campus — Abril 2018</figcaption></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b65af61113dc" width="1" height="1" alt=""><hr><p><a href="https://medium.com/luvotels/como-levamos-nossa-startup-para-portugal-b65af61113dc">Como levamos nossa startup para Portugal</a> was originally published in <a href="https://medium.com/luvotels">luvotels</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How did I end up in Portugal?]]></title>
            <link>https://medium.com/luvotels/how-did-i-end-up-in-portugal-51d92067e9c2?source=rss----646cefa00486---4</link>
            <guid isPermaLink="false">https://medium.com/p/51d92067e9c2</guid>
            <category><![CDATA[travel]]></category>
            <category><![CDATA[lisboa]]></category>
            <category><![CDATA[startup]]></category>
            <dc:creator><![CDATA[Giovanna Girnos]]></dc:creator>
            <pubDate>Mon, 30 Apr 2018 10:36:58 GMT</pubDate>
            <atom:updated>2018-04-30T14:55:40.030Z</atom:updated>
            <content:encoded><![CDATA[<p>A quick summary of a Brazilian in Lisbon</p><p><strong>Well, that’s a good question!</strong></p><p>Everything began when I started to consider studying abroad while I was doing my Public Relations BA at UNESP in São Paulo. I’m not sure if every Brazilian person is aware of that, but at that time (2013) a governamental programme that used to take students to study abroad, didn’t offer that many scholarships for communication students.</p><p>However, at that time, I came across some other options of scholarships that were being offered by other companies and institutions. For this reason, in 2014 I ended up applying to one of these opportunities that would take place in Portugal. For my surprise — or not — I wasn’t among the chosen ones to live such experience at that moment. The good thing of this story is that my opportunity to live in Portugal wasn’t over, actually, it was just the beginning!</p><p>After this episode some years passed and throughout this time I ended up choosing to focus all my energy on finishing my studies, doing my best in my internship and saving as much money as possible so I could — in a not far future — spend all my savings in my dream of having an experience abroad.</p><p>When I realized that all these goals were slowly being accomplished I restarted my researches on courses abroad that would interest me and, to make matters better, I came across a really cool one: a Post-grad in Branding and Content Marketing. This course was the perfect package. It would not only focus on the things that I like but it would also have the perfect length: one year! Also, I was bringing my dream of living in Portugal back cause this experience would take place in Lisbon! How cool is that?</p><p><strong>Well, but why Portugal</strong>?</p><p>I have to be honest: for me it was the least complicated option! The language is the same (although it doesn’t sound similar AT ALL), which means a proficiency test wouldn’t be necessary and it would also mean to save time and money, right?</p><p>In addition to all this pros, I thought that studying in Europe would be an amazing idea cause, as everyone knows, almost every single city in this continent is super well-connected with one another and that would enable me to visit as many different places as I could!</p><p>Since my course was already chosen and every other aspect of this experience was combining with my needs, I applied for this Post-grad studies in April 2017 and waited for the result that would be available at the end of July. Throughout this waiting time I came back home to spend some time with my family and also to find a job that could provide me some extra cash to this possible adventure.</p><p>It was on the 24th of July when I got to know the result of my application: yes, I passed! My dream was about to begin!</p><p>At that moment it was the time to put together all the boring stuff: every single document to legalize my situation in Portugal, of course. I had to ask for a <em>temporary student visa</em> which means I’d have to have applied for a course with a one year length max.</p><p>Like most of the consulates, the Portuguese one was full of visa requests at the time I asked for mine. That meant I had to wait longer than the expected date to receive my documents.That’s when the stress came over me. Since I had already bought my flight tickets and my classes were about to begin I had to send them an email asking them to rush with my visa otherwise all my plans could be messed up.</p><p>If you are an organized person like me, you can imagine that such episode was quite of a nightmare right? I had everything planned but I was depending on the consulate’s efficiency.</p><p>However, even with all this extra stress, the luck was by my side. Thanks to the empathy of some consulate’s employees every document was ready before my journey… one day before, I may add. And then my adventure begins. On September 23rd I was heading to Portugal with my luggages and an wide open heart!</p><p>Once I arrived in Lisbon soil I automatically started to solve some bureaucracies such as: legal documents, to provide my public transport card and, of course, to find a cozy place where I could live! In a week I had almost everything solved. I found a place to stay, I had the opportunity to meet some people and also to stroll around the city! That was the proof that my international experience had finally begun!</p><p>The first cultural clash that I noticed was certainly the language barrier. Oh yeah, we speak the same language but it’s kind of completely different. As Portuguese people say… we speak “Brazilian”. I may confess that even being in the first row in my first weeks of classes, I wasn’t able to understand loads of things that were being said by my classmates and teachers. Some months after that I can say I’m a Portuguese pro! Now I can understand everything!</p><p>Even though I started my studies, I was also looking for a job so I could save some more money and, at this time, my savings would be in Euro (yay)! Moreover, this money would be really helpful to pay my expenses in Lisbon that- although is not that expensive compared to other places in Europe- it is still not cheap. The good thing is that finding a job was already in my plans so everything was flowing as expected. For this reason, I had to provide a license that would enable me to work legally and also not to pay taxes throughout this time.</p><p>I can say that such thing was the beginning of my professional journey in Lisbon. For two months I experienced working in a bar, after that, during Christmas time, I was working in a store as a “gift wrapper”. Even though I had already found some sources of money, I was still looking for a job. That’s when I found a quite uncommon job offer online…</p><p>It was a Brazilian StartUp, based in Lisbon, that was looking for content producers who could speak Brazilian Portuguese. Their business was focused on <em>Love Hotels</em> Market (Motel in Portuguese).</p><p>After my interview for this StartUp I was admitted and I automatically started to officially work for Luvotels (<a href="http://www.luvotels.com/">www.luvotels.com</a>)! It is basically an online booking platform only focused on Love Hotels in São Paulo. My first role was to produce content related to this topic but, as the business started to grow, I quickly became a sales and customer services manager.</p><p>When it comes to my leisure time, I was able to visit 3 different countries in a short period of 7 months: Ireland, Spain and Germany! Apart from that, I could get to know quite a few lovely places inside Portugal. Since my time in Europe is not over yet, I am planning a super cool trip around France, Italy and Greece before my way back to Brazil.</p><p><strong>What about my situation right now?</strong></p><p>Although I still have some months to enjoy this European life, I can say that what I got until now from all this experience is amazing. From my personal growth to meeting new people, new places and cultures…</p><p>Another cool fact is that I’m looking to my country in a different way since I moved to another continent. In addition to that, I had the opportunity to meet some crazy and amazing people that I have the pleasure to work with. To make matters better I will continue this experience working for Luvotels even though I will be heading back home because they want me with them in São Paulo. Amazing right?</p><p>That’s a summary of my story away from home….</p><p>If you are in doubt of living an adventure in Portugal, what I tell you is the following: JUST LIVE IT! Go for it! You’ll have an amazing experience!</p><p><strong>For now, I thank you Lisbon!</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*p9yVGTJAZhT1CuqA_oV_gA.jpeg" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=51d92067e9c2" width="1" height="1" alt=""><hr><p><a href="https://medium.com/luvotels/how-did-i-end-up-in-portugal-51d92067e9c2">How did I end up in Portugal?</a> was originally published in <a href="https://medium.com/luvotels">luvotels</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The unfair advantages of being a Le Wagon teacher: Part 1 Motivation]]></title>
            <link>https://medium.com/luvotels/the-unfair-advantages-of-being-a-le-wagon-teacher-part-1-motivation-5fca84cdd21f?source=rss----646cefa00486---4</link>
            <guid isPermaLink="false">https://medium.com/p/5fca84cdd21f</guid>
            <category><![CDATA[startup]]></category>
            <category><![CDATA[cto]]></category>
            <category><![CDATA[coding]]></category>
            <category><![CDATA[ruby]]></category>
            <category><![CDATA[startup-lessons]]></category>
            <dc:creator><![CDATA[Jean-Baptiste Feldis]]></dc:creator>
            <pubDate>Thu, 12 Apr 2018 09:58:36 GMT</pubDate>
            <atom:updated>2018-04-12T09:58:35.964Z</atom:updated>
            <content:encoded><![CDATA[<p>Hi there! I’m JB, I’m currently the happy CTO and a co-founder of <a href="https://www.luvotels.com/suites/search_results?utf8=%E2%9C%93&amp;address=S%C3%A3o+Paulo%2C+%C3%89tat+de+S%C3%A3o+Paulo%2C+Br%C3%A9sil&amp;button=&amp;latitude=-23.5505199&amp;longitude=-46.63330940000003&amp;search%5Bradius%5D=&amp;search%5Bradius%5D=10&amp;search%5Bavailable_only%5D=0&amp;search%5Bmin_price%5D=&amp;search%5Bmax_price%5D=&amp;search%5Bmin_hours%5D=&amp;search%5Bmax_hours%5D=&amp;search%5Bpartner_only%5D=0&amp;search%5Bamenities%5D%5B%5D=">Luvotels.com</a> (we do instant booking for Brazilian motels!) and I have been coding in Ruby and Rails since 2007.<br>As much as I’d like that to be 2 to 3 years ago it’s actually 11 crazy and amazing years. During that period I have worked for amazing startups at all stages and for a couple enterprises too. We launched many projects with <a href="https://medium.com/u/2ae857ee9883">Romain Durritcague</a> and failed many times and yet, we are still here playing.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/941/1*RiEiQRm9X3QnQVqCEU7kzg.png" /><figcaption>Explaining “cosas” to young <a href="https://medium.com/u/ac70d71eea29">Diego Van Dyk</a> next to super “blasée” <a href="https://medium.com/u/afb67512fe97">Carolina Karklis</a> ❤️</figcaption></figure><h4>The problem: my brain had isolated my motivation</h4><p>In 2016 I was living in São Paulo, working on various projects and looking for a way to improve my Portuguese. I was really happy working on those projects though I did not realize I was carrying them out of habits and willingness. And that ended up draining way too much of my already low energy.</p><p>To me, startups need a lot of candidness. You need to free your brain from the notion of impossibility so motivation can flow freely. After 11 years of coding for a lot of amazing clients and startups, impossibility was mainly driving my day to day.</p><p>And I believe it’s totally natural, after that time you have the experience to know what <strong>not</strong> to do, what will take <strong>too much time</strong>, which trick will make you get 80% out of a feature for 20% of the effort. <br>It is an amazing skill because you can do a lot of things well and quickly. So… why not let your brain in control?</p><p><strong>The thing is: </strong>our brains are designed for habits, that’s what’s making us comfy. To carry a startup you need to keep getting out of your comfort zone, I needed my motivation and my candidness back so I could mix it up with my experience and erase the word impossibility from my vocabulary.</p><h4>The solution: recharge!</h4><p>So I was in São Paulo looking for ways to improve my PT and… I just basically bumped into <a href="https://medium.com/u/b4bfb25c82ea">Mathieu Le Roux</a> who was looking for teachers to start Le Wagon there. I need to comment that during those 11 years I have had a lot of offers to train people and I always turned them down: training corporates that are there because HR made them be, not for me.</p><p>But Le Wagon is different, it’s a 9-week bootcamp (and, simply put, <a href="https://www.switchup.org/research/best-coding-bootcamps">the best in the world</a>): based on Ruby, focused on getting your hands dirty and it’s as practical as possible. The students learn basic programming, then OOP, then database, then front and then… Rails. They learn by doing, in a project-oriented mindset.<br>It’s a real life experience for the students. And it reaches its climax in the last 2 weeks of the program when they build their own project, previously pitched and student selected, with their own teams. That’s when the magic happens.</p><p>To do that you need extreme dedication and a lot of motivation. When you add to that equation the fact that they have no notion of impossibility: <strong>BINGO</strong>!</p><p>Let’s steal that energy to recharge!</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fgiphy.com%2Fembed%2Ft5wDMqMYp5NXa%2Ftwitter%2Fiframe&amp;url=https%3A%2F%2Fgiphy.com%2Fgifs%2Fdisney-evil-t5wDMqMYp5NXa&amp;image=https%3A%2F%2Fmedia.giphy.com%2Fmedia%2Ft5wDMqMYp5NXa%2Fgiphy.gif&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=giphy" width="435" height="238" frameborder="0" scrolling="no"><a href="https://medium.com/media/718d48c2d91d21006f5abc308681def4/href">https://medium.com/media/718d48c2d91d21006f5abc308681def4/href</a></iframe><p>Well… that’s not exactly stealing as teaching means gathering some energy to pass to your students <em>‒ and a great deal of it!‒<br></em> But when the students are open-minded and motivated to learn you get way more than you actually give. It’s a pretty good deal!</p><h4>The conclusion: nothing is impossible (but let’s be efficient)!</h4><p>Out of the 7 batches I taught ‒ <em>it’s something! </em>‒ I always got taken back to that great feeling I had myself when starting UpShot in 2007. You can find a lot of articles about the student side of it because it is really a life changing experience but I would love to hear more about how the teachers live it.</p><p>Those 2 last weeks have been my energy refill. To see those “young” (not always in age) developers doing crazy things, writing code that would not pass a proper code review and just asking for more until the final demo day, is always a big breath of fresh air.</p><p>I feel I’m back working on ideas first and then letting my developer-brain organize/criticize/prepare. I’m back to believing that nothing is impossible and <strong>it feels good</strong>!</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fgiphy.com%2Fembed%2F3o85xtLX7zCyeeWGLC%2Ftwitter%2Fiframe&amp;display_name=Giphy&amp;url=https%3A%2F%2Fgiphy.com%2Fgifs%2Fgq-inspiration-shia-labeouf-do-it-3o85xtLX7zCyeeWGLC&amp;image=https%3A%2F%2Fmedia3.giphy.com%2Fmedia%2F3o85xtLX7zCyeeWGLC%2Fgiphy.gif&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=giphy" width="435" height="243" frameborder="0" scrolling="no"><a href="https://medium.com/media/27afda174cb00b14cde7888ff50879f2/href">https://medium.com/media/27afda174cb00b14cde7888ff50879f2/href</a></iframe><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5fca84cdd21f" width="1" height="1" alt=""><hr><p><a href="https://medium.com/luvotels/the-unfair-advantages-of-being-a-le-wagon-teacher-part-1-motivation-5fca84cdd21f">The unfair advantages of being a Le Wagon teacher: Part 1 Motivation</a> was originally published in <a href="https://medium.com/luvotels">luvotels</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Writing automated tests is THE thing to learn as a Developer Newbie]]></title>
            <link>https://medium.com/luvotels/writing-automated-tests-is-the-thing-to-learn-as-a-developer-newbie-6eb1667d2437?source=rss----646cefa00486---4</link>
            <guid isPermaLink="false">https://medium.com/p/6eb1667d2437</guid>
            <category><![CDATA[rspec]]></category>
            <category><![CDATA[rails]]></category>
            <category><![CDATA[junior-developer]]></category>
            <category><![CDATA[testing]]></category>
            <category><![CDATA[ruby]]></category>
            <dc:creator><![CDATA[Tamara Jost]]></dc:creator>
            <pubDate>Wed, 14 Mar 2018 16:52:51 GMT</pubDate>
            <atom:updated>2018-04-15T19:22:59.587Z</atom:updated>
            <content:encoded><![CDATA[<h4>Learn rspec for Ruby on Rails</h4><p>So, you’ve just caught the basics of coding. Maybe, like me, you have finished the coding bootcamp of Le Wagon or had another amazing experience making your first steps as a developer. After learning the basics, there is a question that might arise: What shall I learn next? The answer is crystal clear: <strong>Learn to write tests!</strong></p><h3><strong>Why automated testing?</strong></h3><p>Why is that so clear? I am 100% sure that during your first coding experience, you ran into your first bugs. I am also sure that at least once it happened to you that you created a new feature, forgot to check its impact on your existing code, and — oops! — ran into bugs again. Or you implemented changes, opened localhost, and checked your application over and over….losing loads of time testing MANUALLY.</p><p>Now scale this up to a real running application where you implement a new feature and are about to release it. What happens without automated tests?</p><blockquote><strong>Best case:</strong> You test manually hour after hour, find and fix your bugs before you go into production.</blockquote><blockquote><strong>Bad case:</strong> You go to production, find a bug right away, and spend the night fixing it.</blockquote><blockquote><strong>WORST case:</strong> You go to production and next morning you get alerted by your customers that they are not able to buy your product due to a critical bug.</blockquote><p>Even the best case doesn’t sound very appealing, right? This is why I strongly recommend you to learn how to write automated tests.</p><h3><strong>RSpec to test your Rails App</strong></h3><p>Rails comes with Minitests which is a nice tool. However, I would like to give you some insights into Rspec. In my opinion it has the advantage of writing code with a natural English language syntax. Moreover, RSpec is widely used in Rails projects and it’s easy to find answers on Stack Overflow.</p><p>But obviously, <a href="https://www.reddit.com/r/rails/comments/5v5tuy/what_do_you_use_and_why_rspec_vs_minitest/">opinions differ</a>.</p><h3><strong>RSpec Set up and usage</strong></h3><p>To set Rspec up, just follow their github <a href="https://github.com/rspec/rspec-rails#installation">installation guide</a> . In addition to Rspec, I also recommend you to install the gem “<a href="https://github.com/thoughtbot/shoulda-matchers">shoulda-matchers</a>” which supplies simple one-line-codes to test the most common test cases.</p><p>Ideally, you write your tests first and then implement your features to then keep testing it. That’s the typical Test Driven Development (TDD) approach. Here, I will explain it the other way around as it is easier for a reader to follow the logic. And also, in practice, it is common that tests are written after the main code is implemented. Often, when you start as a junior, you are asked to write tests of an existing code. It helps you to get an understanding of the application.</p><h3><strong>RSpec: Test the basics of your models</strong></h3><p>Suppose that you are building an application for booking hotel rooms. You have a Model with Hotels that have many Rooms and Rooms have many Bookings. Within those models you also have some validations. The models could look like that:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/c71db2ebbb0911d2069c28924f9d96c9/href">https://medium.com/media/c71db2ebbb0911d2069c28924f9d96c9/href</a></iframe><p>Now let’s write the basics specs (tests) of the Hotel model:</p><ol><li>Create a hotel_spec.rb file in your spec/models folder</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/370/0*KMlc9Rpzv-MMSEMr." /><figcaption>Folder and file structure</figcaption></figure><p>There is also a generator that creates rspec files automatically:</p><pre>rails generate rspec:model hotel</pre><p>2. Write your basic tests using the shoulda matchers</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/dbf482ce683a8b3b3571090735f25a2d/href">https://medium.com/media/dbf482ce683a8b3b3571090735f25a2d/href</a></iframe><p>Looks nice but what’s up with that syntax? Let’s walk through it step by step:</p><p><em>Line 1:</em> Make sure you require the rails_helper where spec_helper is required. spec_helper is automatically generated when you install the rspec gem</p><p><em>Line 3: </em>Indicates what you are testing: Here we are focusing on the Model Hotel</p><p><em>Line 4–9:</em></p><ul><li><strong>it {}:</strong> is a RSpec method which describes the specifications of what you want to test. Within the it you find your test case. It reads almost like plain english, don’t you think?</li><li><strong>is_expected.to:</strong> another RSpec method that tells us what we expect the code to do. Pretty much plain english again.</li><li><strong>‘have_many’</strong>, <strong>‘validate_presence_of’</strong>, ‘<strong>validate_length_of’</strong> are active model matchers that indicate with what your data has to match. These are simple one_line statements that we can use thanks to Shoulda Matchers. Also the following methods such as <strong>‘dependent’, ‘through’, ‘is_at_most’</strong> are provided to us by Should Matchers. For all options check their <a href="https://github.com/thoughtbot/shoulda-matchers)">documentation</a>.</li></ul><p>Now, you just have to go to your console and run ‘<strong>rspec</strong>’. You will get the results of your tests.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/736/1*fo7m0qNNljpk8khHAsRZ_w.png" /><figcaption>Rspec output in the terminal</figcaption></figure><h3><strong>Rspec: Test the methods of your models</strong></h3><p>Imagine your Room Model has a price. And there is a method “expensive?” which defines if a room is expensive with true or false:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/0c54296236199363dbfbb925b0374554/href">https://medium.com/media/0c54296236199363dbfbb925b0374554/href</a></iframe><p>First you need to create the room_spec.rb file, as shown before. Then, you can test the method:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/43a6085ae8c8a310013dbab259434995/href">https://medium.com/media/43a6085ae8c8a310013dbab259434995/href</a></iframe><p>Let’s go through it again step by step. In general, you can see that 3 different scenarios are being checked. One with where the price is higher than 50, exactly 50 and lower than 50:</p><ul><li>Line 4: <strong>before</strong>: describes activities that are being executed before each of the tests. In this case, that is the assignment of the price to a room. The room is being represented by the <strong>subject</strong>. It<strong> </strong>refers to the variable of the tested Model, which is in this scenario a room. The subject could be understood as if we had written <em>something like</em> the code below (please note: it is not exactly what happens, but you get the idea). For the rest of the tests room_one is now the subject on which we assign a different price.</li></ul><pre>hotel_one = Hotel.create(name: &#39;name&#39;)<br>room_one = Room.create(hotel: hotel_one, name:&#39;name&#39;, max_hosts: 3)</pre><ul><li>Line 6: <strong>describe()</strong>: Again — as almost in plain english — it describes the method to be tested. In this case, a # is used because it is referring to an instance method. If it was a class method, you would use a dot (.) instead of the #</li><li>Line 7/12/17: <strong>context()</strong>: is describing the scenarios that will be tested</li><li>Line 6/11/17: <strong>let()</strong>: is a idiomatic way to define variables in rspecs. In order to test these scenarios, the price needs to be adapted to the described scenario in the context. Thus, the test values for the price are being set thanks to the ‘let’. → <em>:price</em> is now representing the price we set in line 4 within the ‘before’. It is as we would have written <em>something like</em> this:</li></ul><pre>room_one.price = 56</pre><ul><li>Line 8/13/18: <strong>Not_to be_expensive</strong>: Built in Rspec Matchers to test the expectation of the scenario. In this case, since we are testing for booleans, the not_to be_expensive can be directly used. For all built in matcher see the <a href="https://relishapp.com/rspec/rspec-expectations/docs/built-in-matchers">documentation</a>.</li></ul><p>Now again, run ‘rspec’ in your terminal and check whether your tests are passing. You will see how does little green lines will enlighten your day!</p><h3>Further Resources</h3><p>Of course, there are tons of other things that you can test with Rspec. I recommend you to have a look at some of these resources:</p><ul><li>Full <a href="http://rspec.info/">documentation</a> and good video tutorials on rspec</li><li><a href="http://www.betterspecs.org/">Better specs</a> for tips and best practice for rspec</li><li><a href="https://github.com/dscape/factory_girl_rails">Factory Girl</a> to create test data</li></ul><p>❤ Stay tuned for more articles by the amazing dev-team of <a href="http://luvotels.com/">luvotels</a> ❤</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6eb1667d2437" width="1" height="1" alt=""><hr><p><a href="https://medium.com/luvotels/writing-automated-tests-is-the-thing-to-learn-as-a-developer-newbie-6eb1667d2437">Writing automated tests is THE thing to learn as a Developer Newbie</a> was originally published in <a href="https://medium.com/luvotels">luvotels</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>