Move RSpec `shared_examples` from `spec/support`
Currently we have a bunch of files that define shared_examples
in spec/support
directory. Maybe it would be better to move those files to directories that those examples belong to?
We have:
support/mentionable_shared_examples.rb:shared_examples 'a mentionable'
support/mentionable_shared_examples.rb:shared_examples 'an editable mentionable'
support/project_hook_data_shared_example.rb:shared_examples 'project hook data'
support/project_hook_data_shared_example.rb:shared_examples 'deprecated repository hook data'
support/taskable_shared_examples.rb:shared_examples 'a Taskable'
support/api/pagination_shared_examples.rb:shared_examples 'a paginated resources'
support/email_format_shared_examples.rb:shared_examples 'an object with email-formated attributes'
For example, we can move shared examples for Mentionable
to spec/models/concerns/mentionable/shared/mentionable.rb
and spec/models/concerns/mentionable/shared/editable_mentionable.rb
Then we can also use something like below if those examples are needed:
require 'models/concerns/mentionable/shared/editable_mentionable'
Ideally it would be nice if support/
directory contained only configuration files for test harness. What do you think @DouweM @dzaporozhets @rymai?