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

DEV: Update test setup to work with auto groups #205

Merged
merged 2 commits into from
Jan 15, 2024

Conversation

Drenmi
Copy link
Contributor

@Drenmi Drenmi commented Jan 15, 2024

What is this change?

We're updating core to change TL based access settings to be group based. This requires some updates of tests to work correctly. (The existing test setup gives false positives.)

@Drenmi Drenmi force-pushed the dev/update-test-setup-to-work-with-auto-groups branch from b2f17e4 to 27e9bc2 Compare January 15, 2024 08:03
@Drenmi Drenmi force-pushed the dev/update-test-setup-to-work-with-auto-groups branch from 27e9bc2 to cdfddb7 Compare January 15, 2024 08:05
Comment on lines +92 to +93
before { User.set_callback(:create, :after, :ensure_in_trust_level_group) }
after { User.skip_callback(:create, :after, :ensure_in_trust_level_group) }
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A little bit ugly, to avoid this ugly: https://github.com/discourse/discourse/blob/main/spec/rails_helper.rb#L244-L245

This is because the plugin creates new users deep within its belly, and they need the auto-groups for the tag creation not to fail.

@Drenmi Drenmi marked this pull request as ready for review January 15, 2024 08:07
Copy link

@nattsw nattsw left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sadpikachu

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