Sha256: 4dccebba2e7e7a18686d9998b5ac9e663cc6b663baa04f18166ace57e44a2a18
Contents?: true
Size: 728 Bytes
Versions: 11
Compression:
Stored size: 728 Bytes
Contents
require 'spec_helper' describe Microscope::Scope::BooleanScope do subject { User } before do run_migration do create_table(:users, force: true) do |t| t.boolean :active, default: false end end microscope 'User' end describe 'positive scope' do before do @user1 = User.create(active: true) @user2 = User.create(active: false) end its(:active) { should have(1).items } its(:active) { should include(@user1) } end describe 'negative scope' do before do @user1 = User.create(active: false) @user2 = User.create(active: true) end its(:not_active) { should have(1).items } its(:not_active) { should include(@user1) } end end
Version data entries
11 entries across 11 versions & 1 rubygems