Merge pull request #4010 from consul/fix_nested_documentable_spec

Fix flaky nested documentable / imageable specs
This commit is contained in:
Javier Martín
2020-05-18 13:59:40 +02:00
committed by GitHub
2 changed files with 8 additions and 0 deletions

View File

@@ -80,6 +80,8 @@ shared_examples "nested documentable" do |login_as_name, documentable_factory_na
Rails.root.join("spec/fixtures/files/empty.pdf"), Rails.root.join("spec/fixtures/files/empty.pdf"),
make_visible: true make_visible: true
) )
expect(page).to have_css ".loading-bar.complete"
end end
expect(page).to have_css ".file-name", text: "empty.pdf" expect(page).to have_css ".file-name", text: "empty.pdf"
@@ -110,6 +112,8 @@ shared_examples "nested documentable" do |login_as_name, documentable_factory_na
Rails.root.join("spec/fixtures/files/empty.pdf"), Rails.root.join("spec/fixtures/files/empty.pdf"),
make_visible: true make_visible: true
) )
expect(page).to have_css ".loading-bar.complete"
end end
expect_document_has_title(0, "My Title") expect_document_has_title(0, "My Title")

View File

@@ -182,6 +182,8 @@ shared_examples "nested imageable" do |imageable_factory_name, path, imageable_p
Rails.root.join("spec/fixtures/files/clippy.jpg") Rails.root.join("spec/fixtures/files/clippy.jpg")
) )
expect(page).to have_selector ".loading-bar.complete"
click_on submit_button click_on submit_button
expect(page).to have_content imageable_success_notice expect(page).to have_content imageable_success_notice
@@ -197,6 +199,8 @@ shared_examples "nested imageable" do |imageable_factory_name, path, imageable_p
Rails.root.join("spec/fixtures/files/clippy.jpg") Rails.root.join("spec/fixtures/files/clippy.jpg")
) )
expect(page).to have_selector ".loading-bar.complete"
click_on submit_button click_on submit_button
imageable_redirected_to_resource_show_or_navigate_to imageable_redirected_to_resource_show_or_navigate_to