stair_master 0.0.3 → 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/{LICENSE → MIT-LICENSE} +1 -1
- data/README.md +5 -6
- data/Rakefile +2 -2
- data/app/concerns/stair_master/controller.rb +20 -10
- data/lib/stair_master/concerns/ordering.rb +1 -6
- data/lib/stair_master/concerns/tests.rb +0 -5
- data/lib/stair_master/concerns/traversal.rb +1 -1
- data/lib/stair_master/conditions.rb +0 -1
- data/lib/stair_master/conditions/base.rb +0 -8
- data/lib/stair_master/step.rb +2 -10
- data/lib/stair_master/version.rb +1 -1
- data/spec/controllers/base/ordering_spec.rb +0 -23
- data/spec/controllers/base/skip_if_spec.rb +395 -0
- data/spec/controllers/base/skip_unless_spec.rb +151 -0
- data/spec/controllers/base/traversal_spec.rb +247 -158
- data/spec/dummy/Rakefile +1 -1
- data/spec/dummy/app/controllers/concerns/skip_if_methods.rb +24 -0
- data/spec/dummy/app/controllers/concerns/skip_unless_methods.rb +24 -0
- data/spec/dummy/app/controllers/skip_if/step_one_controller.rb +11 -0
- data/spec/dummy/app/controllers/skip_if/step_three_controller.rb +11 -0
- data/spec/dummy/app/controllers/skip_if/step_two_controller.rb +11 -0
- data/spec/dummy/app/controllers/skip_unless/step_one_controller.rb +11 -0
- data/spec/dummy/app/controllers/skip_unless/step_three_controller.rb +11 -0
- data/spec/dummy/app/controllers/skip_unless/step_two_controller.rb +11 -0
- data/spec/dummy/app/steps/skip_if_map.rb +11 -0
- data/spec/dummy/app/steps/skip_unless_map.rb +11 -0
- data/spec/dummy/config/routes.rb +12 -0
- data/spec/dummy/log/development.log +0 -227
- data/spec/dummy/log/test.log +14941 -875
- data/spec/dummy/tmp/cache/assets/test/sprockets/13fe41fee1fe35b49d145bcc06610705 +0 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/2f5173deea6c795b8fdde723bb4b63af +0 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/357970feca3ac29060c1e3861e2c0953 +0 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/cffd775d018f68ce5dba1ee0d951a994 +0 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/d771ace226fc8215a3572e0aa35bb0d6 +0 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/f7cbd26ba1d28d48de824f0e94586655 +0 -0
- data/spec/spec_helper.rb +0 -1
- metadata +78 -108
- data/.gitignore +0 -18
- data/.rspec +0 -1
- data/Gemfile +0 -4
- data/Gemfile.lock +0 -152
- data/Guardfile +0 -16
- data/LICENSE.txt +0 -22
- data/lib/stair_master/conditions/availability.rb +0 -13
- data/spec/controllers/base/getters_spec.rb +0 -9
- data/spec/dummy/app/assets/images/.keep +0 -0
- data/spec/dummy/app/mailers/.keep +0 -0
- data/spec/dummy/app/models/.keep +0 -0
- data/spec/dummy/app/models/concerns/.keep +0 -0
- data/spec/dummy/app/steps/available_if_map.rb +0 -13
- data/spec/dummy/lib/assets/.keep +0 -0
- data/spec/dummy/log/.keep +0 -0
- data/stair_master.gemspec +0 -33
| @@ -0,0 +1,151 @@ | |
| 1 | 
            +
            require 'spec_helper'
         | 
| 2 | 
            +
             | 
| 3 | 
            +
            describe 'when skip_unless condition is defined' do
         | 
| 4 | 
            +
              describe '#previous_step' do
         | 
| 5 | 
            +
                context 'when first step' do
         | 
| 6 | 
            +
                  before(:all) {
         | 
| 7 | 
            +
                    @controller = SkipUnless::StepOneController.new
         | 
| 8 | 
            +
                  }
         | 
| 9 | 
            +
             | 
| 10 | 
            +
                  it 'should be nil' do
         | 
| 11 | 
            +
                    SkipUnless::StepOneController.any_instance.stubs(:dont_skip_step_one?).returns(true)
         | 
| 12 | 
            +
                    get :show
         | 
| 13 | 
            +
             | 
| 14 | 
            +
                    expect(subject.previous_step).to be_nil
         | 
| 15 | 
            +
                  end
         | 
| 16 | 
            +
                end
         | 
| 17 | 
            +
             | 
| 18 | 
            +
                context 'when second step' do
         | 
| 19 | 
            +
                  context 'when should NOT be skipped' do
         | 
