diff --git a/spec/models/wizards/signup/abo_magazin_wizard_spec.rb b/spec/models/wizards/signup/abo_magazin_wizard_spec.rb index d752c9a83..70ffc6f85 100644 --- a/spec/models/wizards/signup/abo_magazin_wizard_spec.rb +++ b/spec/models/wizards/signup/abo_magazin_wizard_spec.rb @@ -164,22 +164,25 @@ def build(params = required_attrs) end describe "#member_or_applied?" do + let(:person) { people(:mitglied) } + let(:group) { groups(:abo_die_alpen) } + before do - allow_any_instance_of(Wizards::Signup::AboBasicLoginWizard).to receive(:current_user).and_return(people(:mitglied)) + allow_any_instance_of(Wizards::Signup::AboBasicLoginWizard).to receive(:current_user).and_return(person) end it "returns true when user has abonnent role" do - Group::AboMagazin::Abonnent.create!(person: people(:mitglied), group: groups(:abo_die_alpen)) + Group::AboMagazin::Abonnent.create!(person:, group:) expect(wizard.member_or_applied?).to be_truthy end it "returns true when user has neuanmeldung role" do - Group::AboMagazin::Neuanmeldung.create!(person: people(:mitglied), group: groups(:abo_die_alpen)) + Group::AboMagazin::Neuanmeldung.create!(person:, group:) expect(wizard.member_or_applied?).to be_truthy end it "returns true when user has gratis abonnent role" do - Group::AboMagazin::Gratisabonnent.create!(person: people(:mitglied), group: groups(:abo_die_alpen)) + Group::AboMagazin::Gratisabonnent.create!(person:, group:) expect(wizard.member_or_applied?).to be_truthy end diff --git a/spec/models/wizards/signup/abo_touren_portal_wizard_spec.rb b/spec/models/wizards/signup/abo_touren_portal_wizard_spec.rb index a1a2c219d..335f98393 100644 --- a/spec/models/wizards/signup/abo_touren_portal_wizard_spec.rb +++ b/spec/models/wizards/signup/abo_touren_portal_wizard_spec.rb @@ -136,17 +136,19 @@ def build(params = required_attrs) end describe "#member_or_applied?" do + let(:person) { people(:mitglied) } + before do - allow_any_instance_of(Wizards::Signup::AboBasicLoginWizard).to receive(:current_user).and_return(people(:mitglied)) + allow_any_instance_of(Wizards::Signup::AboBasicLoginWizard).to receive(:current_user).and_return(person) end it "returns true when user has abonnent role" do - Group::AboTourenPortal::Abonnent.create!(person: people(:mitglied), group: group) + Group::AboTourenPortal::Abonnent.create!(person:, group:) expect(wizard.member_or_applied?).to be_truthy end it "returns true when user has neuanmeldung role" do - Group::AboTourenPortal::Neuanmeldung.create!(person: people(:mitglied), group: group) + Group::AboTourenPortal::Neuanmeldung.create!(person:, group:) expect(wizard.member_or_applied?).to be_truthy end