Skip to content

Commit

Permalink
Add missing test for appeal notification
Browse files Browse the repository at this point in the history
  • Loading branch information
saraycp authored and hennevogel committed Jun 17, 2024
1 parent 48338d0 commit a3aed0e
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/api/spec/factories/notification.rb
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,11 @@
notification.event_payload['reportable_type'] ||= notification.notifiable.reports.first.reportable.class.to_s
end
end

trait :appeal do
event_type { 'Event::AppealCreated' }
notifiable { association(:appeal) }
end
end

factory :rss_notification, parent: :notification do
Expand Down
10 changes: 10 additions & 0 deletions src/api/spec/helpers/webui/notification_helper_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,16 @@
expect(subject).to have_text("'#{notification.notifiable.moderator}' decided to favor the report. This is the reason:")
end
end

context 'when the notification is for Event::AppealCreated' do
let(:notification) do
create(:notification, :appeal)
end

it 'renders the information about the favored decision' do
expect(subject).to have_text("'#{notification.notifiable.appellant.login}' appealed the decision for the following reason:")
end
end
end
end
end

0 comments on commit a3aed0e

Please sign in to comment.