ad985a7a28
Remove .raw from JavaScript fixture file names
Closes #59201
See merge request gitlab-org/gitlab-ce!26430
(cherry picked from commit 79a45f7f02
)
19 lines
688 B
Ruby
19 lines
688 B
Ruby
require 'spec_helper'
|
|
|
|
describe ApplicationController, '(Static JavaScript fixtures)', type: :controller do
|
|
include JavaScriptFixturesHelpers
|
|
|
|
Dir.glob('{,ee/}spec/javascripts/fixtures/**/*.haml').map do |file_path|
|
|
it "static/#{file_path.sub(%r{\A(ee/)?spec/javascripts/fixtures/}, '').sub(/\.haml\z/, '')}" do |example|
|
|
store_frontend_fixture(render_template(file_path), example.description)
|
|
end
|
|
end
|
|
|
|
private
|
|
|
|
def render_template(template_file_name)
|
|
controller = ApplicationController.new
|
|
controller.prepend_view_path(File.dirname(template_file_name))
|
|
controller.render_to_string(template: File.basename(template_file_name), layout: false)
|
|
end
|
|
end
|