-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
Additional perm check in Webdav #25388
Conversation
PVince81
commented
Jul 6, 2016
•
edited
Loading
edited
- TODO: add unit tests
- smashbox: Add cases for Webdav COPY to shared folder smashbox#147
@PVince81, thanks for your PR! By analyzing the annotation information on this pull request, we identified @SergioBertolinSG, @rullzer, @icewind1991 and @DeepDiver1975 to be potential reviewers |
b3023d5
to
2b33227
Compare
Unit tests added. Please review @SergioBertolinSG @DeepDiver1975 @guruz @georgehrke @VicDeo |
👎 integration tests are not working fine: Some are skipped:
|
| shareType | 0 | | ||
| permissions | 1 | | ||
| shareWith | user0 | | ||
And "user1" copies file "/textfile0.txt" to "/testshare/overwritethis.txt" |
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.
Missing 'User' before "user1"
Strange think, I'm pretty sure I ran these tests individually. |
2b33227
to
f8d7757
Compare
@SergioBertolinSG @DeepDiver1975 @georgehrke @VicDeo @butonic please review |
Looks good 👍 |
jsunit test errors:
|
@DeepDiver1975 ah yes, that one was failing on master. Will rebase. |
f8d7757
to
bfaaff0
Compare
Rebased. The JS tests passed locally. |
Integration tests are fine. But why checking the http answer instead of downloading the destination files? like here https://github.com/owncloud/core/blob/master/build/integration/features/sharing-v1.feature#L280 |
bfaaff0
to
dc6c1bf
Compare
@SergioBertolinSG ok, I added a download check. I had to put the download code in a try-catch so we can check the 404 in some cases. |
| shareWith | user0 | | ||
And As an "user0" | ||
When User "user0" moves file "/textfile0.txt" to "/testshare/textfile0.txt" | ||
Then the HTTP status code should be "403" |
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 when and then should be And, seems confusing otherwise.
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.
I find having a second When more readable: "When doing X, Then I see Y". In this verification case we are doing two separate things to verify two. Are you sure this isn't valid ?
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.
And Downloading file XYZ
And the HTTP status code should be 404
isn't more readable. It is confusing because you can't distinguish between which one is the action and which one the check.
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.
It should be only one when statement.
I see two choices, just check the download and not the http answer or use And statements.
(Or perhaps write another new Then which checks downloaded file and http answer, which I don't recommend now)
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.
ok, as you wish. I'll use the And statements then because I want to have both checks (aka asserts) and don't want to duplicate the whole test.
This gives me the feeling that either Behat is not suitable or we might be using it wrong.
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.
No, it is suitable but every test should have only one when statement. We are reusing a typical "when" which downloads the file. Perhaps we could copy it as a then statement adding the content check and just verify downloaded file.
dc6c1bf
to
afea210
Compare
@SergioBertolinSG done |
@PVince81 Sorry for the nitpicking, but I was referring to the first when and then, so making it and and when then. |
@SergioBertolinSG I still don't get it. Can you make the change yourself ? |
Sure. |
Changed tests. There was a function already prepared for this case. |
@jvillafanez @SergioBertolinSG @DeepDiver1975 @guruz second review ? |
Looks good |
👍 |
Will prepare backports |
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |