diff options
author | Stan Hu <stanhu@gmail.com> | 2017-12-24 09:35:30 -0800 |
---|---|---|
committer | Stan Hu <stanhu@gmail.com> | 2017-12-25 05:28:51 -0800 |
commit | a83c41f6c6e0035c40916b3cbdda7fdd4f7e925f (patch) | |
tree | ce0ed5b1113e9eec082b832f098504d4bb061d2e /spec/lib/gitlab/checks/project_moved_spec.rb | |
parent | 5e6dd15a996f57d7a8760f4c9c1dbd7beeeaadff (diff) | |
download | gitlab-ce-a83c41f6c6e0035c40916b3cbdda7fdd4f7e925f.tar.gz |
Fix Error 500s with anonymous clones for a project that has moved
Closes #41457
Diffstat (limited to 'spec/lib/gitlab/checks/project_moved_spec.rb')
-rw-r--r-- | spec/lib/gitlab/checks/project_moved_spec.rb | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/spec/lib/gitlab/checks/project_moved_spec.rb b/spec/lib/gitlab/checks/project_moved_spec.rb index fa1575e2177..3d72e78332d 100644 --- a/spec/lib/gitlab/checks/project_moved_spec.rb +++ b/spec/lib/gitlab/checks/project_moved_spec.rb @@ -35,6 +35,13 @@ describe Gitlab::Checks::ProjectMoved, :clean_gitlab_redis_shared_state do project_moved = described_class.new(project, user, 'foo/bar', 'http') expect(project_moved.add_redirect_message).to eq("OK") end + + it 'should handle anonymous clones' do + project_moved = described_class.new(project, nil, 'foo/bar', 'http') + + expect(project_moved.add_redirect_message).to eq("OK") + expect(Gitlab::Redis::SharedState.with { |redis| redis.get("redirect_namespace:anonymous:#{project.id}") }).not_to be_nil + end end describe '#redirect_message' do |