Fix application_id erroneous inclusion in ScheduledStatusSerializer (#33159)
				
					
				
			This commit is contained in:
		@@ -10,6 +10,6 @@ class REST::ScheduledStatusSerializer < ActiveModel::Serializer
 | 
			
		||||
  end
 | 
			
		||||
 | 
			
		||||
  def params
 | 
			
		||||
    object.params.without(:application_id)
 | 
			
		||||
    object.params.without('application_id')
 | 
			
		||||
  end
 | 
			
		||||
end
 | 
			
		||||
 
 | 
			
		||||
@@ -11,11 +11,18 @@ RSpec.describe REST::ScheduledStatusSerializer do
 | 
			
		||||
  end
 | 
			
		||||
 | 
			
		||||
  let(:account) { Fabricate(:account) }
 | 
			
		||||
  let(:scheduled_status) { Fabricate.build(:scheduled_status, scheduled_at: 4.minutes.from_now, account: account) }
 | 
			
		||||
  let(:scheduled_status) { Fabricate.build(:scheduled_status, scheduled_at: 4.minutes.from_now, account: account, params: { application_id: 123 }) }
 | 
			
		||||
 | 
			
		||||
  context 'with scheduled_at' do
 | 
			
		||||
  describe 'serialization' do
 | 
			
		||||
    it 'is serialized as RFC 3339 datetime' do
 | 
			
		||||
      expect { DateTime.rfc3339(subject['scheduled_at']) }.to_not raise_error
 | 
			
		||||
      expect { DateTime.rfc3339(subject['scheduled_at']) }
 | 
			
		||||
        .to_not raise_error
 | 
			
		||||
    end
 | 
			
		||||
 | 
			
		||||
    it 'returns expected values and removes application_id from params' do
 | 
			
		||||
      expect(subject.deep_symbolize_keys)
 | 
			
		||||
        .to include(scheduled_at: be_a(String))
 | 
			
		||||
        .and include(params: not_include(:application_id))
 | 
			
		||||
    end
 | 
			
		||||
  end
 | 
			
		||||
end
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user