In RSpec 2 shared_examples_for can have parameters. You can simply hand over arguments from it_behaves...

If a controller action responds to other formats than HTML (XML, PDF, Excel, JSON, ...), you can reach that code in...

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

FactoryBot.define do factory :parent do transient do child_name nil child_allowed_to_drive false end child do association(:child...

askubuntu.com

...I had to choose "proceed without pairing" and enter the PIN "0000" Select & test the headphones in System Settings > Sound. Choose High Fidelity Playback (A2DP Sink).

If you are using VNC to run Selenium tests, it may be hard to see what's going on since by default there is no list of open windows and...

github.com

...I have not used Colcade yet, but it looks very promising. It has no tests, though. I'd also love to see a migration guide for users coming from Masonry...

github.com

...Opera 11.00, and possibly other browsers.) Caches the results of its two feature tests in jQuery.fn.placeholder.input and jQuery.fn.placeholder.textarea. For example, if @placeholder is natively supported for input elements, jQuery.fn.placeholder.input will...

You should test the callback methods and its correct invocation in two separate tests. Understand the ActiveRecord note before you move on with this note. Say this is your Spaceship...

...docked => :en_route end before_transition :on => :launch, :do => :release_docking_clamps end end Testing that a state_machine callback is called at the correct point in a record's...

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

...see Cucumber: Check if a select field contains a disabled option on how to test this...

Generally, Selenium tests use the browser to interact with the page. If it's unavailable, a timeout error is thrown. Now, consider a scenario like this: @javascript Scenario: Receive...

Errors happening on the target page are not "visible" to the test If the browser is still waiting for further responses from the server (like after following...

github.com

...get full SQL syntax highlighting in the editor of your choice and can easily test your SQL in the database console during development. https://robots.thoughtbot.com/announcing-scenic--versioned-database-views-for-rails Notes: PostgreSQL only

When you need to find out in which kind of spec you are during run-time, it's definitely possible...

thoughtbot.github.io

Let's say you have two factories that share some attributes and traits: FactoryBot.define do factory :user do screen_name...

makandra dev

If you need dummy data to play around with in development, it's often faster to reuse your existing factories...

makandra dev
impactahead.com

Also see the list of IRB commands. Switching the context Changes the "default receiver" of expressions. Can be used to...

...For Spreewald >= 1.9.0 it is as described in Solution 1. When doing integration testing with cucumber and selenium you will often encounter problems with timing - For example if your test...

...runs faster than your application, html elements may not yet be visible when the test looks for them. That's why Spreewald (a collection of cucumber steps) has a concept...

RSpec lets you define the arguments with which you expect a method to be invoked: subject.should_receive(:say).with('hello...

redis.io

Hint You're not able to control which redis replica will chosen for the failover. Connect to your sentinel instance...

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

...Then console step from spreewald in combination with geordi vnc from geordi to debug tests within a real browser. Sometimes when you type in the browser it suddenly disappears. You...

tutorialzine.com

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

Views are normally (for good reason) not rendered in controller specs. If you need it to happen, use: