-
Notifications
You must be signed in to change notification settings - Fork 20
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
Forbid using CRLF in the reg. code (bsc#1111419) #400
Conversation
lslezak
commented
Oct 11, 2018
- Forbid using CRLF in the reg. code they cannot be included in the registration code
- The code is sent in the HTTP header which does not allow using CRLF, it is used as header field separator.
- Normally you cannot enter a new line character into the input field but you can copy & paste it by mistake with the registration code
- 3.2.17
they cannot be included in the registration code - 3.2.17
# include CRLF characters which are not allowed | ||
let(:reg_code) { "\nmy-reg-code\r" } | ||
it "displays error popup and does not register the system" do | ||
expect(Yast::UI).to receive(:QueryWidget).with(:reg_code, :Value) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
np: IMHO, you are not testing this, so I would use allow
here to make it clear. The same for the next two lines.
expect(Yast::UI).to receive(:UserInput).and_return(:next, :abort) | ||
expect(Registration::UI::AbortConfirmation).to receive(:run).and_return(true) | ||
|
||
expect(Yast::Report).to receive(:Error).with(/Invalid registration code/) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This (and the next line) is what you really want to test. So it is fine to use expect
here.
✔️ Internal Jenkins job #6 successfully finished |