As context, I have a form for programming exercises with a title and
description. The form also has fields for the associated Hint object,
just a regular text area field for the hint text.
When I submit a form using webrat and cucumber my application receives
'params' with:
"new_hint_attributes"=>"[{\"text\"=>\"This is hint 1\"}]"
The key 'new_hint_attributes' maps to a string causing the application
to crash during a cucumber test.
But when I submit the form using the browser my application receives
'params' with:
"new_hint_attributes"=>[{"text"=>"This is hint 1"}]
The key 'new_hint_attributes' maps to an array and everything works
fine.
-- You received this message because you are subscribed to the Google Groups "webrat" group.
To post to this group, send email to webrat@googlegroups.com.
To unsubscribe from this group, send email to webrat+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/webrat?hl=en.
> As context, I have a form for programming exercises with a title and
> description. The form also has fields for the associated Hint object,
> just a regular text area field for the hint text.
> When I submit a form using webrat and cucumber my application receives
> 'params' with:
> "new_hint_attributes"=>"[{\"text\"=>\"This is hint 1\"}]"
> The key 'new_hint_attributes' maps to a string causing the application
> to crash during a cucumber test.
> But when I submit the form using the browser my application receives
> 'params' with:
> "new_hint_attributes"=>[{"text"=>"This is hint 1"}]
> The key 'new_hint_attributes' maps to an array and everything works
> fine.
Maybe you can create a gist with the relevant parts of your app and
tests so that we can reproduce it?
-- You received this message because you are subscribed to the Google Groups "webrat" group.
To post to this group, send email to webrat@googlegroups.com.
To unsubscribe from this group, send email to webrat+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/webrat?hl=en.
> > As context, I have a form for programming exercises with a title and
> > description. The form also has fields for the associated Hint object,
> > just a regular text area field for the hint text.
> > When I submit a form using webrat and cucumber my application receives
> > 'params' with:
> > "new_hint_attributes"=>"[{\"text\"=>\"This is hint 1\"}]"
> > The key 'new_hint_attributes' maps to a string causing the application
> > to crash during a cucumber test.
> > But when I submit the form using the browser my application receives
> > 'params' with:
> > "new_hint_attributes"=>[{"text"=>"This is hint 1"}]
> > The key 'new_hint_attributes' maps to an array and everything works
> > fine.
> Maybe you can create a gist with the relevant parts of your app and
> tests so that we can reproduce it?
> --
> You received this message because you are subscribed to the Google Groups "webrat" group.
> To post to this group, send email to webrat@googlegroups.com.
> To unsubscribe from this group, send email to webrat+unsubscribe@googlegroups.com.
> For more options, visit this group athttp://groups.google.com/group/webrat?hl=en.
-- You received this message because you are subscribed to the Google Groups "webrat" group.
To post to this group, send email to webrat@googlegroups.com.
To unsubscribe from this group, send email to webrat+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/webrat?hl=en.
I've made some slight progress towards solving this. I switched from
Ruby 1.9.1 to ruby 1.8.7 and it solved the issue for several nested
file fields.
However, now I'm struggling with nested 'file_field'(s). I'm using
webrat 0.7.1, cucumber 0.7.2, rails 2.3.5 and ruby 1.8.7-p249
It is the same kind of error. I'm expecting an array of file fields in
'params'
I tried writing a few webrat specs to try and reproduce the problem
but I haven't had any luck. I was wondering if anyone is familiar with
what can cause "Expecting array but getting string" type errors.
> > > As context, I have a form for programming exercises with a title and
> > > description. The form also has fields for the associated Hint object,
> > > just a regular text area field for the hint text.
> > > When I submit a form using webrat and cucumber my application receives
> > > 'params' with:
> > > "new_hint_attributes"=>"[{\"text\"=>\"This is hint 1\"}]"
> > > The key 'new_hint_attributes' maps to a string causing the application
> > > to crash during a cucumber test.
> > > But when I submit the form using the browser my application receives
> > > 'params' with:
> > > "new_hint_attributes"=>[{"text"=>"This is hint 1"}]
> > > The key 'new_hint_attributes' maps to an array and everything works
> > > fine.
> > > I was wondering what I might be doing wrong.
> > Maybe you can create a gist with the relevant parts of your app and
> > tests so that we can reproduce it?
> > --
> > You received this message because you are subscribed to the Google Groups "webrat" group.
> > To post to this group, send email to webrat@googlegroups.com.
> > To unsubscribe from this group, send email to webrat+unsubscribe@googlegroups.com.
> > For more options, visit this group athttp://groups.google.com/group/webrat?hl=en.
> --
> You received this message because you are subscribed to the Google Groups "webrat" group.
> To post to this group, send email to webrat@googlegroups.com.
> To unsubscribe from this group, send email to webrat+unsubscribe@googlegroups.com.
> For more options, visit this group athttp://groups.google.com/group/webrat?hl=en.
-- You received this message because you are subscribed to the Google Groups "webrat" group.
To post to this group, send email to webrat@googlegroups.com.
To unsubscribe from this group, send email to webrat+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/webrat?hl=en.
I've been trying to figure this out for a few days now. To better
describe what I'm experiencing
I've created a very simple github rails project at http://github.com/flsafe/test
Check out the README on the github project page.
This project has just two models. A user and and Image. A user has
many images.
To see what I'm talking about one would clone the project with:
The output will contain a description of the values I'm expecting in
the
'params' variable in the controller.
I know it's a lot to ask to checkout the project. I'm sure everyone is
very busy.
But I would really appreciate it after trying to figure this out for a
few days.
Thanks
On May 10, 3:45 pm, Frank <francisco.li...@gmail.com> wrote:
> I've made some slight progress towards solving this. I switched from
> Ruby 1.9.1 to ruby 1.8.7 and it solved the issue for several nested
> file fields.
> However, now I'm struggling with nested 'file_field'(s). I'm using
> webrat 0.7.1, cucumber 0.7.2, rails 2.3.5 and ruby 1.8.7-p249
> It is the same kind of error. I'm expecting an array of file fields in
> 'params'
> I tried writing a few webrat specs to try and reproduce the problem
> but I haven't had any luck. I was wondering if anyone is familiar with
> what can cause "Expecting array but getting string" type errors.
> > > > As context, I have a form for programming exercises with a title and
> > > > description. The form also has fields for the associated Hint object,
> > > > just a regular text area field for the hint text.
> > > > When I submit a form using webrat and cucumber my application receives
> > > > 'params' with:
> > > > "new_hint_attributes"=>"[{\"text\"=>\"This is hint 1\"}]"
> > > > The key 'new_hint_attributes' maps to a string causing the application
> > > > to crash during a cucumber test.
> > > > But when I submit the form using the browser my application receives
> > > > 'params' with:
> > > > "new_hint_attributes"=>[{"text"=>"This is hint 1"}]
> > > > The key 'new_hint_attributes' maps to an array and everything works
> > > > fine.
> > > > I was wondering what I might be doing wrong.
> > > Maybe you can create a gist with the relevant parts of your app and
> > > tests so that we can reproduce it?
> > > --
> > > You received this message because you are subscribed to the Google Groups "webrat" group.
> > > To post to this group, send email to webrat@googlegroups.com.
> > > To unsubscribe from this group, send email to webrat+unsubscribe@googlegroups.com.
> > > For more options, visit this group athttp://groups.google.com/group/webrat?hl=en.
> > --
> > You received this message because you are subscribed to the Google Groups "webrat" group.
> > To post to this group, send email to webrat@googlegroups.com.
> > To unsubscribe from this group, send email to webrat+unsubscribe@googlegroups.com.
> > For more options, visit this group athttp://groups.google.com/group/webrat?hl=en.
> --
> You received this message because you are subscribed to the Google Groups "webrat" group.
> To post to this group, send email to webrat@googlegroups.com.
> To unsubscribe from this group, send email to webrat+unsubscribe@googlegroups.com.
> For more options, visit this group athttp://groups.google.com/group/webrat?hl=en.
-- You received this message because you are subscribed to the Google Groups "webrat" group.
To post to this group, send email to webrat@googlegroups.com.
To unsubscribe from this group, send email to webrat+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/webrat?hl=en.
> I've been trying to figure this out for a few days now. To better
> describe what I'm experiencing
> I've created a very simple github rails project at http://github.com/flsafe/test
> Check out the README on the github project page.
> This project has just two models. A user and and Image. A user has
> many images.
> To see what I'm talking about one would clone the project with:
> The output will contain a description of the values I'm expecting in
> the
> 'params' variable in the controller.
> I know it's a lot to ask to checkout the project. I'm sure everyone is
> very busy.
> But I would really appreciate it after trying to figure this out for a
> few days.
> Thanks
Just quickly Frank, you might have more luck with Capybara. It's basically a re-write of Webrat with a very similar API, but there seems to be a more active community around it.
I would try using capybara and see if your problem goes away. Then I'd try asking the capybara mailing list for help. There are a lot more people active in there.
> On May 10, 3:45 pm, Frank <francisco.li...@gmail.com> wrote:
>> I've made some slight progress towards solving this. I switched from
>> Ruby 1.9.1 to ruby 1.8.7 and it solved the issue for several nested
>> file fields.
>> However, now I'm struggling with nested 'file_field'(s). I'm using
>> webrat 0.7.1, cucumber 0.7.2, rails 2.3.5 and ruby 1.8.7-p249
>> It is the same kind of error. I'm expecting an array of file fields in
>> 'params'
>> I tried writing a few webrat specs to try and reproduce the problem
>> but I haven't had any luck. I was wondering if anyone is familiar with
>> what can cause "Expecting array but getting string" type errors.
>>>>> As context, I have a form for programming exercises with a title and
>>>>> description. The form also has fields for the associated Hint object,
>>>>> just a regular text area field for the hint text.
>>>>> When I submit a form using webrat and cucumber my application receives
>>>>> 'params' with:
>>>>> "new_hint_attributes"=>"[{\"text\"=>\"This is hint 1\"}]"
>>>>> The key 'new_hint_attributes' maps to a string causing the application
>>>>> to crash during a cucumber test.
>>>>> But when I submit the form using the browser my application receives
>>>>> 'params' with:
>>>>> "new_hint_attributes"=>[{"text"=>"This is hint 1"}]
>>>>> The key 'new_hint_attributes' maps to an array and everything works
>>>>> fine.
>>>>> I was wondering what I might be doing wrong.
>>>> Maybe you can create a gist with the relevant parts of your app and
>>>> tests so that we can reproduce it?
>>>> --
>>>> You received this message because you are subscribed to the Google Groups "webrat" group.
>>>> To post to this group, send email to webrat@googlegroups.com.
>>>> To unsubscribe from this group, send email to webrat+unsubscribe@googlegroups.com.
>>>> For more options, visit this group athttp://groups.google.com/group/webrat?hl=en.
>>> --
>>> You received this message because you are subscribed to the Google Groups "webrat" group.
>>> To post to this group, send email to webrat@googlegroups.com.
>>> To unsubscribe from this group, send email to webrat+unsubscribe@googlegroups.com.
>>> For more options, visit this group athttp://groups.google.com/group/webrat?hl=en.
>> --
>> You received this message because you are subscribed to the Google Groups "webrat" group.
>> To post to this group, send email to webrat@googlegroups.com.
>> To unsubscribe from this group, send email to webrat+unsubscribe@googlegroups.com.
>> For more options, visit this group athttp://groups.google.com/group/webrat?hl=en.
> -- > You received this message because you are subscribed to the Google Groups "webrat" group.
> To post to this group, send email to webrat@googlegroups.com.
> To unsubscribe from this group, send email to webrat+unsubscribe@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/webrat?hl=en.
-- You received this message because you are subscribed to the Google Groups "webrat" group.
To post to this group, send email to webrat@googlegroups.com.
To unsubscribe from this group, send email to webrat+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/webrat?hl=en.
On Tue, May 11, 2010 at 7:07 PM, Frank <francisco.li...@gmail.com> wrote:
> Hi Guys,
> I've been trying to figure this out for a few days now. To better
> describe what I'm experiencing
> I've created a very simple github rails project at http://github.com/flsafe/test
Hello Frank,
Thanks for providing a repo for the test.
After a couple of hours debugging this isssue, I added a branch that
shows that the behavior you're trying to use actually works. However,
in your sample app, you're using what I think is a strange flavor of
fields_for. Although I haven't done any Rails in a while, the docs
show that the usage should be like this:
http://github.com/brynary/webrat/blob/rails_attach_file/spec/integrat...
Can you please check if there's anything missing in the branch I
created? http://github.com/brynary/webrat/blob/rails_attach_file Note that under ./spec/integration/rails there's a fully fledged Rails
app that tests Webrat's integration with Rails.
If you see anything missing that would cause the integration test to
break, please provide a patch for the branch and we'll look into it.
Thank you.
-- You received this message because you are subscribed to the Google Groups "webrat" group.
To post to this group, send email to webrat@googlegroups.com.
To unsubscribe from this group, send email to webrat+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/webrat?hl=en.