2014-10-07 09:05:24 -04:00
|
|
|
require 'spec_helper'
|
|
|
|
|
2015-12-09 05:55:36 -05:00
|
|
|
describe Gitlab::GitAccessWiki, lib: true do
|
2015-03-24 09:10:55 -04:00
|
|
|
let(:access) { Gitlab::GitAccessWiki.new(user, project) }
|
2014-10-07 09:05:24 -04:00
|
|
|
let(:project) { create(:project) }
|
|
|
|
let(:user) { create(:user) }
|
|
|
|
|
|
|
|
describe 'push_allowed?' do
|
|
|
|
before do
|
|
|
|
create(:protected_branch, name: 'master', project: project)
|
|
|
|
project.team << [user, :developer]
|
|
|
|
end
|
|
|
|
|
2015-03-24 09:10:55 -04:00
|
|
|
subject { access.push_access_check(changes) }
|
2014-10-07 09:05:24 -04:00
|
|
|
|
2015-02-12 13:17:35 -05:00
|
|
|
it { expect(subject.allowed?).to be_truthy }
|
2014-10-07 09:05:24 -04:00
|
|
|
end
|
|
|
|
|
|
|
|
def changes
|
|
|
|
['6f6d7e7ed 570e7b2ab refs/heads/master']
|
|
|
|
end
|
|
|
|
end
|