|
47 | 47 | COFFEE_SPEC_PATH = "spec/coffeescripts/calendar/CalendarSpec.coffee" |
48 | 48 |
|
49 | 49 | APP_JSX_PATH = "app/jsx/dashboard_card/DashboardCardAction.jsx" |
50 | | - JSX_SPEC_PATH = "spec/coffeescripts/jsx/dashboard_card/DashboardCardActionSpec.coffee" |
| 50 | + JSX_SPEC_PATH = "spec/javascripts/jsx/dashboard_card/DashboardCardActionSpec.coffee" |
51 | 51 |
|
52 | 52 | APP_RB_PATH = "app/controllers/accounts_controller.rb" |
53 | 53 | APP_RB_SPEC_PATH = "spec/controllers/accounts_controller_spec.rb" |
54 | 54 | LIB_RB_PATH = "lib/reporting/counts_report.rb" |
55 | 55 | LIB_RB_SPEC_PATH = "spec/lib/reporting/counts_report_spec.rb" |
56 | 56 |
|
57 | 57 | APP_ERB_PATH = "app/views/announcements/index.html.erb" |
58 | | - PUBLIC_HTML_PATH = "public/partials/_license_help.html" |
59 | | - PUBLIC_JS_PATH = "public/javascripts/account_settings.js" |
| 58 | + PUBLIC_JS_PATH = "public/javascripts/eportfolios/eportfolio_section.js" |
| 59 | + PUBLIC_JS_SPEC_PATH = "spec/javascripts/jsx/eportfolios/eportfolioSectionSpec.jsx" |
| 60 | + |
60 | 61 | PUBLIC_BOWER_JS_PATH = "public/javascripts/bower/axios/dist/axios.amd.js" |
61 | 62 | PUBLIC_ME_JS_PATH = "public/javascripts/mediaelement/mep-feature-speed-instructure.js" |
62 | 63 | PUBLIC_VENDOR_JS_PATH = "public/javascripts/vendor/bootstrap/bootstrap-dropdown.js" |
|
79 | 80 | :ensure_coffee_specs |
80 | 81 | end |
81 | 82 | end |
| 83 | + end |
82 | 84 |
|
83 | | - context "js changes" do |
84 | | - include_examples "change combos", |
85 | | - PUBLIC_JS_PATH, |
86 | | - COFFEE_SPEC_PATH, |
87 | | - :ensure_coffee_specs |
| 85 | + describe "#ensure_public_js_specs" do |
| 86 | + include_examples "change combos", |
| 87 | + PUBLIC_JS_PATH, |
| 88 | + PUBLIC_JS_SPEC_PATH, |
| 89 | + :ensure_public_js_specs |
88 | 90 |
|
89 | | - context "in excluded public sub dirs" do |
90 | | - context "bower" do |
91 | | - include_examples "does not yield", |
92 | | - [{ path: PUBLIC_BOWER_JS_PATH, deleted?: false }], |
93 | | - :ensure_coffee_specs |
94 | | - end |
95 | | - context "mediaelement" do |
96 | | - include_examples "does not yield", |
97 | | - [{ path: PUBLIC_ME_JS_PATH, deleted?: false }], |
98 | | - :ensure_coffee_specs |
99 | | - end |
100 | | - context "vendor" do |
101 | | - include_examples "does not yield", |
102 | | - [{ path: PUBLIC_VENDOR_JS_PATH, deleted?: false }], |
103 | | - :ensure_coffee_specs |
104 | | - end |
| 91 | + context "in excluded public sub dirs" do |
| 92 | + context "bower" do |
| 93 | + include_examples "does not yield", |
| 94 | + [{ path: PUBLIC_BOWER_JS_PATH, deleted?: false }], |
| 95 | + :ensure_public_js_specs |
| 96 | + end |
| 97 | + context "mediaelement" do |
| 98 | + include_examples "does not yield", |
| 99 | + [{ path: PUBLIC_ME_JS_PATH, deleted?: false }], |
| 100 | + :ensure_public_js_specs |
| 101 | + end |
| 102 | + context "vendor" do |
| 103 | + include_examples "does not yield", |
| 104 | + [{ path: PUBLIC_VENDOR_JS_PATH, deleted?: false }], |
| 105 | + :ensure_public_js_specs |
105 | 106 | end |
106 | 107 | end |
107 | 108 | end |
|
131 | 132 |
|
132 | 133 | describe "#ensure_no_unnecessary_selenium_specs" do |
133 | 134 | context "has selenium specs" do |
| 135 | + context "needs public js specs" do |
| 136 | + context "has no public js specs" do |
| 137 | + include_examples "yields", |
| 138 | + [{ path: SELENIUM_SPEC_PATH, deleted?: false }, |
| 139 | + { path: PUBLIC_JS_PATH, deleted?: false }], |
| 140 | + :ensure_no_unnecessary_selenium_specs |
| 141 | + end |
| 142 | + |
| 143 | + context "has public js specs" do |
| 144 | + include_examples "does not yield", |
| 145 | + [{ path: SELENIUM_SPEC_PATH, deleted?: false }, |
| 146 | + { path: PUBLIC_JS_PATH, deleted?: false }, |
| 147 | + { path: PUBLIC_JS_SPEC_PATH, deleted?: false }], |
| 148 | + :ensure_no_unnecessary_selenium_specs |
| 149 | + end |
| 150 | + end |
| 151 | + |
134 | 152 | context "needs coffee specs" do |
135 | 153 | context "has no coffee specs" do |
136 | 154 | include_examples "yields", |
|
192 | 210 |
|
193 | 211 | describe "#ban_new_erb" do |
194 | 212 | context "erb additions exist" do |
195 | | - let(:changes) { [double(path: "yarg.erb", added?: true)] } |
| 213 | + let(:changes) { [double(path: APP_ERB_PATH, added?: true)] } |
196 | 214 |
|
197 | 215 | it "yields" do |
198 | 216 | expect { |b| subject.ban_new_erb(&b) }.to yield_with_no_args |
199 | 217 | end |
200 | 218 | end |
201 | 219 |
|
202 | 220 | context "erb non additions exist" do |
203 | | - let(:changes) { [double(path: "yarg.erb", added?: false)] } |
| 221 | + let(:changes) { [double(path: APP_ERB_PATH, added?: false)] } |
204 | 222 |
|
205 | 223 | it "does not yield" do |
206 | 224 | expect { |b| subject.ban_new_erb(&b) }.not_to yield_with_no_args |
207 | 225 | end |
208 | 226 | end |
209 | 227 |
|
210 | 228 | context "no erb changes exist" do |
211 | | - let(:changes) { [double(path: "yarg.js", added?: true)] } |
| 229 | + let(:changes) { [double(path: PUBLIC_VENDOR_JS_PATH, added?: true)] } |
212 | 230 |
|
213 | 231 | it "does not yield" do |
214 | 232 | expect { |b| subject.ban_new_erb(&b) }.not_to yield_with_no_args |
|
0 commit comments