httpie.org

...and has very nice defaults and coloured output which makes it good for local testing. Usage examples with curl equivalent: # curl post curl --data "foo=23&bar=42" https://example.org...

makandra dev
github.com

...through of unknown options to Cucumber Add --rerun=N option to rerun failed Cucumber tests up to N times. Reboots the test environment between runs, thus will pick up fixes...

medium.com

Advantages over a classic Rails monolith By (automatically) only requiring expected/allowed dependencies in tests, components cannot accidentally use (i.e. depend on) code they're not allowed to

...of the clear separation and dependencies. No need to know the whole application. Faster test runs, because only dependent components need to run. A growing team can still keep up...

...as an npm package. // vendor/asset-libs/bought-font/package.json { "name": "bought-font", "version": "1.0.0", "description": "", "main": "index.scss", "scripts": { "test": "echo \"Error: no test specified\" && exit 1" }, "author": "Salesman of trust", "license": "LICENSE", "private": true...

github.com

...official" rails2 branch [2] which contains commits that were added after 0.8.6 was released. Tests are fully passing on our fork for Ruby 1.8.7, REE, and Ruby 1.9.3.

...of Module.const_defined? was missing. [2] Changes for replica sets were reverted (since their tests were not passing) and some tests were fixed...

...that has two disadvantages: You're doing something that never happens in reality. Your tests shouldn't do things your code never does. You're fiddling with internal state. When...

...writing tests, stay on your chosen abstraction level. Solution 1 record.unmemoize_all Solution 2 Perform a full reload by re-finding your record: it 'updates on changes' do subject.seat_counts...

...provides a script to migrate your Ruby project automatically. Make sure your project has tests and you have a backup of your files (or pushed your commits to Git)

...is not perfect). Check the diff to see what the script has done. Run tests to see if everything still works...

Our rspec_candy gem now gives you three matchers: be_same_number_as Tests if the given number is the "same" as the receiving number, regardless of whether you're...

...purposes". Internally the matcher compares normalized results of #to_s. be_same_second_as Tests if the given Time or DateTime is the same as the receiving Time or DateTime...

When testing Ruby code that prints something to the terminal, you can test that output. Since RSpec 3.0 there is a very convenient way to do that. Anything that writes...

...print) can be captured like this: expect { something }.to output("hello\n").to_stdout Testing stderr works in a similar fashion: expect { something }.to output("something went wrogn\n").to...

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

github.com

Microsoft provides virtual machine disk images to facilitate website testing in multiple versions of IE, regardless of the host operating system. Unfortunately, setting these virtual machines up without Microsoft's...

...on a Rails project a bundle install will get you back the gems. Run tests Now run your test suite to see if the migration was successful. Troubleshooting: Use an...

...not to include 3 Applications Tip This can be used to test for exclusion of multiple values all at once...

rspec.info

You can define methods in any example group using Ruby's def keyword or define_method method: describe "example" do...

...server from time to time. Before doing a full deploy, you might want to test that server in an isolated deploy. There is a single way to do this: the...

...run for servers matching {:roles=> }, but no servers matched. Instead, specify the server-under-test like this: HOSTFILTER=separate-sidekiq.makandra.de cap production deploy Capistrano is aware of this env variable and...

...silence some specific warnings. Add this to your initializers, or require it in your tests: silenced = [ /Not considered a useful test/, /use: should(_not)? have_sent_email/, ] # list of warnings...

makandra dev

...if you make any error in programming. E.g. a simple typo would make the test above green. The block will catch the Spec:: exception and the test will be happy...

Custom matchers are a useful RSpec feature which you can use to DRY up repetitive expectations in your specs. Unfortunately...

blog.hashrocket.com

Testing with real live production data does come with at least one catch. All those real live users in your production environment have real live email addresses that receive real...

...and check if your application responds and everything looks okay. Run your application's tests...

makandra dev

...Find descendant(s) by CSS selector .find(selector) one: .querySelector(selector), many: .querySelectorAll(selector) Test an element (returns boolean) .is(selector) .matches(selector) Test for class presence (boolean) .hasClass(class...

...files from the dist folder, which is most often <ES6 javascript. 9. Achieve green tests. 10. Check if postcss, uglifier, babel and other compilers work for production. This can be...

.replace(/^/, '#') Ruby My use case was comparing colors in an integration test, so I used JS to get the pseudo element's style via Selenium, and then processed it...

...Here is how to circumvent that. What's going on? You are making ActionController::TestRequests in your specs, and their #initialize method does this: self.session = TestSession.new This means that each...

...behavior by stubbing the controller's session and querying that stub: persisted_session = ActionController::TestSession.new controller.stub :session => persisted_session # do things persisted_session[:something].should ... Apply this workaround only when...