Sha256: 812a09a98b35ec10aa3fea440864b53cf123ec34d952f3c71ec72c4665297d06

Contents?: true

Size: 733 Bytes

Versions: 1

Compression:

Stored size: 733 Bytes

Contents

require "spec_helper"

describe '.available_scopes' do
  it 'should be an array' do
    expect(SomeThing.available_scopes).to be_a_kind_of(Array)
  end

  it 'should contain an array of scope names' do
    expect(SomeThing.available_scopes).to eq([:scope1])
  end

  it 'does not bleed into other models' do
    expect(SomeOtherThing.available_scopes).to eq([])
  end

  it 'cannot be mutated' do
    expected = SomeThing.available_scopes.dup
    SomeThing.available_scopes << :scope2
    expect(SomeThing.available_scopes).to eq(expected)
  end
end

describe '.additonal_available_scope' do
  it 'appends to the available scope list' do
    expect(OneMoreThing.available_scopes).to eq([:scope2, :class_method_as_a_scope])
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
scopelist-0.0.3 spec/scopelist_spec.rb