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

Cucumber bug fixed #40

Merged
merged 4 commits into from
Feb 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading