Learn

Writing a Chrome extension with Elm

Writing a Chrome extension with Elm

In my quest for learning a new language I’ve picked Elm and Elixir, I think both are great languages to learn but for this article, I will be focusing on Elm. To be more specific, I will guide you through the process of building a simple Google Chrome extension using Elm.

How to test a function that yields a block with Minitest and Rspec

How to test a function that yields a block with Minitest and Rspec

Have you ever tried writing a test for a function that takes a block and does something to that block? I recently had to do that same thing and found there was not much written about it so in this post I’m going to fix that, I’m going to show you how to create expectations on block arguments.

How to write a Cucumber test for Google Maps

How to write a Cucumber test for Google Maps

Trying to write a Cucumer test for a Google Maps related feature is a bit trickier than you might expect. It involves tweaking the Google Map on the testing environment and using a javascript capable driver like Selelnium. Check out the article to see how you can do it.

How to install Bootstrap 4 in Rails

How to install Bootstrap 4 in Rails

Every day there’s a new library in the spotlight or maybe just a new version of a really popular one like Bootstrap in this case that doesn’t always have a corresponding ruby gem that you can install into your app yet. So what do you do? Do you sit and wait until someone decides to write one for you?

Understanding and extending Rails form helpers

Understanding and extending Rails form helpers

Helpers in rails are meant to clean up view code by allowing you to extract data processing logic from your markup code. By moving the logic out, you get an added benefit, you can test your “view logic” easier. At least that’s the most common use case you’ll see in Rails.

Nested trees with Ruby on Rails

Nested trees with Ruby on Rails

Did you ever needed to get the children’s children of a newsted tree like structure? Well it turns out, in Rails, that stuff is pretty easy to do. You can use the awesome_nested_set gem and you’re all set, everything is right there for you to use.

Decoupling CSS Selectors From Your Tests

Decoupling CSS Selectors From Your Tests

For a long time, I’ve been bothered by the problem of using CSS selectors to target DOM elements in my tests (with Capybara). In this short article, I’m going to try Eduardo Gutierrez’s suggestion of using data attributes for targeting DOM elements instead of CSS selectors.

7 Steps to better Cucumber tests

7 Steps to better Cucumber tests

When you are starting out with rails testing there are so many things you need to learn about and thus it’s very hard to have a clear picture of what goes where and what’s the best way of writing unit tests and view specs and integration tests etc.

The Beginner's Guide to Rails Helpers

The Beginner’s Guide to Rails Helpers

Helpers in Rails are used to extract complex logic out of the view so that you can organize our code better. This article is meant to shed some light over the “How and when to use Rails Helpers”.

Mastering Ruby Blocks in Less Than 5 Minutes

Mastering Ruby Blocks in Less Than 5 Minutes

Blocks are one of the most powerful and often overlooked feature of ruby. There is something about yield that makes blocks very hard to understand at first. I’m going to talk about some of the concepts and provide a few examples so by the end of this post you’ll have a solid understanding of ruby blocks.

How to Use link_to in Rails

How to Use link_to in Rails

Even after 7 years of using Ruby on Rails I still have trouble remembering how to properly use all those options available for the link_to helper. Three out of five times I have to fire up the docs and search for the examples (cause that’s how I like to read the docs).