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

Fixing validations #101

Merged
merged 6 commits into from
Oct 26, 2023
Merged

Fixing validations #101

merged 6 commits into from
Oct 26, 2023

Conversation

antopalidi
Copy link
Member

No description provided.

@antopalidi antopalidi requested a review from microstudi October 5, 2023 16:46
@codecov
Copy link

codecov bot commented Oct 5, 2023

Codecov Report

Attention: 1 lines in your changes are missing coverage. Please review.

Comparison is base (0b83ff7) 94.33% compared to head (78b806c) 94.45%.
Report is 1 commits behind head on main.

❗ Current head 78b806c differs from pull request most recent head 0f1f3dd. Consider uploading reports for the commit 0f1f3dd to get more accurate results

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #101      +/-   ##
==========================================
+ Coverage   94.33%   94.45%   +0.11%     
==========================================
  Files          66       66              
  Lines        1412     1424      +12     
==========================================
+ Hits         1332     1345      +13     
+ Misses         80       79       -1     
Files Coverage Δ
...cidim/participatory_documents/create_suggestion.rb 70.37% <100.00%> (+1.13%) ⬆️
...dim/participatory_documents/admin/document_form.rb 100.00% <100.00%> (ø)
...dels/decidim/participatory_documents/suggestion.rb 86.51% <100.00%> (+1.15%) ⬆️
...m/participatory_documents/pdf_document_uploader.rb 100.00% <100.00%> (ø)
...ticipatory_documents/admin/documents_controller.rb 86.66% <66.66%> (-1.47%) ⬇️

... and 1 file with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Contributor

@microstudi microstudi left a comment

Choose a reason for hiding this comment

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

Looks good, can you check a couple of comments?

@@ -59,6 +61,22 @@ module Decidim::ParticipatoryDocuments::Admin
expect(subject.box_opacity).to be_nil
end
end

context "when the document has no file" do
Copy link
Contributor

Choose a reason for hiding this comment

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

Are we missing a the case of uploading an invalid file?

Copy link
Member Author

Choose a reason for hiding this comment

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

this is done

let(:file) { upload_test_file(Decidim::Dev.test_file("dummy-dummies-example.json", "application/pdf")) }

it "is valid" do
expect(subject).to be_valid
Copy link
Contributor

Choose a reason for hiding this comment

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

shouldnt this case be invalid?

Copy link
Member Author

Choose a reason for hiding this comment

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

Validation of this file goes earlier, the form is submitted without the invalid file with no errors. I added that check to the commands test UpdateDocument

@antopalidi antopalidi self-assigned this Oct 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants