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

Spec coverage on Settings/ controllers specs #24221

Merged
merged 8 commits into from
Apr 11, 2023

Conversation

mjankowski
Copy link
Contributor

Adds more coverage to the /settings/ controllers.

Does not quite get to 100% on this group ... but pretty close. Mostly failure edge cases left to do, but I think the full happy path is covered after these changes.

@mjankowski mjankowski force-pushed the settings-controllers-specs branch 3 times, most recently from 33eb31d to e905aeb Compare March 27, 2023 18:01
Copy link
Contributor

@ClearlyClaire ClearlyClaire left a comment

Choose a reason for hiding this comment

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

In most cases, the tests you added only check for the HTTP response code. While that's still an improvement given these methods aren't currently tested at all, that makes the test descriptions misleading, whereas similar test descriptions read something like “returns http success” in our other tests.

I'd like that either the tests get changed to actually test what they claim, or their description be changed to reflect what they are actually testing.

it 'removes an alias' do
delete :destroy, params: { id: account_alias.id }

expect(response).to redirect_to(settings_aliases_path)
Copy link
Contributor

Choose a reason for hiding this comment

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

I think it should also check that the record actually gets deleted.

it 'creates an alias for the user' do
post :create, params: { account_alias: { acct: '[email protected]' } }

expect(response).to redirect_to(settings_aliases_path)
Copy link
Contributor

Choose a reason for hiding this comment

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

I think it should also check that a record gets actually created.

@mjankowski mjankowski force-pushed the settings-controllers-specs branch from e905aeb to 4a19d6d Compare April 11, 2023 09:12
@mjankowski
Copy link
Contributor Author

Pushed update with a few spec changes for better creation/deletion checks, and also some wording changes to make some of the descriptions less inaccurate.

You are correct that my current goal here is broad coverage and just getting all the lines executing in the spec. I'll continue to go deeper on actual behavior specs once the broad coverage is solid.

@ClearlyClaire ClearlyClaire merged commit 36eeb70 into mastodon:main Apr 11, 2023
@mjankowski mjankowski deleted the settings-controllers-specs branch April 11, 2023 09:41
skerit pushed a commit to 11ways/mastodon that referenced this pull request Jul 7, 2023
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.

2 participants