...have a program running in a hidden X screen (like with Xvfb for Selenium tests) you may want to look at that hidden screen occasionally. First, find out what X...
VCR.use_cassette(' ', match_requests_on: %i[method oauth_uri]) do # Your test here
...Unpoly you may also use up.util.parseUrl(), which implements the technique in this card with tests and all caveats fixed. Related topic: JavaScript: Working with Query Parameters Javascript: Read params from...
...If you have more than one recording device, find the correct one. Make a test call to a colleague that can tell you if it's too loud or too...
...This broke during deployment while Capistrano tries to run bundle --deployment --quiet --without development test. On our development machines bundle install run successfully. Fix this by making sure both sides...
...positioning, width/heigth, or similar. Every browser has its own caveats and you can not test them all. Generally speaking: Use the html tag to define your page's default background...
...are probably using closures to hide local state, e.g. to have private methods. In tests you may find it necessary to inspect a variable that is hidden behind a closure...
...committed fix that is not yet in the stable repository. You can enable the testing sources (natty-proposed) and update your packages to get the fix. You will also receive...
...lots of other code in testing, so hold on to something. This can be avoided by restricting it to the compiz package (I did not test this). Warning: Your system...
class Note does 'strip_carriage_returns', :prose, :code end Here is the test that goes with it: describe Note do describe 'before_validation' do it_should_run_callbacks...
yarn add rails-erb-loader Add this to your config/webpacker/environment.js: environment.loaders.prepend('erb', { test: /\.erb$/, enforce: 'pre', use: [{ loader: 'rails-erb-loader', }] }) Start using erb. For example, in a...
If you need to test some HTML, e.g. an embed code, you can use RubyMine's "scratch files": File > New Scratch File (or Ctrl + Shift + Alt + Ins) Select "HTML" as...
...rails generators) with rails g -h. generator model migration controller entry in routes.rb views tests scaffold ✔ ✔ ✔ ✔ ✔ ✔ resource ✔ ✔ ✔ ✔ ✔ model ✔ ✔ ✔ controller ✔ ✔ ✔ migration ✔ Also see this blog post...
...you could open a new tab via window.open when using execute_script in Selenium tests. It no longer works in Chrome (will show a "popup blocked" notification). This is because...
So I checked the /var/lib/dpkg/info/varnish.postrm for exit 78 and found the following: [...] if test -e /var/lib/varnish; then rm -r /var/lib/varnish > /dev/null 2>&1 || exit 78 fi [...] This directory couldn...
If you open a pop-up window [1] in your Selenium tests and you want to close it, you can do this: # Find our target window handle = page.driver.find_window("My...
...is not used before removing it. If you remove the --dry-run flag, all tests will actually run and you can skip adding the require_relative line. It will take...
...above commands does, see explainshell. Note that we use geordi cucumber to run our tests. If you don't, xargs cucumber or similar might work for you. Part of Geordi...
...account, users will get a BCrypt::Errors::InvalidHash when trying to sign in. Your tests will not notice this, since they create new users for each scenario.
...If you want to open XLSX spreadsheets (for example to confirm your output in tests), you can use roo. To easily dump Rails records to XLSX, there is also axlsx...
Note that if you plan to freeze your Firefox versions because your Selenium tests break whenever Firefox updates, there is a better way that lets you keep an up-to...
If you get an error like this for a puppet mount: $ > puppet agent --test Info: Retrieving pluginfacts Info: Retrieving plugin Info: Loading facts Info: Caching catalog for example.makandra.de Info: Applying...
...should way of writing specs for expecting things to happen. However, if you have tests you cannot change (e.g. because they are inside a gem, spanning multiple versions of Rails...
...rails generate cucumber:install --capybara to integrate cucumber/capybara into your rails project. Run your tests and fix error messages by reintegrating parts from your backed up files...
...Solution: Add gem 'minitest' to your Gemfile, before any rspec gem. Another MiniTest::Unit::TestCase is now Minitest::Test. From /Users/makandra/.rvm/rubies/ruby-1.9.3-p484/lib/ruby/1.9.1/test/unit/testcase.rb:8:in ` ' In order to remove this message, you...