| 20 | 
            +
                    before(:all) {
         | 
| 21 | 
            +
                      @controller = SkipUnless::StepTwoController.new
         | 
| 22 | 
            +
                    }
         | 
| 23 | 
            +
             | 
| 24 | 
            +
                    it 'should get step 1' do
         | 
| 25 | 
            +
                      SkipUnless::StepTwoController.any_instance.stubs(:dont_skip_step_one?).returns(true)
         | 
| 26 | 
            +
                      SkipUnless::StepTwoController.any_instance.stubs(:dont_skip_step_two?).returns(true)
         | 
| 27 | 
            +
                      get :show
         | 
| 28 | 
            +
             | 
| 29 | 
            +
                      expect(subject.previous_step.label).to eq 'Step 1'
         | 
| 30 | 
            +
                    end
         | 
| 31 | 
            +
                  end
         | 
| 32 | 
            +
             | 
| 33 | 
            +
                  context 'when should be skipped' do
         | 
| 34 | 
            +
                    before(:all) {
         | 
| 35 | 
            +
                      @controller = SkipUnless::StepTwoController.new
         | 
| 36 | 
            +
                    }
         | 
| 37 | 
            +
             | 
| 38 | 
            +
                    it 'should return nil' do
         | 
| 39 | 
            +
                      SkipUnless::StepTwoController.any_instance.stubs(:dont_skip_step_two?).returns(true)
         | 
| 40 | 
            +
                      get :show
         | 
| 41 | 
            +
             | 
| 42 | 
            +
                      expect(subject.previous_step).to be_nil
         | 
| 43 | 
            +
                    end
         | 
| 44 | 
            +
                  end
         | 
| 45 | 
            +
                end
         | 
| 46 | 
            +
             | 
| 47 | 
            +
                context 'when third step' do
         | 
| 48 | 
            +
                  context 'when should NOT be skipped' do
         | 
| 49 | 
            +
                    before(:all) {
         | 
| 50 | 
            +
                      @controller = SkipUnless::StepThreeController.new
         | 
| 51 | 
            +
                    }
         | 
| 52 | 
            +
             | 
| 53 | 
            +
                    it 'should get step 2' do
         | 
| 54 | 
            +
                      SkipUnless::StepThreeController.any_instance.stubs(:dont_skip_step_two?).returns(true)
         | 
| 55 | 
            +
                      SkipUnless::StepThreeController.any_instance.stubs(:dont_skip_step_three?).returns(true)
         | 
| 56 | 
            +
                      get :show
         | 
| 57 | 
            +
             | 
| 58 | 
            +
                      expect(subject.previous_step.label).to eq 'Step 2'
         | 
| 59 | 
            +
                    end
         | 
| 60 | 
            +
                  end
         | 
| 61 | 
            +
             | 
| 62 | 
            +
                  context 'when should be skipped' do
         | 
| 63 | 
            +
                    before(:all) {
         | 
| 64 | 
            +
                      @controller = SkipUnless::StepThreeController.new
         | 
| 65 | 
            +
                    }
         | 
| 66 | 
            +
             | 
| 67 | 
            +
                    it 'should be step 1' do
         | 
| 68 | 
            +
                      SkipUnless::StepThreeController.any_instance.stubs(:dont_skip_step_one?).returns(true)
         | 
| 69 | 
            +
                      SkipUnless::StepThreeController.any_instance.stubs(:dont_skip_step_three?).returns(true)
         | 
| 70 | 
            +
                      get :show
         | 
| 71 | 
            +
             | 
| 72 | 
            +
                      expect(subject.previous_step.label).to eq 'Step 1'
         | 
| 73 | 
            +
                    end
         | 
| 74 | 
            +
                  end
         | 
| 75 | 
            +
                end
         | 
| 76 | 
            +
              end
         | 
| 77 | 
            +
             | 
| 78 | 
            +
              describe '#next_step' do
         | 
| 79 | 
            +
                context 'when first step' do
         | 
| 80 | 
            +
                  context 'when should NOT be skipped' do
         | 
| 81 | 
            +
                    before(:all) {
         | 
| 82 | 
            +
                      @controller = SkipUnless::StepOneController.new
         | 
| 83 | 
            +
                    }
         | 
| 84 | 
            +
             | 
| 85 | 
            +
                    it 'should get step 2' do
         | 
| 86 | 
            +
                      SkipUnless::StepOneController.any_instance.stubs(:dont_skip_step_one?).returns(true)
         | 
| 87 | 
            +
                      SkipUnless::StepOneController.any_instance.stubs(:dont_skip_step_two?).returns(true)
         | 
| 88 | 
            +
                      get :show
         | 
| 89 | 
            +
             | 
| 90 | 
            +
                      expect(subject.next_step.label).to eq 'Step 2'
         | 
