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

WIP - 4175 add request type flag #2

Open
wants to merge 316 commits into
base: main
Choose a base branch
from
Open
Changes from 1 commit
Commits
Show all changes
316 commits
Select commit Hold shift + click to select a range
13d164a
Merge pull request #3857 from ChaelCodes/3742-low-inventory-report
awwaiid Nov 12, 2023
547d4ba
Merge branch 'dashboard' into dashboard-activity-card-3798
awwaiid Nov 12, 2023
9e92a98
Fix unrelated lint isue [#3798]
awwaiid Nov 12, 2023
17aa91c
Fix navigation items [#3798]
awwaiid Nov 12, 2023
b25e320
Re-organize reports list [#3798]
awwaiid Nov 12, 2023
6b890b7
Merge pull request #3819 from lokisk1155/lokisk1155-#3735
awwaiid Nov 12, 2023
7cc0763
Merge remote-tracking branch 'origin/dashboard' into dashboard-activi…
awwaiid Nov 12, 2023
88a53cb
Merge pull request #3812 from rubyforgood/dashboard-activity-card-3798
awwaiid Nov 12, 2023
756f294
Merge branch 'main' into dashboard
awwaiid Dec 17, 2023
8220e00
Merge remote-tracking branch 'origin/main' into dashboard
awwaiid Dec 22, 2023
75cd62e
Extract product drives card to separate report [#3734]
awwaiid Dec 23, 2023
a6b4849
Clean out some lint [#3734]
awwaiid Dec 23, 2023
517d0fb
Fix page helper for product drive report spec [#3734]
awwaiid Dec 23, 2023
afd8c64
Move helper method to the correct spec [#3734]
awwaiid Dec 24, 2023
c20401c
Copy page helper [#3734]
awwaiid Dec 24, 2023
6e0b771
Copy helper from dashboard page [#3734]
awwaiid Dec 24, 2023
872f4ea
Merge branch 'main' into dashboard
awwaiid Jan 13, 2024
96f245b
Merge branch 'dashboard' into 3734-move-product-drives-card-to-produc…
awwaiid Jan 13, 2024
0919c22
Click on correct header [#3734]
awwaiid Jan 13, 2024
90389b2
Remove clicking off of date range, it isn't needed [#3734]
awwaiid Jan 13, 2024
dbff0af
Rename to include summary [#3734]
awwaiid Jan 13, 2024
a216b66
Update tests to have Summary in the name [#3734]
awwaiid Jan 13, 2024
444aa49
Revert accidental path change [#3734]
awwaiid Jan 13, 2024
e3a5e71
Merge pull request #3984 from rubyforgood/3734-move-product-drives-ca…
awwaiid Jan 13, 2024
9c738a2
Add filter to mfg donation report and tune style [#3735]
awwaiid Jan 13, 2024
0868441
Merge pull request #4028 from rubyforgood/manufacture-donations-filte…
awwaiid Jan 13, 2024
831d4b0
Add basic request specs for some reports [#4029]
awwaiid Jan 14, 2024
e8e546c
Merge pull request #4030 from rubyforgood/dashboard-specs-4029
awwaiid Jan 14, 2024
36c0704
Remove date-filter, other unused queries, and obey Bullet [#3724]
awwaiid Jan 14, 2024
b272b91
Filter on counties report directly [#3724]
awwaiid Jan 14, 2024
e2d1c22
Merge pull request #4032 from rubyforgood/remove-dashboard-filter-3724
awwaiid Jan 14, 2024
f44e444
Merge branch 'main' into dashboard
awwaiid Jan 21, 2024
c8b5131
Merge branch 'main' into dashboard
awwaiid Jan 21, 2024
bab467f
Merge remote-tracking branch 'origin/main' into dashboard
awwaiid Feb 4, 2024
df0d759
Merge remote-tracking branch 'origin/main' into dashboard
awwaiid Feb 10, 2024
55d36e4
Clean out erb lint
awwaiid Feb 10, 2024
a6371f7
Fix expectations to work with cuprite
awwaiid Feb 10, 2024
b5dcff0
Wait for submenu to show before clicking through
awwaiid Feb 11, 2024
128ff44
Clean out some rubocop lint
awwaiid Feb 11, 2024
f40cbce
Move donations summary into main reports controller
awwaiid Feb 11, 2024
cacb59a
Consolidate manufacturer donations into main reports controller
awwaiid Feb 11, 2024
a6428bf
Consolidate product drives summary into main reports controller
awwaiid Feb 11, 2024
e5341eb
Consolidate itemized donations report
awwaiid Feb 11, 2024
2db7d1d
Consolidate itemized distributions report
awwaiid Feb 11, 2024
407f738
Consolidate activity graph report
awwaiid Feb 11, 2024
33ce9e4
Merge pull request #4095 from rubyforgood/dashboard-reports-controller
awwaiid Feb 11, 2024
81b1247
Remove generic count/buttons and extract getting-started
awwaiid Feb 11, 2024
8e89364
No longer displaying the totals
awwaiid Feb 11, 2024
80fc8ff
Fix flaky test by waiting for javascript result
awwaiid Feb 11, 2024
ecdd904
Re-organize reports menu entries
awwaiid Feb 11, 2024
8e4eb71
We no longer show the org logo on the dashboard
awwaiid Feb 11, 2024
49821c9
Merge remote-tracking branch 'origin/main' into dashboard
awwaiid Feb 24, 2024
e483637
Unify on request spec
awwaiid Feb 25, 2024
4c5bbeb
Remove unnecessary forced spaces
awwaiid Feb 25, 2024
db4d441
Move an assertion from system to request spec
awwaiid Feb 25, 2024
993778a
Clean out the lint trap
awwaiid Feb 25, 2024
f8ca6e0
Merge remote-tracking branch 'origin/main' into dashboard
awwaiid Feb 25, 2024
31bf22a
Move distributions summary into consolidated reports
awwaiid Feb 25, 2024
cefe205
Allow sub-controller paths for menu entries
awwaiid Feb 25, 2024
922ec32
Consolidate purchases summary report with the other reports
awwaiid Feb 25, 2024
bce1288
Fix sidebar highlighting for reports and organization admin
awwaiid Feb 25, 2024
2826843
Clean out some lint
awwaiid Feb 25, 2024
d7757c5
Consolidate summary reports specs
awwaiid Feb 25, 2024
ffef79b
Merge remote-tracking branch 'origin/main' into dashboard
awwaiid Mar 2, 2024
1f9c68b
Remove uneeded forced indent
awwaiid Mar 2, 2024
f3647c4
Validate the filters work
awwaiid Mar 2, 2024
971697a
Assume active-class is always an array
awwaiid Mar 2, 2024
0ebe7cf
Move donation spec from system to request style, fix lint
awwaiid Mar 2, 2024
258005d
Migrate itemized donation report from system to request spec
awwaiid Mar 2, 2024
123e8ca
Move system specs to request specs for product drive summary report
awwaiid Mar 3, 2024
c2638fe
Move purchase summary report spec from system to requests
awwaiid Mar 3, 2024
2de9bcb
Merge remote-tracking branch 'origin/main' into dashboard
awwaiid Mar 10, 2024
6fd2f10
Merge remote-tracking branch 'origin/main' into dashboard
awwaiid Mar 10, 2024
35c4e27
Adds type enum to request model.
nathangthomas Mar 15, 2024
d1911fe
Adds request type enum to request model.
nathangthomas Mar 19, 2024
3007e64
Adds request_type to request.
nathangthomas Mar 19, 2024
7ae36b4
Adds request_type to request.
nathangthomas Mar 19, 2024
a2c79df
Passes request_type to FamilyRequestCreateService.new
nathangthomas Mar 19, 2024
7e17565
Passes request_type to FamilyRequestCreateService.new
nathangthomas Mar 19, 2024
9b5977e
Passes request_type to RequestCreateService.new
nathangthomas Mar 19, 2024
854cd39
Passes request_type to Request.new.
nathangthomas Mar 19, 2024
8435518
Adds hidden field in order to pass request_type param on submit.
nathangthomas Mar 19, 2024
45a9495
Adds request type flag to index and show pages as well as the request…
nathangthomas Mar 19, 2024
4791021
Adds by_request_type scope for filtering by request type.
nathangthomas Mar 19, 2024
3866a8f
Adds request type flag to index and show pages as well as the request…
nathangthomas Mar 19, 2024
8a775ec
Adds by_request_type filter.
nathangthomas Mar 19, 2024
7287c11
Merge branch 'main' into dashboard
awwaiid Mar 26, 2024
df48642
Merge remote-tracking branch 'origin/main' into dashboard
awwaiid Mar 26, 2024
7c5f900
Remove test from incorrect merge
awwaiid Mar 27, 2024
5802818
Merge branch 'main' into dashboard
awwaiid Mar 29, 2024
982f322
Port forward the organization_name param
awwaiid Mar 29, 2024
fc3ea3a
Fix new reports to use organization_name param
awwaiid Mar 29, 2024
44b3978
Fix dashboard system spec to use application_name
awwaiid Mar 29, 2024
4919505
Merge remote-tracking branch 'origin/main' into dashboard
awwaiid Mar 30, 2024
c27ce8d
Remove event discrepancy logic
dorner Apr 1, 2024
f144204
lint
dorner Apr 1, 2024
a037b1c
Updates flag names and removes flag styles based on feedback from rub…
nathangthomas Apr 2, 2024
d888831
Merge remote-tracking branch 'origin/main' into dashboard
awwaiid Apr 3, 2024
26afeb4
Adds test for request_type enum.
nathangthomas Apr 3, 2024
b35e686
revamp the styling of privacy policy page
SinanTang Apr 4, 2024
da51d1c
Merge branch 'main' into 4178-privacypolicy-styling
SinanTang Apr 4, 2024
97b5255
Merge branch 'main' into 4178-privacypolicy-styling
SinanTang Apr 6, 2024
0431927
change the background and text color
SinanTang Apr 6, 2024
739e0c3
Merge remote-tracking branch 'refs/remotes/origin/4178-privacypolicy-…
SinanTang Apr 7, 2024
5c2997b
Removes unnecessary line.
nathangthomas Apr 8, 2024
0cd4451
Adds Type to expected_headers.
nathangthomas Apr 8, 2024
94a1be4
Adds request_type traits to request factory.
nathangthomas Apr 8, 2024
42f1f84
Adds request_type to family_request_create_service_spec args.
nathangthomas Apr 8, 2024
c6e45c8
Adds request_type to args.
nathangthomas Apr 8, 2024
3049b6c
Merge branch 'main' into dashboard
awwaiid Apr 9, 2024
f4202a9
Only show outstanding requests for the current org
awwaiid Apr 10, 2024
b4c1cbd
Group low-inventory report by item, not storage location
awwaiid Apr 10, 2024
debb351
Show the expected email address for outstanding-request partners
awwaiid Apr 10, 2024
3b274a7
Merge remote-tracking branch 'origin/main' into dashboard
awwaiid Apr 10, 2024
ec47ef6
Update dashboard system spec with item-grouped low-inventory
awwaiid Apr 10, 2024
0cfddca
Merge branch 'main' into 4175-add-request-type-flag
nathangthomas Apr 12, 2024
4e5de08
update the background color of logo
SinanTang Apr 13, 2024
7f15298
update the background color of logo
SinanTang Apr 13, 2024
8354477
Merge remote-tracking branch 'origin/main' into dashboard
awwaiid Apr 14, 2024
0b3cbc0
Merge remote-tracking branch 'origin/main' into dashboard
awwaiid Apr 16, 2024
aba16d1
Run ci/cd checks on merges consistently
awwaiid Apr 16, 2024
b63d998
Pull :setup_date_range_picker call into before_action
awwaiid Apr 16, 2024
fadfd71
Match menu entries better
awwaiid Apr 16, 2024
6273aa3
Clean up outstanding requests partial extraction
awwaiid Apr 16, 2024
94c0ebd
Stringify action_name, esp when it is nil
awwaiid Apr 18, 2024
5bf83f8
Extract partials for other dashboard blocks
awwaiid Apr 18, 2024
9ab87d7
Update specs with new sidebar menu layout
awwaiid Apr 18, 2024
c68f683
Allow editing of records pre-snapshot
dorner Apr 19, 2024
6686bc8
Add Codespaces support
aeisenberg Apr 17, 2024
eec777f
Remove commented code
aeisenberg Apr 21, 2024
071d5df
use bootstrap instead of tailwindcss for privacypolicy page
SinanTang Apr 21, 2024
d4fd3c4
spec fix
dorner Apr 21, 2024
dc46c1d
Use `-f` flag when copying
aeisenberg Apr 21, 2024
67e9d71
Pass request_type directly.
nathangthomas Apr 22, 2024
d8e9806
Remove request_type partial and enter text directly into reqest_row
nathangthomas Apr 22, 2024
1e19d30
Revert changes to database.yml
nathangthomas Apr 22, 2024
43f7365
Revert changes to request_spec.rb
nathangthomas Apr 22, 2024
c1792ac
Remove request_type
nathangthomas Apr 22, 2024
6441532
Remove hidden request_type fields.
nathangthomas Apr 22, 2024
a27b4e6
Fix merge conflicts / merge remote.
nathangthomas Apr 23, 2024
b896c7c
refactor: remove more test order dependence (#4273)
elasticspoon Apr 25, 2024
82d1d91
3343 partner profile (#4051)
jadekstewart3 Apr 25, 2024
b8639e7
build(deps): bump mini_racer from 0.9.0 to 0.12.0
dependabot[bot] Apr 23, 2024
24e0edb
build(deps): bump coverband from 6.1.0 to 6.1.1
dependabot[bot] Apr 24, 2024
5026b95
Merge branch 'main' into dashboard
awwaiid Apr 26, 2024
87a0192
Revert "Revert "feat(#3345): serve last user role on login""
cielf Apr 20, 2024
ebd6e3e
fix(#4297): flaky report spec
elasticspoon Apr 25, 2024
3eb390c
Fix user spec
dorner Apr 26, 2024
343dc25
Merge pull request #4307 from rubyforgood/fix-user-spec
cielf Apr 26, 2024
5c2fe9c
restoring settings partial in partner profile edit
cielf Apr 27, 2024
6a636eb
Merge pull request #4308 from cielf/restore_settings_on_partner_profi…
awwaiid Apr 27, 2024
72b1904
Merge remote-tracking branch 'origin/main' into dashboard
awwaiid Apr 27, 2024
312d881
Alphabetize sub-menu-entries
awwaiid Apr 27, 2024
f7adc42
use us spelling for gray
SinanTang Apr 28, 2024
4ce6300
Add event-driven low inventory query
awwaiid Apr 28, 2024
f49a357
Update when github flows get executed
awwaiid Apr 28, 2024
b698b05
Update low inventory spec to work with events
awwaiid Apr 29, 2024
2392f4f
Switch from direct-creating inventoryItems to creating a purchase
awwaiid Apr 29, 2024
8e46780
Merge pull request #4247 from rubyforgood/remove-event-differ
awwaiid Apr 30, 2024
0b6bc5e
refactor: change item seeding removal strategy (#4264)
elasticspoon May 1, 2024
a35c758
#4248: fix flaky tests that depends on jQuery (#4268)
callmarx May 1, 2024
f10fa39
build(deps): bump jbuilder from 2.11.5 to 2.12.0 (#4317)
dependabot[bot] May 1, 2024
19be5c8
build(deps): bump coverband from 6.1.1 to 6.1.2 (#4316)
dependabot[bot] May 2, 2024
e24d318
build(deps-dev): bump knapsack_pro from 7.0.1 to 7.1.0 (#4322)
dependabot[bot] May 2, 2024
da7992c
build(deps): bump dotenv-rails from 3.1.0 to 3.1.1 (#4321)
dependabot[bot] May 2, 2024
da6c1c1
build(deps): bump httparty from 0.21.0 to 0.22.0 (#4320)
dependabot[bot] May 2, 2024
754dac3
refactor: remove item seeding simple models
elasticspoon May 2, 2024
8ce0db4
Prevent import of inventory if storage location already has items in …
vincent-truong-main May 2, 2024
e68403a
4294 Disable deleting purchases and donations with inactive items (#4…
pshong79 May 2, 2024
6603dd5
refactor: removed db seeding dependency
elasticspoon May 2, 2024
fb4149d
build(deps): bump geocoder from 1.8.2 to 1.8.3
dependabot[bot] May 3, 2024
f158ba9
Handle multiple UpdateExisting events
dorner May 3, 2024
30fcd73
fix: test failures from removing seeding
elasticspoon May 3, 2024
ef3c4e7
Merge branch 'main' into 4243-edit-old-stuff
dorner May 3, 2024
9258f16
refactor: remove item seeding (models med) (#4222)
elasticspoon May 5, 2024
9111fd8
address linting issue
SinanTang May 5, 2024
d49a873
feat: add FMV column to purchases
sean-dickinson May 2, 2024
a683e75
chore: lint
sean-dickinson May 4, 2024
338f791
feat: move to request spec
sean-dickinson May 6, 2024
b0de921
Display initial allocation for distributions
veezus Apr 29, 2024
49c6ed0
Align distribution totals with columns from _distribution_row
veezus May 6, 2024
55f4599
Copy `.env` only if it does not already exist
aeisenberg May 6, 2024
92aa728
feat(tests): Add helper to await select2
elasticspoon May 5, 2024
0f9c177
refactor: remove item seeding (models hard) (#4223)
elasticspoon May 7, 2024
5c5f552
refactor(tests): remove seeded item reliance (services 1) (#4330)
elasticspoon May 7, 2024
c1c5075
Merge pull request #4255 from SinanTang/4178-privacypolicy-styling
cielf May 7, 2024
4a1655d
Merge pull request #4318 from veezus/date-fulfilled
cielf May 7, 2024
efd5f80
Merge pull request #4328 from sean-dickinson/4314-add-fmv-column-to-p…
cielf May 7, 2024
a9de08b
Fix spelling and make Oxford comma usage consistent
norrismei May 9, 2024
76cbe00
Update Barcode Scanning and Inventory Management descriptions
norrismei May 9, 2024
51fce85
Merge pull request #4344 from norrismei/homepage-edits
cielf May 9, 2024
90b6e74
refactor: remove reliance on seeded items
elasticspoon May 5, 2024
23d25e5
refactor(tests): remove seeded item reliance
elasticspoon May 6, 2024
c891510
refactor(tests): remove reliance on seeded items
elasticspoon May 6, 2024
36de864
refactor: remove reliance on seeded db data (services 2) (#4332)
elasticspoon May 10, 2024
b87d56e
build(deps): bump dotenv-rails from 3.1.1 to 3.1.2
dependabot[bot] May 7, 2024
a06703b
Tests for partner settings partials with enabled request types only
norrismei May 8, 2024
cf0d18f
Fix failing spec
dorner May 10, 2024
4fb0e03
Merge pull request #4347 from rubyforgood/fix-spec
awwaiid May 10, 2024
56d450a
Merge branch 'main' into 4243-edit-old-stuff
awwaiid May 10, 2024
4431272
Fix type error error preventing validation errors from being displaye…
OliverLeighC May 10, 2024
2716d6c
4218 customize distribution receipt (#4234)
nikolaz90 May 10, 2024
fb9af31
build(deps-dev): bump knapsack_pro from 7.1.0 to 7.2.0 (#4346)
dependabot[bot] May 10, 2024
9f001c1
Use factory organization for non-seeded spec [#4243]
awwaiid May 10, 2024
a52a7d0
Use controller/action name instead of path for active menus
awwaiid May 12, 2024
189dc89
Use Inventory::View to simplify low-inventory query
awwaiid May 12, 2024
a43b405
Merge remote-tracking branch 'origin/main' into dashboard
awwaiid May 12, 2024
7326a15
refactor(tests): remove relinace on preseeded db (systems 2)
elasticspoon May 10, 2024
0803246
refactor: remove seeded item reliance (events) (#4337)
elasticspoon May 12, 2024
d103c7e
refactor: remove reliance on preseeded data (requests 2) (#4329)
elasticspoon May 12, 2024
1bf4ac0
Clear events again!
dorner May 12, 2024
befd4fe
Fix up spec to match behavior
awwaiid May 12, 2024
ce7d144
refactor(tests): remove reliance on seeded db (system 3) (#4349)
elasticspoon May 12, 2024
d27aa81
Merge remote-tracking branch 'origin/main' into dashboard
awwaiid May 12, 2024
2df842f
Merge pull request #3788 from rubyforgood/dashboard
awwaiid May 12, 2024
7dd5c81
Merge pull request #4287 from rubyforgood/4243-edit-old-stuff
awwaiid May 12, 2024
d84f9ed
Update README with some codespace edits
awwaiid May 12, 2024
47b57f3
Add github host for running in a codespace
awwaiid May 12, 2024
55c5371
Merge remote-tracking branch 'origin/main' into aeisenberg-devcontain…
awwaiid May 12, 2024
3b83dd9
Empty commit for ci validation
awwaiid May 12, 2024
f646c21
Specify itemizable for inv factory build
awwaiid May 12, 2024
281b6a8
Merge branch 'main-ci' into aeisenberg-devcontainer-updates
awwaiid May 12, 2024
a5a816f
Merge pull request #4350 from rubyforgood/clear-events
cielf May 13, 2024
a972fa4
refactor: missing barcode spec
elasticspoon May 12, 2024
dc23182
fix: inventory aggregate
elasticspoon May 14, 2024
adab5e7
Merge pull request #4353 from rubyforgood/aeisenberg-devcontainer-upd…
awwaiid May 15, 2024
d5aed3c
fix: specs that got added
elasticspoon May 15, 2024
cace801
Merge pull request #4359 from elasticspoon/fix-more-specs
awwaiid May 15, 2024
d53785c
Change request_type data_type to string, replace request_type string …
nathangthomas May 15, 2024
56b7c04
Merge branch 'main' of github.com:unabridged/human-essentials into 41…
nathangthomas May 15, 2024
36cb9b2
Merge branch 'main' into 4175-add-request-type-flag
nathangthomas May 15, 2024
41a0429
Remove request_type from tests
nathangthomas May 15, 2024
c0af65c
Merge branch '4175-add-request-type-flag' of github.com:unabridged/hu…
nathangthomas May 15, 2024
91907dd
Updates based on Codespace Validation (#4358)
awwaiid May 16, 2024
97bb355
Remove `organization_name` from base URL (#4331)
jp524 May 16, 2024
f093039
build(deps): bump omniauth-rails_csrf_protection from 1.0.1 to 1.0.2 …
dependabot[bot] May 16, 2024
5af2778
build(deps-dev): bump rubocop-performance from 1.20.2 to 1.21.0
dependabot[bot] May 15, 2024
f2574ad
build(deps): bump nokogiri from 1.16.4 to 1.16.5 (#4356)
dependabot[bot] May 16, 2024
32e101a
fix: flaky dist by county spec
elasticspoon May 16, 2024
b583d7b
Merge pull request #4362 from elasticspoon/fix-flaky-dist-by-county-spec
awwaiid May 16, 2024
f46736e
Add request_type_label method
nathangthomas May 16, 2024
656e712
Undo changes to versions
nathangthomas May 16, 2024
3a0e841
Add request_type_label method
nathangthomas May 16, 2024
a8513ea
build(deps-dev): bump rubocop-rails from 2.24.1 to 2.25.0
dependabot[bot] May 17, 2024
46d6fec
build(deps-dev): bump standard and rubocop
dependabot[bot] May 17, 2024
3d4b658
remove item generation (#4206)
elasticspoon May 17, 2024
389e6d9
Add request_type to initialize
nathangthomas May 17, 2024
c1acb98
Merge branch 'main' into 4175-add-request-type-flag
nathangthomas May 17, 2024
15ecc79
Fix request_type bug
nathangthomas May 21, 2024
9c0572b
Merge branch '4175-add-request-type-flag' of github.com:unabridged/hu…
nathangthomas May 21, 2024
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
Prev Previous commit
Next Next commit
Add request_type_label method
nathangthomas committed May 16, 2024
commit f46736ee5b568d4226517840a242c71f0df07419
4 changes: 4 additions & 0 deletions app/models/request.rb
Original file line number Diff line number Diff line change
@@ -60,6 +60,10 @@ def user_email
partner_user_id ? User.find_by(id: partner_user_id).email : Partner.find_by(id: partner_id).email
end

def request_type_label
request_type&.first&.capitalize
end

private

def sanitize_items_data
2 changes: 1 addition & 1 deletion app/views/requests/_request_row.html.erb
Original file line number Diff line number Diff line change
@@ -13,7 +13,7 @@
<%= request_row.comments %>
</td>
<td>
<%= request_row&.request_type&.first&.capitalize %>
<%= request_row.request_type_label %>
</td>
<td>
<%= render partial: "status", locals: {status: request_row.status} %>
10 changes: 10 additions & 0 deletions spec/models/request_spec.rb
Original file line number Diff line number Diff line change
@@ -57,6 +57,16 @@
end
end

describe "request_type_label" do
let(:id_one) { create(:item).id }
let(:id_two) { create(:item).id }
let(:request) { create(:request, request_items: [{ item_id: id_one, quantity: 15 }, { item_id: id_two, quantity: 18 }], request_type: "individual") }

it "returns the the first letter of the request_type capitalized" do
expect(request.request_type_label).to eq("I")
end
end

describe "versioning" do
it { is_expected.to be_versioned }
end