calebhearth / formulaic

Simplify form filling with Capybara
MIT License
552 stars 29 forks source link

Formulaic does not know how to fill in a Symbol value #50

Closed hovsater closed 8 years ago

hovsater commented 8 years ago

Hi,

I'm using Formulaic in a project of mine and we use an enum type for selecting a user's role. Since enum values are of type Symbol, Formulaic complains with the following error message:

Formulaic does not know how to fill in a Symbol value

My suggestion would be to convert symbol values to strings by calling #to_s on them and then let StringInput class handle it as usual. What do you think about this? Can this have any side effects that I'm not seeing right now?

I'd love to send a pull request as we decide on a solution! :smile:

Cheers, Kevin

calebhearth commented 8 years ago

It makes sense to me to treat them the same as Strings, which would try to select and fill_in at least.

On Nov 26, 2015, at 11:40 AM, Kevin Sjöberg notifications@github.com wrote:

Hi,

I'm using Formulaic in a project of mine and we use an enum type for selecting a user's role. Since enum values are of type Symbol, Formulaic complains with the following error message:

Formulaic does not know how to fill in a Symbol value

I was wondering if we could solve this in any particular way? Enums should be filled out as select inputs in my opinion. I'd be happy to submit a pull request if we can decide on a solution.

Cheers, Kevin

— Reply to this email directly or view it on GitHub.

hovsater commented 8 years ago

@calebthompson I've sent a pull request addressing this issue. You can find at #51.

hovsater commented 8 years ago

Closed by #51.

hovsater commented 8 years ago

@calebthompson I'm closing this since we've merged #51.