diff options
author | Stan Hu <stanhu@gmail.com> | 2015-07-22 02:11:14 +0000 |
---|---|---|
committer | Stan Hu <stanhu@gmail.com> | 2015-07-22 02:11:14 +0000 |
commit | 6bf1beaf94a5ef63632475bad56bfa2099a4513d (patch) | |
tree | 1607d00ead4bfb63d9b56ff32e4ae735c1049c69 | |
parent | dc5504812d8e6c4976a1c4bd9850c428a138b1fb (diff) | |
parent | 5aff5223d4ba675beae2673fe5ed204531f5b42c (diff) | |
download | gitlab-ce-6bf1beaf94a5ef63632475bad56bfa2099a4513d.tar.gz |
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 643557d for the `branches_spec.rb` may be causing issues. Just clear what we need.
See merge request !1022
-rw-r--r-- | spec/requests/api/branches_spec.rb | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/spec/requests/api/branches_spec.rb b/spec/requests/api/branches_spec.rb index bb3862c9eb2..5c1b58535cc 100644 --- a/spec/requests/api/branches_spec.rb +++ b/spec/requests/api/branches_spec.rb @@ -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 |