Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'spec/views')
-rw-r--r--spec/views/projects/buttons/_dropdown.html.haml_spec.rb3
-rw-r--r--spec/views/projects/commit/_commit_box.html.haml_spec.rb8
2 files changed, 5 insertions, 6 deletions
diff --git a/spec/views/projects/buttons/_dropdown.html.haml_spec.rb b/spec/views/projects/buttons/_dropdown.html.haml_spec.rb
index d0e692635b9..8b9aab30286 100644
--- a/spec/views/projects/buttons/_dropdown.html.haml_spec.rb
+++ b/spec/views/projects/buttons/_dropdown.html.haml_spec.rb
@@ -8,7 +8,8 @@ describe 'projects/buttons/_dropdown' do
assign(:project, project)
allow(view).to receive(:current_user).and_return(user)
- allow(view).to receive(:can?).and_return(true)
+ allow(view).to receive(:can?).with(user, :push_code, project).and_return(true)
+ allow(view).to receive(:can_collaborate_with_project?).and_return(true)
end
context 'empty repository' do
diff --git a/spec/views/projects/commit/_commit_box.html.haml_spec.rb b/spec/views/projects/commit/_commit_box.html.haml_spec.rb
index 448b925cf34..2fdd28a3be4 100644
--- a/spec/views/projects/commit/_commit_box.html.haml_spec.rb
+++ b/spec/views/projects/commit/_commit_box.html.haml_spec.rb
@@ -7,6 +7,7 @@ describe 'projects/commit/_commit_box.html.haml' do
before do
assign(:project, project)
assign(:commit, project.commit)
+ allow(view).to receive(:current_user).and_return(user)
allow(view).to receive(:can_collaborate_with_project?).and_return(false)
end
@@ -47,7 +48,8 @@ describe 'projects/commit/_commit_box.html.haml' do
context 'viewing a commit' do
context 'as a developer' do
before do
- expect(view).to receive(:can_collaborate_with_project?).and_return(true)
+ project.add_developer(user)
+ allow(view).to receive(:can_collaborate_with_project?).and_return(true)
end
it 'has a link to create a new tag' do
@@ -58,10 +60,6 @@ describe 'projects/commit/_commit_box.html.haml' do
end
context 'as a non-developer' do
- before do
- expect(view).to receive(:can_collaborate_with_project?).and_return(false)
- end
-
it 'does not have a link to create a new tag' do
render