...expressions extract structured data from text. This lesson teaches you to write, read and test them, and shows where they are the right tool and where they aren't.

...pattern readable, e.g. with the /x flag, comments or nested sub-patterns. You can test a pattern interactively, and you know that line breaks and multiline matching behave differently across...

...main').search('horizon').where('year > 1995').order(:year).to_a Adapt both the integration test and RSpec examples for the search functionality, using the guidelines from the "Testing" chapter in...

...Growing Rails Applications in Practice. RSpec examples should cover all edge cases E2E tests should only cover one "happy path" to show successful integration Open budgets in Project Hero (makandra...

...explain what each run costs and on which servers it should run. You can test code that enqueues and performs jobs. You can compare GoodJob with the alternatives you will...

...queue: set up, configuration, the dashboard, how jobs are executed and retried 📄 Rails Guide: Testing jobs and the have_enqueued_job matcher — how to test enqueuing and performing

...rather than per controller. You can attach records to the signed-in user and test the whole authentication flow. You can assess the security of an authentication implementation: brute force...

...should be customized to work with the existing form styles in your MovieDB. Add tests for all these features. Discussion Discuss the implementation with your mentor, with an emphasis on...

...a short summary for your mentor. The questions at the end are not a test. If you can't answer one, that is exactly what your mentor wants to know...

...how Rails works out of the box: simple, robust, fast to build, easy to test with a real browser. The price is that every interaction is a full page load...

...validations and authorization, state management, more code, more build tooling, and a much harder testing story. Hybrids. The line isn't binary. A server-rendered app can embed an island...

You can build a ViewComponent following our conventions, and write a unit test for it. Resources Read what's new to you, skim what's familiar, skip what...

...be missing — detect it and fall back — in HTML, CSS and JavaScript. You can test an app in browsers and devices you don't own, e.g. on BrowserStack, including mobile...

...API, with a compatibility table at the bottom of each page 📄 MDN: Cross-browser testing — the module, including feature detection in JavaScript and CSS 📄 Reminder: Safari is not an evergreen...

...screenshot: close enough to prove your HTML structure can carry the real layout. The test: pixel perfection must be reachable later by editing only CSS rules, never the HTML. You...

Use vector graphics Create multiple sizes of the image Use media queries that test for min-device-pixel-ratio Use Use Ignore the issue Discuss the pros and cons...

makandra Curriculum

...to memorize the key takeaways of 1-5 on the list. Watch Dominik's talk "Test-Led Development" (in our library) and try to apply his technique in the future

...Network tab, with throttling simulating a slow connection. You can create large amounts of test data quickly, e.g. inside a single transaction. Resources Read what's new to you, skim...

...yourself in Cucumber scenarios. Cucumber Factory We have a very useful gem to create test data in cucumber: cucumber_factory. Read through the README. Integrate it into your MovieDB and...

...you cannot find any opportunities to DRY up a Cucumber scenario, do this exercise (testing the file upload from before): Write a scenario: User can upload a movie poster in...

Best results in other decks

makandra dev

An end-to-end test (E2E test) is a script that remote-controls a web browser with tools like Selenium WebDriver. This card shows basic techniques for fixing a flaky...

...and seed per process: DISPLAY=:17 bundle exec parallel_cucumber --serialize-stdout --verbose-process-command --test-options '--order random' features/ bin/cucumber --order random --profile parallel features/location/import.feature features/location/export.feature Using the parallel...

A flaky test is a test that is often green, but sometimes red. It may only fail on some PCs, or only when the entire test suite is run.

...are many causes for flaky tests. This card focuses on a specific class of feature with heavy side effects, mostly on on the UI. Features like the following can amplify...

Search in all decks