Giter VIP home page Giter VIP logo

testblog's Introduction

netguru RoR workshop - test blog

Hello stranger! You have just taken your first step on your adventure with programming in RoR. We are proud of you! Now, we challenge you to complete the following task. Ready, steady...

Follow the instructions:

  1. Clone the repository: git clone [email protected]:netguru/testblog.git
  2. Install an appropriate Ruby (2.1) - we recommend using RVM - and run the command bundle
  3. Launch the app and take a look around (bundle exec rails s)
  4. Your job is to:
    • add a simple comment system
    • add a simple voting system (vote_up / vote_down is enough)
    • in the post view the date should be formatted like so โ€“ 21/07/2013 : 14:10
    • after receiving three negative votes the comemnt should be marked as abusive and hidden from the user
    • that comment should still be visible to the author of the post on the comments list, the author should be able to cancel the 'abusive' state
    • user can't vote twice for the same comment
    • all those actions should be accessible through the app interface (you need to add/modify views - fixing the unit tests is not enough)
    • โ— all specs should be green ๐Ÿ’š
  5. General rules:
    • don't fork the repository. Clone it and make a new one โ€“ we want all of you to have equal chances
    • try writing small, self-containing commits
    • do not modify the specs, only the application code
  6. If you run into any difficulties you can always talk about them with other participants or one of the coaches on our open channel
  7. I see that you're doing great! When all tasks are done and the specs are green:
  8. Splendid! You've finished the task. We will soon let you know about the result.

Remember โ€“ there is a lmited number of attendees, so the sooner you complete the task the better your chances are.

Here are some great resources to help you with kicking off your adventure with Rails:

Improve your workflow with automated rspec running

Technically, they way how you will be completing this task is called Test-driven development (TDD). I found using guard gem in this programming methodology is very helpful. If you aren't familiar with TDD concept yet let me explain this in few words.

Idea of this programming methodology is to first write a test and then write a piece of code that will make this test pass ๐Ÿ’š.

In testblog app tests are already written. The 'only' thing you need to do is to make these tests pass and eventually add your own for custom behaviour of app (and also make them pass!).

To make this process more friendly I would recommend you use guard-rspec gem. How does it work?

It's very simple. By default Guard (with rspec addon) watches files in your working folder and when you make any change to them (add piece of code, remove file, etc.) it runs test so you can track your progress all the time without running rspec command anymore!

It saves a lot of the time, help to track current and further tasks and what is more, if your new piece of code will destroy (bug :exlamation:) any behaviour in app you will get notified about it immedlity. As sooner you can react on bug as easier it is to remove this bug.

How to start?

  1. Open new tab/window of console/terminal/cmd that will be dedicated for guard runner.

  2. Go to testblog directory and run guard init rspec

    You should see in console:

    21:02:07 - INFO - Writing new Guardfile to /path_where_you_cloned_this_repo/testblog/Guardfile
    21:02:07 - INFO - rspec guard added to Guardfile, feel free to edit it
    
  3. Run guard command. Now this console/terminal/cmd tab will watch all files in project's directory untill you terminate it (control+c on OS X). You should see this console output:

    21:02:18 - INFO - Guard is using TerminalTitle to send notifications.
    21:02:18 - INFO - Guard::RSpec is running
    21:02:18 - INFO - Guard is now watching at '/path_where_you_cloned_this_repo/testblog'
    
  4. Go write some code and get notified about your progress on live with guard!

You can also modify default behaviour of guard! For further read visit guard-rspec repo and/or guard repo.

testblog's People

Contributors

sztosz avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.