summaryrefslogtreecommitdiff
path: root/spec/lib/gitlab
diff options
context:
space:
mode:
authorValery Sizov <vsv2711@gmail.com>2014-11-14 18:23:55 +0200
committerValery Sizov <vsv2711@gmail.com>2014-11-18 13:10:07 +0200
commit53bf52f191612df92d993cbcd3c4d6c89ab9c95a (patch)
tree48d6fc548d308f8fd83a78a0653a7720247306f4 /spec/lib/gitlab
parenta4e98f0ec985c91631f41c56317926f29365d95a (diff)
downloadgitlab-ce-53bf52f191612df92d993cbcd3c4d6c89ab9c95a.tar.gz
Better message for failed pushes because of git hooks
Conflicts: lib/gitlab/git_access.rb spec/lib/gitlab/git_access_spec.rb
Diffstat (limited to 'spec/lib/gitlab')
-rw-r--r--spec/lib/gitlab/git_access_spec.rb24
-rw-r--r--spec/lib/gitlab/git_access_wiki_spec.rb4
2 files changed, 14 insertions, 14 deletions
diff --git a/spec/lib/gitlab/git_access_spec.rb b/spec/lib/gitlab/git_access_spec.rb
index fe0a6bbdabb..1addba55787 100644
--- a/spec/lib/gitlab/git_access_spec.rb
+++ b/spec/lib/gitlab/git_access_spec.rb
@@ -5,14 +5,14 @@ describe Gitlab::GitAccess do
let(:project) { create(:project) }
let(:user) { create(:user) }
- describe 'download_allowed?' do
+ describe 'download_access_check' do
describe 'master permissions' do
before { project.team << [user, :master] }
context 'pull code' do
- subject { access.download_allowed?(user, project) }
+ subject { access.download_access_check(user, project) }
- it { should be_true }
+ it { subject.allowed?.should be_true }
end
end
@@ -20,9 +20,9 @@ describe Gitlab::GitAccess do
before { project.team << [user, :guest] }
context 'pull code' do
- subject { access.download_allowed?(user, project) }
+ subject { access.download_access_check(user, project) }
- it { should be_false }
+ it { subject.allowed?.should be_false }
end
end
@@ -33,22 +33,22 @@ describe Gitlab::GitAccess do
end
context 'pull code' do
- subject { access.download_allowed?(user, project) }
+ subject { access.download_access_check(user, project) }
- it { should be_false }
+ it { subject.allowed?.should be_false }
end
end
describe 'without acccess to project' do
context 'pull code' do
- subject { access.download_allowed?(user, project) }
+ subject { access.download_access_check(user, project) }
- it { should be_false }
+ it { subject.allowed?.should be_false }
end
end
end
- describe 'push_allowed?' do
+ describe 'push_access_check' do
def protect_feature_branch
create(:protected_branch, name: 'feature', project: project)
end
@@ -117,9 +117,9 @@ describe Gitlab::GitAccess do
permissions_matrix[role].each do |action, allowed|
context action do
- subject { access.push_allowed?(user, project, changes[action]) }
+ subject { access.push_access_check(user, project, changes[action]) }
- it { should allowed ? be_true : be_false }
+ it { subject.allowed?.should allowed ? be_true : be_false }
end
end
end
diff --git a/spec/lib/gitlab/git_access_wiki_spec.rb b/spec/lib/gitlab/git_access_wiki_spec.rb
index ed5785b31e6..d8d19fd50f0 100644
--- a/spec/lib/gitlab/git_access_wiki_spec.rb
+++ b/spec/lib/gitlab/git_access_wiki_spec.rb
@@ -11,9 +11,9 @@ describe Gitlab::GitAccessWiki do
project.team << [user, :developer]
end
- subject { access.push_allowed?(user, project, changes) }
+ subject { access.push_access_check(user, project, changes) }
- it { should be_true }
+ it { subject.should be_true }
end
def changes