|
9 | 9 | end |
10 | 10 |
|
11 | 11 | context 'when single css_path is specified' do |
12 | | - let(:config_file) { |
13 | | - <<~CONFIG |
14 | | - defaults: &defaults |
15 | | - base_url: http://0.0.0.0:9292 |
16 | | - css_path: /test.css |
17 | | - routes: |
18 | | - - / |
19 | | -
|
20 | | - development: |
21 | | - <<: *defaults |
22 | | -
|
23 | | - test: |
24 | | - <<: *defaults |
25 | | - CONFIG |
26 | | - } |
| 12 | + let(:config_file) { file_fixture('config/single-css-path.yml').read } |
27 | 13 |
|
28 | 14 | it 'sets css_path with the path' do |
29 | 15 | expect(subject.config['css_path']).to eq '/app/spec/internal/public/test.css' |
|
35 | 21 | end |
36 | 22 |
|
37 | 23 | context 'when multiple css_paths are specified' do |
38 | | - let(:config_file) { |
39 | | - <<~CONFIG |
40 | | - defaults: &defaults |
41 | | - base_url: http://0.0.0.0:9292 |
42 | | - css_paths: |
43 | | - - /test.css |
44 | | - - /test2.css |
45 | | - routes: |
46 | | - - / |
47 | | - - /new_route |
48 | | -
|
49 | | - development: |
50 | | - <<: *defaults |
51 | | -
|
52 | | - test: |
53 | | - <<: *defaults |
54 | | - CONFIG |
55 | | - } |
| 24 | + let(:config_file) { file_fixture('config/mutliple-css-paths.yml').read } |
56 | 25 |
|
57 | 26 | it 'sets css_path to empty string' do |
58 | 27 | expect(subject.config['css_path']).to eq '' |
|
64 | 33 | end |
65 | 34 |
|
66 | 35 | context 'when no paths are specified' do |
67 | | - let(:config_file) { |
68 | | - <<~CONFIG |
69 | | - defaults: &defaults |
70 | | - base_url: http://0.0.0.0:9292 |
71 | | - manifest_name: application |
72 | | - routes: |
73 | | - - / |
74 | | -
|
75 | | - development: |
76 | | - <<: *defaults |
77 | | -
|
78 | | - test: |
79 | | - <<: *defaults |
80 | | - CONFIG |
81 | | - } |
| 36 | + let(:config_file) { file_fixture('config/no-paths-specified.yml').read } |
82 | 37 |
|
83 | 38 | it 'sets css_path with the path' do |
84 | 39 | expect(subject.config['css_path']).to eq '/stylesheets/application.css' |
|
90 | 45 | end |
91 | 46 |
|
92 | 47 | context 'when single css_path and multiple css_paths are both specified' do |
93 | | - let(:config_file) { |
94 | | - <<~CONFIG |
95 | | - defaults: &defaults |
96 | | - base_url: http://0.0.0.0:9292 |
97 | | - css_path: /test.css |
98 | | - css_paths: |
99 | | - - /test.css |
100 | | - - /test2.css |
101 | | - routes: |
102 | | - - / |
103 | | - - /new_route |
104 | | -
|
105 | | - development: |
106 | | - <<: *defaults |
107 | | -
|
108 | | - test: |
109 | | - <<: *defaults |
110 | | - CONFIG |
111 | | - } |
| 48 | + let(:config_file) { file_fixture('config/paths-both-specified.yml').read } |
112 | 49 |
|
113 | 50 | it 'raises an error' do |
114 | 51 | expect { subject }.to raise_error LoadError, 'Cannot specify both css_path and css_paths' |
115 | 52 | end |
116 | 53 | end |
117 | 54 |
|
118 | 55 | context 'when css_paths and routes are not the same length' do |
119 | | - let(:config_file) { |
120 | | - <<~CONFIG |
121 | | - defaults: &defaults |
122 | | - base_url: http://0.0.0.0:9292 |
123 | | - css_paths: |
124 | | - - /test.css |
125 | | - - /test2.css |
126 | | - routes: |
127 | | - - / |
128 | | - - /new_route |
129 | | - - /newer_route |
130 | | -
|
131 | | - development: |
132 | | - <<: *defaults |
133 | | -
|
134 | | - test: |
135 | | - <<: *defaults |
136 | | - CONFIG |
137 | | - } |
| 56 | + let(:config_file) { file_fixture('config/paths-and-routes-not-same-length.yml').read } |
138 | 57 |
|
139 | 58 | it 'raises an error' do |
140 | 59 | expect { subject }.to raise_error LoadError, 'Must specify css_paths for each route' |
|
0 commit comments