Use if instead of skip to skip tests

This way the tests won't appear as "pending" when running the test
suite, and so we get rid of a lot of noise in the test results. There
doesn't seem to be a way to call `skip` without the test being marked as
"pending".

Note that in the globalizable tests we need to build a factory before
deciding whether an atribute is required or not (particularly for the
milestone factory, since milestone attributes are required depending on
the presence of other attributes). This isn't possible before we're
inside the test, so we can't add an `if:` condition to the test. So
we're adding the condition inside the test instead. A minor
inconvenience of this method is the test still runs even when the
condition is `false`.
This commit is contained in:
Javi Martín
2021-09-08 03:24:15 +02:00
parent 2927174e06
commit e49c32638d
7 changed files with 57 additions and 91 deletions

View File

@@ -201,10 +201,8 @@ shared_examples "nested documentable" do |login_as_name, documentable_factory_na
expect(page).to have_content documentable_success_notice
end
scenario "Should show new document after successful creation with one uploaded file" do
if documentable_factory_name == "dashboard_action"
skip("Not render Documents count on dashboard_actions")
end
scenario "Should show new document after successful creation with one uploaded file",
unless: documentable_factory_name == "dashboard_action" do
do_login_for user_to_login, management: management
visit send(path, arguments)
send(fill_resource_method_name) if fill_resource_method_name
@@ -223,10 +221,7 @@ shared_examples "nested documentable" do |login_as_name, documentable_factory_na
end
scenario "Should show resource with new document after successful creation with
maximum allowed uploaded files" do
if documentable_factory_name == "dashboard_action"
skip("Not render Documents count on dashboard_actions")
end
maximum allowed uploaded files", unless: documentable_factory_name == "dashboard_action" do
do_login_for user_to_login, management: management
visit send(path, arguments)