Replace static fixture by generated one in issue_spec.js ## What does this MR do? - clean up `issue_spec.js` - introduce an alternative approach to #19445 - rename `rake teaspoon` to `rake teaspoon:tests` - introduce `rake teaspoon:fixtures` which generates fixtures using RSpec - introduce `rake teaspoon` which runs `rake teaspoon:fixtures` and `rake teaspoon:tests` ## Why was this MR needed? - many duplications - missing existence checks - missing conditions - static fixtures don't match real views ## Reasoning I want to explain some of my decisions here, so that they stay visible for future discussions. ### Why not HAML? - same number of HAML templates as number of fixtures (many input files) - embedded logic less readable - can not be rendered by JavaScript (because of inline Ruby) ### Why RSpec? - real controllers for fixtures - spys available for mocking - easily report failed fixture generations ### Why not magic_lamp? (#19445) - introduces another dependency/tool - needs to run a server concurrently to teaspoon - makes it harder to use a JavaScript test runner - static HTML files serve faster See merge request !6059 |
||
|---|---|---|
| .. | ||
| api | ||
| assets | ||
| backup | ||
| banzai | ||
| ci | ||
| constraints | ||
| container_registry | ||
| gitlab | ||
| json_web_token | ||
| omni_auth | ||
| rouge/formatters | ||
| support | ||
| tasks | ||
| banzai.rb | ||
| disable_email_interceptor.rb | ||
| event_filter.rb | ||
| expand_variables.rb | ||
| extracts_path.rb | ||
| file_size_validator.rb | ||
| file_streamer.rb | ||
| gitlab.rb | ||
| gt_one_coercion.rb | ||
| repository_cache.rb | ||
| static_model.rb | ||
| unfold_form.rb | ||
| uploaded_file.rb | ||
| version_check.rb | ||