|
7 | 7 | before(:each) do |
8 | 8 | HighVoltage.configure do |config| |
9 | 9 | ActiveSupport::Deprecation.silence do |
10 | | - config.action_caching = config_value |
11 | | - config.action_caching_layout = config_value |
12 | 10 | config.content_path = config_value |
13 | 11 | config.layout = config_value |
14 | | - config.page_caching = config_value |
15 | 12 | config.parent_engine = config_value |
16 | 13 | config.route_drawer = config_value |
17 | 14 | config.routes = config_value |
|
25 | 22 | end |
26 | 23 | end |
27 | 24 |
|
28 | | - it { expect(HighVoltage.action_caching).to eq config_value } |
29 | | - it { expect(HighVoltage.action_caching_layout).to eq config_value } |
30 | 25 | it { expect(HighVoltage.content_path).to eq config_value } |
31 | 26 | it { expect(HighVoltage.layout).to eq config_value } |
32 | | - it { expect(HighVoltage.page_caching).to eq config_value } |
33 | 27 | it { expect(HighVoltage.parent_engine).to eq config_value } |
34 | 28 | it { expect(HighVoltage.route_drawer).to eq config_value } |
35 | 29 | it { expect(HighVoltage.routes).to eq config_value } |
36 | 30 | end |
37 | | - |
38 | | - describe "#action_caching" do |
39 | | - context "action caching is enabled" do |
40 | | - it 'displays a deprecation warning' do |
41 | | - allow(ActiveSupport::Deprecation).to receive(:warn) |
42 | | - |
43 | | - HighVoltage.configure do |config| |
44 | | - config.action_caching = true |
45 | | - end |
46 | | - |
47 | | - expect(ActiveSupport::Deprecation).to have_received(:warn) |
48 | | - .with(HighVoltage::Configuration::CACHING_DEPRECATION_WARNING) |
49 | | - end |
50 | | - end |
51 | | - |
52 | | - context "action caching is disabled" do |
53 | | - it 'does not display a deprecation warning' do |
54 | | - allow(ActiveSupport::Deprecation).to receive(:warn) |
55 | | - |
56 | | - HighVoltage.configure do |config| |
57 | | - config.action_caching = false |
58 | | - end |
59 | | - |
60 | | - expect(ActiveSupport::Deprecation).not_to have_received(:warn) |
61 | | - .with(HighVoltage::Configuration::CACHING_DEPRECATION_WARNING) |
62 | | - end |
63 | | - end |
64 | | - end |
65 | | - |
66 | | - describe "#action_caching_layout" do |
67 | | - context "action caching layout is enabled" do |
68 | | - it 'displays a deprecation warning' do |
69 | | - allow(ActiveSupport::Deprecation).to receive(:warn) |
70 | | - |
71 | | - HighVoltage.configure do |config| |
72 | | - config.action_caching_layout = true |
73 | | - end |
74 | | - |
75 | | - expect(ActiveSupport::Deprecation).to have_received(:warn) |
76 | | - .with(HighVoltage::Configuration::CACHING_DEPRECATION_WARNING) |
77 | | - end |
78 | | - end |
79 | | - |
80 | | - context "action caching layout is disabled" do |
81 | | - it "does not display a deprecation warning" do |
82 | | - allow(ActiveSupport::Deprecation).to receive(:warn) |
83 | | - |
84 | | - HighVoltage.configure do |config| |
85 | | - config.action_caching_layout = false |
86 | | - end |
87 | | - |
88 | | - expect(ActiveSupport::Deprecation).not_to have_received(:warn) |
89 | | - .with(HighVoltage::Configuration::CACHING_DEPRECATION_WARNING) |
90 | | - end |
91 | | - end |
92 | | - end |
93 | | - |
94 | | - describe "#page_caching" do |
95 | | - context "page caching is enabled" do |
96 | | - it "displays a deprecation warning" do |
97 | | - allow(ActiveSupport::Deprecation).to receive(:warn) |
98 | | - |
99 | | - HighVoltage.configure do |config| |
100 | | - config.page_caching = true |
101 | | - end |
102 | | - |
103 | | - expect(ActiveSupport::Deprecation).to have_received(:warn) |
104 | | - .with(HighVoltage::Configuration::CACHING_DEPRECATION_WARNING) |
105 | | - end |
106 | | - end |
107 | | - |
108 | | - context "page caching is disbled" do |
109 | | - it "does not display a deprecation warning" do |
110 | | - allow(ActiveSupport::Deprecation).to receive(:warn) |
111 | | - |
112 | | - HighVoltage.configure do |config| |
113 | | - config.page_caching = false |
114 | | - end |
115 | | - |
116 | | - expect(ActiveSupport::Deprecation).not_to have_received(:warn) |
117 | | - .with(HighVoltage::Configuration::CACHING_DEPRECATION_WARNING) |
118 | | - end |
119 | | - end |
120 | | - end |
121 | | - |
122 | | - describe '#set_default_configuration' do |
123 | | - it 'defaults caching without a deprecation warning' do |
124 | | - allow(ActiveSupport::Deprecation).to receive(:warn) |
125 | | - |
126 | | - Class.new do |
127 | | - extend HighVoltage::Configuration |
128 | | - end |
129 | | - |
130 | | - expect(ActiveSupport::Deprecation).not_to have_received(:warn) |
131 | | - end |
132 | | - end |
133 | 31 | end |
0 commit comments