| 91 | 
            +
                    end
         | 
| 92 | 
            +
                  end
         | 
| 93 | 
            +
             | 
| 94 | 
            +
                  context 'when should be skipped' do
         | 
| 95 | 
            +
                    before(:all) {
         | 
| 96 | 
            +
                      @controller = SkipUnless::StepOneController.new
         | 
| 97 | 
            +
                    }
         | 
| 98 | 
            +
             | 
| 99 | 
            +
                    it 'should get step 3' do
         | 
| 100 | 
            +
                      SkipUnless::StepOneController.any_instance.stubs(:dont_skip_step_one?).returns(true)
         | 
| 101 | 
            +
                      SkipUnless::StepOneController.any_instance.stubs(:dont_skip_step_three?).returns(true)
         | 
| 102 | 
            +
                      get :show
         | 
| 103 | 
            +
             | 
| 104 | 
            +
                      expect(subject.next_step.label).to eq 'Step 3'
         | 
| 105 | 
            +
                    end
         | 
| 106 | 
            +
                  end
         | 
| 107 | 
            +
                end
         | 
| 108 | 
            +
             | 
| 109 | 
            +
                context 'when second step' do
         | 
| 110 | 
            +
                  context 'when should NOT be skipped' do
         | 
| 111 | 
            +
                    before(:all) {
         | 
| 112 | 
            +
                      @controller = SkipUnless::StepTwoController.new
         | 
| 113 | 
            +
                    }
         | 
| 114 | 
            +
             | 
| 115 | 
            +
                    it 'should be step 3' do
         | 
| 116 | 
            +
                      SkipUnless::StepTwoController.any_instance.stubs(:dont_skip_step_two?).returns(true)
         | 
| 117 | 
            +
                      SkipUnless::StepTwoController.any_instance.stubs(:dont_skip_step_three?).returns(true)
         | 
| 118 | 
            +
                      get :show
         | 
| 119 | 
            +
             | 
| 120 | 
            +
                      expect(subject.next_step.label).to eq 'Step 3'
         | 
| 121 | 
            +
                    end
         | 
| 122 | 
            +
                  end
         | 
| 123 | 
            +
             | 
| 124 | 
            +
                  context 'when should be skipped' do
         | 
| 125 | 
            +
                    before(:all) {
         | 
| 126 | 
            +
                      @controller = SkipUnless::StepTwoController.new
         | 
| 127 | 
            +
                    }
         | 
| 128 | 
            +
             | 
| 129 | 
            +
                    it 'should return nil' do
         | 
| 130 | 
            +
                      SkipUnless::StepTwoController.any_instance.stubs(:dont_skip_step_two?).returns(true)
         | 
| 131 | 
            +
                      get :show
         | 
| 132 | 
            +
             | 
| 133 | 
            +
                      expect(subject.next_step).to be_nil
         | 
| 134 | 
            +
                    end
         | 
| 135 | 
            +
                  end
         | 
| 136 | 
            +
                end
         | 
| 137 | 
            +
             | 
| 138 | 
            +
                context 'when third step' do
         | 
| 139 | 
            +
                  before(:all) {
         | 
| 140 | 
            +
                    @controller = SkipUnless::StepThreeController.new
         | 
| 141 | 
            +
                  }
         | 
| 142 | 
            +
             | 
| 143 | 
            +
                  it 'should get step 2' do
         | 
| 144 | 
            +
                    SkipUnless::StepThreeController.any_instance.stubs(:dont_skip_step_three?).returns(true)
         | 
| 145 | 
            +
                    get :show
         | 
| 146 | 
            +
             | 
| 147 | 
            +
                    expect(subject.next_step).to be_nil
         | 
| 148 | 
            +
                  end
         | 
| 149 | 
            +
                end
         | 
| 150 | 
            +
              end
         | 
| 151 | 
            +
            end
         | 
| @@ -1,255 +1,344 @@ | |
| 1 1 | 
             
            require 'spec_helper'
         | 
| 2 2 |  | 
| 3 3 | 
             
            describe 'traversal' do
         | 
| 4 | 
            -
               | 
| 5 | 
            -
                 | 
| 6 | 
            -
                   | 
| 7 | 
            -
             | 
| 8 | 
            -
             | 
| 9 | 
            -
             | 
| 10 | 
            -
                   | 
| 11 | 
            -
                     | 
| 12 | 
            -
             | 
| 13 | 
            -
             | 
| 14 | 
            -
                      expect(subject.current_step.label).to eq 'Step 1'
         | 
| 15 | 
            -
                    end
         | 
| 4 | 
            +
              describe '#current_step' do
         | 
| 5 | 
            +
                context 'when first step' do
         | 
