Let the following setup: # my_model_spec.rb describe MyModel do it 'perfoms a test' it_behaves_like 'something shared' end # something_shared.rb shared_examples_for 'something shared' do it 'does something'
...a test' is spec/models/my_model_spec.rb[1:1]. The ID of the ExampleGroup created by it_behaves_like 'something shared' is spec/models/my_model_spec.rb[1:2] as it is the second ExampleGroup in the...
All Rubyists should be familiar with the common definitions for include and extend. You include a module to add instance...
Some browsers render PNG images with color profiles and other shenanigans, some do not. The cleanest way to have consistent...
...the resulting record will not have the attributes that defined that scope, and this behavior can be quite useful. Because you cannot have the best from both worlds you should...
...article and make informed choices about how to define your conditions. Also see the Best Practice section below. The problem in detail Consider this Rails class and the following articles...
This talk shows simple and advanced usages of the ruby/debug debugger. It goes through a step by step debugging workflow...
While most Rails Apps are tied to at least one external REST API, machine-to-machine communication via GraphQL is...
There is no such thing as a "default order" of rows in database tables. For instance, when you paginate a...
Same requests are recorded only once in vcr. Replaying a test fails, if you trigger the same request multiple times...
When RubyMine reports Rubocop returning "exit code -1", upgrading Rubocop can be the fix: gem install rubocop "The logs" can...
When your Cucumber feature needs to browse the page HTML, and you are not sure how to express your query...
A list of implementation details that make for a better / expected user experience. Have these in mind when implementing a web design. This document outlines a non-exhaustive list of...
...also in our library): Designing a Complex Form Designing a Dashboard Designing Content Designing Beautiful Shadows in CSS Pairing typefaces Then, take the quiz at cantunsee.space. Did you spot all...
We're always striving towards keeping our website's JavaScript as small as possible. If you're using webpack(er...
...boring style violations. When you demonstrate an appreciation for constructive criticism, your reviewer provides better feedback . Make others better: Your code review techniques set an example for your colleagues. Effective...
If you expect method calls in RSpec 3, be aware that the argument matchers use very liberal equality rules (more...
...the window's resize event, that might call your event listener many times. A better way is to subscribe to changes of the MediaQueryList object that is returned by matchMedia...
I frequently find myself needing a combination of group_by, count and sort for quick statistics. Here's a method...
Web technology is a broad field and you cannot be an expert in all aspects. However, it is useful to...
Enable local logging for Sentry when: Debugging Sentry event capture locally Testing error handling without polluting production metrics Developing background...
...system's environment specifies. This is usually good enough. To test any timezone-dependent behavior in Chrome, you can change the time zone using the Chrome DevTools Protocol. Example
This guide shows how to create an AngularJS application that consumes more and more memory until, eventually, the browser process...
...Capybara see the print stylesheet Capybara always requests as the screen medium. The step belows reloads the current page with a query param we will use in our layout to...
This card is mainly an explanation how variable fonts work in CSS, not necessarily a recommendation to actually use them...
Capybara and most assistive technology will fail to find tags that are missing an href attribute. This will probably happen...