Created
July 9, 2015 22:00
-
-
Save xchoi/ed1c207274fe56bb3f8c to your computer and use it in GitHub Desktop.
jasmine spec from rspec that passes rubocop
This file contains hidden or 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' | |
describe 'Jasmine suite', :js do | |
def run_jasmine_tests | |
visit '/jasmine' | |
Timeout.timeout(10) do | |
sleep 0.25 while page.has_css?('.runningAlert') | |
end | |
end | |
it 'passes' do | |
run_jasmine_tests | |
if page.has_css?('.failingAlert') | |
messages = [] | |
all('.specDetail.failed .description').each_with_index do |spec, index| | |
messages << "#{index + 1}. #{spec.text}" | |
end | |
messages.unshift("Jasmine suite failed with #{messages.size} failures") | |
fail messages.join("\n") | |
else | |
page.should have_css('.passingAlert') | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment