Skip to content

Commit

Permalink
FIX: specs after discourse-assign group assignment (#27)
Browse files Browse the repository at this point in the history
Assignment become a polymorphic object accepting User or Group. Therefore, we don't have `assign_to_user_id` column anymore. Instead, we have ` assigned_to_id` and ` assigned_to_type`
  • Loading branch information
lis2 committed Aug 27, 2021
1 parent 25fc778 commit 50d5cf4
Showing 1 changed file with 3 additions and 3 deletions.
Expand Up @@ -999,7 +999,7 @@
post "/prometheus/receiver/#{token}", params: payload
end.to change { Topic.count }.by(1)

expect(topic.assigned_to_user.id).to eq(bob.id)
expect(topic.assigned_to).to eq(bob)
end

describe 'when prometheus_alert_receiver_enable_assign is false' do
Expand All @@ -1012,7 +1012,7 @@
post "/prometheus/receiver/#{token}", params: payload
end.to change { Topic.count }.by(1)

expect(topic.assigned_to_user).to eq(nil)
expect(topic.assigned_to).to eq(nil)
end
end

Expand All @@ -1031,7 +1031,7 @@
end.to change { Topic.count }.by(1)

expect(response.status).to eq(200)
expect(assignee_group.users.include?(topic.assigned_to_user)).to eq(true)
expect(assignee_group.users.include?(topic.assigned_to)).to eq(true)
topic.destroy!
end
end
Expand Down

0 comments on commit 50d5cf4

Please sign in to comment.