debian-mirror-gitlab/spec/lib/gitlab/git_access_wiki_spec.rb

23 lines
541 B
Ruby
Raw Normal View History

2015-04-26 12:48:37 +05:30
require 'spec_helper'
2015-12-23 02:04:40 +05:30
describe Gitlab::GitAccessWiki, lib: true do
2016-08-24 12:49:21 +05:30
let(:access) { Gitlab::GitAccessWiki.new(user, project, 'web') }
2015-04-26 12:48:37 +05:30
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
subject { access.push_access_check(changes) }
it { expect(subject.allowed?).to be_truthy }
end
def changes
['6f6d7e7ed 570e7b2ab refs/heads/master']
end
end