Created
July 19, 2012 22:59
-
-
Save dimroc/3147449 to your computer and use it in GitHub Desktop.
Capybara request spec to ensure jasmine specs pass
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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