js-routes 2.2.4 → 2.2.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -2,6 +2,8 @@
2
2
  # because it cause unrevertable changes to runtime
3
3
  # what is why I added "zzz_last" in the beginning
4
4
 
5
+ require "sprockets"
6
+ require "sprockets/railtie"
5
7
  require 'spec_helper'
6
8
  require "fileutils"
7
9
 
@@ -12,6 +14,10 @@ describe "after Rails initialization", :slow do
12
14
  Sprockets::VERSION.to_i >= 3
13
15
  end
14
16
 
17
+ def sprockets_v4?
18
+ Sprockets::VERSION.to_i >= 4
19
+ end
20
+
15
21
  def sprockets_context(environment, name, filename)
16
22
  if sprockets_v3?
17
23
  Sprockets::Context.new(environment: environment, name: name, filename: filename.to_s, metadata: {})
@@ -35,6 +41,7 @@ describe "after Rails initialization", :slow do
35
41
  end
36
42
 
37
43
  before(:all) do
44
+ JsRoutes::Engine.install_sprockets!
38
45
  Rails.configuration.eager_load = false
39
46
  Rails.application.initialize!
40
47
  end
@@ -73,7 +80,7 @@ describe "after Rails initialization", :slow do
73
80
  context "the preprocessor" do
74
81
  before(:each) do
75
82
  path = Rails.root.join('config','routes.rb').to_s
76
- if sprockets_v3?
83
+ if sprockets_v3? || sprockets_v4?
77
84
  expect_any_instance_of(Sprockets::Context).to receive(:depend_on).with(path)
78
85
  else
79
86
  expect(ctx).to receive(:depend_on).with(path)
@@ -86,7 +93,6 @@ describe "after Rails initialization", :slow do
86
93
  end
87
94
 
88
95
  context "when dealing with js-routes.js" do
89
-
90
96
  context "with Rails" do
91
97
  context "and initialize on precompile" do
92
98
  before(:each) do
data/spec/spec_helper.rb CHANGED
@@ -7,7 +7,7 @@ require 'rails/all'
7
7
  require 'js-routes'
8
8
  require 'active_support/core_ext/hash/slice'
9
9
 
10
- unless ENV['TRAVIS_CI']
10
+ unless ENV['CI']
11
11
  code = system("yarn build")
12
12
  unless code
13
13
  exit(1)
@@ -94,10 +94,6 @@ end
94
94
 
95
95
 
96
96
  class ::App < Rails::Application
97
- # Enable the asset pipeline
98
- config.assets.enabled = true
99
- # initialize_on_precompile
100
- config.assets.initialize_on_precompile = true
101
97
  config.paths['config/routes.rb'] << 'spec/config/routes.rb'
102
98
  config.root = File.expand_path('../dummy', __FILE__)
103
99
  end