Running the Awesome window manager within Gnome

Posted Almost 13 years ago by Tobias Kraze.

...it up to switch between Awesome and regular Gnome on login. Here is how: (Tested on Fedora 15 / Ubuntu 11.10/12.04/14.04 with Gnome 3, and Ubuntu 10.10 with Gnome...

Capybara steps to match stuff within any selector

Posted Almost 13 years ago by Dominik Schöler.

...behavior to be impractical, but it is by design. In order to perform a test or action in all matching elements, do not use within but prefer the attached "inside...

Force SSH client to use password authentication instead of public key

Posted Almost 13 years ago by Thomas Eisenbarth.

To test if you can connect to a host using password authentication and explicitly deny public key authentication: ssh -o PreferredAuthentications=password -o PubkeyAuthentication=no user@host This also works...

Force Google Chrome to run in English on Linux

Posted Almost 13 years ago by Arne Hartherz.

...en”. They reappear when Chrome gets updated. This may help you running your Selenium tests using the Chrome driver on applications that choose the language from what the browser sends...

ActiveSupport::StringInquirer

Posted Almost 13 years ago by Lexy.
api.rubyonrails.org

Wrapping a string in this class gives you a prettier way to test for equality...

Playing audio in a browser

Posted About 13 years ago by Henning Koch.

...skinned, and which work for both Flash and HTML5 audio playback. Some products I tested are: jPlayer : Free. Provides a thin Javascript layer over the mess that is HTML5 audio...

Why preloading associations "randomly" uses joined tables or multiple queries

Posted About 13 years ago by Henning Koch.

...Mysql::Error: Column 'created_at' in order clause is ambiguous Unless you have a test covering this particular case, you won't notice this until after you deployed.

Setup (and secure) an SSH server on Ubuntu

Posted About 13 years ago.

...Don't forget to restart after editing the sshd_config: sudo service ssh restart (Tested on Ubuntu...

Synchronize a Selenium-controlled browser with Capybara

Posted About 13 years ago by Henning Koch.

...a button on a Selenium-controlled browser, the call will return control to your test before the next page is loaded. This can lead to concurrency issues when a Cucumber...

plus2/whereuat - GitHub

Posted About 13 years ago by Lexy.
github.com

Adds a slide out panel to your Rails application that directs clients to test stories that have been marked as 'delivered' in Pivotal Tracker...

Traversing the DOM tree with jQuery

Posted About 13 years ago by Henning Koch.
api.jquery.com

...of matched elements to those that match the selector or pass the function's test. jQuery has a select method, but it has nothing to do with navigating the DOM...

Check that a Range covers an element in both Ruby 1.9 and 1.8.7

Posted About 13 years ago by Henning Koch.
rhnh.net

...the min and max values, the range is iterated over from min until the test value is found (or max) [...] Ruby 1.9 introduces a new method Range#cover? that implements...

Closures in Ruby

Posted About 13 years ago by Dominik Schöler.
innig.net

...I *think* it is, based on experiment. There's no authoritative answer other than testing the CRuby implementation, because there's no real spec -- so there may be other differences...

Use the back button in Cucumber

Posted Over 13 years ago by Thomas Eisenbarth.

In order to go back one page in your Cucumber tests, you can use the following step definition for Capybara: When(/^I go back$/) do visit page.driver.request.env['HTTP_REFERER']

Match strings in a given order with Cucumber and Capybara

Posted Over 13 years ago by Dominik Schöler.

Augsburg Berlin Beta Group """ The step ignores all HTML tags and only tests on plain text...

Reload the page in your Cucumber features

Posted Over 13 years ago by Arne Hartherz.

...visit url_for(request.params) end For a step that distinguishes between drivers (Selenium, Rack::Test, Culerity), check n4k3d.com...

The WordCount Simulation

Posted Over 13 years ago by Lexy.
testobsessed.com

So this is the simulation that I use in my Agile Testing class, as well as in other contexts where I want to teach lessons about increasing Agility. The mechanics...

Run a rake task in all environments

Posted Over 13 years ago by Henning Koch.
youtube.com

power-rake db:migrate VERSION=20100913132321 By default the environments development, test, cucumber and performance are considered. The script will not run rake on a production or...

Strip carriage returns in submitted textareas

Posted Over 13 years ago by Henning Koch.

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

Fix a spec that only runs when called directly

Posted Over 13 years ago by Henning Koch.

...only runs when it is called directly, but not as part of the whole test suite, make sure the filename is foo_spec.rb instead of just foo.rb...

Airbrake notification in Rake tasks

Posted Over 13 years ago by Tobias Kraze.

...the usual notification rules, i.e. you won't get anything in the development or test environments. Obiously, this only works with tasks that actually depend on :environment...

rspec_candy is now a gem

Posted About 12 years ago by Henning Koch.
github.com

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

MySQL replication how-to

Posted Over 13 years ago by Arne Hartherz.

...example SOURCE the_dump.sql in the MySQL shell) Set up an SSH tunnel Manually, for testing purposes: ssh -L 3307:localhost:3306 10.50.0.101 This maps the local port 3307 to port...

Cucumber Webrat steps

Posted Over 13 years ago by Lexy.

Most of these will not work in newer projects because these use the Capybara/Rack::Test combo in lieu of Webrat. Find input fields Then /^there should be a "([^"]+)" field$/ do...