Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bugfix: impasse creating/editing unsorted test cases #221

Open
vegetadevelop opened this issue Oct 14, 2013 · 0 comments
Open

Bugfix: impasse creating/editing unsorted test cases #221

vegetadevelop opened this issue Oct 14, 2013 · 0 comments

Comments

@vegetadevelop
Copy link

During test case creation/editing from 6th step the order of these ones will lost (in editing and view mode, after saved also).
This is my solution implemented in: vendor/plugins/redmine_impasse/app/controllers/impasse_test_case_controller.rb

in new/edit funtion:


      if @node.is_test_case? and params.include? :test_steps
        #---------------------------------------------------------------------      
        # BUGFIX: <sorting test steps> sort test steps list correctly
        #   params[:test_steps] --> tmp_params (hash with key corresponding to the step number) --> tmp (sorted array)
        #---------------------------------------------------------------------      
        tmp_params = Hash.new
        params[:test_steps].each do |k,v|
            k = "#{v['step_number']}"
            tmp_params[("#{k}").to_i] = v
        end
        tmp = tmp_params.sort
        tmp_params.clear
        @test_steps = tmp.collect{|i, ts| Impasse::TestStep.new(ts) }
        @test_steps.each{|ts| raise ActiveRecord::RecordInvalid.new(ts) unless ts.valid? }
        @test_case.test_steps.replace(@test_steps)
        tmp.clear
        #</sorting test steps>
        #---------------------------------------------------------------------
      end

Platform: redmine 1.4.7, ruby 1.8.7, rails 2.3.5, impasse 1.2.2

cforce added a commit to cforce/redmine_impasse that referenced this issue Oct 14, 2013
cforce added a commit to cforce/redmine_impasse that referenced this issue Oct 14, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant