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

Add tests for Samr::UserProperties #285

Merged
merged 1 commit into from
Mar 14, 2025

Conversation

zeroSteiner
Copy link
Contributor

This adds tests for Samr::UserProperties. There are no functional changes, just tests to ensure things continue to consistently work as we intend for them to.

Testing

  • Watch the tests pass

Sorry, something went wrong.

Comment on lines +43 to +57
context 'when #user_properties is cleared' do
before(:each) { subject.user_properties.clear }

it 'does not include the property_count' do
expect(subject.property_count?).to be_falsey
expect(subject.snapshot).to_not include(:property_count)
end

it 'does not include the user_properties' do
expect(subject.user_properties?).to be_falsey
expect(subject.snapshot).to_not include(:user_properties)
end
end
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This one here highlights the behavior that has been a problem in the past where the state of user_properties needs to be synced properly.

@smcintyre-r7 smcintyre-r7 added the DCERPC DCERPC related label Mar 14, 2025

it 'includes the user_properties' do
expect(subject.user_properties?).to be_truthy
expect(subject.snapshot).to include(:user_properties)
Copy link
Contributor

Choose a reason for hiding this comment

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

Same here?

Suggested change
expect(subject.snapshot).to include(:user_properties)
expect(subject.snapshot).to include(:user_properties)
expect(subject.user_properties).to eq([user_property1, user_property2])

@cdelafuente-r7 cdelafuente-r7 merged commit 984a58b into rapid7:master Mar 14, 2025
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
DCERPC DCERPC related
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants