Commit 2273d09b authored by Alfredo Sumaran's avatar Alfredo Sumaran

Merge branch 'remove-turbolink' into 'master'

remove Turbolinks from lockfile.js, do page refresh instead

See merge request !1299
parents 78ec4e8f b4120c41
......@@ -4,15 +4,16 @@
function PathLocks() {}
PathLocks.init = function(url, path) {
return $('a.path-lock').on('click', function() {
return $('a.path-lock').on('click', function(e) {
var $lockBtn, currentState, toggleAction;
e.preventDefault();
$lockBtn = $(this);
currentState = $lockBtn.data('state');
toggleAction = currentState === 'lock' ? 'unlock' : 'lock';
return $.post(url, {
path: path
}, function() {
return Turbolinks.visit(location.href);
location.reload();
});
});
};
......
......@@ -43,6 +43,24 @@ feature 'Path Locks', feature: true, js: true do
end
end
scenario 'Unlocking files' do
within find('.tree-content-holder') do
click_link "VERSION"
end
within '.file-actions' do
click_link "Lock"
expect(page).to have_link('Unlock')
end
within '.file-actions' do
click_link "Unlock"
expect(page).to have_link('Lock')
end
end
scenario 'Managing of lock list' do
create :path_lock, path: 'encoding', user: user, project: project
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment