github.com

Using this gem, whenever a Capybara test in Cucumber, Rspec or Minitest fails, the HTML for the failed page and a screenshot (when using capybara-webkit, Selenium or poltergeist) is...

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...

github.com

Takes a screenshot when you call it, or when a test fails...

...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...

github.com

A comprehensive script to convert test suites from RSpec 2 to RSpec 3. This converts more than should/expect syntax...

github.com

...for Ruby 1.9 with a powerful configuration library and automatic merging of coverage across test suites. Note that rcov won't ever have support for Ruby 1.9, you're supposed...

Capistrano is by default configured to exclude the gems of the groups development and test when deploying to the stages production and staging. Whenever you create custom groups in your...

...deploy, add the following to config/deploy/production.rb and config/deploy/staging.rb respectively: set :bundle_without, %w[development test cucumber deploy].join(' ') Be aware, that gems that belong to two groups, are only excluded...

blog.bigbinary.com

...environment yet, which Rails 5 enforces. If this error occurs while migrating your parallel test databases, make sure to update the parallel_tests gem first: current versions fix this. If...

...you're still using Cucumber < v3, the latest version of parallel_tests will be...

engineyard.com

Nice tutorial about packaging Ruby bindings to your API in a Ruby gem, with tests using VCR casettes...

makandra dev
filippo.io

Enter the hostname of a server to test it for CVE...

regular-expressions.info

...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...

requestb.in

Requestb.in is a webservice that gives you a temporary URL you can use to test request. The page will automatically record and display the latest web request made to it...

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...

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...

makandra dev

...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...

coffeescript.org

The Javascript in operator does what Hash#has_key? does in Ruby: Return whether an object has a property.

blog.mailgun.com

...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...

caniemail.com

The french Tilt Studio built a caniuse clone for email clients. Note that while checking styling support helps using (or...

justinfrench.com

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...

Don't say is_a?(ActiveRecord::NamedScope::Scope) because that is no longer true in Rails 3 and also doesn...

github.com

matches. Example 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

...MyModel is spec/models/my_model_spec.rb[1]. The ID of the ExampleGroup created by it 'performs a test' is spec/models/my_model_spec.rb[1:1]. The ID of the ExampleGroup created by it_behaves_like 'something...

github.com

Internet Explorer until version 9 has some limitations when parsing CSS files Summarized, these are: Up to 31 CSS files...

...current JavaScript VM: window.addEventListener('error', function(event) { console.log("Got an uncaught error: ", event.error) }) Tip Testing tools like Jasmine might also listen to the error event and fail your test if...