expect{subject.exec}.toraise_error(Gitlab::GitAccess::UnauthorizedError,'You are not allowed to force push code to a protected branch on this project.')
expect{subject}.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
...
@@ -124,13 +123,13 @@ describe Gitlab::Checks::ChangeAccess do
...
@@ -124,13 +123,13 @@ describe Gitlab::Checks::ChangeAccess do
expect{subject.exec}.toraise_error(Gitlab::GitAccess::UnauthorizedError,'You are not allowed to push code to protected branches on this project.')
expect{subject}.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
...
@@ -139,7 +138,7 @@ describe Gitlab::Checks::ChangeAccess do
...
@@ -139,7 +138,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.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.')
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.')
end
end
end
end
...
@@ -152,13 +151,13 @@ describe Gitlab::Checks::ChangeAccess do
...
@@ -152,13 +151,13 @@ describe Gitlab::Checks::ChangeAccess do
let(:protocol){'web'}
let(:protocol){'web'}
it'allows branch deletion'do
it'allows branch deletion'do
expect{subject.exec}.not_toraise_error
expect{subject}.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.exec}.toraise_error(Gitlab::GitAccess::UnauthorizedError,'You can only delete protected branches using the web interface.')
expect{subject}.toraise_error(Gitlab::GitAccess::UnauthorizedError,'You can only delete protected branches using the web interface.')
end
end
end
end
end
end
...
@@ -179,7 +178,7 @@ describe Gitlab::Checks::ChangeAccess do
...
@@ -179,7 +178,7 @@ describe Gitlab::Checks::ChangeAccess do