Skip to content

Commit

Permalink
Merge pull request #40 from tamu-edu-students/cucumber-bug-fixed
Browse files Browse the repository at this point in the history
Cucumber bug fixed
  • Loading branch information
jacobtoddmathes authored Feb 26, 2024
2 parents 54b5d12 + 2ae844f commit bd0a9a6
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 2 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
[![Maintainability](https://api.codeclimate.com/v1/badges/62f4dd4fb092b4211973/maintainability)](https://codeclimate.com/repos/65caed0abc0d27237b1794c9/maintainability)
![rubocop](https://img.shields.io/endpoint?url=https://gist.githubusercontent.com/barnden/c7b2d5e19079e12445b300407e383294/raw/badge.json)

**All project files in rails_root**

Links
- Deployed Application
- https://elrc-app-dfcfc7cd862b.herokuapp.com/
Expand Down
1 change: 1 addition & 0 deletions rails_root/.rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
# ignore migration files

AllCops:
DisabledByDefault: false
Exclude:
- 'db/**/*'
- 'config/**/*'
Expand Down
4 changes: 3 additions & 1 deletion rails_root/app/controllers/survey_responses_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -48,13 +48,15 @@ def edit

# POST /survey_responses or /survey_responses.json
def create
if survey_response_params.values.any? { |value| value.nil? || value.empty? }
# If any of the survey_response_params values are nil, then the form is invalid
if survey_response_params.values.any? { |value| value.nil? || value.empty? || survey_response_params.keys.length != SurveyResponse.column_names.length - 3 }
respond_to do |format|
format.html do
redirect_to new_survey_response_url, notice: 'invalid form', status: :unprocessable_entity
end
format.json { render json: { error: 'invalid form' }, status: :unprocessable_entity }
end

else
@survey_response = SurveyResponse.new(survey_response_params)

Expand Down
2 changes: 1 addition & 1 deletion rails_root/features/step_definitions/stepdefs.rb
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@

When('I try to create model instances') do
post survey_profiles_url, survey_profile: @survey_profiles_attributes
post survey_responses_url, survey_response: @survey_profiles_attributes
post survey_responses_url, survey_response: @survey_responses_attributes
end

Given('I have a set of valid attributes') do
Expand Down

0 comments on commit bd0a9a6

Please sign in to comment.