Sha256: be9024c0f42def8c713c0d5489dc02a263f44b7248b36d1977fd577510144f4c

Contents?: true

Size: 742 Bytes

Versions: 9

Compression:

Stored size: 742 Bytes

Contents

require "spec_helper"

describe Scorpion::Rails::ActiveRecord::Association, type: :model do
  include Scorpion::Rspec::Helper

  before( :each ) do
    author = Author.create! name: "Pitbull"
    Todo.create! name: "Be even more awesome", author: author
  end

  it "shares scorpion with associations" do
    author = Author.with_scorpion( scorpion ).first
    expect( author.todos.scorpion ).to be scorpion
  end

  it "shares scorpion with association results" do
    author = Author.with_scorpion( scorpion ).first
    expect( author.todos.first.scorpion ).to be scorpion
  end

  it "shares scorpion with single associations" do
    todo = Todo.with_scorpion( scorpion ).first
    expect( todo.author.scorpion ).to be scorpion
  end

end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
scorpion-ioc-1.0.10 spec/lib/scorpion/rails/active_record/association_spec.rb
scorpion-ioc-1.0.8 spec/lib/scorpion/rails/active_record/association_spec.rb
scorpion-ioc-1.0.7 spec/lib/scorpion/rails/active_record/association_spec.rb
scorpion-ioc-1.0.6 spec/lib/scorpion/rails/active_record/association_spec.rb
scorpion-ioc-1.0.4 spec/lib/scorpion/rails/active_record/association_spec.rb
scorpion-ioc-1.0.3 spec/lib/scorpion/rails/active_record/association_spec.rb
scorpion-ioc-1.0.2 spec/lib/scorpion/rails/active_record/association_spec.rb
scorpion-ioc-1.0.1 spec/lib/scorpion/rails/active_record/association_spec.rb
scorpion-ioc-1.0.0 spec/lib/scorpion/rails/active_record/association_spec.rb