From ce222c0c045d21b77b73a956178530c2168c486e Mon Sep 17 00:00:00 2001 From: Faizaan Gagan Date: Thu, 15 Apr 2021 02:15:20 +0530 Subject: [PATCH] modified spec to confirm working for multiple users and groups --- spec/components/custom_wizard/action_spec.rb | 3 +++ spec/fixtures/wizard.json | 4 +++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/spec/components/custom_wizard/action_spec.rb b/spec/components/custom_wizard/action_spec.rb index 932539e5..ef6c4e57 100644 --- a/spec/components/custom_wizard/action_spec.rb +++ b/spec/components/custom_wizard/action_spec.rb @@ -93,6 +93,8 @@ describe CustomWizard::Action do it 'allows using multiple PM targets' do User.create(username: 'angus1', email: "angus1@email.com") User.create(username: 'faiz', email: "faiz@email.com") + Group.create(name: "cool_group") + Group.create(name: 'cool_group_1') wizard = CustomWizard::Builder.new(@template[:id], user).build wizard.create_updater(wizard.steps[0].id, {}).update wizard.create_updater(wizard.steps[1].id, {}).update @@ -108,6 +110,7 @@ describe CustomWizard::Action do ) expect(topic.exists?).to eq(true) expect(topic.first.all_allowed_users.map(&:username)).to include('angus1', 'faiz') + expect(topic.first.allowed_groups.map(&:name)).to include('cool_group', 'cool_group_1') expect(post.exists?).to eq(true) end end diff --git a/spec/fixtures/wizard.json b/spec/fixtures/wizard.json index 14210d7d..ccaea390 100644 --- a/spec/fixtures/wizard.json +++ b/spec/fixtures/wizard.json @@ -485,7 +485,9 @@ "output_connector": "set", "output": [ "angus1", - "faiz" + "faiz", + "cool_group", + "cool_group_1" ] } ]