diff --git a/src/api/spec/components/bs_request_activity_timeline_component_spec.rb b/src/api/spec/components/bs_request_activity_timeline_component_spec.rb index 77fb7a7c72b..172bdf7ab2c 100644 --- a/src/api/spec/components/bs_request_activity_timeline_component_spec.rb +++ b/src/api/spec/components/bs_request_activity_timeline_component_spec.rb @@ -4,11 +4,11 @@ let!(:comment) { travel_to(1.day.ago) { create(:comment_request, commentable: bs_request) } } it 'shows the comment first, as it is an older timeline item' do - expect(render_inline(described_class.new(bs_request: bs_request))).to have_css('.timeline-item:first-child', text: comment.user.login) - expect(render_inline(described_class.new(bs_request: bs_request))).to have_css('.timeline-item:first-child', text: '1 day ago') + expect(render_inline(described_class.new(bs_request: bs_request, history_elements: [history_element]))).to have_css('.timeline-item:first-child', text: comment.user.login) + expect(render_inline(described_class.new(bs_request: bs_request, history_elements: [history_element]))).to have_css('.timeline-item:first-child', text: '1 day ago') end it 'shows the history element in the second position, as it is more recent' do - expect(render_inline(described_class.new(bs_request: bs_request))).to have_css('.timeline-item:last-child', text: 'accepted request') + expect(render_inline(described_class.new(bs_request: bs_request, history_elements: [history_element]))).to have_css('.timeline-item:last-child', text: 'accepted request') end end