| 6 | 
            +
                  before(:all){
         | 
| 7 | 
            +
                    @controller = Base::StepOneController.new
         | 
| 8 | 
            +
                  }
         | 
| 9 | 
            +
             | 
| 10 | 
            +
                  it 'should get step' do
         | 
| 11 | 
            +
                    get :show
         | 
| 12 | 
            +
             | 
| 13 | 
            +
                    expect(subject.current_step.label).to eq 'Step 1'
         | 
| 16 14 | 
             
                  end
         | 
| 15 | 
            +
                end
         | 
| 16 | 
            +
             | 
| 17 | 
            +
                context 'when middle step' do
         | 
| 18 | 
            +
                  before(:all){
         | 
| 19 | 
            +
                    @controller = Base::StepTwoController.new
         | 
| 20 | 
            +
                  }
         | 
| 17 21 |  | 
| 18 | 
            -
                   | 
| 19 | 
            -
                     | 
| 20 | 
            -
                      get :show
         | 
| 22 | 
            +
                  it 'should get step' do
         | 
| 23 | 
            +
                    get :show
         | 
| 21 24 |  | 
| 22 | 
            -
             | 
| 23 | 
            -
                    end
         | 
| 25 | 
            +
                    expect(subject.current_step.label).to eq 'Step 2'
         | 
| 24 26 | 
             
                  end
         | 
| 27 | 
            +
                end
         | 
| 28 | 
            +
             | 
| 29 | 
            +
                context 'when last step' do
         | 
| 30 | 
            +
                  before(:all){
         | 
| 31 | 
            +
                    @controller = Base::StepThreeController.new
         | 
| 32 | 
            +
                  }
         | 
| 25 33 |  | 
| 26 | 
            -
                   | 
| 27 | 
            -
                     | 
| 28 | 
            -
                      get :show
         | 
| 34 | 
            +
                  it 'should get step' do
         | 
| 35 | 
            +
                    get :show
         | 
| 29 36 |  | 
| 30 | 
            -
             | 
| 31 | 
            -
                    end
         | 
| 37 | 
            +
                    expect(subject.current_step.label).to eq 'Step 3'
         | 
| 32 38 | 
             
                  end
         | 
| 33 39 | 
             
                end
         | 
| 40 | 
            +
              end
         | 
| 34 41 |  | 
| 35 | 
            -
             | 
| 42 | 
            +
              describe '#current_step_index' do
         | 
| 43 | 
            +
                context 'when first step' do
         | 
| 44 | 
            +
                  before(:all){
         | 
| 45 | 
            +
                    @controller = Base::StepOneController.new
         | 
| 46 | 
            +
                  }
         | 
| 36 47 |  | 
| 37 | 
            -
                   | 
| 38 | 
            -
                     | 
| 39 | 
            -
                      get :show
         | 
| 48 | 
            +
                  it 'should get step' do
         | 
| 49 | 
            +
                    get :show
         | 
| 40 50 |  | 
| 41 | 
            -
             | 
| 42 | 
            -
                    end
         | 
| 51 | 
            +
                    expect(subject.current_step_index).to eq 0
         | 
| 43 52 | 
             
                  end
         | 
| 53 | 
            +
                end
         | 
| 54 | 
            +
             | 
| 55 | 
            +
                context 'when middle step' do
         | 
| 56 | 
            +
                  before(:all){
         | 
| 57 | 
            +
                    @controller = Base::StepTwoController.new
         | 
| 58 | 
            +
                  }
         | 
| 44 59 |  | 
| 45 | 
            -
                   | 
| 46 | 
            -
                     | 
| 47 | 
            -
                      get :show
         | 
| 60 | 
            +
                  it 'should get step' do
         | 
| 61 | 
            +
                    get :show
         | 
| 48 62 |  | 
| 49 | 
            -
             | 
| 50 | 
            -
                    end
         | 
| 63 | 
            +
                    expect(subject.current_step_index).to eq 1
         | 
| 51 64 | 
             
                  end
         | 
| 65 | 
            +
                end
         | 
| 52 66 |  | 
| 53 | 
            -
             | 
| 54 | 
            -
             | 
| 55 | 
            -
             | 
| 67 | 
            +
                context 'when last step' do
         | 
| 68 | 
            +
                  before(:all){
         | 
| 69 | 
            +
                    @controller = Base::StepThreeController.new
         | 
| 70 | 
            +
                  }
         | 
| 56 71 |  | 
| 57 | 
            -
             | 
| 58 | 
            -
                     | 
| 72 | 
            +
                  it 'should get step' do
         | 
| 73 | 
            +
                    get :show
         | 
| 74 | 
            +
             | 
| 75 | 
            +
                    expect(subject.current_step_index).to eq 2
         | 
| 59 76 | 
             
                  end
         | 
