2018-03-20 10:12:48 -04:00
|
|
|
require 'spec_helper'
|
|
|
|
|
|
|
|
feature 'Multi-file editor new file', :js do
|
|
|
|
let(:user) { create(:user) }
|
|
|
|
let(:project) { create(:project, :repository) }
|
|
|
|
|
|
|
|
before do
|
|
|
|
project.add_master(user)
|
|
|
|
sign_in(user)
|
|
|
|
|
|
|
|
visit project_path(project)
|
|
|
|
|
|
|
|
wait_for_requests
|
|
|
|
|
|
|
|
click_link('Web IDE')
|
|
|
|
|
|
|
|
wait_for_requests
|
|
|
|
end
|
|
|
|
|
|
|
|
after do
|
|
|
|
set_cookie('new_repo', 'false')
|
|
|
|
end
|
|
|
|
|
|
|
|
it 'creates file in current directory' do
|
|
|
|
find('.add-to-tree').click
|
|
|
|
|
|
|
|
click_link('New file')
|
|
|
|
|
|
|
|
page.within('.modal') 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-04-30 04:55:57 -04:00
|
|
|
first('.multi-file-discard-btn .btn').click
|
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')
|
|
|
|
|
|
|
|
expect(page).to have_content('file name')
|
|
|
|
end
|
|
|
|
end
|