Skip to content

Instantly share code, notes, and snippets.

@dimroc
Created July 19, 2012 22:59
Show Gist options
  • Save dimroc/3147449 to your computer and use it in GitHub Desktop.
Save dimroc/3147449 to your computer and use it in GitHub Desktop.
Capybara request spec to ensure jasmine specs pass
require 'spec_helper'
# For use alongside Jasminerice
# Requirements: Capybara, Underscorejs
# Remember this is a request spec, so place in spec/requests/ or
# tag scenario with request: tue.
feature "JasmineSpecs" do
scenario "should all pass", js: true do
visit "/jasmine"
wait_until do
page.evaluate_script("jsApiReporter.finished")
end
jasmine_results =
page.evaluate_script(<<-TRUTH_JS)
_.all(jsApiReporter.results(), function(r) { return r.result == "passed"} )
TRUTH_JS
jasmine_results.should be_true
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment