-
Notifications
You must be signed in to change notification settings - Fork 251
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
Undefined method size
on 0.8.2
#214
Comments
We're locking to 0.7.0 for now, but I'll be happy to provide more information and/or help test a fix. |
Thanks for the report @GeekOnCoffee, much appreciated. Could you include a stack trace also? (We have one in #149, just wanted to double check that this is indeed the same issue, and that one is closed anyway so it's better to have it here.) |
I confirm that stacktrace is the same as in #149 (comment) |
@GeekOnCoffee |
Confirming the same issue @ollieh-m suggestion worked for me |
Hey guys! Got the same issue when I was moving along to Rails 5.2.0.rc1. Just downgraded to 0.7.0 again, may try the other fix another time. Came from this issue: rspec/rspec-rails#1915 Here's a backtrace if you want though....
|
Next week or so I'll try @ollieh-m 's approach as well |
No feedback received from @GeekOnCoffee since a long time. If someone feels the original problem remains, please speak up - closing for now, but will reopen if it turns out to still be a problem with v0.8.3. |
Well, this is not resolved IMO. Capybara 2.14.3 test suite fails with these kind of errors:
The full log is here: https://apps.fedoraproject.org/koschei/package/rubygem-capybara |
Thanks for the info @voxik. I looked into this but am having a bit of a hard time understanding why this happens. This is the failing code (from def build_file_part(parameter_name, uploaded_file)
uploaded_file.set_encoding(Encoding::BINARY) if uploaded_file.respond_to?(:set_encoding)
<<-EOF
--#{MULTIPART_BOUNDARY}\r
Content-Disposition: form-data; name="#{parameter_name}"; filename="#{escape(uploaded_file.original_filename)}"\r
Content-Type: #{uploaded_file.content_type}\r
Content-Length: #{uploaded_file.size}\r
\r
#{uploaded_file.read}\r
EOF
end The Do you have a repo that reproduces this? Like a branch in your gem's repo or so? It would help immensely when trying to understand why this happens now. Thanks in advance. |
Interesting, I fail to create test case which would prove this. But I am pretty sure that the |
Isn't the |
So I got to |
I reached this point: https://github.com/teamcapybara/capybara/blob/2.14.3/lib/capybara/rack_test/form.rb#L43 And this call simply does not call
|
These lines probably have the clue: https://github.com/teamcapybara/capybara/blob/2.14.3/lib/capybara/rack_test/form.rb#L3-L16 Subclassing This commit has the details: teamcapybara/capybara@95a297e#diff-c88a9acbdd8b694a0468c4e3839bbbb6 @voxik Is it critical for you to have this working with this (outdated) version of capybara? The latest version is 2.18.0 according to rubygems.org. So I'm inclined to close this as "known broken". The combination |
Unfortunately I am stuck with old Capybara, because newer Capybara has new dependencies, which are not in Fedora yet. Anyway, I took the commit from Capybara, which workaround the issue and I submitted the teamcapybara/capybara#1981, which changes Capybara to call the #initialize method of parent class. Please feel free to close this issue. There is probably nothing else what could be done here (although documenting the incompatibility might help, but who would read it, right? 😉 ) |
Unfortunately, this is quite true. But I will add a note in the README anyway. Thanks for your feedback! |
Howdy all! Just pinging to remind myself that I got this again. (On rack test 1.0.0 I think?) Bumping down to 0.7.0 solved it for me! :) |
@Schwad Interesting. If you can make a reproducible test case, we can give it a look. Closing so we don't keep this old issue alive (it's better to open up a new one for 1.0.0) |
We upgraded from 0.7.0 to 0.8.2 and we're seeing the undefined method
size
error on form submissions without an attachment field but no file attached. The same form works fine if a file is attached.We're using shrine for uploads, not sure if that's relevant.
Related to: #210
The text was updated successfully, but these errors were encountered: