Disabling caching in test environment because it was causing issues with Markdown

This commit is contained in:
Douwe Maan 2015-10-22 15:38:11 +02:00
parent adba37f99a
commit c1ecfb5de9
2 changed files with 15 additions and 9 deletions

View File

@ -7,6 +7,8 @@ Gitlab::Application.configure do
# and recreated between test runs. Don't rely on the data there! # and recreated between test runs. Don't rely on the data there!
config.cache_classes = false config.cache_classes = false
config.cache_store = :null_store
# Configure static asset server for tests with Cache-Control for performance # Configure static asset server for tests with Cache-Control for performance
config.serve_static_assets = true config.serve_static_assets = true
config.static_cache_control = "public, max-age=3600" config.static_cache_control = "public, max-age=3600"

View File

@ -9,12 +9,16 @@ begin
rescue rescue
end end
Gitlab::Application.config.session_store( if Rails.env.test?
:redis_store, # Using the cookie_store would enable session replay attacks. Gitlab::Application.config.session_store :cookie_store, key: "_gitlab_session"
servers: Gitlab::Application.config.cache_store[1].merge(namespace: 'session:gitlab'), # re-use the Redis config from the Rails cache store else
key: '_gitlab_session', Gitlab::Application.config.session_store(
secure: Gitlab.config.gitlab.https, :redis_store, # Using the cookie_store would enable session replay attacks.
httponly: true, servers: Gitlab::Application.config.cache_store[1].merge(namespace: 'session:gitlab'), # re-use the Redis config from the Rails cache store
expire_after: Settings.gitlab['session_expire_delay'] * 60, key: '_gitlab_session',
path: (Gitlab::Application.config.relative_url_root.nil?) ? '/' : Gitlab::Application.config.relative_url_root secure: Gitlab.config.gitlab.https,
) httponly: true,
expire_after: Settings.gitlab['session_expire_delay'] * 60,
path: (Gitlab::Application.config.relative_url_root.nil?) ? '/' : Gitlab::Application.config.relative_url_root
)
end