Forum: RSpec rspec and should have_many through

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
Ae592ef2737969945cb65e40d1d2f7b4?d=identicon&s=25 slavix t. (slavix)
on 2011-09-14 03:30
(Received via mailing list)
Anyone can help me with rspec shoulda validations  please.
I can't get the syntax right for these validations. Please correct me

    it { should have_one :tradable, :through => :trade_order}
    it { should belong_to :source,   :polymorphic => true }
    it { should have_many :transfers, :as => :source }

this is for Rspec 2, rails 3.1,

  gem "rspec-rails"
  gem "remarkable_activerecord", "~> 4.0.0.alpha4"
  gem 'rspec-rails-ext'
  gem 'rspec-rails-matchers'
  gem "shoulda-matchers"
Justin Ko (Guest)
on 2011-09-14 03:45
(Received via mailing list)
On Tue, Sep 13, 2011 at 8:53 PM, slavix <> wrote:

>  gem "rspec-rails"
I believe remarkable_activerecord and shoulda-matchers have conflicting
API's? Also, looks like you need to use methods, rather than symbols as

it { should have_one(:tradable).through(:trade_order) }
This topic is locked and can not be replied to.