2018-03-20 10:12:48 -04:00
|
|
|
require 'spec_helper'
|
|
|
|
|
2018-07-05 02:32:05 -04:00
|
|
|
describe 'Multi-file editor new directory', :js do
|
2018-03-20 10:12:48 -04:00
|
|
|
let(:user) { create(:user) }
|
|
|
|
let(:project) { create(:project, :repository) }
|
|
|
|
|
|
|
|
before do
|
2018-07-11 10:36:08 -04:00
|
|
|
project.add_maintainer(user)
|
2018-03-20 10:12:48 -04:00
|
|
|
sign_in(user)
|
|
|
|
|
|
|
|
visit project_tree_path(project, :master)
|
|
|
|
|
|
|
|
wait_for_requests
|
|
|
|
|
|
|
|
click_link('Web IDE')
|
|
|
|
|
|
|
|
wait_for_requests
|
|
|
|
end
|
|
|
|
|
|
|
|
after do
|
|
|
|
set_cookie('new_repo', 'false')
|
|
|
|
end
|
|
|
|
|
|
|
|
it 'creates directory in current directory' do
|
2018-08-07 11:15:56 -04:00
|
|
|
all('.ide-tree-actions button').last.click
|
2018-03-20 10:12:48 -04:00
|
|
|
|
|
|
|
page.within('.modal') do
|
|
|
|
find('.form-control').set('folder name')
|
|
|
|
|
|
|
|
click_button('Create directory')
|
|
|
|
end
|
|
|
|
|
2018-08-07 11:15:56 -04:00
|
|
|
first('.ide-tree-actions button').click
|
2018-03-20 10:12:48 -04:00
|
|
|
|
|
|
|
page.within('.modal-dialog') do
|
|
|
|
find('.form-control').set('file name')
|
|
|
|
|
|
|
|
click_button('Create file')
|
|
|
|
end
|
|
|
|
|
|
|
|
wait_for_requests
|
|
|
|
|
2018-04-17 11:27:46 -04:00
|
|
|
find('.js-ide-commit-mode').click
|
|
|
|
|
2018-05-01 07:02:22 -04:00
|
|
|
find('.multi-file-commit-list-item').hover
|
2018-09-21 01:51:23 -04:00
|
|
|
click_button 'Stage'
|
2018-03-21 06:05:08 -04:00
|
|
|
|
2018-03-20 10:12:48 -04:00
|
|
|
fill_in('commit-message', with: 'commit message ide')
|
|
|
|
|
|
|
|
click_button('Commit')
|
|
|
|
|
2018-04-18 09:45:50 -04:00
|
|
|
find('.js-ide-edit-mode').click
|
|
|
|
|
2018-03-20 10:12:48 -04:00
|
|
|
expect(page).to have_content('folder name')
|
|
|
|
end
|
|
|
|
end
|