BigW Consortium Gitlab

git_access_wiki_spec.rb 541 Bytes
Newer Older
1 2
require 'spec_helper'

Douwe Maan committed
3
describe Gitlab::GitAccessWiki, lib: true do
4
  let(:access) { Gitlab::GitAccessWiki.new(user, project, 'web') }
5 6 7 8 9 10 11 12 13
  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

14
    subject { access.push_access_check(changes) }
15

16
    it { expect(subject.allowed?).to be_truthy }
17 18 19 20 21 22
  end

  def changes
    ['6f6d7e7ed 570e7b2ab refs/heads/master']
  end
end