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

[ci] Test source_controller #2749

Merged
merged 2 commits into from
Mar 8, 2017
Merged

[ci] Test source_controller #2749

merged 2 commits into from
Mar 8, 2017

Conversation

Ana06
Copy link
Member

@Ana06 Ana06 commented Mar 3, 2017

Test source_controller methods that are called in the old test suit from project_controller_tests.rb. :bowtie:

@Ana06 Ana06 added DO NOT MERGE ⚠️ Explain yourself if you add/remove this label to a PR Frontend Things related to the OBS RoR app and removed DO NOT MERGE ⚠️ Explain yourself if you add/remove this label to a PR labels Mar 3, 2017
@Ana06
Copy link
Member Author

Ana06 commented Mar 3, 2017

@Ana06 Ana06 changed the title [ci] Test source_controller#show_project_meta [ci] Test source_controller Mar 3, 2017
end

it { expect(response).to be_success }
it {expect(Xmlhash.parse(response.body)["name"]).to eq(project.name)}
Copy link
Member

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 }
Copy link
Member

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

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.
@Ana06
Copy link
Member Author

Ana06 commented Mar 6, 2017

@evanrolfe

Does this comment apply to all controller specs? Maybe it should go in the test suite guide instead?

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
Copy link
Member

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') }
Copy link
Member

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

@bgeuken
Copy link
Member

bgeuken commented Mar 7, 2017

@Ana06 *ping*

It is called in teh old test suite from `project_controller_tests.rb#test_updating_config_file`.
@bgeuken bgeuken merged commit d2ce5b7 into openSUSE:master Mar 8, 2017
@Ana06 Ana06 deleted the source_coverage branch October 6, 2018 09:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Frontend Things related to the OBS RoR app
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants