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 integration tests for comments #22511

Merged
merged 1 commit into from
Feb 19, 2016

Conversation

LukasReschke
Copy link
Member

This adds integration tests for the comments. Especially with regard to the permission handling, time to add automated security integration tests to our APIs.

It's not the super nicest approach but it works 😉
Fixes #22367

cc @MorrisJobke @DeepDiver1975 Please review.

@LukasReschke LukasReschke added this to the 9.0-current milestone Feb 18, 2016
@mention-bot
Copy link

By analyzing the blame information on this pull request, we identified @SergioBertolinSG, @MorrisJobke and @DeepDiver1975 to be potential reviewers

Given user "user0" exists
And As an "user0"
And User "user0" uploads file "data/textfile.txt" to "/myFileToComment.txt"
And "User0" posts a comment with content "My first comment" on the file named "/myFileToComment.txt" it should return "201"
Copy link
Member Author

Choose a reason for hiding this comment

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

Indentation 🙊

@LukasReschke LukasReschke force-pushed the add-integration-tests-for-comments branch from e22fbfb to 13253a5 Compare February 18, 2016 22:25
@LukasReschke LukasReschke mentioned this pull request Feb 18, 2016
3 tasks
And the response should contain a property "oc:actorDisplayName" with value "user1"
And the response should contain only "1" comments
Then As "user1" delete the created comment it should return "204"
Then As "user1 load all the comments of the file named "/myFileToComment.txt" it should return "207"
Copy link
Contributor

Choose a reason for hiding this comment

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

missing "

Copy link
Member Author

Choose a reason for hiding this comment

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

Good catch 😄

@LukasReschke LukasReschke force-pushed the add-integration-tests-for-comments branch 2 times, most recently from b9a9956 to d3636d7 Compare February 18, 2016 22:47
@SergioBertolinSG
Copy link
Contributor

I think the base of the gherkin syntax is being forgotten lately, 'given' for preconditions, 'when' for the actual test and 'then' for expected postconditions.

Here the scenarios doesn't have a when statement.

@LukasReschke LukasReschke force-pushed the add-integration-tests-for-comments branch from d3636d7 to f33ee86 Compare February 19, 2016 10:29
@LukasReschke
Copy link
Member Author

@SergioBertolinSG Mind taking another look? THX.

And the response should contain a property "oc:message" with value "My first comment"
And the response should contain a property "oc:actorDisplayName" with value "user1"
And the response should contain only "1" comments
Then As "user0" edit the last created comment and set text to "My edited comment" it should return "403"
Copy link
Contributor

Choose a reason for hiding this comment

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

newline ;)

Copy link
Member Author

Choose a reason for hiding this comment

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

Done 😄

@rullzer
Copy link
Contributor

rullzer commented Feb 19, 2016

👍 cool stuff!

@PVince81
Copy link
Contributor

Nice 👍

This adds integration tests for the comments. Especially with regard to the permission handling, didn't find any problem in it.

Fixes #22367
@LukasReschke LukasReschke force-pushed the add-integration-tests-for-comments branch from 9bb5b46 to 16be9af Compare February 19, 2016 17:08
LukasReschke added a commit that referenced this pull request Feb 19, 2016
…ments

Add integration tests for comments
@LukasReschke LukasReschke merged commit 357cdfd into master Feb 19, 2016
@LukasReschke LukasReschke deleted the add-integration-tests-for-comments branch February 19, 2016 17:10
@blizzz
Copy link
Contributor

blizzz commented Mar 1, 2016

Thank you.

@lock
Copy link

lock bot commented Aug 7, 2019

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.

@lock lock bot locked as resolved and limited conversation to collaborators Aug 7, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Security Check: Comments
9 participants