diff options
Diffstat (limited to 'spec/support/shared_examples/features/wiki/user_views_wiki_empty_shared_examples.rb')
-rw-r--r-- | spec/support/shared_examples/features/wiki/user_views_wiki_empty_shared_examples.rb | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/spec/support/shared_examples/features/wiki/user_views_wiki_empty_shared_examples.rb b/spec/support/shared_examples/features/wiki/user_views_wiki_empty_shared_examples.rb index 14180d503df..3514ce286d6 100644 --- a/spec/support/shared_examples/features/wiki/user_views_wiki_empty_shared_examples.rb +++ b/spec/support/shared_examples/features/wiki/user_views_wiki_empty_shared_examples.rb @@ -20,11 +20,11 @@ RSpec.shared_examples 'User views empty wiki' do end end - shared_examples 'empty wiki message' do |writable: false, issuable: false, confluence: false| + shared_examples 'empty wiki message' do |writable: false, issuable: false, confluence: false, expect_button: true| # This mirrors the logic in: # - app/views/shared/empty_states/_wikis.html.haml # - WikiHelper#wiki_empty_state_messages - it 'shows the empty state message with the expected elements' do + it 'shows the empty state message with the expected elements', :js do visit wiki_path(wiki) if writable @@ -37,7 +37,7 @@ RSpec.shared_examples 'User views empty wiki' do if issuable && !writable expect(element).to have_content("improve the wiki for this #{container_name}") expect(element).to have_link("issue tracker", href: project_issues_path(project)) - expect(element).to have_link("Suggest wiki improvement", href: new_project_issue_path(project)) + expect(element.has_link?("Suggest wiki improvement", href: new_project_issue_path(project))).to be(expect_button) else expect(element).not_to have_content("improve the wiki for this #{container_name}") expect(element).not_to have_link("issue tracker") |