Sha256: 626468b99802dfccc2238b30d5bc1e31d75635024dcbf32d953588222de62a9b
Contents?: true
Size: 648 Bytes
Versions: 5
Compression:
Stored size: 648 Bytes
Contents
require 'spec_helper' describe Microscope::InstanceMethod::BooleanInstanceMethod do before do run_migration do create_table(:animals, force: true) do |t| t.boolean :fed, default: false end end microscope 'Animal' end describe '#feed!' do let(:animal) { Animal.create(fed: false) } it { expect { animal.feed! }.to change { animal.reload.fed? }.from(false).to(true) } end describe '#not_feed!' do let(:animal) { Animal.create(fed: true) } it { expect { animal.not_feed! }.to change { animal.reload.fed? }.from(true).to(false) } it { expect(animal).to respond_to(:unfeed!) } end end
Version data entries
5 entries across 5 versions & 1 rubygems