|
1 | 1 | require 'rails_helper' |
2 | 2 |
|
3 | 3 | describe 'asset_vanilla_es6', :type => :feature do |
4 | | - |
5 | 4 | it 'loads and runs the transpiled es6 from assets in js', :js => true do |
6 | 5 | visit asset_vanilla_es6_example_index_path |
7 | 6 | expect(page).to have_text "Asset vanilla ES6" |
|
12 | 11 | expect(page).to have_text "Fibonacci sequence: 0, 1," |
13 | 12 | expect(page.driver.error_messages).to eq [] |
14 | 13 | end |
| 14 | + |
| 15 | + it 'loads and runs the transpiled es6 from inline ERB in js', :js => true do |
| 16 | + visit inline_vanilla_es6_example_index_path |
| 17 | + expect(page).to have_text "Inline vanilla ES6 with ERB" |
| 18 | + expect(page.driver.console_messages.map {|m| m[:message]}).to include "Inline vanilla ES6 ready" |
| 19 | + expect(page).to have_text "Fibonacci sequence:" |
| 20 | + sleep 2.seconds |
| 21 | + expect(page).to have_text "Fibonacci sequence: 0, 1," |
| 22 | + expect(page.driver.error_messages).to eq [] |
| 23 | + end |
| 24 | + |
| 25 | + it 'loads and runs the transpiled es6 from a remote .es6 view template in js', :js => true do |
| 26 | + visit remote_vanilla_es6_example_index_path |
| 27 | + expect(page).to have_text "Remote vanilla ES6" |
| 28 | + click_link 'Execute remote.js.es6' |
| 29 | + sleep 2.seconds |
| 30 | + expect(page.driver.console_messages.map {|m| m[:message]}).to include "Remote vanilla ES6 ready" |
| 31 | + expect(page).to have_text "Fibonacci sequence:" |
| 32 | + sleep 2.seconds |
| 33 | + expect(page).to have_text "Fibonacci sequence: 0, 1," |
| 34 | + expect(page.driver.error_messages).to eq [] |
| 35 | + end |
15 | 36 | end |
0 commit comments