diff --git a/spec/policies/matched_effort_policy_spec.rb b/spec/policies/matched_effort_policy_spec.rb index 3654c816d..7468dfa11 100644 --- a/spec/policies/matched_effort_policy_spec.rb +++ b/spec/policies/matched_effort_policy_spec.rb @@ -4,13 +4,13 @@ subject { described_class.new(user, matched_effort) } let!(:report) { create(:report, :approved, organisation: user.organisation, fund: activity.associated_fund) } - let(:matched_effort) { build_stubbed(:matched_effort, activity: activity) } + let(:matched_effort) { create(:matched_effort, activity: activity) } context "as a user that belongs to BEIS" do - let(:user) { build_stubbed(:beis_user) } + let(:user) { create(:beis_user) } context "when the activity is a programme activity owned by the organisation" do - let(:activity) { build_stubbed(:programme_activity, organisation: user.organisation) } + let(:activity) { create(:programme_activity, organisation: user.organisation) } it "permits all actions" do is_expected.to permit_action(:create) @@ -20,7 +20,7 @@ end context "when the activity is a project activity" do - let(:activity) { build_stubbed(:project_activity) } + let(:activity) { create(:project_activity) } it "forbids all actions" do is_expected.to forbid_action(:create) @@ -31,10 +31,10 @@ end context "as a partner organisation user" do - let(:user) { build_stubbed(:partner_organisation_user) } + let(:user) { create(:partner_organisation_user) } context "when the matched effort belongs to an activity owned by the user" do - let(:activity) { build_stubbed(:project_activity, organisation: user.organisation) } + let(:activity) { create(:project_activity, organisation: user.organisation) } context "when there is an editable report for the organisation" do before do @@ -58,7 +58,7 @@ end context "when the matched effort does not belong to an activity owned by the user" do - let(:activity) { build_stubbed(:project_activity) } + let(:activity) { create(:project_activity) } context "when there is an editable report for the organisation" do before do