Skip to content

A platform for community discussion. Free, open, simple.

DEV: stop hardcoding ids in specs

Sam Saffron78c5adc093e2
diff --git a/spec/jobs/bulk_invite_spec.rb b/spec/jobs/bulk_invite_spec.rb
index 283fbee2e2d..f25bf7812e0 100644
--- a/spec/jobs/bulk_invite_spec.rb
+++ b/spec/jobs/bulk_invite_spec.rb
@@ -8,9 +8,9 @@ describe Jobs::BulkInvite do
fab!(:admin) { Fabricate(:admin) }
fab!(:group1) { Fabricate(:group, name: 'group1') }
fab!(:group2) { Fabricate(:group, name: 'group2') }
- fab!(:topic) { Fabricate(:topic, id: 999) }
+ fab!(:topic) { Fabricate(:topic) }
let(:email) { "[email protected]" }
- let(:invites) { [{ email: '[email protected]' }, { email: '[email protected]', groups: 'GROUP1;group2', topic_id: 999 }] }
+ let(:invites) { [{ email: '[email protected]' }, { email: '[email protected]', groups: 'GROUP1;group2', topic_id: topic.id }] }
it 'raises an error when the invites array is missing' do
expect { Jobs::BulkInvite.new.execute(current_user_id: user.id) }