gitlab-org--gitlab-foss/spec
Rémy Coutable 71672dfa6a
Return an ApplicationSetting in CurrentSettings
This replaces the use of fake_application_settings with
`::ApplicationSetting.build`_from_defaults. The reason is that
`fake_application_settings` doesn't have the custom accessors that
`ApplicationSetting` has, e.g. `#commit_email_hostname`, thus this
can lead to unexpected `nil` values which comes from the database
column instead of `.default_commit_email_hostname` returned by
`ApplicationSetting#commit_email_hostname`.

Using `::ApplicationSetting.build_from_defaults` should be safe as it
doesn't try to `INSERT` a DB record, in contrary to
`::ApplicationSetting.create_from_defaults` which we used to use, and
which created issues that the introduction of
`fake_application_settings` tried to resolve (575dced5).

Signed-off-by: Rémy Coutable <remy@rymai.me>
2018-12-19 11:24:53 +01:00
..
bin
config
controllers Update specs to rails5 format 2018-12-19 10:04:31 +11:00
db
dependencies
factories Backfill project_repositories for legacy storage projects 2018-12-18 21:13:38 -02:00
features Merge branch '54146-fix-calendar-query' into 'master' 2018-12-19 10:03:44 +00:00
finders
fixtures
frontend
graphql
helpers
initializers Update specs to rails5 format 2018-12-19 10:04:31 +11:00
javascripts
lib Return an ApplicationSetting in CurrentSettings 2018-12-19 11:24:53 +01:00
mailers
migrations
models Merge branch 'force-reload-arguments-2' into 'master' 2018-12-18 15:05:52 +00:00
policies
presenters
rack_servers
requests Update specs to rails5 format 2018-12-19 10:04:31 +11:00
routing
rubocop
serializers
services Run CommonSystemNotesService on issuable create 2018-12-18 08:36:56 +08:00
sidekiq/cron
support Merge branch 'blackst0ne-convert-specs-rails5-style' into 'master' 2018-12-19 07:11:12 +00:00
tasks
uploaders
validators
views Adds releases index route 2018-12-18 11:01:55 +01:00
workers
factories_spec.rb
fast_spec_helper.rb
rails_helper.rb
rake_helper.rb
simplecov_env.rb
spec_helper.rb