2017-03-26 16:16:55 -04:00
|
|
|
require 'spec_helper'
|
|
|
|
|
2018-07-05 02:32:05 -04:00
|
|
|
describe 'Wiki shortcuts', :js do
|
2017-03-26 16:16:55 -04:00
|
|
|
let(:user) { create(:user) }
|
2018-05-04 05:45:16 -04:00
|
|
|
let(:project) { create(:project, :wiki_repo, namespace: user.namespace) }
|
2017-10-12 08:53:46 -04:00
|
|
|
let(:wiki_page) { create(:wiki_page, wiki: project.wiki, attrs: { title: 'home', content: 'Home page' }) }
|
2017-03-26 16:16:55 -04:00
|
|
|
|
|
|
|
before do
|
2017-06-21 19:44:10 -04:00
|
|
|
sign_in(user)
|
2017-07-06 12:20:50 -04:00
|
|
|
visit project_wiki_path(project, wiki_page)
|
2017-03-26 16:16:55 -04:00
|
|
|
end
|
|
|
|
|
2018-07-05 02:32:05 -04:00
|
|
|
it 'Visit edit wiki page using "e" keyboard shortcut' do
|
2017-03-26 16:16:55 -04:00
|
|
|
find('body').native.send_key('e')
|
|
|
|
|
|
|
|
expect(find('.wiki-page-title')).to have_content('Edit Page')
|
|
|
|
end
|
|
|
|
end
|