Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

can't convert Symbol into Integer when using rgeo, postgis for "have_db_column" shoulda matcher (in rails) #159

Closed
fourcolors opened this Issue · 2 comments

2 participants

@fourcolors

Hi

This is more of an shoulda-matcher issue but I didn't know where I should post this.

I'm using postgis, postgresql and rgeo to draw a route that is datatype of line_string with options geographic. When I run it though the shoulda matche I get

can't convert Symbol into Integer

Here is the matcher and migration that causes the issue. I think shoulda matchers should be able to handle this.

Migration

  #Geographic data that is the route
  t.line_string :route, :geographic => true

#rspec test with shoulda matcher
it {should have_db_column(:route).of_type(:line_string).with_options(:geographic)}

They migrations run fine and everything else is in order, the test just doesn't pass. Anyway, I thought I would post this so it could be fixed or maybe added for feature update for shoulda. I guess a work around would be to make my own custom matcher but it would be nice if this was handled by default.

@jferris
Admin

The with_options method there expects a hash, and you're giving it a symbol. The matcher also only accepts the options precision, limit, default, null, and scale. If you can write a good patch that will support generic options like "geographic," I'd pull it in.

@fourcolors

looks like it's a bad idea to test migrations lol. so.. i just deleted those migrations.

@fourcolors fourcolors closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.