Commit d86284e4 authored by Thong Kuah's avatar Thong Kuah

Move stub_licensed_features up, replace allow

As creation of PathLock in `project.path_locks.create`, triggers a
memoization of `Project#licensed_feature_available?`, call
stub_licensed_features first before all else.
parent 73e9ae5a
......@@ -18,8 +18,11 @@ describe Lfs::UnlockFileService do
describe 'File Locking integraction' do
let(:params) { { id: lock.id } }
let(:current_user) { lock_author }
let(:file_locks_license) { true }
before do
stub_licensed_features(file_locks: file_locks_license)
project.add_developer(lock_author)
project.path_locks.create(path: lock.path, user: lock_author)
end
......@@ -31,9 +34,7 @@ describe Lfs::UnlockFileService do
end
context 'when File Locking is not available' do
before do
allow(project).to receive(:feature_available?).with(:file_locks).and_return(false)
end
let(:file_locks_license) { false }
it 'does not delete the Path Lock' do
expect { subject.execute }.not_to change { PathLock.count }
......
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