Sha256: 4dbaa6de818aceb47ad9f81cb962207f6ee2796e5bebbc53a09a5f64264423d2
Contents?: true
Size: 1.45 KB
Versions: 3
Compression:
Stored size: 1.45 KB
Contents
require 'spec_helper' def notice name Hashie::Mash.new(name: name.to_sym, type: :notice) end def error name Hashie::Mash.new(name: name.to_sym, type: :error) end describe Controll::Flow::EventMapper::Util do let(:redirections) do { :error => error_map, :notice => notice_map } end let(:notice_map) do {:welcome => valid_events } end let(:valid_events) { [:hello, :hi] } let(:invalid_events) { [:blip, :blap] } let(:error_map) do {bad: ['bad_payment', 'wrong_payment'] } end let(:types) { [:notice, :error] } context 'use' do subject { clazz.new hello, notice_map } let(:clazz) { Controll::Flow::EventMapper::Util } let(:hello) { notice :hello } let(:bad_payment) { error :bad_payment } describe '.initialize' do its(:event) { should be_a Controll::Event } its(:event_map) { should == notice_map } end describe '.map_event' do specify do subject.map_event.should == 'welcome' end end describe '.matcher' do specify do subject.send(:matcher).should be_a Controll::Event::Matcher end specify do subject.send(:matcher).event.should be_a Controll::Event end end describe '.valid?' do specify do subject.send(:valid?, valid_events).should be_true end specify do subject.send(:valid?, invalid_events).should be_false end end end end
Version data entries
3 entries across 3 versions & 1 rubygems
Version | Path |
---|---|
controll-0.3.2 | spec/controll/flow/event_mapper/util_spec.rb |
controll-0.3.1 | spec/controll/flow/event_mapper/util_spec.rb |
controll-0.3.0 | spec/controll/flow/event_mapper/util_spec.rb |