first changed for click_link so that the test can wait the capybara default time.

This commit is contained in:
iagirre
2018-02-28 15:12:50 +01:00
committed by Bertocq
parent 9747386575
commit ffd6bdb3d7

View File

@@ -64,11 +64,15 @@ feature 'Debates' do
end
end
scenario 'Show: "Back" link directs to previous page', :js do
scenario 'Show: "Back" link directs to previous page' do
debate = create(:debate, title: 'Test Debate 1')
visit debates_path(order: :hot_score, page: 1)
first(:link, debate.title).click
within("#debate_#{debate.id}") do
click_link debate.title
end
link_text = find_link('Go back')[:href]
expect(link_text).to include(debates_path(order: :hot_score, page: 1))