summaryrefslogtreecommitdiff
path: root/spec/support/shared_examples/features/wiki/user_uses_wiki_shortcuts_shared_examples.rb
blob: 0330b345a1857af1aa397b89704d75778f096b4a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
# frozen_string_literal: true

# Requires a context containing:
#   wiki
#   user

RSpec.shared_examples 'User uses wiki shortcuts' do
  let(:wiki_page) { create(:wiki_page, wiki: wiki, title: 'home', content: 'Home page') }

  before do
    sign_in(user)
    visit wiki_page_path(wiki, wiki_page)
  end

  it 'Visit edit wiki page using "e" keyboard shortcut', :js do
    find('body').native.send_key('e')

    expect(find('.wiki-page-title')).to have_content('Edit Page')
  end
end