Skip to content

Commit

Permalink
Merge pull request #861 from sul-dlss/style-changes
Browse files Browse the repository at this point in the history
Send filename when creating and updating styles
  • Loading branch information
ndushay committed Mar 18, 2024
2 parents 3a4e709 + a2d1f34 commit 1fe5b44
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .rubocop_todo.yml
Expand Up @@ -24,7 +24,7 @@ Metrics/CyclomaticComplexity:
# Offense count: 22
# Configuration parameters: CountComments, CountAsOne, AllowedMethods, AllowedPatterns.
Metrics/MethodLength:
Max: 126
Max: 127

# Offense count: 1
# Configuration parameters: CountKeywordArgs, MaxOptionalParameters.
Expand Down
5 changes: 3 additions & 2 deletions lib/robots/dor_repo/gis_delivery/load_geoserver.rb
Expand Up @@ -232,8 +232,9 @@ def create_raster(connection, workspace_name)
logger.debug "load-geoserver: #{bare_druid} loaded style #{raster_style}"
if style_exists.nil?
logger.debug "load-geoserver: #{bare_druid} saving new style #{raster_style}"
style.create(style_name: raster_style, filename: nil)
style.update(style_name: raster_style, filename: nil, payload: sldtxt)
filename = "#{raster_style}.sld"
style.create(style_name: raster_style, filename:)
style.update(style_name: raster_style, filename:, payload: sldtxt)
end
else
raster_style = 'raster_grayband' # a simple band-oriented histogram adjusted style
Expand Down
4 changes: 2 additions & 2 deletions spec/robots/dor_repo/gis_delivery/load_geoserver_spec.rb
Expand Up @@ -909,8 +909,8 @@

it 'runs without error and updates style with correct payload' do
test_perform(robot, druid)
expect(style).to have_received(:create).with(style_name: "raster_#{druid}", filename: nil)
expect(style).to have_received(:update).with(style_name: "raster_#{druid}", filename: nil, payload:)
expect(style).to have_received(:create).with(style_name: "raster_#{druid}", filename: "raster_#{druid}.sld")
expect(style).to have_received(:update).with(style_name: "raster_#{druid}", filename: "raster_#{druid}.sld", payload:)
end
end

Expand Down

0 comments on commit 1fe5b44

Please sign in to comment.