Check the comment is present after commenting
We've got a bug which causes the admin description not to appear immediately after commenting, due to the `admin_layout` variable being false when we add a comment using an AJAX request. So the test reloaded the page to check the admin description was there. However, sometimes reloading the page is faster than the AJAX request, and so the comment is not there yet. By checking the results of the AJAX request before reloading the page, the test passes. A proper solution would be to display the admin description or name right after the comment is added.
This commit is contained in:
@@ -412,6 +412,10 @@ describe "Commenting Budget::Investments" do
|
|||||||
check "comment-as-administrator-budget_investment_#{investment.id}"
|
check "comment-as-administrator-budget_investment_#{investment.id}"
|
||||||
click_button "Publish comment"
|
click_button "Publish comment"
|
||||||
|
|
||||||
|
within "#comments" do
|
||||||
|
expect(page).to have_content "I am your Admin!"
|
||||||
|
end
|
||||||
|
|
||||||
visit admin_budget_budget_investment_path(investment.budget, investment)
|
visit admin_budget_budget_investment_path(investment.budget, investment)
|
||||||
|
|
||||||
within "#comments" do
|
within "#comments" do
|
||||||
|
|||||||
Reference in New Issue
Block a user