Testing Services in Angular 2
Services allow your code to share common functionality across the application. Find out how to use a TDD approach to incorporate them into your application.
Ruby exceptions are 4400 times faster than ActiveRecord::Base#create
How slow are Ruby exceptions as compared to other frequent actions we may be doing in Rails apps. Like for example, as compared to ActiveRecord::Base#create
Announcing FormLinter
A tool for making better forms.
Gold Master Testing
Gold Master Testing is a technique for evaluating complex legacy systems.
Brief look at RSpec's formatting options
A few weeks ago, I noticed weird output in the RSpec test suite (~4000 tests) for a Rails application: .............................................................................................unknown OID 353414: failed to recognize type of '<field>'. It will be treated as String ........................................................................................................................................... This Rails app uses a PostgreSQL database. After some Googling, it turns out that this is a warning from PostgreSQL. When the database doesn't recognize the type to use for a column, it casts to string by default.
Real-Time Messaging with Rails and ActionCable
In the previous article I showed how to create a custom messaging application allowing one-to-one chats between users. We’ve integrated Devise, set up proper associations, added support for Emoji, and made everything work in a synchronous fashion. However, I would really like this app to be more modern. Therefore today we will enhance it further […]
Code Analysis: Minitest
As you may know, Minitest is the default testing library for Rails & DHH’s favorite. Some people prefer it for its simplicity and how little code it has compared to its main ‘competitor’ (RSpec). Now this post is not about which one you should choose or which is ‘better’. This post is about how Minitest […]
Rails and adapter objects: different implementations in production and tests
If you work with service objects in Rails apps, very quickly you need to have the dependency being passed to the service object constructor. Which usually means, that the Rails controller needs to do it. This blogpost describes how to have a different implementation being passed in the production environment and an in-memory one in the tests.
Ruby 2.4 implements Regexp#match? without polluting global variables
Ruby 2.4 now allows matching a regex without updating global variables using Regexp#match?. This is a faster option to match regexes when we don't care about the match data
Bloc Tech Talk: Principles of Good Design by Sanny Lin
Bloc's Designer Sanny Lin tells us all about the principles of good design using helpful examples.