mirror of
https://github.com/Growstuff/growstuff.git
synced 2026-10-31 03:09:06 -04:00
- Deleted Elasticsearch gems from Gemfile and Gemfile.lock. - Updated README and TECH documentation to reflect the removal of Elasticsearch. - Removed Elasticsearch-related code from models, controllers, services, and factories. - Adjusted tests to eliminate dependencies on Elasticsearch. - Cleaned up Docker configuration and environment variables related to Elasticsearch. - Added a TODO file for future gem reviews and potential removals.
91 lines
1.9 KiB
Ruby
91 lines
1.9 KiB
Ruby
# frozen_string_literal: true
|
|
|
|
FactoryBot.define do
|
|
factory :crop do
|
|
name { "magic bean" }
|
|
en_wikipedia_url { "http://en.wikipedia.org/wiki/Magic_bean" }
|
|
approval_status { "approved" }
|
|
creator
|
|
|
|
factory :annual_crop, parent: :crop do
|
|
perennial { false }
|
|
end
|
|
factory :perennial_crop, parent: :crop do
|
|
perennial { true }
|
|
end
|
|
|
|
factory :tomato do
|
|
name { "tomato" }
|
|
en_wikipedia_url { "http://en.wikipedia.org/wiki/Tomato" }
|
|
end
|
|
|
|
factory :maize do
|
|
name { "maize" }
|
|
en_wikipedia_url { "http://en.wikipedia.org/wiki/Maize" }
|
|
end
|
|
|
|
factory :chard do
|
|
name { "chard" }
|
|
end
|
|
|
|
factory :walnut do
|
|
name { "walnut" }
|
|
end
|
|
|
|
factory :apple do
|
|
name { "apple" }
|
|
end
|
|
|
|
factory :pear do
|
|
name { "pear" }
|
|
end
|
|
|
|
# for testing varieties
|
|
factory :roma do
|
|
name { "roma tomato" }
|
|
end
|
|
|
|
factory :popcorn do
|
|
name { "popcorn" }
|
|
end
|
|
|
|
factory :eggplant do
|
|
name { "eggplant" }
|
|
end
|
|
|
|
factory :crop_with_photo do
|
|
name { 'marshmallow' }
|
|
photos { FactoryBot.create_list(:photo, 1) }
|
|
end
|
|
|
|
# This should have a name that is alphabetically earlier than :uppercase
|
|
# crop to ensure that the ordering tests work.
|
|
factory :lowercasecrop do
|
|
name { "ffrench bean" }
|
|
end
|
|
|
|
factory :uppercasecrop do
|
|
name { "Swiss chard" }
|
|
end
|
|
|
|
factory :autoloaded_crop do
|
|
creator { "cropbot" }
|
|
end
|
|
|
|
# for testing crop request
|
|
factory :crop_request do
|
|
name { "Ultra berry" }
|
|
en_wikipedia_url { "" }
|
|
approval_status { "pending" }
|
|
association :requester, factory: :member
|
|
request_notes { "Please approve this even though it's fake." }
|
|
end
|
|
|
|
factory :rejected_crop do
|
|
name { "Fail bean" }
|
|
approval_status { "rejected" }
|
|
reason_for_rejection { "Totally fake" }
|
|
end
|
|
end
|
|
end
|