-
Notifications
You must be signed in to change notification settings - Fork 4
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
Fixing validations #101
Conversation
Codecov ReportAttention:
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
☔ View full report in Codecov by Sentry. |
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.
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 |
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.
Are we missing a the case of uploading an invalid file?
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 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 |
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.
shouldnt this case be invalid?
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.
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
No description provided.