提交 6bf1beaf 编写于 作者: S Stan Hu

Merge branch 'fix-cache-clear-test-issue' into 'master'

Use project repository expire_cache to clear cache in test

Clearing the entire Redis cache in 643557da for the `branches_spec.rb` may be causing issues. Just clear what we need.

See merge request !1022
......@@ -13,13 +13,9 @@ describe API::API, api: true do
let!(:branch_sha) { '0b4bc9a49b562e85de7cc9e834518ea6828729b9' }
describe "GET /projects/:id/repository/branches" do
before do
# Ensure that repository.branch_names is cleared from the cache at start to ensure
# the list matches reality
Rails.cache.clear
end
it "should return an array of project branches" do
project.repository.expire_cache
get api("/projects/#{project.id}/repository/branches", user)
expect(response.status).to eq(200)
expect(json_response).to be_an Array
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册