summaryrefslogtreecommitdiff
path: root/spec/models/release_highlight_spec.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/models/release_highlight_spec.rb')
-rw-r--r--spec/models/release_highlight_spec.rb10
1 files changed, 9 insertions, 1 deletions
diff --git a/spec/models/release_highlight_spec.rb b/spec/models/release_highlight_spec.rb
index a5441e2f47b..14a43df4229 100644
--- a/spec/models/release_highlight_spec.rb
+++ b/spec/models/release_highlight_spec.rb
@@ -3,7 +3,7 @@
require 'spec_helper'
RSpec.describe ReleaseHighlight, :clean_gitlab_redis_cache do
- let(:fixture_dir_glob) { Dir.glob(File.join('spec', 'fixtures', 'whats_new', '*.yml')).grep(/\d*\_(\d*\_\d*)\.yml$/) }
+ let(:fixture_dir_glob) { Dir.glob(File.join(Rails.root, 'spec', 'fixtures', 'whats_new', '*.yml')).grep(/\d*\_(\d*\_\d*)\.yml$/) }
before do
allow(Dir).to receive(:glob).with(Rails.root.join('data', 'whats_new', '*.yml')).and_return(fixture_dir_glob)
@@ -193,4 +193,12 @@ RSpec.describe ReleaseHighlight, :clean_gitlab_redis_cache do
expect(subject).to eq('Free')
end
end
+
+ describe '.file_paths' do
+ it 'joins relative file paths with the root path to avoid caching the root url' do
+ allow(described_class).to receive(:relative_file_paths).and_return([+'/a.yml'])
+
+ expect(described_class.file_paths.first).to eq("#{Rails.root}/a.yml")
+ end
+ end
end