Don't include unneeded helpers in tests

Including them might lead to conflicts since two methods might have the
same name. For example, we're getting some exceptions when taking
screenshots of a failing test, because the method `image_path` from
`ActionView::Helpers::AssetUrlHelper` has the same name as a method used
to save the screenshot.

Besides, we were including all helpers in places were only the `dom_id`
method is used, and in other places where no helper methods were used at
all. So we can just invoke `ActionView::RecordIdentifier.dom_id`
directly.
This commit is contained in:
Javi Martín
2020-04-15 21:02:58 +02:00
parent 7491f44d54
commit 2cd4696244
14 changed files with 5 additions and 27 deletions

View File

@@ -1,8 +1,4 @@
shared_examples "nested documentable" do |login_as_name, documentable_factory_name, path, documentable_path_arguments, fill_resource_method_name, submit_button, documentable_success_notice|
include ActionView::Helpers
include DocumentsHelper
include DocumentablesHelper
let!(:administrator) { create(:user) }
let!(:user) { create(:user, :level_two) }
let!(:arguments) { {} }