Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Expose multi-CV feature downstream #85

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from

Conversation

jeremylenz
Copy link

This removes allow_multiple_content_views from UpstreamOnlySettings, allowing it to be exposed downstream.

I didn't remove the UpstreamOnlySettings feature entirely, because I thought it might be handy to have in the future? thoughts welcome.

@evgeni
Copy link
Member

evgeni commented Sep 28, 2024

Stubbing constants is weird (in Ruby?). You'd need stub_const from either rspec-mocks or minitest-stub-const for that, I think.

@jeremylenz
Copy link
Author

Originally I was just setting them in the test, but that felt weird too. What's the non-weird way?

@ShimShtein
Copy link
Contributor

I think it would be better to redesign the UpstreamOnlySettings module to be a proper class:

class UpstreamOnlySettings
  def self.include?(key)
    new.include?
  def include?(key)
    SETTINGS.include?(key.to_s)
  end
end

Then it would be easier to stub the class:

UpstreamOnlySettings.any_instance.stubs(:include?).returns(false)

@jeremylenz
Copy link
Author

@ShimShtein good idea! updated.

I'm relying on CI to see if my tests are good, looks like someone needs to click a button for me

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants