summaryrefslogtreecommitdiff
path: root/spec/presenters
diff options
context:
space:
mode:
authorBob Van Landuyt <bob@vanlanduyt.co>2018-04-18 12:44:12 +0200
committerBob Van Landuyt <bob@vanlanduyt.co>2018-04-24 13:59:41 +0200
commitaeed6b5a34e2c1c98a374e6c6178d84e07779531 (patch)
treec9b169862980a0e651d66a9669d20eb1e558ce06 /spec/presenters
parenta544f6ec58ba5f9cfbff6b59b50bc92bc2274bdb (diff)
downloadgitlab-ce-aeed6b5a34e2c1c98a374e6c6178d84e07779531.tar.gz
Only show push-to-master authorized users
Hide the push to master instructions for users that are not allowed to do that. Also hide buttons that would direct them to commit directly in master
Diffstat (limited to 'spec/presenters')
-rw-r--r--spec/presenters/project_presenter_spec.rb11
1 files changed, 11 insertions, 0 deletions
diff --git a/spec/presenters/project_presenter_spec.rb b/spec/presenters/project_presenter_spec.rb
index 0a130c59037..830d2ee3b20 100644
--- a/spec/presenters/project_presenter_spec.rb
+++ b/spec/presenters/project_presenter_spec.rb
@@ -208,6 +208,17 @@ describe ProjectPresenter do
it 'returns nil if user cannot push' do
expect(presenter.new_file_anchor_data).to be_nil
end
+
+ context 'when the project is empty' do
+ let(:project) { create(:project, :empty_repo) }
+
+ # Since we protect the default branch for empty repos
+ it 'is empty for a developer' do
+ project.add_developer(user)
+
+ expect(presenter.new_file_anchor_data).to be_nil
+ end
+ end
end
describe '#readme_anchor_data' do