| 60 77 | 
             
                end
         | 
| 78 | 
            +
              end
         | 
| 79 | 
            +
             | 
| 80 | 
            +
              describe '#current_step_name' do
         | 
| 81 | 
            +
                context 'when first step' do
         | 
| 82 | 
            +
                  before(:all){
         | 
| 83 | 
            +
                    @controller = Base::StepOneController.new
         | 
| 84 | 
            +
                  }
         | 
| 61 85 |  | 
| 62 | 
            -
             | 
| 63 | 
            -
             | 
| 64 | 
            -
                    it 'should "Step 2"' do
         | 
| 65 | 
            -
                      get :show
         | 
| 86 | 
            +
                  it 'should get step' do
         | 
| 87 | 
            +
                    get :show
         | 
| 66 88 |  | 
| 67 | 
            -
             | 
| 68 | 
            -
                    end
         | 
| 89 | 
            +
                    expect(subject.current_step_name).to eq :step_one
         | 
| 69 90 | 
             
                  end
         | 
| 91 | 
            +
                end
         | 
| 92 | 
            +
             | 
| 93 | 
            +
                context 'when middle step' do
         | 
| 94 | 
            +
                  before(:all){
         | 
| 95 | 
            +
                    @controller = Base::StepTwoController.new
         | 
| 96 | 
            +
                  }
         | 
| 70 97 |  | 
| 71 | 
            -
                   | 
| 72 | 
            -
                     | 
| 73 | 
            -
                      get :show
         | 
| 98 | 
            +
                  it 'should get step' do
         | 
| 99 | 
            +
                    get :show
         | 
| 74 100 |  | 
| 75 | 
            -
             | 
| 76 | 
            -
                    end
         | 
| 101 | 
            +
                    expect(subject.current_step_name).to eq :step_two
         | 
| 77 102 | 
             
                  end
         | 
| 103 | 
            +
                end
         | 
| 78 104 |  | 
| 79 | 
            -
             | 
| 80 | 
            -
             | 
| 81 | 
            -
             | 
| 105 | 
            +
                context 'when last step' do
         | 
| 106 | 
            +
                  before(:all){
         | 
| 107 | 
            +
                    @controller = Base::StepThreeController.new
         | 
| 108 | 
            +
                  }
         | 
| 82 109 |  | 
| 83 | 
            -
             | 
| 84 | 
            -
                     | 
| 110 | 
            +
                  it 'should get step' do
         | 
| 111 | 
            +
                    get :show
         | 
| 112 | 
            +
             | 
| 113 | 
            +
                    expect(subject.current_step_name).to eq :step_three
         | 
| 85 114 | 
             
                  end
         | 
| 86 115 | 
             
                end
         | 
| 87 116 | 
             
              end
         | 
| 88 117 |  | 
| 89 | 
            -
               | 
| 90 | 
            -
                 | 
| 91 | 
            -
                   | 
| 92 | 
            -
             | 
| 118 | 
            +
              describe '#previous_step' do
         | 
| 119 | 
            +
                context 'when first step' do
         | 
| 120 | 
            +
                  before(:all){
         | 
| 121 | 
            +
                    @controller = Base::StepOneController.new
         | 
| 122 | 
            +
                  }
         | 
| 93 123 |  | 
| 94 | 
            -
             | 
| 95 | 
            -
             | 
| 96 | 
            -
                    it 'should be "Step 2"' do
         | 
| 97 | 
            -
                      get :show
         | 
| 124 | 
            +
                  it 'should be nil' do
         | 
| 125 | 
            +
                    get :show
         | 
| 98 126 |  | 
| 99 | 
            -
             | 
| 100 | 
            -
                    end
         | 
| 127 | 
            +
                    expect(subject.previous_step).to be_nil
         | 
| 101 128 | 
             
                  end
         | 
| 129 | 
            +
                end
         | 
| 130 | 
            +
             | 
| 131 | 
            +
                context 'when middle step' do
         | 
| 132 | 
            +
                  before(:all){
         | 
| 133 | 
            +
                    @controller = Base::StepTwoController.new
         | 
| 134 | 
            +
                  }
         | 
| 102 135 |  | 
| 103 | 
            -
                   | 
| 104 | 
            -
                     | 
| 105 | 
            -
                      get :show
         | 
| 136 | 
            +
                  it 'should get step' do
         | 
| 137 | 
            +
                    get :show
         | 
| 106 138 |  | 
| 107 | 
            -
             | 
| 108 | 
            -
                    end
         | 
| 139 | 
            +
                    expect(subject.previous_step.label).to eq 'Step 1'
         | 
| 109 140 | 
             
                  end
         | 
| 141 | 
            +
                end
         | 
| 142 | 
            +
             | 
