-
Notifications
You must be signed in to change notification settings - Fork 433
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
[ci] Test source_controller #2749
Conversation
end | ||
|
||
it { expect(response).to be_success } | ||
it {expect(Xmlhash.parse(response.body)["name"]).to eq(project.name)} |
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.
whitespaces are missing here
put :update_project_config, params: { project: project, comment: 'Updated by test' } | ||
end | ||
|
||
it { expect(response).to be_success } |
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 would also check if the comment got created
# WARNING: If you change owner tests make sure you uncomment this line | ||
# and start a test backend. Some of the Owner methods | ||
# require real backend answers for projects/packages. | ||
# CONFIG['global_write_through'] = true |
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.
Does this comment apply to all controller specs? Maybe it should go in the test suite guide instead?
https://github.com/evanrolfe/open-build-service/blob/master/src/api/spec/README.md
Also what are the "owner tests" and "owner methods"?
It is tested in `project_controller_tests.rb#test_add_and_modify_repo` of the old test suite so there was a coverage difference between both test suites. I tested it with a simple project, instead with a complex one as it is done in the old test suite as it is not needed. It would be better to test the `Project#to_axml` method with a complex project than doing it here.
Not to all of them, only the ones that gave calls to the backend. And yes we should add it to the guide, I would do it in another PR as it is unrelated. 😉 |
before do | ||
login user | ||
put :update_project_config, params: { project: project, comment: 'Updated by test' } | ||
#project.reload |
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.
There is debug code left;-)
end | ||
|
||
it { expect(response).to be_success } | ||
it { expect(project.config.to_s).to include('Updated', 'by', 'test') } |
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.
JFYI There should also be a comment instance that got created for the project
@Ana06 *ping* |
It is called in teh old test suite from `project_controller_tests.rb#test_updating_config_file`.
Test
source_controller
methods that are called in the old test suit fromproject_controller_tests.rb
.