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

Uncoverables #78

Closed
61315 opened this issue Apr 15, 2024 · 0 comments
Closed

Uncoverables #78

61315 opened this issue Apr 15, 2024 · 0 comments
Assignees
Labels
help wanted Extra attention is needed testing all things testing related

Comments

@61315
Copy link
Collaborator

61315 commented Apr 15, 2024

While working on the implementation of the invitation feature (#75), I wanted to resolve all the remaining offenses and coverage issues. After commits 51ee84f and 76cdcba, I was able to address all the RuboCop offenses. I also fixed the uncovered code to the best of my abilities, including the parts related to the invitation feature.

The problem lies with these. Only two files, just nine lines left.

app/controllers/survey_responses_controller.rb:

  50. # GET /survey/page/:page
+ 51. def survey
- 52.   logger.info '========== survey triggered =========='
- 53.   @pagination, @questions, @section = paginate(collection: SurveyQuestion.all, params: { per_page: 10, page: params[:page] })
- 54.   @survey_response = SurveyResponse.find_by_id(session[:survey_id])
- 55.   render :survey
  56. end
  117.        end
- 118.      elsif params[:commit] == 'Previous'
- 119.        format.html do
- 120.          session[:page_number] -= 1
- 121.          redirect_to edit_survey_response_path(@survey_response)
  122.        end

app/models/survey_response.rb:

  90.      rescue ActiveRecord::RecordNotFound
- 91.        next
  92.      end
+ 93.      answer = SurveyAnswer.where(question:, response: self).first
- 94.      if answer.nil?
- 95.        SurveyAnswer.create choice:, question:, response: self
  96.      else

I couldn't cover those code blocks. I'm feeling a bit burned out at the moment from staring at the code for so long, and most importantly, I'm having a hard time understanding how these work. I even considered just deleting them, so I just tried to remove that part, but rest assured, the RSpec test is bombarded with red marks.

I want to ask for help from the person who originally wrote this code. Please explain what needs to be done to cover them. I request the scrum master to investigate this matter.

@61315 61315 added help wanted Extra attention is needed testing all things testing related labels Apr 15, 2024
@61315 61315 closed this as not planned Won't fix, can't repro, duplicate, stale Apr 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed testing all things testing related
Projects
None yet
Development

No branches or pull requests

2 participants