Skip to content

Commit

Permalink
Set/Override config.default_funder_id for tests
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
aaronskiba committed Sep 13, 2024
1 parent 1aa9933 commit 8e90edb
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion spec/features/plans_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@
@org = create(:org)
@research_org = create(:org, :organisation, :research_institute,
name: 'Test Research Org', templates: 1)
@funding_org = create(:org, :funder, templates: 1, name: Rails.application.config.default_funder_name)
@funding_org = create(:org, :funder, templates: 1)
Rails.application.config.default_funder_id = @funding_org.id
@template = create(:template, org: @org)
@user = create(:user, org: @org)
sign_in(@user)
Expand Down

0 comments on commit 8e90edb

Please sign in to comment.