Skip to content

Commit

Permalink
Merge pull request #14038 from ncounter/fix-time-tests
Browse files Browse the repository at this point in the history
  • Loading branch information
ncounter committed Mar 19, 2023
2 parents 39daeb7 + a0ccec9 commit 7cb6b33
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
RSpec.describe BsRequestActivityTimelineComponent, type: :component do
let(:bs_request) { create(:bs_request_with_submit_action) }
let!(:history_element) { create(:history_element_request_accepted, op_object_id: bs_request.id) }
let!(:comment) { create(:comment_request, commentable: bs_request, created_at: Time.zone.yesterday) }
let!(:comment) { create(:comment_request, commentable: bs_request, created_at: Time.now.utc - 1.day) }

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_selector('.timeline-item:first-child', text: 'wrote')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

RSpec.describe BsRequestCommentComponent, type: :component do
let(:commentable) { create(:bs_request_with_submit_action) }
let(:comment_a) { create(:comment_request, commentable: commentable, body: 'Comment A', created_at: Time.zone.yesterday) }
let(:comment_a) { create(:comment_request, commentable: commentable, body: 'Comment A', created_at: Time.now.utc - 1.day) }

before do
render_inline(described_class.new(comment: comment_a, commentable: commentable, level: 1))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
end

context 'for any kind of history elements' do
let(:element) { create(:history_element_request_accepted, user: user, created_at: Time.zone.yesterday) }
let(:element) { create(:history_element_request_accepted, user: user, created_at: Time.now.utc - 1.day) }

it 'displays an avatar' do
expect(rendered_content).to have_selector("img[title='#{user.realname}']", count: 1)
Expand Down

0 comments on commit 7cb6b33

Please sign in to comment.