Quick HTML testing with RubyMine

Posted About 4 years ago by Dominik Schöler.

If you need to test some HTML, e.g. an embed code, you can use RubyMine's "scratch files":

ActiveRecord: Specifying conditions on an associated table

Posted About 4 years ago by Henning Koch.

We can use ActiveRecord's where to add conditions to a relation. But sometimes our condition is not on the...

Letting a DOM element fade into transparency

Posted About 4 years ago by Henning Koch.

You can use the CSS property mask-image to define an "alpha channel" for an element. E.g. to let an...

Ruby: How to fetch a remote host's TLS certificate

Posted About 4 years ago by Arne Hartherz.

TLS/SSL certificates are often used for HTTPS traffic. Occasionally a service may also use their TLS certificate to support public...

How to write modular code

Posted About 4 years ago by Judith Roth.

Or: How to avoid and refactor spaghetti code Please note that I tried to keep the examples small. The effects...

How to make a cucumber test work with multiple browser sessions

Posted About 4 years ago by Tobias Kraze.

Imagine you want to write a cucumber test for a user-to-user chat. To do this, you need the...

Rails: Rest API post-mortem analysis

Posted About 4 years ago by Emanuel.

This is a personal post-mortem analysis of a project that was mainly build to provide a REST API to...

How to: Validate dynamic attributes / JSON in ActiveRecord

Posted About 4 years ago by Emanuel.

PostgreSQL and ActiveRecord have a good support for storing dynamic attributes (hashes) in columns of type JSONB. But sometimes you...

Structuring Rails applications: the Modular Monorepo Monolith

Posted About 4 years ago by Dominik Schöler.
medium.com

Root Insurance runs their application as a monolithic Rails application – but they've modularized it inside its repository. Here is...

Always convert and strip user-provided images to sRGB

Posted About 4 years ago by Michael Leimstädtner.

Debugging image color profiles is hard. You can't trust your eyes in this matter, as the image rendering depends...

Jasmine: Test that an object is an instance of a given class

Posted About 4 years ago by Henning Koch.

To test that an object was constructed by a given constructor function, use jasmine.any(Klass): describe('plus()', function() { it ('returns...

Defining new elements for your HTML document

Posted About 4 years ago by Henning Koch.

Browsers come with a set of built-in elements like or . When we need a new component not covered by...

How to set up SMTP email delivery with a Gmail account

Posted About 4 years ago by Jakob Scholz.

If you want to make your Rails application be capable of sending SMTP emails, check out the action mailer configuration...

Rspec 3: what to do when `describe` is undefined

Posted Over 4 years ago by Daniel Straßner.

When tests might not run with skipping RSpec in the RSpec.describe failing with the error undefined method 'describe' for main...

Understanding grid sizes of (SVG) icons

Posted Over 4 years ago by Michael Leimstädtner.

A primer on vector graphics For rastered image formats like JPG or PNG, each pixel is basically drawn on a...

Pattern: Disabling a certain feature in tests

Posted Over 4 years ago by Dominik Schöler.

There is a kind of features in web applications that hinder automated integration tests. Examples include cookie consent banners or...

ActiveSupport includes Timecop-like helpers

Posted Over 4 years ago by Arne Hartherz.
api.rubyonrails.org

ActiveSupport (since 4.1) includes test helpers to manipulate time, just like the Timecop gem: To travel a relative amount of...

Email validation regex

Posted Over 4 years ago by Jakob Scholz.

There is a practical short list for valid/invalid example email addresses - Thanks to Florian L.! The definition for valid emails...

Rails: Verify the CSRF token

Posted Over 4 years ago by Emanuel.

Rails uses a CSRF token in forms and AJAX requests to verify a user request. Internally it compares the injected...

Rails: Decrypt a session cookie

Posted Over 4 years ago by Emanuel.

This method helps you to manually decrypt the session cookie in Rails 5.2. Chrome can retrieve the session cookie string...

WProofreader: How to manually enable for a WYSIWYG editor instance (with CKeditor 4 example)

Posted Over 4 years ago by Arne Hartherz.

WProofreader is a spelling and grammar checking tool that integrates with textareas and numerous WYSIWYG editors. While it usually activates...

A collection of useful design resources for developers

Posted Over 4 years ago by Emanuel.

This collection contains some useful design resources for developers. Many of them were mentioned in the Refactoring UI tutorials.

Integrating or upgrading makandra-rubocop

Posted Over 4 years ago by Daniel Straßner.

Most of the time it is a tedious task to apply a code style guide to an existing code...

How to enable Chromedriver logging

Posted Over 4 years ago by Arne Hartherz.

When using Chrome for Selenium tests, the chromedriver binary will be used to control Chrome. To debug problems that stem...