require 'spec_helper' describe 'ordering methods' do describe '#available_steps' do before(:all){ @controller = Base::StepOneController.new } describe '#available_steps' do it 'should contain all steps' do get :show subject.available_steps.should eq [:step_one, :step_two, :step_three] end end describe '#step_is_available?' do it 'should return true if in list' do get :show subject.should be_step_is_available(:step_one) subject.should be_step_is_available(:step_two) subject.should be_step_is_available(:step_three) end it 'should return false if not available' do StairMaster::Step.any_instance.stubs(:available?).returns(false) get :show subject.should_not be_step_is_available(:step_one) end it 'should throw error if not apart of inital list' do get :show expect{ subject.step_is_available?(:step_four) }.to raise_error end end end end