Skip to content

Commit 8e90edb

Browse files
committed
Set/Override config.default_funder_id for tests
The 'User creates a new Plan' test will not pass unless an org exists within the db such that `org.id == Rails.application.config.default_funder_id`. However, we have `config.default_funder_id = Rails.application.secrets.default_funder_id` within `config/application.rb`. This secret is not read while executing the tests via our GitHub actions. Thus, we are overriding/setting that value within the test itself.
1 parent 1aa9933 commit 8e90edb

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

spec/features/plans_spec.rb

+2-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@
1010
@org = create(:org)
1111
@research_org = create(:org, :organisation, :research_institute,
1212
name: 'Test Research Org', templates: 1)
13-
@funding_org = create(:org, :funder, templates: 1, name: Rails.application.config.default_funder_name)
13+
@funding_org = create(:org, :funder, templates: 1)
14+
Rails.application.config.default_funder_id = @funding_org.id
1415
@template = create(:template, org: @org)
1516
@user = create(:user, org: @org)
1617
sign_in(@user)

0 commit comments

Comments
 (0)