Sha256: accae4337be75bae7aa5522916cc4feeb58276ba5c56dd6c62bec5ede252c199

Contents?: true

Size: 659 Bytes

Versions: 8

Compression:

Stored size: 659 Bytes

Contents

require 'spec_helper'

describe HatTrick::DSL do
  subject(:controller) {
    Class.new.send(:include, HatTrick::DSL).tap do |c|
      c.stubs(:before_filter)
      c.any_instance.stubs(:render)
    end
  }

  describe HatTrick::DSL::ClassMethods do
    describe "#step" do
      it "should call Wizard#add_step" do
        HatTrick::WizardDefinition.any_instance.expects(:add_step).with(:foo, {})
        controller.instance_eval do
          wizard do
            step :foo
          end
        end
      end

      it "raises an error if called outside a wizard block" do
        expect { controller.step :foo }.to raise_error
      end
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
hat-trick-0.4.0 spec/lib/hat_trick/dsl_spec.rb
hat-trick-0.3.0 spec/lib/hat_trick/dsl_spec.rb
hat-trick-0.2.2 spec/lib/hat_trick/dsl_spec.rb
hat-trick-0.2.1 spec/lib/hat_trick/dsl_spec.rb
hat-trick-0.2.0 spec/lib/hat_trick/dsl_spec.rb
hat-trick-0.1.5 spec/lib/hat_trick/dsl_spec.rb
hat-trick-0.1.4 spec/lib/hat_trick/dsl_spec.rb
hat-trick-0.1.3 spec/lib/hat_trick/dsl_spec.rb