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

@@ -173,9 +173,7 @@ shared_examples "mappable" do |mappable_factory_name, mappable_association_name,
end
end
describe "At #{mappable_edit_path}" do
before { skip } if mappable_edit_path.blank?
describe "At #{mappable_edit_path}", if: mappable_edit_path.present? do
scenario "Should edit map on #{mappable_factory_name} and contain default values" do
do_login_for mappable.author, management: management