diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md index fba00e2c3..a9f784ac3 100644 --- a/CONTRIBUTORS.md +++ b/CONTRIBUTORS.md @@ -85,6 +85,8 @@ submit the change with your pull request. - Mark Taffman / [mftaff](https://github.com/mftaff) - Jennifer Kruse / [jenkr55](https://github.com/jenkr55) - Christopher Bazin / [RobotScissors](https://github.com/robotscissors) +- Ahmed Shahin / [codeminator](https://www.github.com/codeminator) +- Brandon Baker / [brandonbaker40](https://github.com/brandonbaker40) ## Bots diff --git a/Gemfile.lock b/Gemfile.lock index 106f5d901..4bf828c6f 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -2,21 +2,21 @@ GEM remote: https://rubygems.org/ remote: https://rails-assets.org/ specs: - actionmailer (4.2.10) - actionpack (= 4.2.10) - actionview (= 4.2.10) - activejob (= 4.2.10) + actionmailer (4.2.11) + actionpack (= 4.2.11) + actionview (= 4.2.11) + activejob (= 4.2.11) mail (~> 2.5, >= 2.5.4) rails-dom-testing (~> 1.0, >= 1.0.5) - actionpack (4.2.10) - actionview (= 4.2.10) - activesupport (= 4.2.10) + actionpack (4.2.11) + actionview (= 4.2.11) + activesupport (= 4.2.11) rack (~> 1.6) rack-test (~> 0.6.2) rails-dom-testing (~> 1.0, >= 1.0.5) rails-html-sanitizer (~> 1.0, >= 1.0.2) - actionview (4.2.10) - activesupport (= 4.2.10) + actionview (4.2.11) + activesupport (= 4.2.11) builder (~> 3.1) erubis (~> 2.7.0) rails-dom-testing (~> 1.0, >= 1.0.5) @@ -26,20 +26,20 @@ GEM addressable active_median (0.1.4) activerecord - active_utils (3.3.12) - activesupport (>= 3.2, < 6.0) + active_utils (3.3.15) + activesupport (>= 4.2) i18n - activejob (4.2.10) - activesupport (= 4.2.10) + activejob (4.2.11) + activesupport (= 4.2.11) globalid (>= 0.3.0) - activemodel (4.2.10) - activesupport (= 4.2.10) + activemodel (4.2.11) + activesupport (= 4.2.11) builder (~> 3.1) - activerecord (4.2.10) - activemodel (= 4.2.10) - activesupport (= 4.2.10) + activerecord (4.2.11) + activemodel (= 4.2.11) + activesupport (= 4.2.11) arel (~> 6.0) - activesupport (4.2.10) + activesupport (4.2.11) i18n (~> 0.7) minitest (~> 5.1) thread_safe (~> 0.3, >= 0.3.4) @@ -53,7 +53,7 @@ GEM ast (2.4.0) autoprefixer-rails (8.6.4) execjs - bcrypt (3.1.11) + bcrypt (3.1.12) better_errors (2.2.0) coderay (>= 1.0.0) erubis (>= 2.6.6) @@ -72,11 +72,11 @@ GEM sass (>= 3.3.4) bootstrap_form (2.7.0) builder (3.2.3) - bullet (5.7.5) + bullet (5.9.0) activesupport (>= 3.0.0) - uniform_notifier (~> 1.11.0) + uniform_notifier (~> 1.11) byebug (10.0.2) - cancancan (2.2.0) + cancancan (2.3.0) capybara (2.18.0) addressable mini_mime (>= 0.1.3) @@ -87,15 +87,15 @@ GEM capybara-email (3.0.1) capybara (>= 2.4, < 4.0) mail - capybara-screenshot (1.0.21) + capybara-screenshot (1.0.22) capybara (>= 1.0, < 4) launchy - chartkick (2.3.5) + chartkick (3.0.1) childprocess (0.9.0) ffi (~> 1.0, >= 1.0.11) climate_control (0.2.0) cliver (0.3.2) - codeclimate-test-reporter (1.0.8) + codeclimate-test-reporter (1.0.9) simplecov (<= 0.13) codemirror-rails (5.16.0) railties (>= 3.0, < 6.0) @@ -122,7 +122,7 @@ GEM rails (>= 4.0.0, < 5.1) rails-i18n (>= 4.0.0) sass-rails (>= 4.0.3) - concurrent-ruby (1.0.5) + concurrent-ruby (1.1.4) connection_pool (2.2.2) coveralls (0.8.19) json (>= 1.8, < 3) @@ -133,10 +133,10 @@ GEM crass (1.0.4) csv_shaper (1.3.0) activesupport (>= 3.0.0) - dalli (2.7.8) + dalli (2.7.9) database_cleaner (1.7.0) debug_inspector (0.0.3) - devise (4.4.3) + devise (4.5.0) bcrypt (~> 3.0) orm_adapter (~> 0.1) railties (>= 4.1.0, < 6.0) @@ -163,10 +163,10 @@ GEM erubis (2.7.0) excon (0.62.0) execjs (2.7.0) - factory_bot (4.10.0) + factory_bot (4.11.1) activesupport (>= 3.0.0) - factory_bot_rails (4.10.0) - factory_bot (~> 4.10.0) + factory_bot_rails (4.11.1) + factory_bot (~> 4.11.1) railties (>= 3.0.0) faker (1.9.1) i18n (>= 0.7) @@ -176,10 +176,10 @@ GEM figaro (1.1.1) thor (~> 0.14) flickraw (0.9.9) - font-awesome-sass (5.0.13) + font-awesome-sass (5.5.0.1) sassc (>= 1.11) formatador (0.2.5) - friendly_id (5.2.4) + friendly_id (5.2.5) activerecord (>= 4.0.0) geocoder (1.4.9) gibbon (1.2.1) @@ -190,7 +190,7 @@ GEM gravatar-ultimate (2.0.0) activesupport (>= 2.3.14) rack - guard (2.14.2) + guard (2.15.0) formatador (>= 0.2.4) listen (>= 2.7, < 4.0) lumberjack (>= 1.0.12, < 2.0) @@ -226,7 +226,7 @@ GEM rubocop (>= 0.49.0) sysexits (~> 1.1) hashie (3.5.7) - heroics (0.0.24) + heroics (0.0.25) erubis (~> 2.0) excon moneta @@ -261,7 +261,7 @@ GEM railties (>= 3.2) sprockets-rails json (2.1.0) - jsonapi-resources (0.9.0) + jsonapi-resources (0.9.3) activerecord (>= 4.1) concurrent-ruby railties (>= 4.1) @@ -284,34 +284,34 @@ GEM addressable (~> 2.3) leaflet-rails (1.3.1) rails (>= 4.2.0) - letter_opener (1.6.0) + letter_opener (1.7.0) launchy (~> 2.2) listen (3.1.5) rb-fsevent (~> 0.9, >= 0.9.4) rb-inotify (~> 0.9, >= 0.9.7) ruby_dep (~> 1.2) - loofah (2.2.2) + loofah (2.2.3) crass (~> 1.0.2) nokogiri (>= 1.5.9) lumberjack (1.0.13) - mail (2.7.0) + mail (2.7.1) mini_mime (>= 0.1.1) memcachier (0.0.2) - method_source (0.9.0) + method_source (0.9.2) mime-types (3.1) mime-types-data (~> 3.2015) mime-types-data (3.2016.0521) mimemagic (0.3.2) - mini_mime (1.0.0) + mini_mime (1.0.1) mini_portile2 (2.3.0) minitest (5.11.3) - moneta (0.8.1) + moneta (1.0.0) multi_json (1.11.3) multi_xml (0.6.0) multipart-post (2.0.0) nenv (0.3.0) - newrelic_rpm (5.2.0.345) - nokogiri (1.8.4) + newrelic_rpm (5.6.0.349) + nokogiri (1.8.5) mini_portile2 (~> 2.3.0) notiffany (0.1.1) nenv (~> 0.1) @@ -351,9 +351,9 @@ GEM parser (2.5.1.0) ast (~> 2.4.0) pg (0.21.0) - platform-api (2.1.0) - heroics (~> 0.0.23) - moneta (~> 0.8.1) + platform-api (2.2.0) + heroics (~> 0.0.25) + moneta (~> 1.0.0) plupload-rails (1.2.1) rails (>= 3.1) poltergeist (1.17.0) @@ -361,31 +361,31 @@ GEM cliver (~> 0.3.1) websocket-driver (>= 0.2.0) powerpack (0.1.1) - pry (0.11.3) + pry (0.12.2) coderay (~> 1.1.0) method_source (~> 0.9.0) - public_suffix (3.0.2) + public_suffix (3.0.3) quiet_assets (1.1.0) railties (>= 3.1, < 5.0) - rack (1.6.10) - rack-protection (2.0.3) + rack (1.6.11) + rack-protection (2.0.4) rack rack-test (0.6.3) rack (>= 1.0) - rails (4.2.10) - actionmailer (= 4.2.10) - actionpack (= 4.2.10) - actionview (= 4.2.10) - activejob (= 4.2.10) - activemodel (= 4.2.10) - activerecord (= 4.2.10) - activesupport (= 4.2.10) + rails (4.2.11) + actionmailer (= 4.2.11) + actionpack (= 4.2.11) + actionview (= 4.2.11) + activejob (= 4.2.11) + activemodel (= 4.2.11) + activerecord (= 4.2.11) + activesupport (= 4.2.11) bundler (>= 1.3.0, < 2.0) - railties (= 4.2.10) + railties (= 4.2.11) sprockets-rails - rails-assets-leaflet (1.3.1) - rails-assets-leaflet.markercluster (1.3.0) - rails-assets-leaflet (>= 1.0.3) + rails-assets-leaflet (1.3.4) + rails-assets-leaflet.markercluster (1.4.1) + rails-assets-leaflet (>= 1.3.1) rails-deprecated_sanitizer (1.0.3) activesupport (>= 4.2.0.alpha) rails-dom-testing (1.0.9) @@ -402,9 +402,9 @@ GEM rails_stdout_logging rails_serve_static_assets (0.0.5) rails_stdout_logging (0.0.5) - railties (4.2.10) - actionpack (= 4.2.10) - activesupport (= 4.2.10) + railties (4.2.11) + actionpack (= 4.2.11) + activesupport (= 4.2.11) rake (>= 0.8.7) thor (>= 0.18.1, < 2.0) rainbow (2.1.0) @@ -421,19 +421,19 @@ GEM rspec-core (~> 3.8.0) rspec-expectations (~> 3.8.0) rspec-mocks (~> 3.8.0) - rspec-activemodel-mocks (1.0.3) + rspec-activemodel-mocks (1.1.0) activemodel (>= 3.0) activesupport (>= 3.0) rspec-mocks (>= 2.99, < 4.0) rspec-core (3.8.0) rspec-support (~> 3.8.0) - rspec-expectations (3.8.1) + rspec-expectations (3.8.2) diff-lcs (>= 1.2.0, < 2.0) rspec-support (~> 3.8.0) rspec-mocks (3.8.0) diff-lcs (>= 1.2.0, < 2.0) rspec-support (~> 3.8.0) - rspec-rails (3.8.0) + rspec-rails (3.8.1) actionpack (>= 3.0) activesupport (>= 3.0) railties (>= 3.0) @@ -450,12 +450,12 @@ GEM ruby-progressbar (~> 1.7) unicode-display_width (~> 1.0, >= 1.0.1) ruby-progressbar (1.9.0) - ruby-units (2.3.0) + ruby-units (2.3.1) ruby_dep (1.5.0) ruby_parser (3.11.0) sexp_processor (~> 4.9) rubyzip (1.2.2) - sass (3.5.6) + sass (3.6.0) sass-listen (~> 4.0.0) sass-listen (4.0.0) rb-fsevent (~> 0.9, >= 0.9.4) @@ -466,15 +466,15 @@ GEM sprockets (>= 2.8, < 4.0) sprockets-rails (>= 2.0, < 4.0) tilt (>= 1.1, < 3) - sassc (1.12.0) + sassc (2.0.0) ffi (~> 1.9.6) - sass (>= 3.3.0) - selenium-webdriver (3.14.0) + rake + selenium-webdriver (3.141.0) childprocess (~> 0.5) - rubyzip (~> 1.2) + rubyzip (~> 1.2, >= 1.2.2) sexp_processor (4.11.0) shellany (0.0.1) - sidekiq (5.2.1) + sidekiq (5.2.2) connection_pool (~> 2.2, >= 2.2.2) rack-protection (>= 1.5.0) redis (>= 3.3.5, < 5) @@ -515,7 +515,7 @@ GEM unicorn (5.4.1) kgio (~> 2.6) raindrops (~> 0.7) - uniform_notifier (1.11.0) + uniform_notifier (1.12.1) warden (1.2.7) rack (>= 1.0) webrat (0.7.3) @@ -527,7 +527,7 @@ GEM websocket-extensions (0.1.3) will_paginate (3.1.6) xmlrpc (0.3.0) - xpath (3.1.0) + xpath (3.2.0) nokogiri (~> 1.8) PLATFORMS diff --git a/app/views/crops/_hierarchy.html.haml b/app/views/crops/_hierarchy.html.haml index 19be51f6d..a4b760354 100644 --- a/app/views/crops/_hierarchy.html.haml +++ b/app/views/crops/_hierarchy.html.haml @@ -3,7 +3,7 @@ - unless defined? max - max = 0 # list all without "show all" toggle button - display_crops.each do |c| - %li.crop-hierarchy{ class: max != 0 && @count >= max ? ['hide', 'toggle'] : [] } + %li.crop-hierarchy{ class: (max != 0 && @count >= max) || !c.approved? ? ['hide', 'toggle'] : [] } = link_to c, c - @count += 1 - if c.varieties.present? diff --git a/config/initializers/inflections.rb b/config/initializers/inflections.rb index 599d85bf4..f30e7af4f 100644 --- a/config/initializers/inflections.rb +++ b/config/initializers/inflections.rb @@ -16,15 +16,198 @@ ActiveSupport::Inflector.inflections do |inflect| inflect.plural 'square foot', 'square feet' - inflect.plural 'broccoli', 'broccoli' - inflect.plural 'kale', 'kale' - inflect.plural 'squash', 'squash' - inflect.plural 'bok choy', 'bok choy' + + # crops inflect.plural 'achiote', 'achiote' + inflect.plural 'agave', 'agave' inflect.plural 'alfalfa', 'alfalfa' inflect.plural 'allspice', 'allspice' - inflect.plural 'spinach', 'spinach' + inflect.plural 'aloe vera', 'aloe vera' + inflect.plural 'amaranth', 'amaranth' + inflect.plural 'Amelanchier', 'Amelanchier' + inflect.plural 'anise', 'anise' + inflect.plural 'anise hyssop', 'anise hyssop' + inflect.plural 'arrowroot', 'arrowroot' + inflect.plural 'arugula', 'arugula' + inflect.plural 'asparagus', 'asparagus' + inflect.plural 'balm', 'balm' + inflect.plural 'bamboo', 'bamboo' + inflect.plural 'barley', 'barley' + inflect.plural 'black mustard', 'black mustard' + inflect.plural 'bok choy', 'bok choy' + inflect.plural 'borage', 'borage' + inflect.plural 'Brassica', 'Brassica' + inflect.plural 'Brassica oleracea', 'Brassica oleracea' + inflect.plural 'Brassica oleracea Acephela group', 'Brassica oleracea Acephela group' + inflect.plural 'Brassica rapa', 'Brassica rapa' + inflect.plural 'Brazilian starfish', 'Brazilian starfish' + inflect.plural 'breadfruit', 'breadfruit' + inflect.plural 'broccoflower', 'broccoflower' + inflect.plural 'broccoli', 'broccoli' + inflect.plural 'broccolini', 'broccolini' + inflect.plural 'Brussels sprouts', 'Brussels sprouts' + inflect.plural 'buckwheat', 'buckwheat' + inflect.plural 'burdock', 'burdock' + inflect.plural 'calamint', 'calamint' + inflect.plural 'cantueso', 'cantueso' + inflect.plural 'capsicum', 'capsica' + inflect.plural 'capsicum annuum', 'capsicum annuum' + inflect.plural 'Capsicum baccatum', 'Capsicum baccatum' + inflect.plural 'Capsicum chinense', 'Capsicum chinense' + inflect.plural 'catnip', 'catnip' + inflect.plural 'cavalo nero', 'cavalo nero' + inflect.plural 'celeriac', 'celeriac' + inflect.plural 'celery', 'celery' + inflect.plural 'celtuce', 'celtuce' + inflect.plural 'chard', 'chard' + inflect.plural 'chaya', 'chaya' + inflect.plural 'chervil', 'chervil' + inflect.plural 'chia', 'chia' + inflect.plural 'chickweed', 'chickweed' + inflect.plural 'chicory', 'chicory' + inflect.plural 'chilli', 'chillies' + inflect.plural 'chilli pepper', 'chilli peppers' + inflect.plural 'choy sum', 'choy sum' + inflect.plural 'cicely', 'cicely' + inflect.plural 'citron', 'citrones' + inflect.plural 'coffee', 'coffee' + inflect.plural 'comfrey', 'comfrey' + inflect.plural 'coriander', 'coriander' + inflect.plural 'corn', 'corn' + inflect.plural 'corn salad', 'corn salad' + inflect.plural 'cress', 'cress' + inflect.plural 'Cucurbita maxima', 'Cucurbita maxima' + inflect.plural 'cumin', 'cumin' + inflect.plural 'curry leaf', 'curry leaves' + inflect.plural 'dill', 'dill' + inflect.plural 'epazote', 'epazote' + inflect.plural 'fennel', 'fennel' + inflect.plural 'fenugreek', 'fenugreek' + inflect.plural 'flax', 'flax' + inflect.plural 'galangal', 'galangal' inflect.plural 'garlic', 'garlic' + inflect.plural 'ginger', 'ginger' + inflect.plural 'goji', 'goji' + inflect.plural 'Good King Henry', 'Good King Henry' + inflect.plural 'grains of paradise', 'grains of paradise' + inflect.plural 'grapefruit', 'grapefruit' + inflect.plural 'greater galangal', 'greater galangal' + inflect.plural 'guava', 'guava' + inflect.plural 'hemp', 'hemp' + inflect.plural 'hibiscus', 'hibiscuses' + inflect.plural 'hīnau', 'hīnau' + inflect.plural 'hyssop', 'hyssop' + inflect.plural 'jabuticaba', 'jabuticaba' + inflect.plural 'jasmine', 'jasmine' + inflect.plural 'kabocha', 'kabocha' + inflect.plural 'kai lan', 'kai lan' + inflect.plural 'kale', 'kale' + inflect.plural 'kamo kamo', 'kamo kamo' + inflect.plural 'karaka', 'karaka' + inflect.plural 'kava', 'kava' + inflect.plural 'kawakawa', 'kawakawa' + inflect.plural 'kiwifruit', 'kiwifruit' + inflect.plural 'kohlrabi', 'kohlrabies' + inflect.plural 'komatsuna', 'komatsuna' + inflect.plural 'kūmara', 'kūmara' + inflect.plural "lady's bedstraw", "lady's bedstraw" + inflect.plural 'lavender', 'lavender' + inflect.plural 'lemon myrtle', 'lemon myrtle' + inflect.plural 'lemonade', 'lemonade' + inflect.plural 'lemongrass', 'lemongrass' + inflect.plural 'lesser calamint', 'lesser calamint' + inflect.plural 'lesser galangal', 'lesser galangal' inflect.plural 'licorice', 'licorice' inflect.plural 'lillipilli', 'lillipillies' + inflect.plural 'lovage', 'lovage' + inflect.plural 'luffa', 'luffa' + inflect.plural 'macadamia', 'macadamia' + inflect.plural 'mango', 'mangoes' + inflect.plural 'maracuja', 'maracuja' + inflect.plural 'marjoram', 'marjoram' + inflect.plural 'mashua', 'mashua' + inflect.plural 'milkweed', 'milkweed' + inflect.plural 'mint', 'mint' + inflect.plural 'miro', 'miro' + inflect.plural 'mitsuba', 'mitsuba' + inflect.plural 'mizuna', 'mizuna' + inflect.plural 'moringa', 'moringa' + inflect.plural 'mustard', 'mustard' + inflect.plural 'oak', 'oak' + inflect.plural 'okra', 'okra' + inflect.plural 'olive herb', 'olive herb' + inflect.plural 'olluco', 'olluco' + inflect.plural 'oregano', 'oregano' + inflect.plural 'pandan', 'pandan' + inflect.plural 'parsley', 'parsley' + inflect.plural 'passion fruit', 'passion fruit' + inflect.plural 'pearl millet', 'pearl millet' + inflect.plural 'pennyroyal', 'pennyroyal' + inflect.plural 'peppermint', 'peppermint' + inflect.plural 'perilla', 'perilla' + inflect.plural 'potato', 'potatoes' + inflect.plural 'potato Gladstone', 'potato Gladstone' + inflect.plural 'potato matariki', 'potato matariki' + inflect.plural 'potato Taranaki', 'potato Taranaki' + inflect.plural 'Prince of Wales', 'Prince of Wales' + inflect.plural 'pūhā', 'pūhā' + inflect.plural 'purslane', 'purslane' + inflect.plural 'quinoa', 'quinoa' + inflect.plural 'radicchio', 'radicchio' + inflect.plural 'rainbow chard', 'rainbow chard' + inflect.plural 'rapeseed', 'rapeseed' + inflect.plural 'rapini', 'rapini' + inflect.plural 'rhubarb', 'rhubarb' + inflect.plural 'rosemary', 'rosemary' + inflect.plural 'rutabaga', 'rutabaga' + inflect.plural 'rye', 'rye' + inflect.plural 'safflower', 'safflower' + inflect.plural 'saffron', 'saffron' + inflect.plural 'sage', 'sage' + inflect.plural 'salad burnet', 'salad burnet' + inflect.plural 'salsify', 'salsify' + inflect.plural 'salvia', 'salvia' + inflect.plural 'sassafras', 'sassafras' + inflect.plural 'sesame', 'sesame' + inflect.plural 'shiitake', 'shiitake' + inflect.plural 'shiso', 'shiso' + inflect.plural 'smallage', 'smallage' + inflect.plural 'sorghum', 'sorghum' + inflect.plural 'spearmint', 'spearmint' + inflect.plural 'spinach', 'spinach' + inflect.plural 'spinach Santana', 'spinach Santana' + inflect.plural 'spring greens', 'spring greens' + inflect.plural 'squash', 'squash' + inflect.plural 'star anise', 'star anise' + inflect.plural 'starfruit', 'starfruit' + inflect.plural 'stevia', 'stevia' + inflect.plural 'summer savory', 'summer savory' + inflect.plural 'Swiss chard', 'Swiss chard' + inflect.plural 'tamarind', 'tamarind' + inflect.plural 'tampala', 'tampala' + inflect.plural 'tansy', 'tansy' + inflect.plural 'taro', 'taro' + inflect.plural 'tarragon', 'tarragon' + inflect.plural 'tatsoi', 'tatsoi' + inflect.plural 'tawa', 'tawa' + inflect.plural 'tea', 'tea' + inflect.plural 'thyme', 'thyme' + inflect.plural 'tromboncino', 'tromboncini' + inflect.plural 'turmeric', 'turmeric' + inflect.plural 'valerian', 'valerian' + inflect.plural 'vanilla', 'vanilla' + inflect.plural 'violet cauliflower', 'violet cauliflower' + inflect.plural 'wasabi', 'wasabi' + inflect.plural 'water caltrop', 'water caltrop' + inflect.plural 'watercress', 'watercress' + inflect.plural 'wattle', 'wattle' + inflect.plural 'wheat', 'wheat' + inflect.plural 'wild baccatum', 'wild baccatum' + inflect.plural 'wild bergamot', 'wild bergamot' + inflect.plural 'winter savory', 'winter savory' + inflect.plural 'wormwood', 'wormwood' + inflect.plural 'yarrow', 'yarrow' + inflect.plural 'yerba buena', 'yerba buena' + inflect.plural "za'atar", "za'atar" + inflect.plural 'zucchini', 'zucchini' end diff --git a/spec/controllers/photos_controller_spec.rb b/spec/controllers/photos_controller_spec.rb index 4be3aec7f..e54933c3e 100644 --- a/spec/controllers/photos_controller_spec.rb +++ b/spec/controllers/photos_controller_spec.rb @@ -113,7 +113,7 @@ describe PhotosController do comment = FactoryBot.create(:comment) expect do post :create, photo: { flickr_photo_id: photo.flickr_photo_id }, type: "comment", id: comment.id - end.to raise_error + end.to raise_error('Photos not supported') end end diff --git a/spec/features/crops/inflections_spec.rb b/spec/features/crops/inflections_spec.rb index d08f2490b..615c4c9e9 100644 --- a/spec/features/crops/inflections_spec.rb +++ b/spec/features/crops/inflections_spec.rb @@ -17,5 +17,39 @@ feature "irregular crop inflections" do expect("garlic".pluralize).to eq "garlic" expect("licorice".pluralize).to eq "licorice" expect("lillipilli".pluralize).to eq "lillipillies" + expect("barley".pluralize).to eq "barley" + expect("Brassica oleracea Acephela group".pluralize).to eq "Brassica oleracea Acephela group" + expect("common flax".pluralize).to eq "common flax" + expect("cumin".pluralize).to eq "cumin" + expect("Good King Henry".pluralize).to eq "Good King Henry" + expect("oregano".pluralize).to eq "oregano" + expect("star anise".pluralize).to eq "star anise" + end + + scenario "crops which are particularly irregular" do + expect("curry leaf".pluralize).to eq "curry leaves" + end + + scenario "crops which require -es" do + expect("mango".pluralize).to eq "mangoes" + expect("potato".pluralize).to eq "potatoes" + end + + scenario "crops where the first crop would normally be pluralized" do + expect("Potato Onion".pluralize).to eq "Potato Onions" + expect("pear tomato".pluralize).to eq "pear tomatoes" + expect("chilli pepper".pluralize).to eq "chilli peppers" + end + + scenario "crops where the proper name succeeds the crop that would normally be pluralized" do + expect("potato Taranaki".pluralize).to eq "potato Taranaki" + expect("potato Gladstone".pluralize).to eq "potato Gladstone" + expect("potato matariki".pluralize).to eq "potato matariki" + expect("spinach Santana".pluralize).to eq "spinach Santana" + end + + scenario "crops of Māori origin" do + expect("kūmara".pluralize).to eq "kūmara" + expect("pūhā".pluralize).to eq "pūhā" end end diff --git a/spec/features/rss/plantings_spec.rb b/spec/features/rss/plantings_spec.rb index 59833eff1..c3f68fea6 100644 --- a/spec/features/rss/plantings_spec.rb +++ b/spec/features/rss/plantings_spec.rb @@ -9,6 +9,6 @@ feature 'Plantings RSS feed' do scenario 'The index title is what we expect' do visit plantings_path(format: 'rss') expect(page).to have_content "Recent plantings from "\ - "#{@owner ? @owner : 'all members'} (#{ENV['GROWSTUFF_SITE_NAME']})" + "#{@owner || 'all members'} (#{ENV['GROWSTUFF_SITE_NAME']})" end end diff --git a/spec/features/rss/posts_spec.rb b/spec/features/rss/posts_spec.rb index 445a50cca..668276fbb 100644 --- a/spec/features/rss/posts_spec.rb +++ b/spec/features/rss/posts_spec.rb @@ -9,6 +9,6 @@ feature 'Posts RSS feed' do scenario 'The index title is what we expect' do visit posts_path(format: 'rss') expect(page).to have_content "Recent posts from "\ - "#{@author ? @author : 'all members'} (#{ENV['GROWSTUFF_SITE_NAME']})" + "#{@author || 'all members'} (#{ENV['GROWSTUFF_SITE_NAME']})" end end diff --git a/spec/features/rss/seeds_spec.rb b/spec/features/rss/seeds_spec.rb index 888cc42ec..abb66e7e3 100644 --- a/spec/features/rss/seeds_spec.rb +++ b/spec/features/rss/seeds_spec.rb @@ -9,6 +9,6 @@ feature 'Seeds RSS feed' do scenario 'The index title is what we expect' do visit seeds_path(format: 'rss') expect(page).to have_content "Recent seeds from "\ - "#{@owner ? @owner : 'all members'} (#{ENV['GROWSTUFF_SITE_NAME']})" + "#{@owner || 'all members'} (#{ENV['GROWSTUFF_SITE_NAME']})" end end