| 143 | 
            +
                context 'when last step' do
         | 
| 144 | 
            +
                  before(:all){
         | 
| 145 | 
            +
                    @controller = Base::StepThreeController.new
         | 
| 146 | 
            +
                  }
         | 
| 110 147 |  | 
| 111 | 
            -
                   | 
| 112 | 
            -
                     | 
| 113 | 
            -
                      get :show
         | 
| 148 | 
            +
                  it 'should get step' do
         | 
| 149 | 
            +
                    get :show
         | 
| 114 150 |  | 
| 115 | 
            -
             | 
| 116 | 
            -
                    end
         | 
| 151 | 
            +
                    expect(subject.previous_step.label).to eq 'Step 2'
         | 
| 117 152 | 
             
                  end
         | 
| 118 153 | 
             
                end
         | 
| 154 | 
            +
              end
         | 
| 119 155 |  | 
| 120 | 
            -
             | 
| 121 | 
            -
             | 
| 122 | 
            -
             | 
| 123 | 
            -
             | 
| 156 | 
            +
              describe '#previous_step_index' do
         | 
| 157 | 
            +
                context 'when first step' do
         | 
| 158 | 
            +
                  before(:all){
         | 
| 159 | 
            +
                    @controller = Base::StepOneController.new
         | 
| 160 | 
            +
                  }
         | 
| 124 161 |  | 
| 125 | 
            -
             | 
| 126 | 
            -
                     | 
| 162 | 
            +
                  it 'should be nil' do
         | 
| 163 | 
            +
                    get :show
         | 
| 164 | 
            +
             | 
| 165 | 
            +
                    expect(subject.previous_step_index).to be_nil
         | 
| 127 166 | 
             
                  end
         | 
| 167 | 
            +
                end
         | 
| 168 | 
            +
             | 
| 169 | 
            +
                context 'when middle step' do
         | 
| 170 | 
            +
                  before(:all){
         | 
| 171 | 
            +
                    @controller = Base::StepTwoController.new
         | 
| 172 | 
            +
                  }
         | 
| 128 173 |  | 
| 129 | 
            -
                   | 
| 130 | 
            -
                     | 
| 131 | 
            -
                      get :show
         | 
| 174 | 
            +
                  it 'should get step' do
         | 
| 175 | 
            +
                    get :show
         | 
| 132 176 |  | 
| 133 | 
            -
             | 
| 134 | 
            -
                    end
         | 
| 177 | 
            +
                    expect(subject.previous_step_index).to eq 0
         | 
| 135 178 | 
             
                  end
         | 
| 179 | 
            +
                end
         | 
| 180 | 
            +
             | 
| 181 | 
            +
                context 'when last step' do
         | 
| 182 | 
            +
                  before(:all){
         | 
| 183 | 
            +
                    @controller = Base::StepThreeController.new
         | 
| 184 | 
            +
                  }
         | 
| 136 185 |  | 
| 137 | 
            -
                   | 
| 138 | 
            -
                     | 
| 139 | 
            -
                      get :show
         | 
| 186 | 
            +
                  it 'should get step' do
         | 
| 187 | 
            +
                    get :show
         | 
| 140 188 |  | 
| 141 | 
            -
             | 
| 142 | 
            -
                    end
         | 
| 189 | 
            +
                    expect(subject.previous_step_index).to eq 1
         | 
| 143 190 | 
             
                  end
         | 
| 144 191 | 
             
                end
         | 
| 192 | 
            +
              end
         | 
| 145 193 |  | 
| 146 | 
            -
             | 
| 147 | 
            -
             | 
| 148 | 
            -
             | 
| 149 | 
            -
             | 
| 194 | 
            +
              describe '#previous_step_name' do
         | 
| 195 | 
            +
                context 'when first step' do
         | 
| 196 | 
            +
                  before(:all){
         | 
| 197 | 
            +
                    @controller = Base::StepOneController.new
         | 
| 198 | 
            +
                  }
         | 
| 150 199 |  | 
| 151 | 
            -
             | 
| 152 | 
            -
                     | 
| 200 | 
            +
                  it 'should be nil' do
         | 
| 201 | 
            +
                    get :show
         | 
| 202 | 
            +
             | 
| 203 | 
            +
                    expect(subject.previous_step_name).to be_nil
         | 
| 153 204 | 
             
                  end
         | 
| 205 | 
            +
                end
         | 
| 206 | 
            +
             | 
| 207 | 
            +
                context 'when middle step' do
         | 
| 208 | 
            +
                  before(:all){
         | 
| 209 | 
            +
                    @controller = Base::StepTwoController.new
         | 
| 210 | 
            +
                  }
         | 
| 154 211 |  | 
| 155 | 
            -
                   | 
