Testing file download links in an end-to-end test can be painful, especially with Selenium. The attached download_helpers.rb provides...

While verifying doubles in RSpec is a good default, it is limited in the amount of methods it actually is...

When the order matters: expect(array1).toEqual(array2) Regardless of order: expect(array1).toEqual(jasmine.arrayWithExactContents(array2)) Ignoring extra elements:

RSpec's let allows you to super into "outside" definitions, in parent contexts. Example: describe '#save' do subject { described_class.new(attributes...

Jasmine is a great tool to unit test your JavaScript components without writing an expensive end-to-end test for...

Resources RubyGuides: Mastering Ruby Regular Expressions Using regular expressions in JavaScript Testing regular expressions visually Regular Expressions: Quantifier modes...

A flaky test is a test that is often green, but sometimes red. It may only fail on some PCs...

makandra Curriculum

Basic validations Read the Rails Guide on ActiveRecord Validations. You should have an overview which kinds of validations are built...

When testing JavaScript functionality in Selenium (E2E), you may need to access a class or function inside of a evaluate...

tableconvert.com

https://tableconvert.com/ is an online tool to convert tables between different formats (e.g. json, markdown, csv).

makandra dev
mixedcontentexamples.com

The pages […] allow you to see different types of mixed content and test how they behave in your browser. The...

When testing with Cucumber / Caypbara, iframes are ignored, so you can't interact with them. To interact with your iframe...

After performing a live migration of a VM you may encounter issues with the clock of the migrated VM. The...

makandra dev
github.com

FactoryBot allows to create traits from Enums since version 6.0.0 The automatic definition of traits for Active Record enum attributes...

Select2 is a fantastic library for advanced dropdown boxes, but it depends on jQuery. Alternatives Tom Select

makandra dev
github.com

If you render markdown from user input, an attacker might be able to use this to inject javascript code into...

When an event listener on a DOM element throws an error, that error will be silenced and not interrupt your...

Test-Driven Development (TDD) in its most dogmatic form (red-green-refactor in micro-iterations) can be tedious. It does...

makandra dev

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

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

api.rubyonrails.org

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

In Ruby on Rails, all objects have a useful blank? method. It returns true for nil but also for empty...

Not all versions of Node.js are compatible with each other. Also npm packages may require a minimum or maximum version...

Download buttons can be difficult to test, especially with Selenium. Depending on browser, user settings and response headers, one of...