expect{subject}.toraise_error(Gitlab::GitAccess::UnauthorizedError,'You are not allowed to force push code to a protected branch on this project.')
expect{subject.exec}.toraise_error(Gitlab::GitAccess::UnauthorizedError,'You are not allowed to force push code to a protected branch on this project.')
end
end
it'raises an error if the user is not allowed to merge to protected branches'do
it'raises an error if the user is not allowed to merge to protected branches'do
...
@@ -128,13 +122,13 @@ describe Gitlab::Checks::ChangeAccess do
...
@@ -128,13 +122,13 @@ describe Gitlab::Checks::ChangeAccess do
expect{subject}.toraise_error(Gitlab::GitAccess::UnauthorizedError,'You are not allowed to push code to protected branches on this project.')
expect{subject.exec}.toraise_error(Gitlab::GitAccess::UnauthorizedError,'You are not allowed to push code to protected branches on this project.')
end
end
context'branch deletion'do
context'branch deletion'do
...
@@ -143,7 +137,7 @@ describe Gitlab::Checks::ChangeAccess do
...
@@ -143,7 +137,7 @@ describe Gitlab::Checks::ChangeAccess do
context'if the user is not allowed to delete protected branches'do
context'if the user is not allowed to delete protected branches'do
it'raises an error'do
it'raises an error'do
expect{subject}.toraise_error(Gitlab::GitAccess::UnauthorizedError,'You are not allowed to delete protected branches from this project. Only a project master or owner can delete a protected branch.')
expect{subject.exec}.toraise_error(Gitlab::GitAccess::UnauthorizedError,'You are not allowed to delete protected branches from this project. Only a project master or owner can delete a protected branch.')
end
end
end
end
...
@@ -156,13 +150,13 @@ describe Gitlab::Checks::ChangeAccess do
...
@@ -156,13 +150,13 @@ describe Gitlab::Checks::ChangeAccess do
let(:protocol){'web'}
let(:protocol){'web'}
it'allows branch deletion'do
it'allows branch deletion'do
expect{subject}.not_toraise_error
expect{subject.exec}.not_toraise_error
end
end
end
end
context'over SSH or HTTP'do
context'over SSH or HTTP'do
it'raises an error'do
it'raises an error'do
expect{subject}.toraise_error(Gitlab::GitAccess::UnauthorizedError,'You can only delete protected branches using the web interface.')
expect{subject.exec}.toraise_error(Gitlab::GitAccess::UnauthorizedError,'You can only delete protected branches using the web interface.')
end
end
end
end
end
end
...
@@ -183,7 +177,7 @@ describe Gitlab::Checks::ChangeAccess do
...
@@ -183,7 +177,7 @@ describe Gitlab::Checks::ChangeAccess do