head :bad_request end end end And change your routes + add some a test: resource :content_security_policy_report, only: :create describe ContentSecurityPolicyReportsController do describe 'POST /content_security_policy_report' do
expect(Rails.logger).to receive(:info).with('Content Security Policy Report: Mozilla/5.0 ["test"]') post '/content_security_policy_report', params: ['test'].to_json, headers: { 'Content-Type': 'application/csp-report', 'User-Agent': 'Mozilla/5.0' } expect(response...
This seems to be obvious, but you can expect Rake tasks to be called in RSpec. it 'deletes all Users...
...error), the CI job will pass MINOR: With our current setup, we lose the test coverage of the main run A fix for the passing CI despite syntax error could...
- 'if [[ $main_cucumber_run_passed =~ false ]]; then (echo -e "\033[0;33mRerunning failed tests:\033[0m"; bundle exec cucumber @tmp/failing_features.txt --strict --tags "not @real-stripe-requests" -f pretty -f...
The Javascript in operator does what Hash#has_key? does in Ruby: Return whether an object has a property.
...clients, various devices, various providers. All these things have to be thought about and tested. It’s no surprise developers don’t want to deal with this when there is...
The french Tilt Studio built a caniuse clone for email clients. Note that while checking styling support helps using (or...
Eventually you’ll forget that you used to spend hours testing your code in a browser, and start complaining that your automated tests are taking minutes to run! You’ll...
...have intense debates with co-workers about what to test and how to test it properly. You’ll start writing the test first to expose the bug or missing feature...
Due to the way we setup Jasmine tests in our projects, you may run into various errors when Jasmine boots. Setting jasmineRequire on undefined Jasmine 4 may fail with an...
Now add the following loader to your config/webpack/environment.js: environment.loaders.prepend('fix-jasmine4-global-detection', { test: /jasmine-core\/lib\/jasmine-core\/jasmine\.js$/, use: [{ loader: 'string-replace-loader', options: { search: 'window.toString() === \'[object GjsGlobal...
...use plain ruby scripts, consider lib/scripts/* as folder. Keeping tasks slim For readability and testing it's easier to keep your tasks slim. We suggest to use folders inside the...
...Your code of exporting all users e.g. into a XSLX file end end end Testing should not be optional Tasks should be tested the same way as other code, even...
Don't say is_a?(ActiveRecord::NamedScope::Scope) because that is no longer true in Rails 3 and also doesn...
When testing with Cucumber / Caypbara, iframes are ignored, so you can't interact with them. To interact with your iframe, you have to explicitly tell your driver to use it...
...up DOM elements. There are also matchers like have_field to make expectations during tests. These methods also have a number of options to influence the lookup. E.g. the :disabled...
...a number between 100 and 99999. Modes: Greedy, Lazy and Possessive Example string: This test is a first test string. greedy (default): * and + match as much as they can and...
...backtrack when they can't satisfy the regex, i.e. the .* in /.*test/ will first match the whole example string and then go back to match this: This test is a...
Same requests are recorded only once in vcr. Replaying a test fails, if you trigger the same request multiple times. The error message is somehow confusing, as your cassette contains...
URI ignoring query parameter ordering 1 URI ignoring query parameter ordering 2 Tests with AJAX Using javascript in integration tests might cause issues that AJAX requests are not...
...formerly known as "spec_candy.rb") is now available as a gem. It works, it is tested and there will be updates. Usage Add rspec_candy to your Gemfile. Add require 'rspec...
Scenario outlines allow us to more concisely express repetitive examples through the use of a template with placeholders.
"I click on ..." step fixed Errors added to ToleranceForSeleniumSyncIssues::RETRY_ERRORS Capybara::ElementNotFound Selenium::WebDriver::Error::ElementNotVisibleError Selenium::WebDriver::Error...
...number of words, lines and paragraphs, and outputs the result. For example: $ ruby count_words.rb test.txt test.txt has 123 words test.txt has 13 lines test.txt has 4 paragraphs Hint
Hashrocket Lunch n' Learn #1 with Avdi Grimm: Making Little Classes out of Big Ones A look at the pros...
...tab, and inspect the live DOM. You can debug a failing end-to-end test by pausing it and inspecting the page and the server log. You review your own...
...and following the guidelines from the referred card above. If you are debugging rspec tests, you can use rspec -b to print the full stack trace. If you encounter problems...
...TLSv1.3 gelöst? Du weißt, wie du eine Webseite auf die Sicherheit der SSL Konfiguration testen kannst. Du kennst Certificate Transparency logs und weißt wofür das gut ist.
...Was kannst du hier herausfinden? Wie ist es möglich, dass die Informationen dort vorliegen? Teste makandra.de auf SSL Labs. Schau dir das Testergebnis an und verstehe welche Ergebnisse dir angezeigt...
...relative 'lib/capistrano/slackistrano' set :slackistrano, { klass: Slackistrano::CustomMessaging, channel: '#your-channel', webhook: 'https://hooks.slack.com/services/your/webhook/url', } Test Slackistrano: cap staging slack:deploy:test When you are satisfied, do a real deploy to...
Syn is a synthetic event library that pretty much handles typing, clicking, moving, and dragging exactly how a real user...
This works in all relevant browsers: document.activeElement You can use this in your Selenium steps, for example, to assert that...