Sha256: 6d4dc95a4cb4dae2ae1ef9da48cace6fe124b7a58229ea7ee988b867282d6f6b

Contents?: true

Size: 699 Bytes

Versions: 1

Compression:

Stored size: 699 Bytes

Contents

require 'spec_helper'

describe CassandraObject::Associations do
  context "belongs_to" do
    it "should fetch the user record from the belongs_to relationship from a cassandra object" do
      user = User.create! :position => 1
      issue = Issue.create! :description => 'web site not working', :worth => 1.5, :user_id => user.id
      expect(issue.user.id).to eq user.id
    end

    it "should fetch the cassandra object from the belongs_to relationship from an active record object" do
      issue = Issue.create! :description => 'web site not working', :worth => 1.5
      user = User.create! :position => 1, :issue_id => issue.id
      expect(user.issue.id).to eq issue.id
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
sessionm-cassandra_object-4.0.3 spec/cassandra_object/associations_spec.rb