Commit Graph
55 Commits
Author SHA1 Message Date
Daniel O'Connorandgoogle-labs-jules[bot] c7eef27f9a Fix new harvest from planting not prefilling crop (#4786)
When initializing a new harvest from a planting (via `planting_slug`
or `harvest[planting_id]`), `HarvestsController#new` now properly looks
up the planting, assigns `@harvest.planting` and `@harvest.crop` from
the planting's crop, and sets `@planting` and `@crop` instance variables
for view rendering.

Regression tests added to `HarvestsController` spec and request spec.

Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>
2026-09-20 14:10:14 +09:30
Daniel O'Connor 3edd2510d8 Merge pull request #4683 from Growstuff/refactor-harvests-remove-elasticsearch-14630838429921835504
Refactor harvests to remove Elasticsearch
2026-06-24 20:26:22 +09:30
035210197f Prompt for updated planting rating when harvesting (#4608)
* Update planting rating when recording a harvest

- Added virtual attribute `overall_rating` to `Harvest` model.
- Updated `HarvestsController` to permit `overall_rating` and synchronize it to the associated `Planting`.
- Added a rating range field (1-5) to the harvest form.
- Added controller tests to verify that the planting rating is updated.
- Refined feature tests for harvesting.

Co-authored-by: CloCkWeRX <365751+CloCkWeRX@users.noreply.github.com>

* I have updated the system to allow for recording a planting rating when a harvest is logged. Here is a summary of the changes:

- Added a virtual attribute `overall_rating` to the `Harvest` model.
- Updated `HarvestsController` to permit `overall_rating` and synchronize it to the associated `Planting`.
- Added a rating range field (1-5) to the harvest form.
- Added controller tests to verify that the planting rating is updated correctly.
- Updated feature tests to ensure the harvest form functions as expected.

Co-authored-by: CloCkWeRX <365751+CloCkWeRX@users.noreply.github.com>

* Update database.yml

* Apply suggestions from code review

Co-authored-by: Daniel O'Connor <daniel.oconnor@gmail.com>

* Adjust wording

* Change harvest modal

* Fix tests

---------

Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>
2026-05-03 14:47:00 +09:30
163289e853 Fix RSpec/IndexedLet RuboCop issues in spec files (#4556)
* Fix RSpec/IndexedLet RuboCop issues in spec files

Replace indexed let variable names with descriptive names across 11 spec files.
This improves readability and complies with the RSpec/IndexedLet rule.

Co-authored-by: CloCkWeRX <365751+CloCkWeRX@users.noreply.github.com>

* Rubocop

---------

Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>
2026-04-26 03:10:03 +09:30
Daniel O'Connor 8de6b083f9 Rubocop: RSpecRails/HaveHttpStatus 2026-04-23 14:13:47 +00:00
Daniel O'Connor f1acb35520 Merge pull request #4537 from Growstuff/FactoryBot/SyntaxMethods
Rubocop: FactoryBot/SyntaxMethods
2026-04-23 22:29:24 +09:30
Daniel O'Connor d1f754a288 Rubocop 2022-11-08 00:23:38 +10:30
Daniel O'Connor e2942f17c7 Rubocop corrections 2022-11-08 00:18:35 +10:30
codefactor-io 6c9a15f95e [CodeFactor] Apply fixes 2020-01-11 21:29:37 +00:00
codefactor-io 7e30b6b6e0 [CodeFactor] Apply fixes 2020-01-03 11:28:51 +00:00
Brenda Wallace 8ee332edd8 update harvests controller 2019-12-28 09:20:18 +13:00
Brenda Wallace 0d08f48b71 turn on ES indexing in some controllers 2019-12-27 09:15:53 +13:00
codefactor-io 75c7d63956 [CodeFactor] Apply fixes to commit b730378 2019-12-22 20:46:08 +00:00
Brenda Wallace b730378e14 tidy up and fix specs for harvest controller 2019-12-23 09:45:35 +13:00
codefactor-io e8760f9c38 [CodeFactor] Apply fixes 2019-12-20 03:33:23 +00:00
Brenda Wallace 04fd1a343a Rubocop update (#2334)
* Update rubocop config

* Rubocop update - for rubocop 0.77

* [CodeFactor] Apply fixes

* rubocop fixes

* [CodeFactor] Apply fixes to commit 2826c2e
2019-12-16 22:35:33 +13:00
Awesome Code e7713ab24b Auto corrected by following Lint Ruby RSpec/AlignRightLetBrace 2019-03-20 15:01:33 +13:00
Awesome Code da997ae538 Auto corrected by following Lint Ruby RSpec/AlignLeftLetBrace 2019-03-20 15:01:33 +13:00
Awesome Code 284bb81bbf Auto corrected by following Lint Ruby RSpecEmptyLine 2019-02-09 03:05:40 +00:00
Brenda Wallace a219cc4f67 Update harvests controller spec for new routes 2019-01-06 08:45:42 +13:00
Brenda Wallace 7b01fcbd4b Align all the hashes 2018-12-30 15:22:29 +13:00
Brenda Wallace 550860178e Merge remote-tracking branch 'upstream/dev' into upgrade/rails-5 2018-09-11 16:07:30 +12:00
Awesome Code 90f4db4853 Auto corrected by following Ruby rspec layout 2018-09-10 22:20:12 +00:00
Brenda Wallace 65b4c7dbc1 Revert "Auto corrected by following Style/StringLiterals"
This reverts commit ab56a3c6b3.
2018-02-09 07:58:47 +13:00
Awesome Code ab56a3c6b3 Auto corrected by following Style/StringLiterals 2018-02-07 10:20:26 +13:00
Awesome Code dea7ce241b Auto corrected by following RSpec/EmptyLineAfterFinalLet 2018-01-23 09:00:34 +13:00
Brenda Wallace 8e0b7d9ded Merge branch 'charts' into upgrade/rails-5
Conflicts:
	app/assets/javascripts/crops.js.erb
	spec/controllers/comments_controller_spec.rb
	spec/controllers/harvests_controller_spec.rb
	spec/controllers/photos_controller_spec.rb
	spec/controllers/plantings_controller_spec.rb
	spec/models/post_spec.rb
	spec/views/home/_crops.html.haml_spec.rb
2018-01-11 08:34:20 +13:00
Awesome Code e46f530dc3 Auto corrected by following RSpec/EmptyLineAfterFinalLet 2018-01-09 02:00:40 +00:00
Brenda Wallace 4e5aa8077c Re-wrote harvests#update controller spec 2018-01-05 21:34:11 +13:00
Brenda Wallace 2f9610a60f Http positional arguments in rails 5 2018-01-04 21:28:48 +13:00
milesgould bb6e9e32e6 De-deprecate controller and view specs
We deprecated controller and view specs on the grounds that they were
brittle, and were a poorer measure of user experience than feature
specs. However, feature specs have their own problems: they're much
slower to run, and flakier (see #901). We also ran into a few cases
where feature specs erroneously passed because they were checking for
the presence of a string that occurred in the error page!

Hence, we're cautiously un-deprecating controller and view specs.

Fixes #1132
2017-11-24 19:02:54 +13:00
milesgould d8bf8ae4df De-deprecate controller and view specs
We deprecated controller and view specs on the grounds that they were
brittle, and were a poorer measure of user experience than feature
specs. However, feature specs have their own problems: they're much
slower to run, and flakier (see #901). We also ran into a few cases
where feature specs erroneously passed because they were checking for
the presence of a string that occurred in the error page!

Hence, we're cautiously un-deprecating controller and view specs.

Fixes #1132
2017-11-17 16:51:24 +00:00
Brenda Wallace a6cc530fe5 Updating specs to use same owner for garden and planting 2017-11-18 00:43:17 +13:00
Brenda Wallace 2fbba52bc8 Updating specs to use same owner for garden and planting 2017-11-13 19:18:14 +13:00
Brenda Wallace b3fd8e32d0 Fixed ordering of Harvests - don't order in scope. 2017-11-05 17:42:59 +13:00
Logan Gingerich 10a8df47a9 Factorygirl to factorybot - fixes #1413 (#1425)
* FactoryGirl Changed to FactoryBot

file fix

changes based on comments received

Bundle Update on 2017-10-29

style update to align hash literal

added package-lock

* indentation fixes with rubocop

* name added to contributors
2017-11-01 15:03:31 +00:00
Brenda Wallace 0f523381f0 DRY the harvest controller 2017-02-20 09:58:36 +13:00
Brenda Wallace d00f743c47 rubocop fix up on spec 2017-02-17 16:00:11 +13:00
Daniel O'Connor b24514fa82 Look at right attribute 2017-02-06 14:11:44 +10:30
Daniel O'Connor f0a81d4100 Fix #1182 and improve test coverage 2017-02-06 14:10:40 +10:30
Brenda Wallace 40a981c94d Removed unnecesary braces on hash args 2017-01-22 15:10:11 +13:00
Brenda Wallace 283bb76a9e Link a harvest to a planting, and display 2017-01-04 22:45:49 +13:00
Brenda Wallace 723ebff923 Spacing fixes 2016-11-26 12:13:17 +13:00
Brenda Wallace 62e7c716dd Removed extra empty blank lines 2016-11-26 12:06:02 +13:00
Brenda Wallace 83392ddda1 Indentation clean ups 2016-11-26 10:51:54 +13:00
Brenda Wallace bdb057ca0f Removed all trailing white space 2016-11-14 15:05:32 +13:00
Daniel O'Connor 4b4e0cf69a $ rubocop --only HashSyntax --auto-correct
483 files inspected, 2018 offenses detected, 2018 offenses corrected
2016-05-19 15:53:11 -04:00
Daniel O'Connor c3a883de16 Ensure we choose a plant part 2016-04-07 09:47:53 +09:30
Taylor Griffin 95974ab21b add deprecation not to all controller and view specs 2015-02-12 19:52:53 +11:00
Mackenzie Morgan 0da121a48d adding test for harvest csv 2015-01-29 22:27:09 -05:00