require 'spec_helper' describe 'test methods' do describe '#on_last_step?' do context 'if first item' do before(:all){ @controller = Base::StepOneController.new } it 'should return false' do get :show subject.should_not be_on_last_step end end context 'if middle item' do before(:all){ @controller = Base::StepTwoController.new } it 'should return false' do get :show subject.should_not be_on_last_step end end context 'if last item' do before(:all){ @controller = Base::StepThreeController.new } it 'should return true' do get :show subject.should be_on_last_step end end end describe '#on_first_step?' do context 'if first item' do before(:all){ @controller = Base::StepOneController.new } it 'should return true' do get :show subject.should be_on_first_step end end context 'if middle item' do before(:all){ @controller = Base::StepTwoController.new } it 'should return false' do get :show subject.should_not be_on_first_step end end context 'if last item' do before(:all){ @controller = Base::StepTwoController.new } it 'should return false' do get :show subject.should_not be_on_first_step end end end describe '#is_last_step?' do before(:all){ @controller = Base::StepOneController.new } context 'if first item' do it 'should return false' do get :show subject.should_not be_is_last_step(:step_one) end end context 'if middle item' do it 'should return false' do get :show subject.should_not be_is_last_step(:step_two) end end context 'if last item' do it 'should return true' do get :show subject.should be_is_last_step(:step_three) end end end describe '#is_first_step?' do before(:all){ @controller = Base::StepOneController.new } context 'if first item' do it 'should return true' do get :show subject.should be_is_first_step(:step_one) end end context 'if middle item' do it 'should return false' do get :show subject.should_not be_is_first_step(:step_two) end end context 'if last item' do it 'should return false' do get :show subject.should_not be_is_first_step(:step_three) end end end end