Commit Graph

2446 Commits

Author SHA1 Message Date
Daniel O'Connor
e7659a75a4 Merge pull request #4548 from Growstuff/RSpecRails/HaveHttpStatus
Rubocop: RSpecRails/HaveHttpStatus
2026-04-23 23:52:40 +09:30
Daniel O'Connor
4a66bdc9fe Merge pull request #4546 from Growstuff/Rails/RedundantActiveRecordAllMethod
Rubocop: Rails/RedundantActiveRecordAllMethod
2026-04-23 23:46:39 +09:30
Daniel O'Connor
8de6b083f9 Rubocop: RSpecRails/HaveHttpStatus 2026-04-23 14:13:47 +00:00
Daniel O'Connor
accab7f84c Merge pull request #4545 from Growstuff/RSpecRails/InferredSpecType
Rubocop: RSpecRails/InferredSpecType
2026-04-23 23:29:17 +09:30
Daniel O'Connor
3f6dd59dfa Rubocop: Rails/RedundantActiveRecordAllMethod 2026-04-23 13:48:17 +00:00
Daniel O'Connor
0a71b44dea Merge pull request #4542 from Growstuff/RSpec/ContextMethod
Rubocop: RSpec/ContextMethod
2026-04-23 23:10:33 +09:30
Daniel O'Connor
ba75afb3f5 Rubocop: RSpecRails/InferredSpecType 2026-04-23 13:39:46 +00:00
Daniel O'Connor
aa1c9ceb05 Merge pull request #4543 from Growstuff/RSpec/ExpectChange
Rubocop: RSpec/ExpectChange
2026-04-23 23:02:03 +09:30
Daniel O'Connor
ea5f93f929 Merge pull request #4541 from Growstuff/Lint/EmptyBlock
Rubocop: Lint/EmptyBlock
2026-04-23 22:53:40 +09:30
Daniel O'Connor
6f59635ca7 Rubocop: RSpec/ExpectChange 2026-04-23 13:23:14 +00:00
Daniel O'Connor
6736ae3142 Rubocop: RSpec/ContextMethod 2026-04-23 13:20:47 +00:00
Daniel O'Connor
5d112e9134 Rubocop: Capybara/RSpec/HaveSelector (#4539)
* Rubocop: Capybara/RSpec/HaveSelector

* Rubocop: Capybara/RSpec/HaveSelector
2026-04-23 22:45:58 +09:30
Daniel O'Connor
6ba4f39b4a Rubocop: Lint/EmptyBlock 2026-04-23 13:14:39 +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
c1f171b09e Rubocop: Capybara/NegationMatcher 2026-04-23 12:30:06 +00:00
Daniel O'Connor
ae5c125a96 Rubocop: Layout/IndentationWidth 2026-04-23 12:10:09 +00:00
google-labs-jules[bot]
477812f06b Refactor signup feature spec to use direct database setup
- Rewrote the 'sign up for new account with existing username' test in
  spec/features/signup_spec.rb.
- Replaced UI-driven setup of an existing user with FactoryBot's `create`.
- Replaced UI navigation with a direct call to `new_member_registration_path`.
- Added an explicit assertion for the 'has already been taken' error
  message.
- Ensured a unique email is used for the second signup attempt to isolate
  the username validation check.

Co-authored-by: CloCkWeRX <365751+CloCkWeRX@users.noreply.github.com>
2026-03-26 06:34:32 +00:00
Daniel O'Connor
f94f5638c8 Decrease failures by checking for the save message first 2026-03-26 05:47:00 +00:00
Daniel O'Connor
ae639b6e74 Adjust expectation 2025-12-13 02:12:20 +00:00
Daniel O'Connor
be59bd9f27 Delete spec/tasks/sitemap_cached_spec.rb 2025-12-02 01:58:19 +10:30
google-labs-jules[bot]
7f75aed146 feat: Add sitemap generator
Adds the `sitemap_generator` gem to generate a sitemap.

- Includes static routes and dynamic routes for active crops, plantings, seeds, photos, posts, and members.
- Implements a caching mechanism to ensure the sitemap is generated no more frequently than every 72 hours.
- Updates `robots.txt` to point to the new sitemap.
- Includes a unit test for the caching Rake task.
2025-12-01 14:31:54 +00:00
google-labs-jules[bot]
620337fbac Merge pull request #4353 from Growstuff/feat/import-australian-food-data
Add Rake Task to Import Australian Food Data
2025-12-01 19:43:14 +10:30
Daniel O'Connor
d1509a303e Merge branch 'dev' into fix-crops-show-spec 2025-12-01 19:02:11 +10:30
google-labs-jules[bot]
30e7c5d01c Merge pull request #4352 from Growstuff/add-public-food-key
feat: Add Public Food Key to Crop model
2025-12-01 18:02:33 +10:30
google-labs-jules[bot]
6f0d0afdb8 Fix(specs): Initialize @version_members in crops/show view spec
The `crops/show` view spec was failing with a `NoMethodError` because
the `@version_members` instance variable was `nil`. This variable is used
in the `_history` partial, which is rendered by the `show` view.

This commit fixes the spec by initializing `@version_members` to an
empty hash in the `before` block of the spec. This ensures that the
view can render without errors during the test run.
2025-12-01 02:34:46 +00:00
google-labs-jules[bot]
460daf36f9 Add revert functionality to admin crops page (#4346)
* feat(admin): add revert functionality to crops page

This change adds a "Revert" button to the admin crops page, allowing crop wranglers to revert changes to a previous version.

It introduces a new `Admin::VersionsController` with a `revert` action that uses `paper_trail`'s `reify` method to restore a previous version of a `Crop` object.

The view is updated to include a "Revert" button, which is guarded by a `can?(:wrangle, Crop)` check to ensure only authorized users can see it.

The controller also includes an authorization check to prevent unauthorized users from accessing the revert action directly.

A feature spec is added to test the new functionality, including the authorization logic.

* Consistent UX

* Specs

---------

Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>
Co-authored-by: Daniel O'Connor <daniel.oconnor@gmail.com>
2025-11-30 15:05:13 +10:30
Daniel O'Connor
ba9117db4d I have added the before_destroy callback to the Crop model to destroy all CropCompanion records where the crop is crop_b. (#4266)
I have added a new test to `spec/models/crop_spec.rb` to verify that deleting a crop also destroys the associated `CropCompanion` records.

Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>
2025-11-29 15:32:47 +10:30
Daniel O'Connor
474f09e110 Merge pull request #4332 from Growstuff/crops-controller
Add coverage for crops
2025-11-29 15:32:08 +10:30
google-labs-jules[bot]
63d65c4e6b Merge pull request #4277 from Growstuff/add-activity-update-coverage
Add test coverage for updating an activity via the API
2025-09-30 20:29:11 +09:30
Daniel O'Connor
d9851231f2 Merge pull request #4274 from Growstuff/CloCkWeRX-patch-3
API > Render activities links under member
2025-09-29 01:11:24 +09:30
Daniel O'Connor
488e402a3a Adjust copy of activities and prompts (#4260)
* Adjust copy

* Adjust copy

* Move repeat prompt

* Improve prompts

* Clean up schema

* Fix spec
2025-09-21 14:58:13 +09:30
google-labs-jules[bot]
e99c90adc4 Add recurring activities feature without database persistence (#4261)
* This change introduces a new feature that allows users to create recurring activities.

A user can now specify that an activity should be repeated "X" times, every "Y" weeks. When an activity is created with these options, the application will create the initial activity and then "X" additional copies, with each copy's due date offset by "Y" weeks from the previous one.

The repeat information is not stored in the database. It is only used at the time of creation to generate the recurring activities.

The following changes were made:
- Updated the new activity form to include fields for "repeat times" and "repeat weeks".
- Modified the `ActivitiesController#create` action to handle the creation of recurring activities.
- Added feature tests to ensure the new functionality works as expected.

* Remove not very useful spec

---------

Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>
Co-authored-by: Daniel O'Connor <daniel.oconnor@gmail.com>
2025-09-21 13:53:45 +09:30
google-labs-jules[bot]
41412b8443 Merge pull request #4262 from Growstuff/feature/github-releases-widget
feat: Add cached GitHub releases widget to homepage
2025-09-21 13:37:57 +09:30
Daniel O'Connor
ce946c3a83 Rubocop fixes 2025-09-20 09:45:56 +00:00
Daniel O'Connor
ce7ce70d5f Merge pull request #4222 from Growstuff/feature/add-activity-prompts
feat: Add prompts for new activities
2025-09-20 17:49:47 +09:30
google-labs-jules[bot]
02db5b8130 Add API token generation, authentication, and CRUD for a number of the API resources (#4237)
* feat: Add API token generation and authentication

This commit introduces API token generation and authentication for write operations.

- Adds a section to the user's profile edit page to generate and display an API token.
- Reuses the `authentications` table to store the API token, avoiding the need for a database migration.
- Implements token-based authentication for the API using the `Authorization: Token token=...` header.
- Enables write operations for all API resources and ensures they are protected by the new authentication mechanism.
- Adds feature and request specs to test the new functionality.

* feat: Add API token generation and authentication

This commit introduces API token generation and authentication for write operations.

- Adds a section to the user's profile edit page to generate and display an API token.
- Reuses the `authentications` table to store the API token, avoiding the need for a database migration.
- Implements token-based authentication for the API using the `Authorization: Token token=...` header.
- Enables write operations for all API resources and ensures they are protected by the new authentication mechanism.
- Adds feature and request specs to test the new functionality.

* Mark as editable

* Refactor

* WIP - Authentication

* Implement more test coverage

* Split 401 and 403

* Before Create hooks

* Update harvest specs, defaulting to the first plant part - this may not be right

* Update coverage

* Update coverage

* Rubocop

* Rubocop

* Rubocop

* Fix coverage

* For now, mark photos immutable again

* Fix specs

* Fix specs

* Rubocop

* Fix specs

---------

Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>
Co-authored-by: Daniel O'Connor <daniel.oconnor@gmail.com>
2025-09-10 19:50:06 +09:30
google-labs-jules[bot]
e5c71f1dc4 Merge pull request #4230 from Growstuff/feature/add-more-filters
feat: Add more filters to API resources
2025-09-09 21:34:49 +09:30
google-labs-jules[bot]
bc11a1b8db Merge pull request #4209 from Growstuff/extend-crop-model
Extend Crop Model and Migrate Data from OpenFarm
2025-09-07 20:03:18 +09:30
Daniel O'Connor
ada567dcab Remove JS testing from footer 2025-09-01 14:28:24 +00:00
Daniel O'Connor
d620dc3bfc Merge pull request #4190 from Growstuff/less-js
Specs: Sign up, sign in don't need JS
2025-09-01 23:57:29 +09:30
Daniel O'Connor
c189e3b01a Merge pull request #4062 from Growstuff/feature/planting-rating
Add overall_rating to Plantings
2025-09-01 23:56:13 +09:30
Daniel O'Connor
70e6c44d82 Sign up, sign in don't need JS 2025-09-01 13:20:04 +00:00
google-labs-jules[bot]
0f4803392d Add seed source to Seed model (#4186)
* Add seed source to Seed model

* Update _form.html.haml

* Add to schema

* Default option

* Default option

* Fix test

---------

Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>
Co-authored-by: Daniel O'Connor <daniel.oconnor@gmail.com>
2025-09-01 21:47:31 +09:30
google-labs-jules[bot]
0079513b35 Merge pull request #4183 from Growstuff/feature/timeline-likes
Feature: Display likes on timeline
2025-09-01 19:51:24 +09:30
Daniel O'Connor
abbe9ee7ca Update spec/features/home/home_spec.rb 2025-08-31 13:01:51 +09:30
Daniel O'Connor
074644d5c8 Adjust specs 2025-08-31 03:27:04 +00:00
google-labs-jules[bot]
378bd0d8f1 feat: Add PWA installation instructions to homepage
This commit adds instructions for mobile users on how to install the Growstuff website as a Progressive Web App (PWA).

The changes include:
- A new section on the homepage with instructions for both iOS and Android devices. This section is only visible to logged-out users.
- New translations for the instructions in the `en.yml` locale file.
- Basic styling for the new section.
- Updated feature tests to verify the new section's visibility.
2025-08-31 02:25:55 +00:00
Daniel O'Connor
8044640023 Merge branch 'dev' into remove-openfarm.cc 2025-08-29 19:56:09 +09:30
google-labs-jules[bot]
4d3c4ca10d Merge pull request #4154 from Growstuff/finish-expired-seeds-task
Add maintenance task to finish expired seeds
2025-08-28 00:16:16 +09:30
Daniel O'Connor
ab29de3d04 Remove dead test 2025-08-27 14:45:57 +00:00