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:
@@ -128,8 +128,8 @@ shared_examples "nested imageable" do |imageable_factory_name, path, imageable_p
|
||||
end
|
||||
end
|
||||
|
||||
scenario "Render image preview after sending the form with validation errors" do
|
||||
skip "Question answers behave differently" if imageable.is_a?(Poll::Question::Answer)
|
||||
scenario "Render image preview after sending the form with validation errors",
|
||||
unless: imageable_factory_name == "poll_question_answer" do
|
||||
do_login_for user, management: management
|
||||
visit send(path, arguments)
|
||||
|
||||
@@ -154,17 +154,14 @@ shared_examples "nested imageable" do |imageable_factory_name, path, imageable_p
|
||||
expect(page).not_to have_selector("#nested-image .image")
|
||||
end
|
||||
|
||||
scenario "Should show successful notice when resource filled correctly without any nested images" do
|
||||
if has_many_images
|
||||
skip "no need to test, there are no attributes for the parent resource"
|
||||
else
|
||||
do_login_for user, management: management
|
||||
visit send(path, arguments)
|
||||
scenario "Should show successful notice when resource filled correctly without any nested images",
|
||||
unless: has_many_images do
|
||||
do_login_for user, management: management
|
||||
visit send(path, arguments)
|
||||
|
||||
send(fill_resource_method_name) if fill_resource_method_name
|
||||
click_on submit_button
|
||||
expect(page).to have_content imageable_success_notice
|
||||
end
|
||||
send(fill_resource_method_name) if fill_resource_method_name
|
||||
click_on submit_button
|
||||
expect(page).to have_content imageable_success_notice
|
||||
end
|
||||
|
||||
scenario "Should show successful notice when resource filled correctly and after valid file uploads" do
|
||||
|
||||
Reference in New Issue
Block a user