Commit aa395954 authored by Lin Jen-Shin's avatar Lin Jen-Shin

Fix branch API tests, by moving to correct context

parent adc742cc
......@@ -313,7 +313,6 @@ describe API::Branches do
expect(json_response['developers_can_merge']).to eq(true)
end
end
end
context "when no one can push" do
let(:protected_branch) { create(:protected_branch, :no_one_can_push, project: project, name: 'protected_branch') }
......@@ -322,13 +321,14 @@ describe API::Branches do
put api("/projects/#{project.id}/repository/branches/#{protected_branch.name}/protect", user),
developers_can_push: true, developers_can_merge: true
expect(response).to have_http_status(200)
expect(response).to have_gitlab_http_status(200)
expect(json_response['name']).to eq(protected_branch.name)
expect(protected_branch.reload.push_access_levels.pluck(:access_level)).to include(Gitlab::Access::NO_ACCESS)
end
end
end
end
end
describe 'PUT /projects/:id/repository/branches/:branch/unprotect' do
let(:route) { "/projects/#{project_id}/repository/branches/#{branch_name}/unprotect" }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment