Skip to content

Commit

Permalink
Merge pull request #1093 from sul-dlss/media-format
Browse files Browse the repository at this point in the history
  • Loading branch information
mjgiarlo authored Dec 19, 2023
2 parents 23d56e2 + 4c3150b commit 1399a05
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 5 deletions.
2 changes: 1 addition & 1 deletion app/controllers/media_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ def hash_for_auth_check
end

def stacks_media_stream_params
allowed_params.slice(:format, :id, :file_name)
allowed_params.slice(:id, :file_name)
end

def id
Expand Down
2 changes: 1 addition & 1 deletion app/models/stacks_media_stream.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ def file
@file ||= StacksFile.new(id:, file_name:)
end

attr_accessor :format, :id, :file_name
attr_accessor :id, :file_name

delegate :etag, :mtime, to: :file

Expand Down
8 changes: 6 additions & 2 deletions spec/models/stacks_media_stream_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,11 @@
require 'rails_helper'

RSpec.describe StacksMediaStream do
it 'has a format accessor' do
expect(StacksMediaStream.new(format: 'abc').format).to eq 'abc'
let(:instance) { StacksMediaStream.new(id: 'bc123gg2323') }

describe '#id' do
subject { instance.id }

it { is_expected.to eq 'bc123gg2323' }
end
end
2 changes: 1 addition & 1 deletion spec/requests/media_auth_request_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
end

let(:mock_media) do
sms = StacksMediaStream.new(id: 'bb582xs1304', file_name: 'file', format:)
sms = StacksMediaStream.new(id: 'bb582xs1304', file_name: 'file')
allow(Purl).to receive(:public_xml).with('bb582xs1304').and_return(public_xml)
sms
end
Expand Down

0 comments on commit 1399a05

Please sign in to comment.