Sha256: b80f90f70d9666209eaea016986222e2087674851c1615e9e4925042657d96d2
Contents?: true
Size: 1.03 KB
Versions: 27
Compression:
Stored size: 1.03 KB
Contents
require 'spec_helper' describe Scorpion::Rails::ActiveRecord::Model, type: :model do include Scorpion::Rspec::Helper before( :each ) do author = Author.create! name: "Pitbull" todo = 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 single associations" do todo = Todo.with_scorpion( scorpion ).first expect( todo.author.scorpion ).to be scorpion end it "shares scorpion with custom scope" do expect( Author.with_scorpion( scorpion ).named( "Pitbull" ).scorpion ).to be scorpion end it "shares scorpion with custom scope results" do expect( Author.with_scorpion( scorpion ).named( "Pitbull" ).first.scorpion ).to be scorpion end it "shares scorpion with custom scope extension results" do expect( Author.with_scorpion( scorpion ).named( "Pitbull" ).alphabetical.first.scorpion ).to be scorpion end end
Version data entries
27 entries across 27 versions & 1 rubygems