Fix API::BranchesSpec.

- Previously created a protected branch manually, without using a
  factory.
This commit is contained in:
Timothy Andrew 2016-08-16 14:10:28 +05:30
parent dd3b738d5b
commit 0e2cecfd62
1 changed files with 1 additions and 1 deletions

View File

@ -243,7 +243,7 @@ describe API::API, api: true do
end
it "removes protected branch" do
project.protected_branches.create(name: branch_name)
create(:protected_branch, project: project, name: branch_name)
delete api("/projects/#{project.id}/repository/branches/#{branch_name}", user)
expect(response).to have_http_status(405)
expect(json_response['message']).to eq('Protected branch cant be removed')