Skip to content
This repository has been archived by the owner on Jan 3, 2025. It is now read-only.

Refactor registration_controller.rb #250

Merged
merged 83 commits into from
Oct 11, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
83 commits
Select commit Hold shift + click to select a range
5a9b51b
split tests into different folders
dunkOnIT Jun 14, 2023
9d5cb1f
set up dynamoid test/dev env and added db tests
dunkOnIT Jun 14, 2023
4833a0a
fixed context naming and syntax errors
dunkOnIT Jun 23, 2023
ee1faac
Made database_functions_spec.rb pass
FinnIckler Jun 23, 2023
c37d55c
added parametrized tests for post_registration
dunkOnIT Jun 23, 2023
7db9537
merged with origin
dunkOnIT Jun 23, 2023
0e67f01
rubocop changes
dunkOnIT Jun 23, 2023
10e9760
Made get_registration_spec pass
FinnIckler Jun 23, 2023
1903b36
merged main into rswag-testing
dunkOnIT Jun 26, 2023
817efa3
merged with rswag-testing changes
dunkOnIT Jun 26, 2023
eb56ce7
missed merge conflict
dunkOnIT Jun 26, 2023
1f3b99a
added back post_attendee_spec.rb
dunkOnIT Jun 26, 2023
b9a122a
post attendee spec tests added
dunkOnIT Jun 26, 2023
cf52323
fixed parametrization of tests
dunkOnIT Jun 26, 2023
69d0290
removed old db test and started PATCH tests
dunkOnIT Jun 27, 2023
a755c10
working PATCH cancel happy path tests
dunkOnIT Jun 27, 2023
8da0f8f
updated routes and finished cancel tests (against wrng path)
dunkOnIT Jun 28, 2023
459d14d
working reg cancel tests
dunkOnIT Jun 28, 2023
f9ad227
made cancel into a separate file
dunkOnIT Jun 28, 2023
2b4a54b
made cancel into a separate file and added it
dunkOnIT Jun 28, 2023
78b9fc4
updated spec with new request format, added update registrations
dunkOnIT Jul 10, 2023
36e9a57
merged with main
dunkOnIT Jul 11, 2023
58b7156
trying to pass post tests
dunkOnIT Jul 11, 2023
b40cbf2
working JWT token submission
dunkOnIT Jul 12, 2023
c82a397
jwt working, code cleaned up
dunkOnIT Jul 12, 2023
5be91ae
cursed attempts to make tests work
dunkOnIT Jul 12, 2023
d80debc
various failed attempts to make shared examples work
dunkOnIT Jul 13, 2023
e395fef
dead-end: testing to make shared examples work
dunkOnIT Jul 17, 2023
e97ad94
DEAD-END: testing to make shared examples work
dunkOnIT Jul 17, 2023
160d6f8
post_attendee first test passes controller
dunkOnIT Jul 17, 2023
a1e38e5
minor test changes
dunkOnIT Jul 17, 2023
94918c0
merged with main
dunkOnIT Jul 17, 2023
7f54e3d
changed create reg to return 202, other minor changes
dunkOnIT Jul 18, 2023
c16e2df
rubocop changes and removed failing tests
dunkOnIT Jul 18, 2023
603b6ba
Removed unnecessary files, fixes from diff analysis
dunkOnIT Jul 18, 2023
7356416
removed shared examples
dunkOnIT Jul 18, 2023
4afc87f
fixed tests
dunkOnIT Jul 18, 2023
732947d
db and all but 1 get_reg test passing
dunkOnIT Jul 18, 2023
af394f3
missed some files in previous commit
dunkOnIT Jul 18, 2023
58632aa
everything working except post test in compose.test.yml
dunkOnIT Jul 19, 2023
4e4a20d
ALL TESTS WORKING YAY
dunkOnIT Jul 19, 2023
2722eb3
rubocop changes
dunkOnIT Jul 19, 2023
300560a
added back deleted spec files
dunkOnIT Jul 19, 2023
a94c753
refactored test paths
dunkOnIT Jul 19, 2023
a87cebd
test refactors, and added reg spec for ease of testing completed specs
dunkOnIT Jul 19, 2023
6d9c314
working RSwag security setup for JWT auth
dunkOnIT Jul 20, 2023
bc1c1b9
added TODO get registration tests
dunkOnIT Jul 27, 2023
04a679d
swagger updated and new post reg test
dunkOnIT Jul 27, 2023
2288987
merged with main
dunkOnIT Jul 27, 2023
f34da4e
PASSING tests passing after main merge
dunkOnIT Jul 27, 2023
21f187e
POST tests PASSING, added comp not open and imeprsonation
dunkOnIT Jul 27, 2023
59d6670
code ready for PR, still needs to be swaggerized
dunkOnIT Aug 1, 2023
050e77e
reverted dev cache change, removed commented code
dunkOnIT Aug 1, 2023
9c59d95
added tests for POSTing attendes
dunkOnIT Aug 10, 2023
abaa189
working cancel registration test
dunkOnIT Aug 11, 2023
5690f24
admin and user cancellation tests in all states
dunkOnIT Aug 12, 2023
4db2411
added update tests
dunkOnIT Aug 21, 2023
4d42c23
added cancel and update tests
dunkOnIT Aug 21, 2023
06448a9
tests failing but added lots of update tests
dunkOnIT Aug 22, 2023
54ceb33
basic factory implementation working
dunkOnIT Sep 18, 2023
e4528cb
more work with factorybot
dunkOnIT Sep 18, 2023
7d05570
adding factory stuff and trying to resolve database existing issue
dunkOnIT Oct 3, 2023
f9427fc
Merge branch 'main' into rswag-testing
FinnIckler Oct 3, 2023
5756af6
removed puts and moved changed_event_ids to lanes.rb
dunkOnIT Oct 3, 2023
182670f
removed registration_status and enable_traces
dunkOnIT Oct 3, 2023
7e3aadf
removed registration_status and enable_traces
dunkOnIT Oct 3, 2023
44ff150
PR changes and added overcommit
dunkOnIT Oct 4, 2023
819f86d
changed overcommit config
dunkOnIT Oct 4, 2023
6c29044
changed overcommit ymlspacing
dunkOnIT Oct 4, 2023
287f8d7
rubocop changes
dunkOnIT Oct 4, 2023
e73873c
final review changes
dunkOnIT Oct 4, 2023
1b9fff4
removed unnecessary puts
dunkOnIT Oct 4, 2023
9188b64
fixed error codes
dunkOnIT Oct 4, 2023
d4b333f
changed comp update format and refactored reg controller
dunkOnIT Oct 6, 2023
7ceb4ef
more controller refactors
dunkOnIT Oct 6, 2023
b5e527e
removed user impersonation, cleaned up error rendering
dunkOnIT Oct 6, 2023
cf30cd8
finished refactor points in issue
dunkOnIT Oct 6, 2023
b929809
merged with master
dunkOnIT Oct 8, 2023
3a3db0a
disabled super check only for RegistrationError
dunkOnIT Oct 9, 2023
db075b7
excluded super check from RegistrationError
dunkOnIT Oct 9, 2023
f4b8a82
1-liner if and unless
dunkOnIT Oct 10, 2023
1ec62c6
rubocop changes
dunkOnIT Oct 10, 2023
55b88ae
explicitly defining test environment
dunkOnIT Oct 11, 2023
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
6 changes: 5 additions & 1 deletion .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ AllCops:
Bundler/OrderedGems:
Enabled: false

Lint/MissingSuper:
Exclude:
- 'lib/registration_error.rb'

Lint/EmptyWhen:
Enabled: false

Expand Down Expand Up @@ -224,4 +228,4 @@ Style/HashSyntax:
Style/GlobalVars:
AllowedVariables:
- $sqs
- $dynamodb
- $dynamodb
8 changes: 6 additions & 2 deletions app/controllers/application_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,12 @@ def performance_profile(&)
end
end

def render_error(status, error)
def render_error(http_status, error)
Metrics.registration_validation_errors_counter.increment
render json: { error: error }, status: status
render json: { error: error }, status: http_status
end

rescue_from ActionController::ParameterMissing do |e|
render json: { error: ErrorCodes::INVALID_REQUEST_DATA }, status: :bad_request
end
end
Loading