Commit f552fc6c authored by Stan Hu's avatar Stan Hu

Fix test for removal of remotes

The Rugged/libgit2 update appears to cache the state of the
remotes. Since the remotes are deleted underneath it via Gitaly, Rugged
doesn't know to refresh the list of remotes. We now test the RPC
response and reload the Rugged repository to validate the removal.
parent 5601408c
......@@ -1894,8 +1894,11 @@ RSpec.describe Gitlab::Git::Repository, :seed_helper do
it 'removes the remote' do
repository_rugged.remotes.create(remote_name, url)
repository.remove_remote(remote_name)
expect(repository.remove_remote(remote_name)).to be true
# Since we deleted the remote via Gitaly, Rugged doesn't know
# this changed underneath it. Let's refresh the Rugged repo.
repository_rugged = Rugged::Repository.new(repository_path)
expect(repository_rugged.remotes[remote_name]).to be_nil
end
end
......
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