| 156 | 
            -
                     | 
| 157 | 
            -
                      get :show
         | 
| 212 | 
            +
                  it 'should get step' do
         | 
| 213 | 
            +
                    get :show
         | 
| 158 214 |  | 
| 159 | 
            -
             | 
| 160 | 
            -
                    end
         | 
| 215 | 
            +
                    expect(subject.previous_step_name).to eq :step_one
         | 
| 161 216 | 
             
                  end
         | 
| 217 | 
            +
                end
         | 
| 218 | 
            +
             | 
| 219 | 
            +
                context 'when last step' do
         | 
| 220 | 
            +
                  before(:all){
         | 
| 221 | 
            +
                    @controller = Base::StepThreeController.new
         | 
| 222 | 
            +
                  }
         | 
| 162 223 |  | 
| 163 | 
            -
                   | 
| 164 | 
            -
                     | 
| 165 | 
            -
                      get :show
         | 
| 224 | 
            +
                  it 'should get step' do
         | 
| 225 | 
            +
                    get :show
         | 
| 166 226 |  | 
| 167 | 
            -
             | 
| 168 | 
            -
                    end
         | 
| 227 | 
            +
                    expect(subject.previous_step_name).to eq :step_two
         | 
| 169 228 | 
             
                  end
         | 
| 170 229 | 
             
                end
         | 
| 171 230 | 
             
              end
         | 
| 172 231 |  | 
| 173 | 
            -
               | 
| 174 | 
            -
                 | 
| 175 | 
            -
                   | 
| 176 | 
            -
             | 
| 232 | 
            +
              describe '#next_step' do
         | 
| 233 | 
            +
                context 'when first step' do
         | 
| 234 | 
            +
                  before(:all){
         | 
| 235 | 
            +
                    @controller = Base::StepOneController.new
         | 
| 236 | 
            +
                  }
         | 
| 177 237 |  | 
| 178 | 
            -
             | 
| 179 | 
            -
             | 
| 180 | 
            -
                    it 'should be "Step 3"' do
         | 
| 181 | 
            -
                      get :show
         | 
| 238 | 
            +
                  it 'should get step' do
         | 
| 239 | 
            +
                    get :show
         | 
| 182 240 |  | 
| 183 | 
            -
             | 
| 184 | 
            -
                    end
         | 
| 241 | 
            +
                    expect(subject.next_step.label).to eq 'Step 2'
         | 
| 185 242 | 
             
                  end
         | 
| 243 | 
            +
                end
         | 
| 186 244 |  | 
| 187 | 
            -
             | 
| 188 | 
            -
             | 
| 189 | 
            -
             | 
| 245 | 
            +
                context 'when middle step' do
         | 
| 246 | 
            +
                  before(:all){
         | 
| 247 | 
            +
                    @controller = Base::StepTwoController.new
         | 
| 248 | 
            +
                  }
         | 
| 190 249 |  | 
| 191 | 
            -
             | 
| 192 | 
            -
                     | 
| 250 | 
            +
                  it 'should get step' do
         | 
| 251 | 
            +
                    get :show
         | 
| 252 | 
            +
             | 
| 253 | 
            +
                    expect(subject.next_step.label).to eq 'Step 3'
         | 
| 193 254 | 
             
                  end
         | 
| 255 | 
            +
                end
         | 
| 256 | 
            +
             | 
| 257 | 
            +
                context 'when last step' do
         | 
| 258 | 
            +
                  before(:all){
         | 
| 259 | 
            +
                    @controller = Base::StepThreeController.new
         | 
| 260 | 
            +
                  }
         | 
| 194 261 |  | 
| 195 | 
            -
                   | 
| 196 | 
            -
                     | 
| 197 | 
            -
                      get :show
         | 
| 262 | 
            +
                  it 'should be nil' do
         | 
| 263 | 
            +
                    get :show
         | 
| 198 264 |  | 
| 199 | 
            -
             | 
| 200 | 
            -
                    end
         | 
| 265 | 
            +
                    expect(subject.next_step).to be_nil
         | 
| 201 266 | 
             
                  end
         | 
| 202 267 | 
             
                end
         | 
| 268 | 
            +
              end
         | 
| 269 | 
            +
             | 
| 270 | 
            +
              describe '#next_step_index' do
         | 
| 271 | 
            +
                context 'when first step' do
         | 
| 272 | 
            +
                  before(:all){
         | 
| 273 | 
            +
                    @controller = Base::StepOneController.new
         | 
| 274 | 
            +
                  }
         | 
| 203 275 |  | 
| 204 | 
            -
             | 
| 205 | 
            -
             | 
| 206 | 
            -
                    it 'should be "Step 2"' do
         | 
| 207 | 
            -
                      get :show
         | 
