Commit 04c690e1 authored by James Lopez's avatar James Lopez

added spec to test git annex fix

parent 977cbcde
......@@ -9,6 +9,7 @@ describe Gitlab::GitAccess, lib: true do
["6f6d7e7ed97bb5f0054f2b1df789b39ca89b6ff9 570e7b2abdd848b95f2f578043fc23bd6f6fd24d refs/heads/synced/git-annex",
"6f6d7e7ed97bb5f0054f2b1df789b39ca89b6ff9 570e7b2abdd848b95f2f578043fc23bd6f6fd24d refs/heads/synced/named-branch"]
end
let(:git_annex_master_changes) { "6f6d7e7ed97bb5f0054f2b1df789b39ca89b6ff9 570e7b2abdd848b95f2f578043fc23bd6f6fd24d refs/heads/master" }
describe 'can_push_to_branch?' do
describe 'push to none protected branch' do
......@@ -323,6 +324,16 @@ describe Gitlab::GitAccess, lib: true do
it { expect(access.push_access_check(git_annex_changes)).to be_allowed }
end
describe 'git annex enabled, push to master branch' do
before do
allow(Gitlab.config.gitlab_shell).to receive(:git_annex_enabled).and_return(true)
create(:ci_commit, project: project, sha: '570e7b2abdd848b95f2f578043fc23bd6f6fd24d', ref: 'refs/heads/master')
project.repository.add_branch(user, 'synced/master', '570e7b2abdd848b95f2f578043fc23bd6f6fd24d')
end
it { expect(access.push_access_check(git_annex_master_changes)).to be_allowed }
end
describe 'git annex disabled' do
before { allow(Gitlab.config.gitlab_shell).to receive(:git_annex_enabled).and_return(false) }
......@@ -330,7 +341,7 @@ describe Gitlab::GitAccess, lib: true do
end
end
describe 'check commit author email' do
describe 'check max file size' do
before do
allow_any_instance_of(Gitlab::Git::Blob).to receive(:size).and_return(5.megabytes.to_i)
project.git_hook.update(max_file_size: 2)
......
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