Merge pull request #2513 from consul/fix_debates_spec_back_link

Flaky spec fix: Debates Show: "Back" link directs to previous page
This commit is contained in:
Alberto Calderón Queimadelos
2018-03-05 11:22:37 +01:00
committed by GitHub

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))