Fix misleading test
The access involvement changes exposed that this test wasn't doing what it said it was. For this to be a self-assignment the event creator and assignee need to be the same
This commit is contained in:
Vendored
+8
@@ -13,6 +13,14 @@ logo_assignment_jz:
|
||||
particulars: <%= { assignee_ids: [ ActiveRecord::FixtureSet.identify(:jz) ] }.to_json %>
|
||||
created_at: <%= 1.week.ago + 1.hour %>
|
||||
|
||||
logo_assignment_david:
|
||||
creator: david
|
||||
collection: writebook
|
||||
eventable: logo (Card)
|
||||
action: card_assigned
|
||||
particulars: <%= { assignee_ids: [ ActiveRecord::FixtureSet.identify(:david) ] }.to_json %>
|
||||
created_at: <%= 1.week.ago + 1.hour %>
|
||||
|
||||
logo_assignment_km:
|
||||
creator: david
|
||||
collection: writebook
|
||||
|
||||
@@ -65,9 +65,9 @@ class Notifier::EventNotifierTest < ActiveSupport::TestCase
|
||||
end
|
||||
|
||||
test "assignment events do not notify you if you assigned yourself" do
|
||||
collections(:writebook).access_for(users(:jz)).access_only!
|
||||
collections(:writebook).access_for(users(:david)).watching!
|
||||
|
||||
notifications = Notifier.for(events(:logo_assignment_jz)).notify
|
||||
notifications = Notifier.for(events(:logo_assignment_david)).notify
|
||||
|
||||
assert_empty notifications
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user