Skip to content

Commit bc4722c

Browse files
committed
adds inline_vanilla_es6 and remote_vanilla_es6 specs
1 parent 0e07075 commit bc4722c

File tree

1 file changed

+22
-1
lines changed

1 file changed

+22
-1
lines changed

spec/asset_vanilla_es6_spec.rb

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
require 'rails_helper'
22

33
describe 'asset_vanilla_es6', :type => :feature do
4-
54
it 'loads and runs the transpiled es6 from assets in js', :js => true do
65
visit asset_vanilla_es6_example_index_path
76
expect(page).to have_text "Asset vanilla ES6"
@@ -12,4 +11,26 @@
1211
expect(page).to have_text "Fibonacci sequence: 0, 1,"
1312
expect(page.driver.error_messages).to eq []
1413
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
1536
end

0 commit comments

Comments
 (0)