Because Terrible Labs loves you.

Motion-juxtapose: Now With Rails Support!

Earlier this year, we released motion-juxtapose, a gem for using screenshots to test iOS apps built with RubyMotion. Today, we released version 0.2.0 with some bug fixes and support for Rails integration tests!

When running under Rails, the gem uses Capybara to capture its screenshots. Any Capybara driver that supports screenshot capture should work, though we’ve only tested this with Poltergeist so far.

In your spec_helper.rb, add:

123

require'juxtapose/capybara'# if you're using rspec, you can get the `look_like?` custom matcher with:require'juxtapose/rspec'

Now the Capybara page object will have a looks_like?(predicate) method that can call to make screenshot assertions:

123456

feature"viewing locations",js:truedoscenario"should only show books at first location"dovisitlocation_pathLocation.find_by_name("Cambridge")expect(page).tolook_like("books at Cambridge")endend