Sha256: 7f1fd7606b63ff9c525a3dfff7d0e2be1aabf10bc8152e907edc415195207252
Contents?: true
Size: 1.69 KB
Versions: 20
Compression:
Stored size: 1.69 KB
Contents
require 'spec_helper' require 'models/active_record/api.rb' describe "reading the current state" do it "uses the AASM default" do expect(DefaultState.new.aasm.current_state).to eql :alpha end it "uses the provided method" do expect(ProvidedState.new.aasm.current_state).to eql :beta end it "uses the persistence storage" do expect(PersistedState.new.aasm.current_state).to eql :alpha end it "uses the provided method even if persisted" do expect(ProvidedAndPersistedState.new.aasm.current_state).to eql :gamma end end describe "writing and persisting the current state" do it "uses the AASM default" do o = DefaultState.new o.release! expect(o.persisted_store).to be_nil end it "uses the provided method" do o = ProvidedState.new o.release! expect(o.persisted_store).to eql :beta end it "uses the persistence storage" do o = PersistedState.new o.release! expect(o.persisted_store).to be_nil end it "uses the provided method even if persisted" do o = ProvidedAndPersistedState.new o.release! expect(o.persisted_store).to eql :beta end end describe "writing the current state without persisting it" do it "uses the AASM default" do o = DefaultState.new o.release expect(o.transient_store).to be_nil end it "uses the provided method" do o = ProvidedState.new o.release expect(o.transient_store).to eql :beta end it "uses the persistence storage" do o = PersistedState.new o.release expect(o.transient_store).to be_nil end it "uses the provided method even if persisted" do o = ProvidedAndPersistedState.new o.release expect(o.transient_store).to eql :beta end end
Version data entries
20 entries across 20 versions & 1 rubygems