Skip to content

Commit 0256880

Browse files
committed
Add UJS tests
1 parent ad3a477 commit 0256880

22 files changed

+5280
-0
lines changed

actionview/RUNNING_UJS_TESTS.rdoc

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
== Running UJS tests
2+
3+
Ensure that you can build the project and run tests.
4+
Run rake ujs:server first, and then run the web tests by
5+
visiting http://localhost:4567 in your browser.
6+
7+
rake test:server

actionview/Rakefile

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,13 @@ namespace :test do
4646
end
4747
end
4848

49+
namespace :ujs do
50+
desc "Starts the test server"
51+
task :server do
52+
system 'bundle exec rackup test/ujs/config.ru -p 4567 -s puma'
53+
end
54+
end
55+
4956
task :lines do
5057
load File.expand_path("..", File.dirname(__FILE__)) + "/tools/line_statistics"
5158
files = FileList["lib/**/*.rb"]

actionview/test/ujs/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/log

actionview/test/ujs/config.ru

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
$LOAD_PATH.unshift File.expand_path('..', __FILE__)
2+
require 'server'
3+
run UJS::Server
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
env:
2+
browser: true
3+
extends: eslint:recommended
4+
rules:
5+
no-undef: off
6+
no-unused-vars: off
7+
indent: off
8+
linebreak-style: ['error', 'unix']
9+
quotes: ['error', 'single']
10+
semi: ['error', 'never']
11+
no-shadow: ['error'] # Prevent potential errors
12+
no-console: 'off'
13+
# styles
14+
space-before-function-paren: ['error', 'never']
15+
space-before-blocks: 'error'
16+
brace-style: ['error', '1tbs', { allowSingleLine: true }]
17+
key-spacing: 'error'
18+
array-bracket-spacing: 'error'
19+
comma-spacing: 'error'
20+
comma-dangle: 'off'
21+
eol-last: 'error'

0 commit comments

Comments
 (0)