| 276 | 
            +
                  it 'should get step' do
         | 
| 277 | 
            +
                    get :show
         | 
| 208 278 |  | 
| 209 | 
            -
             | 
| 210 | 
            -
                    end
         | 
| 279 | 
            +
                    expect(subject.next_step_index).to eq 1
         | 
| 211 280 | 
             
                  end
         | 
| 281 | 
            +
                end
         | 
| 212 282 |  | 
| 213 | 
            -
             | 
| 214 | 
            -
             | 
| 215 | 
            -
             | 
| 283 | 
            +
                context 'when middle step' do
         | 
| 284 | 
            +
                  before(:all){
         | 
| 285 | 
            +
                    @controller = Base::StepTwoController.new
         | 
| 286 | 
            +
                  }
         | 
| 216 287 |  | 
| 217 | 
            -
             | 
| 218 | 
            -
                     | 
| 288 | 
            +
                  it 'should get step' do
         | 
| 289 | 
            +
                    get :show
         | 
| 290 | 
            +
             | 
| 291 | 
            +
                    expect(subject.next_step_index).to eq 2
         | 
| 219 292 | 
             
                  end
         | 
| 293 | 
            +
                end
         | 
| 294 | 
            +
             | 
| 295 | 
            +
                context 'when last step' do
         | 
| 296 | 
            +
                  before(:all){
         | 
| 297 | 
            +
                    @controller = Base::StepThreeController.new
         | 
| 298 | 
            +
                  }
         | 
| 220 299 |  | 
| 221 | 
            -
                   | 
| 222 | 
            -
                     | 
| 223 | 
            -
                      get :show
         | 
| 300 | 
            +
                  it 'should be nil' do
         | 
| 301 | 
            +
                    get :show
         | 
| 224 302 |  | 
| 225 | 
            -
             | 
| 226 | 
            -
                    end
         | 
| 303 | 
            +
                    expect(subject.next_step_index).to be_nil
         | 
| 227 304 | 
             
                  end
         | 
| 228 305 | 
             
                end
         | 
| 306 | 
            +
              end
         | 
| 307 | 
            +
             | 
| 308 | 
            +
              describe '#next_step_name' do
         | 
| 309 | 
            +
                context 'when first step' do
         | 
| 310 | 
            +
                  before(:all){
         | 
| 311 | 
            +
                    @controller = Base::StepOneController.new
         | 
| 312 | 
            +
                  }
         | 
| 229 313 |  | 
| 230 | 
            -
             | 
| 231 | 
            -
             | 
| 232 | 
            -
                    it 'should be nil' do
         | 
| 233 | 
            -
                      get :show
         | 
| 314 | 
            +
                  it 'should get step' do
         | 
| 315 | 
            +
                    get :show
         | 
| 234 316 |  | 
| 235 | 
            -
             | 
| 236 | 
            -
                    end
         | 
| 317 | 
            +
                    expect(subject.next_step_name).to eq :step_two
         | 
| 237 318 | 
             
                  end
         | 
| 319 | 
            +
                end
         | 
| 238 320 |  | 
| 239 | 
            -
             | 
| 240 | 
            -
             | 
| 241 | 
            -
             | 
| 321 | 
            +
                context 'when middle step' do
         | 
| 322 | 
            +
                  before(:all){
         | 
| 323 | 
            +
                    @controller = Base::StepTwoController.new
         | 
| 324 | 
            +
                  }
         | 
| 242 325 |  | 
| 243 | 
            -
             | 
| 244 | 
            -
                     | 
| 326 | 
            +
                  it 'should get step' do
         | 
| 327 | 
            +
                    get :show
         | 
| 328 | 
            +
             | 
| 329 | 
            +
                    expect(subject.next_step_name).to eq :step_three
         | 
| 245 330 | 
             
                  end
         | 
| 331 | 
            +
                end
         | 
| 332 | 
            +
             | 
| 333 | 
            +
                context 'when last step' do
         | 
| 334 | 
            +
                  before(:all){
         | 
| 335 | 
            +
                    @controller = Base::StepThreeController.new
         | 
| 336 | 
            +
                  }
         | 
| 246 337 |  | 
| 247 | 
            -
                   | 
| 248 | 
            -
                     | 
| 249 | 
            -
                      get :show
         | 
| 338 | 
            +
                  it 'should be nil' do
         | 
| 339 | 
            +
                    get :show
         | 
| 250 340 |  | 
| 251 | 
            -
             | 
| 252 | 
            -
                    end
         | 
| 341 | 
            +
                    expect(subject.next_step_name).to be_nil
         | 
| 253 342 | 
             
                  end
         | 
| 254 343 | 
             
                end
         | 
| 255 344 | 
             
              end
         |