Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
张重言
rails
提交
0e54ed1f
R
rails
项目概览
张重言
/
rails
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
R
rails
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
未验证
提交
0e54ed1f
编写于
11月 22, 2019
作者:
R
Rafael Mendonça França
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Make the tests pass in versions of ruby that don't support sprockets 4
上级
c11581e3
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
226 addition
and
200 deletion
+226
-200
Gemfile.lock
Gemfile.lock
+196
-194
railties/test/application/assets_test.rb
railties/test/application/assets_test.rb
+30
-6
未找到文件。
Gemfile.lock
浏览文件 @
0e54ed1f
...
...
@@ -90,40 +90,41 @@ PATH
GEM
remote: https://rubygems.org/
specs:
activerecord-jdbc-adapter (
51.1
-java)
activerecord (~>
5.1
.0)
activerecord-jdbcmysql-adapter (
51.1
-java)
activerecord-jdbc-adapter (=
51.1
)
jdbc-mysql (~> 5.1.36)
activerecord-jdbcpostgresql-adapter (
51.1
-java)
activerecord-jdbc-adapter (=
51.1
)
activerecord-jdbc-adapter (
60.0
-java)
activerecord (~>
6.0
.0)
activerecord-jdbcmysql-adapter (
60.0
-java)
activerecord-jdbc-adapter (=
60.0
)
jdbc-mysql (~> 5.1.36
, < 9
)
activerecord-jdbcpostgresql-adapter (
60.0
-java)
activerecord-jdbc-adapter (=
60.0
)
jdbc-postgres (>= 9.4, < 43)
activerecord-jdbcsqlite3-adapter (
51.1
-java)
activerecord-jdbc-adapter (=
51.1
)
activerecord-jdbcsqlite3-adapter (
60.0
-java)
activerecord-jdbc-adapter (=
60.0
)
jdbc-sqlite3 (~> 3.8, < 3.30)
addressable (2.
5.2
)
public_suffix (>= 2.0.2, <
4
.0)
addressable (2.
7.0
)
public_suffix (>= 2.0.2, <
5
.0)
amq-protocol (2.3.0)
archive-zip (0.1
1
.0)
archive-zip (0.1
2
.0)
io-like (~> 0.3.0)
arel (9.0.0)
ast (2.4.0)
aws-eventstream (1.0.
0
)
aws-partitions (1.
88
.0)
aws-sdk-core (3.
21.2
)
aws-eventstream (~> 1.0)
aws-partitions (~> 1.0)
aws-sigv4 (~> 1.
0
)
aws-eventstream (1.0.
3
)
aws-partitions (1.
243
.0)
aws-sdk-core (3.
80.0
)
aws-eventstream (~> 1.0
, >= 1.0.2
)
aws-partitions (~> 1
, >= 1.239
.0)
aws-sigv4 (~> 1.
1
)
jmespath (~> 1.0)
aws-sdk-kms (1.5.0)
aws-sdk-core (~> 3)
aws-sigv4 (~> 1.
0
)
aws-sdk-s3 (1.
13
.0)
aws-sdk-core (~> 3, >= 3.
21.2
)
aws-sdk-kms (1.
2
5.0)
aws-sdk-core (~> 3
, >= 3.71.0
)
aws-sigv4 (~> 1.
1
)
aws-sdk-s3 (1.
57
.0)
aws-sdk-core (~> 3, >= 3.
77.0
)
aws-sdk-kms (~> 1)
aws-sigv4 (~> 1.0)
aws-sigv4 (1.0.2)
azure-core (0.1.14)
aws-sigv4 (~> 1.1)
aws-sigv4 (1.1.0)
aws-eventstream (~> 1.0, >= 1.0.2)
azure-core (0.1.15)
faraday (~> 0.9)
faraday_middleware (~> 0.10)
nokogiri (~> 1.6)
...
...
@@ -132,14 +133,12 @@ GEM
faraday (~> 0.9)
faraday_middleware (~> 0.10)
nokogiri (~> 1.6, >= 1.6.8)
backburner (1.
4.1
)
backburner (1.
5.0
)
beaneater (~> 1.0)
concurrent-ruby (~> 1.0.1)
concurrent-ruby (~> 1.0
, >= 1.0
.1)
dante (> 0.1.5)
bcrypt (3.1.12)
bcrypt (3.1.12-java)
bcrypt (3.1.12-x64-mingw32)
bcrypt (3.1.12-x86-mingw32)
bcrypt (3.1.13)
bcrypt (3.1.13-java)
beaneater (1.0.0)
benchmark-ips (2.7.2)
blade (0.7.1)
...
...
@@ -159,48 +158,47 @@ GEM
childprocess
faraday
selenium-webdriver
bootsnap (1.
3.0
)
bootsnap (1.
4.5
)
msgpack (~> 1.0)
bootsnap (1.
3.0
-java)
bootsnap (1.
4.5
-java)
msgpack (~> 1.0)
builder (3.2.3)
bunny (2.
9.2
)
amq-protocol (~> 2.3.0)
byebug (1
0.0.2
)
capybara (3.
1.1
)
bunny (2.
14.3
)
amq-protocol (~> 2.3
, >= 2.3
.0)
byebug (1
1.0.1
)
capybara (3.
29.0
)
addressable
mini_mime (>= 0.1.3)
nokogiri (~> 1.8)
rack (>= 1.6.0)
rack-test (>= 0.6.3)
xpath (~> 3.0
)
childprocess (0.9.0
)
ffi (~> 1.0, >= 1.0.11
)
chromedriver-helper (2.
0.0
)
regexp_parser (~> 1.5
)
xpath (~> 3.2
)
childprocess (3.0.0
)
chromedriver-helper (2.
1.1
)
archive-zip (~> 0.10)
nokogiri (~> 1.8)
coffee-rails (
4.2.2
)
coffee-rails (
5.0.0
)
coffee-script (>= 2.2.0)
railties (>=
4.0
.0)
railties (>=
5.2
.0)
coffee-script (2.4.1)
coffee-script-source
execjs
coffee-script-source (1.12.2)
concurrent-ruby (1.0.5)
concurrent-ruby (1.0.5-java)
concurrent-ruby (1.1.5)
connection_pool (2.2.2)
cookiejar (0.3.3)
crass (1.0.
4
)
crass (1.0.
5
)
curses (1.0.2)
daemons (1.
2.6
)
dalli (2.7.
8
)
daemons (1.
3.1
)
dalli (2.7.
10
)
dante (0.2.0)
declarative (0.0.10)
declarative-option (0.1.0)
delayed_job (4.1.
5
)
activesupport (>= 3.0, <
5.3
)
delayed_job_active_record (4.1.
3
)
activerecord (>= 3.0, <
5.3
)
delayed_job (4.1.
8
)
activesupport (>= 3.0, <
6.1
)
delayed_job_active_record (4.1.
4
)
activerecord (>= 3.0, <
6.1
)
delayed_job (>= 3.0, < 5)
digest-crc (0.4.1)
em-http-request (1.1.5)
...
...
@@ -211,15 +209,15 @@ GEM
http_parser.rb (>= 0.6.0)
em-socksify (0.3.2)
eventmachine (>= 1.0.0.beta.4)
erubi (1.
8
.0)
et-orbi (1.
1
.2)
erubi (1.
9
.0)
et-orbi (1.
2
.2)
tzinfo
event_emitter (0.2.6)
eventmachine (1.2.7)
execjs (2.7.0)
faraday (0.1
5.2
)
faraday (0.1
7.0
)
multipart-post (>= 1.2, < 3)
faraday_middleware (0.1
2.2
)
faraday_middleware (0.1
3.1
)
faraday (>= 0.7.4, < 1.0)
faye (1.2.4)
cookiejar (>= 0.3.0)
...
...
@@ -229,56 +227,60 @@ GEM
multi_json (>= 1.0.0)
rack (>= 1.0.0)
websocket-driver (>= 0.5.1)
faye-websocket (0.10.
7
)
faye-websocket (0.10.
9
)
eventmachine (>= 0.12.0)
websocket-driver (>= 0.5.1)
ffi (1.
9.23
)
ffi (1.
9.23
-java)
ffi (1.
9.23
-x64-mingw32)
ffi (1.
9.23
-x86-mingw32)
fugit (1.
1.1
)
et-orbi (~> 1.1, >= 1.1.
1
)
ffi (1.
11.2
)
ffi (1.
11.2
-java)
ffi (1.
11.2
-x64-mingw32)
ffi (1.
11.2
-x86-mingw32)
fugit (1.
3.3
)
et-orbi (~> 1.1, >= 1.1.
8
)
raabro (~> 1.1)
globalid (0.4.2)
activesupport (>= 4.2.0)
google-api-client (0.
19.8
)
google-api-client (0.
34.1
)
addressable (~> 2.5, >= 2.5.1)
googleauth (
>= 0.5, < 0.7.0
)
googleauth (
~> 0.9
)
httpclient (>= 2.8.1, < 3.0)
mi
me-types (~> 3
.0)
mi
ni_mime (~> 1
.0)
representable (~> 3.0)
retriable (>= 2.0, < 4.0)
google-cloud-core (1.2.0)
signet (~> 0.12)
google-cloud-core (1.4.1)
google-cloud-env (~> 1.0)
google-cloud-env (1.
0.1
)
google-cloud-env (1.
3.0
)
faraday (~> 0.11)
google-cloud-storage (1.12.0)
google-cloud-storage (1.24.0)
addressable (~> 2.5)
digest-crc (~> 0.4)
google-api-client (~> 0.
19.0
)
google-api-client (~> 0.
33
)
google-cloud-core (~> 1.2)
googleauth (~> 0.6.2)
googleauth (0.6.2)
googleauth (~> 0.9)
mini_mime (~> 1.0)
googleauth (0.10.0)
faraday (~> 0.12)
jwt (>= 1.4, < 3.0)
logging (~> 2.0)
memoist (~> 0.12)
memoist (~> 0.16)
multi_json (~> 1.11)
os (
~> 0.9
)
signet (~> 0.
7
)
hiredis (0.6.
1
)
hiredis (0.6.
1
-java)
os (
>= 0.9, < 2.0
)
signet (~> 0.
12
)
hiredis (0.6.
3
)
hiredis (0.6.
3
-java)
http_parser.rb (0.6.0)
httpclient (2.8.3)
i18n (1.
6
.0)
i18n (1.
7
.0)
concurrent-ruby (~> 1.0)
io-like (0.3.0)
jdbc-mysql (5.1.46)
jdbc-postgres (42.1.4)
jdbc-sqlite3 (3.20.1)
jaro_winkler (1.5.4)
jaro_winkler (1.5.4-java)
jdbc-mysql (5.1.47)
jdbc-postgres (42.2.6)
jdbc-sqlite3 (3.28.0)
jmespath (1.4.0)
json (2.
1
.0)
json (2.
1
.0-java)
jwt (2.
1.0
)
json (2.
2
.0)
json (2.
2
.0-java)
jwt (2.
2.1
)
kindlerb (1.2.0)
mustache
nokogiri
...
...
@@ -287,163 +289,163 @@ GEM
rb-fsevent (~> 0.9, >= 0.9.4)
rb-inotify (~> 0.9, >= 0.9.7)
ruby_dep (~> 1.2)
little-plugger (1.1.4)
logging (2.2.2)
little-plugger (~> 1.1)
multi_json (~> 1.10)
loofah (2.2.3)
loofah (2.3.1)
crass (~> 1.0.2)
nokogiri (>= 1.5.9)
mail (2.7.1)
mini_mime (>= 0.1.1)
marcel (0.3.3)
mimemagic (~> 0.3.2)
memoist (0.16.
0
)
memoist (0.16.
1
)
metaclass (0.0.4)
method_source (0.9.2)
mime-types (3.1)
mime-types-data (~> 3.2015)
mime-types-data (3.2016.0521)
mimemagic (0.3.3)
mini_magick (4.
8.0
)
mini_mime (1.0.
0
)
mini_magick (4.
9.5
)
mini_mime (1.0.
2
)
mini_portile2 (2.4.0)
minitest (5.1
1.3
)
minitest-bisect (1.
4.0
)
minitest (5.1
3.0
)
minitest-bisect (1.
5.1
)
minitest-server (~> 1.0)
path_expander (~> 1.
0
)
path_expander (~> 1.
1
)
minitest-server (1.0.5)
minitest (~> 5.0)
mocha (1.
5
.0)
mocha (1.
9
.0)
metaclass (~> 0.0.1)
mono_logger (1.1.0)
msgpack (1.2.4)
msgpack (1.2.4-java)
msgpack (1.2.4-x64-mingw32)
msgpack (1.2.4-x86-mingw32)
multi_json (1.13.1)
multipart-post (2.0.0)
mustache (1.0.5)
mustermann (1.0.2)
mysql2 (0.5.1)
mysql2 (0.5.1-x64-mingw32)
mysql2 (0.5.1-x86-mingw32)
nio4r (2.3.1)
nokogiri (1.9.1)
msgpack (1.3.1)
msgpack (1.3.1-java)
msgpack (1.3.1-x64-mingw32)
msgpack (1.3.1-x86-mingw32)
multi_json (1.14.1)
multipart-post (2.1.1)
mustache (1.1.0)
mustermann (1.0.3)
mysql2 (0.4.10)
mysql2 (0.4.10-x64-mingw32)
mysql2 (0.4.10-x86-mingw32)
nio4r (2.5.2)
nio4r (2.5.2-java)
nokogiri (1.10.5)
mini_portile2 (~> 2.4.0)
nokogiri (1.
9.1
-java)
nokogiri (1.
9.1
-x64-mingw32)
nokogiri (1.
10.5
-java)
nokogiri (1.
10.5
-x64-mingw32)
mini_portile2 (~> 2.4.0)
nokogiri (1.
9.1
-x86-mingw32)
nokogiri (1.
10.5
-x86-mingw32)
mini_portile2 (~> 2.4.0)
os (
0.9.6
)
parallel (1.1
2
.1)
parser (2.
5.1
.0)
os (
1.0.1
)
parallel (1.1
9
.1)
parser (2.
6.5
.0)
ast (~> 2.4.0)
path_expander (1.0.3)
pg (1.0.0)
pg (1.0.0-x64-mingw32)
pg (1.0.0-x86-mingw32)
powerpack (0.1.1)
path_expander (1.1.0)
pg (1.1.4)
pg (1.1.4-x64-mingw32)
pg (1.1.4-x86-mingw32)
psych (2.2.4)
public_suffix (3.0.2)
puma (3.12.1)
puma (3.12.1-java)
public_suffix (4.0.1)
puma (4.3.0)
nio4r (~> 2.0)
puma (4.3.0-java)
nio4r (~> 2.0)
que (0.14.3)
qunit-selenium (0.0.4)
selenium-webdriver
thor
raabro (1.1.
5
)
raabro (1.1.
6
)
racc (1.4.15)
rack (2.0.
5
)
rack-cache (1.
7.2
)
rack (2.0.
7
)
rack-cache (1.
10.0
)
rack (>= 0.4)
rack-protection (2.0.
1
)
rack-protection (2.0.
7
)
rack
rack-test (1.
0
.0)
rack-test (1.
1
.0)
rack (>= 1.0, < 3)
rails-dom-testing (2.0.3)
activesupport (>= 4.2.0)
nokogiri (>= 1.6)
rails-html-sanitizer (1.
0.4
)
loofah (~> 2.
2, >= 2.2.2
)
rails-html-sanitizer (1.
3.0
)
loofah (~> 2.
3
)
rainbow (3.0.0)
rake (1
2.3
.1)
rake (1
3.0
.1)
rb-fsevent (0.10.3)
rdoc (6.
0.4
)
rdoc (6.
2.0
)
redcarpet (3.2.3)
redis (4.1.
2
)
redis (4.1.
3
)
redis-namespace (1.6.0)
redis (>= 3.0.4)
regexp_parser (1.6.0)
representable (3.0.4)
declarative (< 0.1.0)
declarative-option (< 0.2.0)
uber (< 0.2.0)
resque (
1.27.4
)
resque (
2.0.0
)
mono_logger (~> 1.0)
multi_json (~> 1.0)
redis-namespace (~> 1.
3
)
redis-namespace (~> 1.
6
)
sinatra (>= 0.9.2)
vegas (~> 0.1.2)
resque-scheduler (4.
3.1
)
resque-scheduler (4.
4.0
)
mono_logger (~> 1.0)
redis (>= 3.3
, < 5
)
resque (
~>
1.26)
redis (>= 3.3)
resque (
>=
1.26)
rufus-scheduler (~> 3.2)
retriable (3.1.1)
rubocop (0.56.0)
retriable (3.1.2)
rubocop (0.76.0)
jaro_winkler (~> 1.5.1)
parallel (~> 1.10)
parser (>= 2.5)
powerpack (~> 0.1)
parser (>= 2.6)
rainbow (>= 2.2.2, < 4.0)
ruby-progressbar (~> 1.7)
unicode-display_width (
~> 1.0, >= 1.0.1
)
ruby-progressbar (1.
9.0
)
unicode-display_width (
>= 1.4.0, < 1.7
)
ruby-progressbar (1.
10.1
)
ruby_dep (1.5.0)
rubyzip (1.2.1)
rufus-scheduler (3.5.0)
fugit (~> 1.1, >= 1.1.1)
sass (3.5.6)
sass-listen (~> 4.0.0)
sass-listen (4.0.0)
rb-fsevent (~> 0.9, >= 0.9.4)
rb-inotify (~> 0.9, >= 0.9.7)
sass-rails (5.0.7)
railties (>= 4.0.0, < 6)
sass (~> 3.1)
sprockets (>= 2.8, < 4.0)
sprockets-rails (>= 2.0, < 4.0)
tilt (>= 1.1, < 3)
rubyzip (2.0.0)
rufus-scheduler (3.6.0)
fugit (~> 1.1, >= 1.1.6)
sass-rails (6.0.0)
sassc-rails (~> 2.1, >= 2.1.1)
sassc (2.2.1)
ffi (~> 1.9)
sassc (2.2.1-x64-mingw32)
ffi (~> 1.9)
sassc (2.2.1-x86-mingw32)
ffi (~> 1.9)
sassc-rails (2.1.2)
railties (>= 4.0.0)
sassc (>= 2.0)
sprockets (> 3.0)
sprockets-rails
tilt
sdoc (1.0.0)
rdoc (>= 5.0)
selenium-webdriver (3.1
2.0
)
childprocess (
~> 0.5
)
rubyzip (
~> 1
.2)
sequel (5.
8
.0)
serverengine (2.0.
6
)
selenium-webdriver (3.1
42.6
)
childprocess (
>= 0.5, < 4.0
)
rubyzip (
>= 1.2
.2)
sequel (5.
26
.0)
serverengine (2.0.
7
)
sigdump (~> 0.2.2)
sidekiq (6.0.
0
)
sidekiq (6.0.
3
)
connection_pool (>= 2.2.2)
rack (>= 2.0.0)
rack-protection (>= 2.0.0)
redis (>= 4.1.0)
sigdump (0.2.4)
signet (0.
8.1
)
signet (0.
12.0
)
addressable (~> 2.3)
faraday (~> 0.9)
jwt (>= 1.5, < 3.0)
multi_json (~> 1.10)
sinatra (2.0.
1
)
sinatra (2.0.
7
)
mustermann (~> 1.0)
rack (~> 2.0)
rack-protection (= 2.0.
1
)
rack-protection (= 2.0.
7
)
tilt (~> 2.0)
sneakers (2.
7
.0)
bunny (~> 2.
9.
2)
sneakers (2.
11
.0)
bunny (~> 2.
1
2)
concurrent-ruby (~> 1.0)
rake
serverengine (~> 2.0.5)
thor
sprockets (
3.7.1
)
sprockets (
4.0.0
)
concurrent-ruby (~> 1.0)
rack (> 1, < 3)
sprockets-export (1.0.0)
...
...
@@ -451,43 +453,43 @@ GEM
actionpack (>= 4.0)
activesupport (>= 4.0)
sprockets (>= 3.0.0)
sqlite3 (1.3.13)
sqlite3 (1.3.13-x64-mingw32)
sqlite3 (1.3.13-x86-mingw32)
stackprof (0.2.11)
sucker_punch (2.0.4)
concurrent-ruby (~> 1.0.0)
sqlite3 (1.4.1)
stackprof (0.2.13)
sucker_punch (2.1.2)
concurrent-ruby (~> 1.0)
thin (1.7.2)
daemons (~> 1.0, >= 1.0.9)
eventmachine (~> 1.0, >= 1.0.4)
rack (>= 1, < 3)
thor (0.20.
0
)
thor (0.20.
3
)
thread_safe (0.3.6)
thread_safe (0.3.6-java)
tilt (2.0.
8
)
turbolinks (5.
1
.1)
turbolinks-source (~> 5.
1
)
turbolinks-source (5.
1
.0)
tilt (2.0.
10
)
turbolinks (5.
2
.1)
turbolinks-source (~> 5.
2
)
turbolinks-source (5.
2
.0)
tzinfo (1.2.5)
thread_safe (~> 0.1)
tzinfo-data (1.201
8.5
)
tzinfo-data (1.201
9.3
)
tzinfo (>= 1.0.0)
uber (0.1.0)
uglifier (4.
1.1
0)
uglifier (4.
2.
0)
execjs (>= 0.3.0, < 3)
unicode-display_width (1.
3.3
)
unicode-display_width (1.
6.0
)
useragent (0.16.10)
vegas (0.1.11)
rack (>= 1.0.0)
w3c_validators (1.3.
3
)
w3c_validators (1.3.
4
)
json (>= 1.8)
nokogiri (~> 1.6)
wdm (0.1.1)
websocket (1.2.8)
websocket-driver (0.7.0)
websocket-driver (0.7.1)
websocket-extensions (>= 0.1.0)
websocket-driver (0.7.1-java)
websocket-extensions (>= 0.1.0)
websocket-extensions (0.1.
3
)
xpath (3.
1
.0)
websocket-extensions (0.1.
4
)
xpath (3.
2
.0)
nokogiri (~> 1.8)
PLATFORMS
...
...
@@ -561,4 +563,4 @@ DEPENDENCIES
websocket-client-simple!
BUNDLED WITH
1.17.
2
1.17.
3
railties/test/application/assets_test.rb
浏览文件 @
0e54ed1f
...
...
@@ -131,7 +131,7 @@ class User < ActiveRecord::Base; raise 'should not be reached'; end
app_file
"app/assets/javascripts/something.else.js.erb"
,
"alert();"
app_file
"app/assets/stylesheets/something.else.css.erb"
,
"body{}"
app_file
"app/assets/config/manifest.js"
,
<<
~
JS
app_file
"app/assets/config/manifest.js"
,
<<
-
JS
.
strip_heredoc
//= link_tree ../images
//= link_directory ../stylesheets .css
//= link_directory ../javascripts .js
...
...
@@ -176,7 +176,11 @@ class User < ActiveRecord::Base; raise 'should not be reached'; end
precompile!
assert_file_exists
(
"
#{
app_path
}
/public/assets/something-*.js"
)
if
sprockets_4?
assert_file_exists
(
"
#{
app_path
}
/public/assets/something-*.js"
)
else
assert_file_exists
(
"
#{
app_path
}
/public/assets/something/index-*.js"
)
end
end
test
"precompile use assets defined in app env config"
do
...
...
@@ -251,14 +255,22 @@ class User < ActiveRecord::Base; raise 'should not be reached'; end
end
test
"the manifest file should be saved by default in the same assets folder"
do
app_file
"app/assets/stylesheets/test.css"
,
"a{color: red}"
if
sprockets_4?
app_file
"app/assets/stylesheets/test.css"
,
"a{color: red}"
else
app_file
"app/assets/javascripts/application.js"
,
"alert();"
end
add_to_config
"config.assets.prefix = '/x'"
precompile!
manifest
=
Dir
[
"
#{
app_path
}
/public/x/.sprockets-manifest-*.json"
].
first
assets
=
ActiveSupport
::
JSON
.
decode
(
File
.
read
(
manifest
))
assert_match
(
/test-([0-z]+)\.css/
,
assets
[
"assets"
][
"test.css"
])
if
sprockets_4?
assert_match
(
/test-([0-z]+)\.css/
,
assets
[
"assets"
][
"test.css"
])
else
assert_match
(
/application-([0-z]+)\.js/
,
assets
[
"assets"
][
"application.js"
])
end
end
test
"assets do not require any assets group gem when manifest file is present"
do
...
...
@@ -486,9 +498,17 @@ class ::PostsController < ActionController::Base ; end
class
::
PostsController
<
ActionController
::
Base
;
end
get
"/posts"
,
{},
{
"HTTPS"
=>
"off"
}
assert_match
(
'src="http://example.com/assets/application.debug.js'
,
last_response
.
body
)
if
sprockets_4?
assert_match
(
'src="http://example.com/assets/application.debug.js'
,
last_response
.
body
)
else
assert_match
(
'src="http://example.com/assets/application.self.js'
,
last_response
.
body
)
end
get
"/posts"
,
{},
{
"HTTPS"
=>
"on"
}
assert_match
(
'src="https://example.com/assets/application.debug.js'
,
last_response
.
body
)
if
sprockets_4?
assert_match
(
'src="https://example.com/assets/application.debug.js'
,
last_response
.
body
)
else
assert_match
(
'src="https://example.com/assets/application.self.js'
,
last_response
.
body
)
end
end
test
"asset urls should be protocol-relative if no request is in scope"
do
...
...
@@ -517,6 +537,10 @@ class ::PostsController < ActionController::Base; end
private
def
sprockets_4?
Sprockets
::
VERSION
>=
"4.0.0"
end
def
app_with_assets_in_view
app_file
"app/assets/javascripts/application.js"
,
"//= require_tree ."
app_file
"app/assets/javascripts/xmlhr.js"
,
"function f1() { alert(); }"
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录