diff options
author | Douglas Barbosa Alexandre <dbalexandre@gmail.com> | 2016-03-17 17:39:50 -0300 |
---|---|---|
committer | Douglas Barbosa Alexandre <dbalexandre@gmail.com> | 2016-03-17 20:55:59 -0300 |
commit | 43d8bdb4f048cbeb5675ed9120cb1aeb415b9586 (patch) | |
tree | f773a103dd7da08866c813e19567c5055e137e9f /spec/models/commit_spec.rb | |
parent | 34ee75379cf8e6459b8926fbf956a8316f87eea7 (diff) | |
download | gitlab-ce-43d8bdb4f048cbeb5675ed9120cb1aeb415b9586.tar.gz |
Restrict access to references for confidential issues
Diffstat (limited to 'spec/models/commit_spec.rb')
-rw-r--r-- | spec/models/commit_spec.rb | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/spec/models/commit_spec.rb b/spec/models/commit_spec.rb index 253902512c3..0e9111c8029 100644 --- a/spec/models/commit_spec.rb +++ b/spec/models/commit_spec.rb @@ -86,10 +86,21 @@ eos let(:issue) { create :issue, project: project } let(:other_project) { create :project, :public } let(:other_issue) { create :issue, project: other_project } + let(:commiter) { create :user } + + before do + project.team << [commiter, :developer] + other_project.team << [commiter, :developer] + end it 'detects issues that this commit is marked as closing' do ext_ref = "#{other_project.path_with_namespace}##{other_issue.iid}" - allow(commit).to receive(:safe_message).and_return("Fixes ##{issue.iid} and #{ext_ref}") + + allow(commit).to receive_messages( + safe_message: "Fixes ##{issue.iid} and #{ext_ref}", + committer_email: commiter.email + ) + expect(commit.closes_issues).to include(issue) expect(commit.closes_issues).to include(other_issue) end |