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

Simplify type and current user in component tests #4690

Merged
merged 4 commits into from
Sep 8, 2021

Conversation

javierm
Copy link
Member

@javierm javierm commented Sep 4, 2021

Objectives

  • Use component test helper methods in all tests under spec/components/ without having to define type: :component
  • Simplify stubbing the current_user method in component tests

@javierm javierm added the Specs label Sep 4, 2021
@javierm javierm self-assigned this Sep 4, 2021
We're choosing `sign_in` instead of `login_as` because IMHO component
tests are more similar to controller tests than they are to system
tests.
The `sign_in(nil)` method was a bit hard to understand IMHO. After all,
in controller and system tests we don't have to specify no user is
signed in; that's the default behavior.

So we're making it the default behavior for component tests as well.
We don't need to sign in as administrator in order to see the tags;
anyone can see them.
@javierm javierm merged commit 30bbd84 into master Sep 8, 2021
@javierm javierm deleted the simplify_component_specs branch September 8, 2021 15:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants