Re: [rspec-users] rspec and shoulda have_indices

2011-09-03 Thread slavix
Yes. Thank you. I changed the code to list indices one at a time and it worked. it { should have_db_index(:currency_id) } it { should have_db_index(:user_id) } On Sep 3, 5:38 am, Michael Guterl wrote: > My guess is that it is checking for an compound index on all of those > fields.  Tr

Re: [rspec-users] rspec and shoulda have_indices

2011-09-03 Thread Michael Guterl
My guess is that it is checking for an compound index on all of those fields. Try specifying them individually and not in an array. On Fri, Sep 2, 2011 at 7:07 PM, slavix wrote: > now getting > Failure/Error: it { should > have_db_index([:user, :currency, :tradable]) } >       Expected Balance t

Re: [rspec-users] rspec and shoulda have_indices

2011-09-02 Thread slavix
now getting Failure/Error: it { should have_db_index([:user, :currency, :tradable]) } Expected Balance to have a index on columns user and currency and tradable () but the indexes are in the db.. (dev and test) Indexes: Action KeynameType Un

Re: [rspec-users] rspec and shoulda have_indices

2011-09-02 Thread David Chelimsky
I moved your post to the bottom. Please read http://idallen.com/topposting.html On Sep 2, 2011, at 5:58 PM, slavix wrote: > On Sep 2, 6:17 am, David Chelimsky wrote: >> On Sep 2, 2011, at 4:12 AM, slavix wrote: >> >>> Hello, >>> I am developing a rails 3.1 app. My Gemfile has shoulda gems >>>

Re: [rspec-users] rspec and shoulda have_indices

2011-09-02 Thread slavix
Thanks, I updated spec with correct statements it { should have_db_index([:user, :currency, :tradable]) } -- and my db (dev and test) has the indexes Indexes: Action Keyname TypeUnique Packed Field Cardinality Collation Null Comment EditDropPRIMARY BTREE Ye

Re: [rspec-users] rspec and shoulda have_indices

2011-09-02 Thread David Chelimsky
On Sep 2, 2011, at 4:12 AM, slavix wrote: > Hello, > I am developing a rails 3.1 app. My Gemfile has shoulda gems > Gemfile > .. > gem "shoulda" > gem "shoulda-matchers" You only need shoulda-matchers if you're using rspec. > In a model spec I have > spec file > it { should have_indices([:user,

[rspec-users] rspec and shoulda have_indices

2011-09-02 Thread slavix
Hello, I am developing a rails 3.1 app. My Gemfile has shoulda gems Gemfile .. gem "shoulda" gem "shoulda-matchers" In a model spec I have spec file it { should have_indices([:user, :currency]) } And I get this error... NoMethodError: undefined method `has_indices?' for # _