mirror of
https://github.com/Growstuff/growstuff.git
synced 2026-05-29 11:15:29 -04:00
Compare commits
71 Commits
release72
...
issue/2745
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
7667711d8a | ||
|
|
a48a082d98 | ||
|
|
6dca8a8103 | ||
|
|
12887fb17a | ||
|
|
1a005062c1 | ||
|
|
6f01c0cf53 | ||
|
|
44e9928805 | ||
|
|
63d65c4e6b | ||
|
|
852ac600f4 | ||
|
|
e182beb12a | ||
|
|
ae33785fc2 | ||
|
|
169d452c1f | ||
|
|
7d5fb63f88 | ||
|
|
f1508cb960 | ||
|
|
a5a201a2e6 | ||
|
|
d3fdd65dd3 | ||
|
|
e9a187b3df | ||
|
|
7b7bf9f4e9 | ||
|
|
d9851231f2 | ||
|
|
f82eabec42 | ||
|
|
83bf752a02 | ||
|
|
6ffdd283e4 | ||
|
|
d8e138ae2d | ||
|
|
81b80d9bb7 | ||
|
|
f080a8a566 | ||
|
|
5a436f9d7f | ||
|
|
a4fd1c4a8e | ||
|
|
7277cb3523 | ||
|
|
522d10e053 | ||
|
|
f3a9b26c8e | ||
|
|
d8f5580ef9 | ||
|
|
d9e58f6bf0 | ||
|
|
60ec4e8d18 | ||
|
|
ede7e6e7f7 | ||
|
|
9c62f955e2 | ||
|
|
6b313c190f | ||
|
|
c575f9d03c | ||
|
|
95a4b0c66c | ||
|
|
e6563d0aab | ||
|
|
177ca58301 | ||
|
|
ca9241685f | ||
|
|
8934e30603 | ||
|
|
32268e3c1e | ||
|
|
fbd840686d | ||
|
|
497f14c1c0 | ||
|
|
051bfd5565 | ||
|
|
2853f7232e | ||
|
|
60a9d54655 | ||
|
|
7598f84cea | ||
|
|
a839d68e85 | ||
|
|
ef427a7971 | ||
|
|
9265cad769 | ||
|
|
d0185c47fd | ||
|
|
fa15889d08 | ||
|
|
1e30aa7db5 | ||
|
|
8512a19bb9 | ||
|
|
54169fe9ac | ||
|
|
03c65ad187 | ||
|
|
70726e7e52 | ||
|
|
a14cc807ae | ||
|
|
6719024c70 | ||
|
|
6e36525a62 | ||
|
|
d1b25ef809 | ||
|
|
974a1019f7 | ||
|
|
5370dc9901 | ||
|
|
9f470817d7 | ||
|
|
9250a179f7 | ||
|
|
eec7bac77a | ||
|
|
e325d7a20e | ||
|
|
c51dd5097c | ||
|
|
38023746a3 |
1
Gemfile
1
Gemfile
@@ -125,6 +125,7 @@ gem 'mailboxer', '>= 0.15.1'
|
||||
gem 'faraday'
|
||||
|
||||
gem 'rack-cors'
|
||||
gem 'rails-i18n'
|
||||
|
||||
gem 'icalendar'
|
||||
|
||||
|
||||
51
Gemfile.lock
51
Gemfile.lock
@@ -82,8 +82,8 @@ GEM
|
||||
addressable
|
||||
active_median (0.6.0)
|
||||
activesupport (>= 7.1)
|
||||
active_record_union (1.3.0)
|
||||
activerecord (>= 4.0)
|
||||
active_record_union (1.4.0)
|
||||
activerecord (>= 6.0)
|
||||
active_utils (3.6.0)
|
||||
activesupport (>= 4.2)
|
||||
i18n
|
||||
@@ -142,7 +142,7 @@ GEM
|
||||
erubi (>= 1.0.0)
|
||||
rack (>= 0.9.0)
|
||||
rouge (>= 1.0.0)
|
||||
bigdecimal (3.2.3)
|
||||
bigdecimal (3.3.0)
|
||||
bluecloth (2.2.0)
|
||||
bonsai-elasticsearch-rails (7.0.1)
|
||||
elasticsearch-model (< 8)
|
||||
@@ -208,7 +208,7 @@ GEM
|
||||
gli (>= 2.7.0)
|
||||
i18n (>= 0.6.4)
|
||||
rubyzip (>= 1.0.0)
|
||||
csv (3.3.1)
|
||||
csv (3.3.5)
|
||||
csv_shaper (1.4.0)
|
||||
activesupport (>= 3.0.0)
|
||||
csv
|
||||
@@ -264,7 +264,7 @@ GEM
|
||||
railties (>= 6.1.0)
|
||||
faker (3.5.2)
|
||||
i18n (>= 1.8.11, < 2)
|
||||
faraday (2.13.4)
|
||||
faraday (2.14.0)
|
||||
faraday-net_http (>= 2.0, < 3.5)
|
||||
json
|
||||
logger
|
||||
@@ -277,7 +277,7 @@ GEM
|
||||
friendly_id (5.5.1)
|
||||
activerecord (>= 4.0.0)
|
||||
gbifrb (0.2.0)
|
||||
geocoder (1.8.5)
|
||||
geocoder (1.8.6)
|
||||
base64 (>= 0.1.0)
|
||||
csv (>= 3.0.0)
|
||||
gibbon (1.2.1)
|
||||
@@ -294,7 +294,7 @@ GEM
|
||||
temple (>= 0.8.2)
|
||||
thor
|
||||
tilt
|
||||
haml-rails (2.1.0)
|
||||
haml-rails (3.0.0)
|
||||
actionpack (>= 5.1)
|
||||
activesupport (>= 5.1)
|
||||
haml (>= 4.0.6)
|
||||
@@ -337,7 +337,7 @@ GEM
|
||||
terminal-table (>= 1.5.1)
|
||||
i18n_data (1.1.0)
|
||||
simple_po_parser (~> 1.1)
|
||||
icalendar (2.11.2)
|
||||
icalendar (2.12.0)
|
||||
base64
|
||||
ice_cube (~> 0.16)
|
||||
logger
|
||||
@@ -411,7 +411,7 @@ GEM
|
||||
mini_magick (4.12.0)
|
||||
mini_mime (1.1.5)
|
||||
mini_portile2 (2.8.9)
|
||||
minitest (5.25.5)
|
||||
minitest (5.26.0)
|
||||
moneta (1.0.0)
|
||||
msgpack (1.8.0)
|
||||
multi_json (1.15.0)
|
||||
@@ -430,10 +430,10 @@ GEM
|
||||
net-protocol
|
||||
netrc (0.11.0)
|
||||
nio4r (2.7.4)
|
||||
nokogiri (1.18.9)
|
||||
nokogiri (1.18.10)
|
||||
mini_portile2 (~> 2.8.2)
|
||||
racc (~> 1.4)
|
||||
nokogiri (1.18.9-x86_64-linux-gnu)
|
||||
nokogiri (1.18.10-x86_64-linux-gnu)
|
||||
racc (~> 1.4)
|
||||
oauth (0.5.6)
|
||||
oj (3.16.11)
|
||||
@@ -475,11 +475,11 @@ GEM
|
||||
date
|
||||
stringio
|
||||
public_suffix (6.0.1)
|
||||
puma (7.0.3)
|
||||
puma (7.0.4)
|
||||
nio4r (~> 2.0)
|
||||
query_diet (0.7.2)
|
||||
racc (1.8.1)
|
||||
rack (2.2.17)
|
||||
rack (2.2.19)
|
||||
rack-cors (2.0.2)
|
||||
rack (>= 2.0.0)
|
||||
rack-protection (3.2.0)
|
||||
@@ -546,7 +546,7 @@ GEM
|
||||
recaptcha (5.21.1)
|
||||
redis-client (0.23.2)
|
||||
connection_pool
|
||||
regexp_parser (2.11.2)
|
||||
regexp_parser (2.11.3)
|
||||
reline (0.6.2)
|
||||
io-console (~> 0.5)
|
||||
responders (3.1.1)
|
||||
@@ -557,7 +557,7 @@ GEM
|
||||
http-cookie (>= 1.0.2, < 2.0)
|
||||
mime-types (>= 1.16, < 4.0)
|
||||
netrc (~> 0.8)
|
||||
rexml (3.4.2)
|
||||
rexml (3.4.4)
|
||||
rouge (4.1.2)
|
||||
rspec (3.13.0)
|
||||
rspec-core (~> 3.13.0)
|
||||
@@ -601,7 +601,7 @@ GEM
|
||||
rswag-ui (2.16.0)
|
||||
actionpack (>= 5.2, < 8.1)
|
||||
railties (>= 5.2, < 8.1)
|
||||
rubocop (1.80.2)
|
||||
rubocop (1.81.1)
|
||||
json (~> 2.3)
|
||||
language_server-protocol (~> 3.17.0.2)
|
||||
lint_roller (~> 1.1.0)
|
||||
@@ -609,10 +609,10 @@ GEM
|
||||
parser (>= 3.3.0.2)
|
||||
rainbow (>= 2.2.2, < 4.0)
|
||||
regexp_parser (>= 2.9.3, < 3.0)
|
||||
rubocop-ast (>= 1.46.0, < 2.0)
|
||||
rubocop-ast (>= 1.47.1, < 2.0)
|
||||
ruby-progressbar (~> 1.7)
|
||||
unicode-display_width (>= 2.4.0, < 4.0)
|
||||
rubocop-ast (1.46.0)
|
||||
rubocop-ast (1.47.1)
|
||||
parser (>= 3.3.7.2)
|
||||
prism (~> 1.4)
|
||||
rubocop-capybara (2.22.1)
|
||||
@@ -621,7 +621,7 @@ GEM
|
||||
rubocop-factory_bot (2.27.1)
|
||||
lint_roller (~> 1.1)
|
||||
rubocop (~> 1.72, >= 1.72.1)
|
||||
rubocop-rails (2.33.3)
|
||||
rubocop-rails (2.33.4)
|
||||
activesupport (>= 4.2.0)
|
||||
lint_roller (~> 1.1)
|
||||
rack (>= 1.1)
|
||||
@@ -641,7 +641,7 @@ GEM
|
||||
ruby-units (4.1.0)
|
||||
ruby-vips (2.2.1)
|
||||
ffi (~> 1.12)
|
||||
rubyzip (3.0.1)
|
||||
rubyzip (3.1.1)
|
||||
sass (3.7.4)
|
||||
sass-listen (~> 4.0.0)
|
||||
sass-listen (4.0.0)
|
||||
@@ -661,9 +661,11 @@ GEM
|
||||
activemodel (>= 6.1)
|
||||
hashie
|
||||
securerandom (0.4.1)
|
||||
selenium-webdriver (4.35.0)
|
||||
selenium-webdriver (4.36.0)
|
||||
base64 (~> 0.2)
|
||||
json (<= 2.13.2)
|
||||
logger (~> 1.4)
|
||||
prism (~> 1.0, < 1.5)
|
||||
rexml (~> 3.2, >= 3.2.5)
|
||||
rubyzip (>= 1.2.2, < 4.0)
|
||||
websocket (~> 1.0)
|
||||
@@ -697,9 +699,9 @@ GEM
|
||||
timeout (0.4.3)
|
||||
tzinfo (2.0.6)
|
||||
concurrent-ruby (~> 1.0)
|
||||
unicode-display_width (3.1.5)
|
||||
unicode-emoji (~> 4.0, >= 4.0.4)
|
||||
unicode-emoji (4.0.4)
|
||||
unicode-display_width (3.2.0)
|
||||
unicode-emoji (~> 4.1)
|
||||
unicode-emoji (4.1.0)
|
||||
unicorn (6.1.0)
|
||||
kgio (~> 2.6)
|
||||
raindrops (~> 0.7)
|
||||
@@ -814,6 +816,7 @@ DEPENDENCIES
|
||||
rails (~> 7.2.0)
|
||||
rails-assets-leaflet.markercluster!
|
||||
rails-controller-testing
|
||||
rails-i18n
|
||||
rails_12factor
|
||||
rake (>= 10.0.0)
|
||||
recaptcha
|
||||
|
||||
@@ -7,9 +7,9 @@ module Api
|
||||
@model.owner = context[:current_user]
|
||||
end
|
||||
|
||||
has_one :owner, class_name: 'Member'
|
||||
has_one :garden
|
||||
has_one :planting
|
||||
has_one :owner, class_name: 'Member', always_include_linkage_data: true
|
||||
has_one :garden, always_include_linkage_data: true
|
||||
has_one :planting, always_include_linkage_data: true
|
||||
|
||||
attribute :name
|
||||
attribute :description
|
||||
|
||||
@@ -12,7 +12,7 @@ module Api
|
||||
|
||||
has_many :photos
|
||||
|
||||
has_one :parent, class_name: 'Crop'
|
||||
has_one :parent, class_name: 'Crop', always_include_linkage_data: true
|
||||
|
||||
attribute :name
|
||||
attribute :en_wikipedia_url
|
||||
|
||||
@@ -7,7 +7,7 @@ module Api
|
||||
@model.owner = context[:current_user]
|
||||
end
|
||||
|
||||
has_one :owner, class_name: 'Member'
|
||||
has_one :owner, class_name: 'Member', always_include_linkage_data: true
|
||||
has_many :plantings
|
||||
has_many :photos
|
||||
|
||||
|
||||
@@ -10,9 +10,9 @@ module Api
|
||||
@model.plant_part = PlantPart.first
|
||||
end
|
||||
|
||||
has_one :crop
|
||||
has_one :planting
|
||||
has_one :owner, class_name: 'Member'
|
||||
has_one :crop, always_include_linkage_data: true
|
||||
has_one :planting, always_include_linkage_data: true
|
||||
has_one :owner, class_name: 'Member', always_include_linkage_data: true
|
||||
# has_one :plant_part
|
||||
has_many :photos
|
||||
|
||||
|
||||
@@ -9,6 +9,7 @@ module Api
|
||||
has_many :plantings, foreign_key: 'owner_id'
|
||||
has_many :harvests, foreign_key: 'owner_id'
|
||||
has_many :seeds, foreign_key: 'owner_id'
|
||||
has_many :activities, foreign_key: 'owner_id'
|
||||
|
||||
has_many :photos
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@ module Api
|
||||
@model.owner = context[:current_user]
|
||||
end
|
||||
|
||||
has_one :owner, class_name: 'Member'
|
||||
has_one :owner, class_name: 'Member', always_include_linkage_data: true
|
||||
has_many :plantings
|
||||
has_many :gardens
|
||||
has_many :harvests
|
||||
|
||||
@@ -7,9 +7,9 @@ module Api
|
||||
@model.owner = context[:current_user]
|
||||
end
|
||||
|
||||
has_one :garden
|
||||
has_one :crop
|
||||
has_one :owner, class_name: 'Member'
|
||||
has_one :garden, always_include_linkage_data: true
|
||||
has_one :crop, always_include_linkage_data: true
|
||||
has_one :owner, class_name: 'Member', always_include_linkage_data: true
|
||||
has_many :photos
|
||||
has_many :harvests
|
||||
|
||||
|
||||
@@ -7,8 +7,8 @@ module Api
|
||||
@model.owner = context[:current_user]
|
||||
end
|
||||
|
||||
has_one :owner, class_name: 'Member'
|
||||
has_one :crop
|
||||
has_one :owner, class_name: 'Member', always_include_linkage_data: true
|
||||
has_one :crop, always_include_linkage_data: true
|
||||
|
||||
attribute :description
|
||||
attribute :quantity
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
%li= link_to "Roles", admin_roles_path, class: 'nav-link'
|
||||
%li= link_to "Forums", forums_path, class: 'nav-link'
|
||||
%li= link_to "CMS", comfy_admin_cms_path, class: 'nav-link'
|
||||
%li= link_to t('.garden_types'), garden_types_path, class: 'nav-link'
|
||||
%li= link_to t('layouts.header.garden_types'), garden_types_path, class: 'nav-link'
|
||||
|
||||
.col-md-4
|
||||
.card
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
- if can? :edit, role
|
||||
= link_to edit_admin_role_path(role), class: 'btn btn-default btn-xs' do
|
||||
= edit_icon
|
||||
= t('.edit')
|
||||
= t('buttons.edit')
|
||||
- if can?(:destroy, role) && ! role.members.any?
|
||||
= link_to admin_role_path(role), method: :delete, data: { confirm: t(:are_you_sure?) }, class: 'btn btn-default btn-xs text-danger' do
|
||||
= delete_icon
|
||||
|
||||
@@ -10,11 +10,11 @@
|
||||
- if can? :edit, an
|
||||
= link_to edit_alternate_name_path(an), class: 'dropdown-item' do
|
||||
= edit_icon
|
||||
= t('.edit')
|
||||
= t('buttons.edit')
|
||||
- if can? :destroy, an
|
||||
= link_to an, method: :delete, data: { confirm: 'Are you sure?' }, class: 'dropdown-item' do
|
||||
= delete_icon
|
||||
= t('.delete')
|
||||
= t('buttons.delete')
|
||||
- else
|
||||
.badge= "#{an.name} (#{an.language})"
|
||||
|
||||
|
||||
@@ -10,11 +10,11 @@
|
||||
.dropdown-menu.dropdown-menu-xs{"aria-labelledby" => "planting-actions-button"}
|
||||
= link_to edit_scientific_name_path(sn), class: 'dropdown-item' do
|
||||
= edit_icon
|
||||
= t('.edit')
|
||||
= t('buttons.edit')
|
||||
.dropdown-divider
|
||||
= link_to sn, method: :delete, data: { confirm: 'Are you sure?' }, class: 'dropdown-item text-danger' do
|
||||
= delete_icon
|
||||
= t('.delete')
|
||||
= t('buttons.delete')
|
||||
- else
|
||||
- if sn.gbif_key
|
||||
= link_to sn.name, "https://www.gbif.org/species/#{sn.gbif_key}",
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
.dropdown-menu.dropdown-menu-xs{"aria-labelledby" => "crop-actions-button"}
|
||||
= link_to edit_crop_path(crop), class: 'dropdown-item' do
|
||||
= edit_icon
|
||||
= t('.edit')
|
||||
= t('buttons.edit')
|
||||
|
||||
= link_to crop_gbif_path(crop), method: :post, class: 'dropdown-item' do
|
||||
= icon 'far', 'update'
|
||||
|
||||
@@ -35,25 +35,25 @@
|
||||
= t('.crops')
|
||||
.dropdown-menu
|
||||
= link_to crops_path, class: 'dropdown-item' do
|
||||
= t('.browse_crops')
|
||||
= t('layouts.header.browse_crops')
|
||||
= link_to seeds_path, class: 'dropdown-item' do
|
||||
= seed_icon
|
||||
= t('.seeds')
|
||||
= t('layouts.header.seeds')
|
||||
= link_to plantings_path, class: 'dropdown-item' do
|
||||
= planting_icon
|
||||
= t('.plantings')
|
||||
= t('layouts.header.plantings')
|
||||
= link_to harvests_path, class: 'dropdown-item' do
|
||||
= harvest_icon
|
||||
= t('.harvests')
|
||||
= t('layouts.header.harvests')
|
||||
%li.nav-item.dropdown
|
||||
%a.nav-link.dropdown-toggle{"aria-expanded" => "false", "aria-haspopup" => "true", "data-bs-toggle" => "dropdown", href: "#", role: "button"}
|
||||
%span
|
||||
= t('.community')
|
||||
.dropdown-menu{"aria-labelledby" => "navbarDropdown"}
|
||||
= link_to t('.community_map'), places_path, class: 'dropdown-item'
|
||||
= link_to t('.browse_members'), members_path, class: 'dropdown-item'
|
||||
= link_to t('.posts'), posts_path, class: 'dropdown-item'
|
||||
= link_to t('.forums'), forums_path, class: 'dropdown-item'
|
||||
= link_to t('layouts.header.community_map'), places_path, class: 'dropdown-item'
|
||||
= link_to t('layouts.header.browse_members'), members_path, class: 'dropdown-item'
|
||||
= link_to Post.model_name.human(count: 2).titleize, posts_path, class: 'dropdown-item'
|
||||
= link_to t('layouts.header.forums'), forums_path, class: 'dropdown-item'
|
||||
|
||||
- if member_signed_in?
|
||||
- if current_member.role?(:crop_wrangler) || current_member.role?(:admin)
|
||||
@@ -63,9 +63,9 @@
|
||||
= t('.admin')
|
||||
.dropdown-menu{"aria-labelledby" => "navbarDropdown"}
|
||||
- if current_member.role?(:crop_wrangler)
|
||||
= link_to t('.crop_wrangling'), wrangle_crops_path, class: 'dropdown-item'
|
||||
= link_to t('layouts.header.crop_wrangling'), wrangle_crops_path, class: 'dropdown-item'
|
||||
- if current_member.role?(:admin)
|
||||
= link_to t('.admin'), admin_path, class: 'dropdown-item'
|
||||
= link_to t('layouts.header.admin'), admin_path, class: 'dropdown-item'
|
||||
|
||||
%li.nav-item.dropdown
|
||||
%a.nav-link.dropdown-toggle{"aria-expanded" => "false", "aria-haspopup" => "true", "data-bs-toggle" => "dropdown", href: "#", role: "button"}
|
||||
@@ -79,23 +79,23 @@
|
||||
= link_to member_activities_path(current_member), class: 'dropdown-item' do
|
||||
= t('.activities')
|
||||
= link_to member_gardens_path(current_member), class: 'dropdown-item' do
|
||||
= t('.gardens')
|
||||
= Garden.model_name.human(count: 2).titleize
|
||||
= link_to member_plantings_path(current_member), class: 'dropdown-item' do
|
||||
= t('.plantings')
|
||||
= Planting.model_name.human(count: 2).titleize
|
||||
= link_to member_harvests_path(current_member), class: 'dropdown-item' do
|
||||
= t('.harvest')
|
||||
= Harvest.model_name.human(count: 2).titleize
|
||||
= link_to member_seeds_path(current_member), class: 'dropdown-item' do
|
||||
= t('.seeds')
|
||||
= link_to t('.posts'), member_posts_path(current_member), class: 'dropdown-item'
|
||||
= Seed.model_name.human(count: 2).titleize
|
||||
= link_to Post.model_name.human(count: 2).titleize, member_posts_path(current_member), class: 'dropdown-item'
|
||||
|
||||
- if current_member.unread_count.positive?
|
||||
.dropdown-divider
|
||||
%strong
|
||||
= link_to(conversations_path, class: 'dropdown-item') do
|
||||
= t('.inbox')
|
||||
= t('layouts.header.inbox')
|
||||
%span.badge.badge-info= current_member.unread_count
|
||||
- else
|
||||
= link_to t('.inbox'), conversations_path, class: 'dropdown-item'
|
||||
= link_to t('layouts.header.inbox'), conversations_path, class: 'dropdown-item'
|
||||
.dropdown-divider
|
||||
= link_to t('.sign_out'), destroy_member_session_path, method: :delete, class: 'dropdown-item'
|
||||
|
||||
|
||||
@@ -47,7 +47,8 @@ search:
|
||||
|
||||
## Paths to search in, passed to File.find
|
||||
paths:
|
||||
- app/
|
||||
- app/views/
|
||||
- app/controllers/
|
||||
|
||||
## Root for resolving relative keys (default)
|
||||
# relative_roots:
|
||||
|
||||
@@ -1,75 +1,7 @@
|
||||
---
|
||||
# Files in the config/locales directory are used for internationalization
|
||||
# and are automatically loaded by Rails. If you want to use locales other
|
||||
# than English, add the necessary files in this directory.
|
||||
#
|
||||
# To use the locales, use `I18n.t`:
|
||||
#
|
||||
# I18n.t 'hello'
|
||||
#
|
||||
# In views, this is aliased to just `t`:
|
||||
#
|
||||
# <%= t('hello') %>
|
||||
#
|
||||
# To use a different locale, set it with `I18n.locale`:
|
||||
#
|
||||
# I18n.locale = :es
|
||||
#
|
||||
# This would use the information in config/locales/es.yml.
|
||||
#
|
||||
# The following keys must be escaped otherwise they will not be retrieved by
|
||||
# the default I18n backend:
|
||||
#
|
||||
# true, false, on, off, yes, no
|
||||
#
|
||||
# Instead, surround them with single quotes.
|
||||
#
|
||||
# en:
|
||||
# 'true': 'foo'
|
||||
#
|
||||
# To learn more, please read the Rails Internationalization guide
|
||||
# available at http://guides.rubyonrails.org/i18n.html.
|
||||
|
||||
en:
|
||||
activerecord:
|
||||
models:
|
||||
comment:
|
||||
one: comment
|
||||
other: comments
|
||||
crop:
|
||||
one: crop
|
||||
other: crops
|
||||
follow:
|
||||
one: follow
|
||||
other: follows
|
||||
garden:
|
||||
one: garden
|
||||
other: gardens
|
||||
harvest:
|
||||
one: harvest
|
||||
other: harvests
|
||||
member:
|
||||
one: member
|
||||
other: members
|
||||
photo:
|
||||
one: photo
|
||||
other: photos
|
||||
planting:
|
||||
one: planting
|
||||
other: plantings
|
||||
post:
|
||||
one: post
|
||||
other: posts
|
||||
seed:
|
||||
one: seed
|
||||
other: seeds
|
||||
application_helper:
|
||||
title:
|
||||
title:
|
||||
default: Default
|
||||
are_you_sure: Are you sure?
|
||||
buttons:
|
||||
add: Add
|
||||
add_photo: Add photo
|
||||
add_seed_to_stash: Add %{crop_name} seeds to stash
|
||||
copy: Copy
|
||||
@@ -98,17 +30,28 @@ en:
|
||||
unlike: Remove like
|
||||
total_likes: Total likes
|
||||
crops:
|
||||
search: Search crops
|
||||
index:
|
||||
subtitle: "%{crops_size} total"
|
||||
title: Browse Crops
|
||||
requested:
|
||||
link: You have %{number_crops} crops awaiting approval
|
||||
subtitle: Pending approval
|
||||
title: Requested crops
|
||||
edit_crop: Edit crop
|
||||
forms:
|
||||
optional: "(Optional)"
|
||||
date:
|
||||
abbr_month_names:
|
||||
- Jan
|
||||
- Feb
|
||||
- Mar
|
||||
- Apr
|
||||
- May
|
||||
- Jun
|
||||
- Jul
|
||||
- Aug
|
||||
- Sep
|
||||
- Oct
|
||||
- Nov
|
||||
- Dec
|
||||
errors:
|
||||
messages:
|
||||
not_saved: Not saved
|
||||
forums:
|
||||
index:
|
||||
title: Forums
|
||||
@@ -117,26 +60,12 @@ en:
|
||||
deleted: Garden was successfully deleted.
|
||||
form:
|
||||
location_helper: If you have a location set in your profile, it will be used when you create a new garden.
|
||||
location: "%{owner}'s %{garden}"
|
||||
overview:
|
||||
gardensactions: gardens/actions
|
||||
gardensphoto: gardens/photo
|
||||
no_plantings: no plantings
|
||||
plantingsthumbnail: plantings/thumbnail
|
||||
updated: Garden was successfully updated.
|
||||
confirm_delete: All plantings associated with this garden will also be deleted. Are you sure?
|
||||
confirm_deactivate: All plantings associated with this garden will be marked as finished. Are you sure?
|
||||
created_prompt_html: "Garden was successfully created. Would you like to <a href=\"%{link}\">plan to weed this garden bed in two weeks</a>?"
|
||||
harvests:
|
||||
created: Harvest was successfully created.
|
||||
harvest_something: Harvest something
|
||||
index:
|
||||
title:
|
||||
crop_harvests: Everyone's %{crop} harvests
|
||||
default: Everyone's harvests
|
||||
owner_harvests: "%{owner}'s harvests"
|
||||
planting_harvests: Harvests from %{planting}
|
||||
updated: Harvest was successfully updated.
|
||||
home:
|
||||
blurb:
|
||||
already_html: Or %{sign_in} if you already have an account
|
||||
@@ -150,23 +79,15 @@ en:
|
||||
view_all: View all activities
|
||||
crops:
|
||||
our_crops: Some of our crops
|
||||
recently_added: Recently added crops
|
||||
recently_planted: Recently Planted
|
||||
view_all: View all crops
|
||||
discuss:
|
||||
discussion: Discussion
|
||||
forums: Forums
|
||||
view_all: View all posts
|
||||
harvests:
|
||||
recently_harvested: Recently Harvested
|
||||
view_all: View all harvests
|
||||
index:
|
||||
add_seeds: Add seeds
|
||||
edit_profile: Edit profile
|
||||
harvest: Harvest
|
||||
plant: Plant
|
||||
post: Post
|
||||
recently_added: Recently Added
|
||||
welcome: Welcome to %{site_name}, %{member_name}
|
||||
harvests:
|
||||
view_all: View all harvests
|
||||
members:
|
||||
title: Some of our members
|
||||
view_all: View all members
|
||||
@@ -199,14 +120,7 @@ en:
|
||||
recently_planted: Recently Planted
|
||||
view_all: View all plantings
|
||||
seeds:
|
||||
crop: Crop
|
||||
description: Description
|
||||
details: Details
|
||||
from: From location
|
||||
owner: Owner
|
||||
title: Seeds available to trade
|
||||
trade_to: Will trade to
|
||||
unspecified: unspecified
|
||||
view_all: View all seeds
|
||||
stats:
|
||||
member_linktext: "%{count} members"
|
||||
@@ -220,13 +134,12 @@ en:
|
||||
pwa_ios_title: For iOS (iPhone/iPad)
|
||||
pwa_title: Want to install Growstuff on your phone?
|
||||
label:
|
||||
days_until_harvest: "%{number} days"
|
||||
weeks_until_harvest: "%{number} weeks until harvest"
|
||||
days_until_finished: "%{number} days"
|
||||
weeks_until_finished: "%{number} weeks"
|
||||
harvesting_now: harvesting now
|
||||
data: 'The data on this page is available in the following formats:'
|
||||
harvesting_now: harvesting now
|
||||
weeks_until_harvest: "%{number} weeks until harvest"
|
||||
layouts:
|
||||
application:
|
||||
skip: Skip
|
||||
header:
|
||||
activities: Activities
|
||||
account: Account
|
||||
@@ -235,33 +148,19 @@ en:
|
||||
browse_members: Browse Members
|
||||
community: Community
|
||||
community_map: Community Map
|
||||
garden_type: Garden Type
|
||||
garden_types: Garden Types
|
||||
crop_wrangling: Crop Wrangling
|
||||
crops: Crops
|
||||
current_memberlogin_name: "%{current_memberlogin_name}"
|
||||
forums: Forums
|
||||
gardens: Gardens
|
||||
harvest: Harvest
|
||||
garden_types: Garden Types
|
||||
harvests: Harvests
|
||||
record: Record
|
||||
inbox: Inbox
|
||||
inbox_unread: Inbox (%{unread_count})
|
||||
plantings: Plantings
|
||||
posts: Posts
|
||||
profile: Profile/Timeline
|
||||
seeds: Seeds
|
||||
skip: Skip navigation menu
|
||||
support_growstuff: Support Growstuff
|
||||
toggle_navigation: Toggle Navigation
|
||||
your_stuff: Your Stuff
|
||||
menu:
|
||||
sign_in: Sign in
|
||||
sign_out: Sign out
|
||||
sign_up: Sign up
|
||||
links:
|
||||
my_gardens: My gardens
|
||||
|
||||
members:
|
||||
edit_profile: Edit profile
|
||||
index:
|
||||
@@ -305,13 +204,8 @@ en:
|
||||
no longer possible.
|
||||
plantings:
|
||||
badges:
|
||||
days_until_finished: days until finished
|
||||
days_until_harvest: days until harvest
|
||||
harvesting_now: harvesting now
|
||||
late_finishing: late finishing
|
||||
sharedbuttonsfinish_planting: shared/buttons/finish_planting
|
||||
super_late: super late
|
||||
plant_something: Plant something
|
||||
form:
|
||||
finish_helper: >
|
||||
A planting is finished when you've harvested all of the crop, or it dies, or it's otherwise
|
||||
@@ -328,35 +222,18 @@ en:
|
||||
progress:
|
||||
progress_0_not_planted_yet: 'Progress: 0% - not planted yet'
|
||||
posts:
|
||||
write_blog_post: Write blog post
|
||||
index:
|
||||
title:
|
||||
author_posts: "%{author} posts"
|
||||
default: Everyone's posts
|
||||
write_blog_post: Write blog post
|
||||
seeds:
|
||||
form:
|
||||
trade_help: >
|
||||
Are you interested in trading or swapping seeds with other %{site_name} members? If you list
|
||||
your seeds as available for trade, other members can contact you to request seeds. You can
|
||||
list any conditions or other information in the description, above.
|
||||
finish_helper: >
|
||||
Seeds are finished when you've planted them all, or you've traded them all away.
|
||||
index:
|
||||
title:
|
||||
crop_seeds: Everyone's %{crop} seeds
|
||||
default: Everyone's seeds
|
||||
owner_seeds: "%{owner} seeds"
|
||||
trade_help: >
|
||||
Are you interested in trading or swapping seeds with other %{site_name} members?
|
||||
If you list your seeds as available for trade, other members can contact you to request seeds.
|
||||
You can list any conditions or other information in the description, above.
|
||||
save_seeds: Save seeds
|
||||
string: "%{crop} seeds belonging to %{owner}"
|
||||
unauthorized:
|
||||
create:
|
||||
all: Please sign in or sign up to create a %{subject}.
|
||||
notification: Please sign in to send a message.
|
||||
planting: Please sign in or sign up to plant something.
|
||||
post: Please sign in or sign up to post.
|
||||
seed: Please sign in or sign up to add seeds.
|
||||
garden_type: Not authorized. Only admins can create garden types.
|
||||
manage:
|
||||
all: Not authorized to %{action} %{subject}.
|
||||
read:
|
||||
notification: You must be signed in to view notifications.
|
||||
view: View
|
||||
|
||||
@@ -1,5 +0,0 @@
|
||||
---
|
||||
ja:
|
||||
home:
|
||||
blurb:
|
||||
intro: "%{site_name}はガーデナーのコミュニティです。"
|
||||
142
public/robots.txt
Normal file
142
public/robots.txt
Normal file
@@ -0,0 +1,142 @@
|
||||
# robots.txt for based on the one for http://www.wikipedia.org/ and friends
|
||||
|
||||
# Observed spamming large amounts of https://en.wikipedia.org/?curid=NNNNNN
|
||||
# and ignoring 429 ratelimit responses, claims to respect robots:
|
||||
# http://mj12bot.com/
|
||||
User-agent: MJ12bot
|
||||
Disallow: /
|
||||
|
||||
# advertising-related bots:
|
||||
User-agent: Mediapartners-Google*
|
||||
Disallow: /
|
||||
|
||||
# Wikipedia work bots:
|
||||
User-agent: IsraBot
|
||||
Disallow:
|
||||
|
||||
User-agent: Orthogaffe
|
||||
Disallow:
|
||||
|
||||
# Crawlers that are kind enough to obey, but which we'd rather not have
|
||||
# unless they're feeding search engines.
|
||||
User-agent: UbiCrawler
|
||||
Disallow: /
|
||||
|
||||
User-agent: DOC
|
||||
Disallow: /
|
||||
|
||||
User-agent: Zao
|
||||
Disallow: /
|
||||
|
||||
# Some bots are known to be trouble, particularly those designed to copy
|
||||
# entire sites. Please obey robots.txt.
|
||||
User-agent: sitecheck.internetseer.com
|
||||
Disallow: /
|
||||
|
||||
User-agent: Zealbot
|
||||
Disallow: /
|
||||
|
||||
User-agent: MSIECrawler
|
||||
Disallow: /
|
||||
|
||||
User-agent: SiteSnagger
|
||||
Disallow: /
|
||||
|
||||
User-agent: WebStripper
|
||||
Disallow: /
|
||||
|
||||
User-agent: WebCopier
|
||||
Disallow: /
|
||||
|
||||
User-agent: Fetch
|
||||
Disallow: /
|
||||
|
||||
User-agent: Offline Explorer
|
||||
Disallow: /
|
||||
|
||||
User-agent: Teleport
|
||||
Disallow: /
|
||||
|
||||
User-agent: TeleportPro
|
||||
Disallow: /
|
||||
|
||||
User-agent: WebZIP
|
||||
Disallow: /
|
||||
|
||||
User-agent: linko
|
||||
Disallow: /
|
||||
|
||||
User-agent: HTTrack
|
||||
Disallow: /
|
||||
|
||||
User-agent: Microsoft.URL.Control
|
||||
Disallow: /
|
||||
|
||||
User-agent: Xenu
|
||||
Disallow: /
|
||||
|
||||
User-agent: larbin
|
||||
Disallow: /
|
||||
|
||||
User-agent: libwww
|
||||
Disallow: /
|
||||
|
||||
User-agent: ZyBORG
|
||||
Disallow: /
|
||||
|
||||
User-agent: Download Ninja
|
||||
Disallow: /
|
||||
|
||||
# Misbehaving: requests much too fast:
|
||||
User-agent: fast
|
||||
Disallow: /
|
||||
|
||||
#
|
||||
# Sorry, wget in its recursive mode is a frequent problem.
|
||||
# Please read the man page and use it properly; there is a
|
||||
# --wait option you can use to set the delay between hits,
|
||||
# for instance.
|
||||
#
|
||||
User-agent: wget
|
||||
Disallow: /
|
||||
|
||||
#
|
||||
# The 'grub' distributed client has been *very* poorly behaved.
|
||||
#
|
||||
User-agent: grub-client
|
||||
Disallow: /
|
||||
|
||||
#
|
||||
# Doesn't follow robots.txt anyway, but...
|
||||
#
|
||||
User-agent: k2spider
|
||||
Disallow: /
|
||||
|
||||
#
|
||||
# Hits many times per second, not acceptable
|
||||
# http://www.nameprotect.com/botinfo.html
|
||||
User-agent: NPBot
|
||||
Disallow: /
|
||||
|
||||
# A capture bot, downloads gazillions of pages with no public benefit
|
||||
# http://www.webreaper.net/
|
||||
User-agent: WebReaper
|
||||
Disallow: /
|
||||
|
||||
# Per their statement, semrushbot respects crawl-delay directives
|
||||
# We want them to overall stay within reasonable request rates to
|
||||
# the backend (20 rps); keeping in mind that the crawl-delay will
|
||||
# be applied by site and not globally by the bot, 5 seconds seem
|
||||
# like a reasonable approximation
|
||||
User-agent: SemrushBot
|
||||
Crawl-delay: 5
|
||||
|
||||
#
|
||||
# Friendly, low-speed bots are welcome viewing pages, but not
|
||||
# dynamically-generated pages please.
|
||||
#
|
||||
# Another exception is for REST API documentation, located at
|
||||
# /api/rest_v1/?doc.
|
||||
#
|
||||
User-agent: *
|
||||
Disallow: /api/
|
||||
@@ -5,8 +5,14 @@ require 'rails_helper'
|
||||
RSpec.describe 'Activities', type: :request do
|
||||
subject { JSON.parse response.body }
|
||||
|
||||
let(:headers) { { 'Accept' => 'application/vnd.api+json' } }
|
||||
let!(:activity) { FactoryBot.create(:activity, garden: create(:garden), planting: create(:planting)) }
|
||||
let(:member) { create(:member) }
|
||||
let(:token) do
|
||||
member.regenerate_api_token
|
||||
member.api_token.token
|
||||
end
|
||||
let(:headers) { { 'Accept' => 'application/vnd.api+json', 'Content-Type' => 'application/vnd.api+json' } }
|
||||
let(:auth_headers) { headers.merge('Authorization' => "Bearer #{token}") }
|
||||
let!(:activity) { FactoryBot.create(:activity, owner: member, garden: create(:garden, owner: member), planting: create(:planting, owner: member)) }
|
||||
let!(:activity2) { FactoryBot.create(:activity) }
|
||||
|
||||
it '#index' do
|
||||
@@ -53,4 +59,37 @@ RSpec.describe 'Activities', type: :request do
|
||||
expect(subject['data'][1]['id']).to eq(activity2.id.to_s)
|
||||
end
|
||||
end
|
||||
|
||||
context '#update' do
|
||||
let(:params) do
|
||||
{
|
||||
'data' => {
|
||||
'type' => 'activities',
|
||||
'id' => activity.id.to_s,
|
||||
'attributes' => {
|
||||
'description' => 'A new description',
|
||||
'finished' => true,
|
||||
'due-date' => '2025-10-31'
|
||||
}
|
||||
}
|
||||
}
|
||||
end
|
||||
|
||||
it 'updates the activity' do
|
||||
patch "/api/v1/activities/#{activity.id}", params: params.to_json, headers: auth_headers
|
||||
|
||||
expect(response).to have_http_status(:ok)
|
||||
|
||||
# Check response
|
||||
expect(subject['data']['attributes']['description']).to eq('A new description')
|
||||
expect(subject['data']['attributes']['finished']).to eq(true)
|
||||
expect(subject['data']['attributes']['due-date']).to eq('2025-10-31')
|
||||
|
||||
# Check database
|
||||
activity.reload
|
||||
expect(activity.description).to eq('A new description')
|
||||
expect(activity.finished).to eq(true)
|
||||
expect(activity.due_date.to_s).to eq('2025-10-31')
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -85,7 +85,7 @@ RSpec.describe 'Gardens', type: :request do
|
||||
member.api_token.token
|
||||
end
|
||||
let(:headers) { { 'Accept' => 'application/vnd.api+json', 'Content-Type' => 'application/vnd.api+json' } }
|
||||
let(:auth_headers) { headers.merge('Authorization' => "Token token=#{token}") }
|
||||
let(:auth_headers) { headers.merge('Authorization' => "Bearer #{token}") }
|
||||
let(:garden_params) do
|
||||
{
|
||||
data: {
|
||||
@@ -116,7 +116,7 @@ RSpec.describe 'Gardens', type: :request do
|
||||
member.api_token.token
|
||||
end
|
||||
let(:headers) { { 'Accept' => 'application/vnd.api+json', 'Content-Type' => 'application/vnd.api+json' } }
|
||||
let(:auth_headers) { headers.merge('Authorization' => "Token token=#{token}") }
|
||||
let(:auth_headers) { headers.merge('Authorization' => "Bearer #{token}") }
|
||||
let(:garden) { create(:garden, owner: member) }
|
||||
let(:other_member_garden) { create(:garden) }
|
||||
let(:update_params) do
|
||||
@@ -164,7 +164,7 @@ RSpec.describe 'Gardens', type: :request do
|
||||
member.api_token.token
|
||||
end
|
||||
let(:headers) { { 'Accept' => 'application/vnd.api+json', 'Content-Type' => 'application/vnd.api+json' } }
|
||||
let(:auth_headers) { headers.merge('Authorization' => "Token token=#{token}") }
|
||||
let(:auth_headers) { headers.merge('Authorization' => "Bearer #{token}") }
|
||||
let!(:garden) { create(:garden, owner: member) }
|
||||
let(:other_member_garden) { create(:garden) }
|
||||
|
||||
|
||||
@@ -117,7 +117,7 @@ RSpec.describe 'Harvests', type: :request do
|
||||
member.api_token.token
|
||||
end
|
||||
let(:headers) { { 'Accept' => 'application/vnd.api+json', 'Content-Type' => 'application/vnd.api+json' } }
|
||||
let(:auth_headers) { headers.merge('Authorization' => "Token token=#{token}") }
|
||||
let(:auth_headers) { headers.merge('Authorization' => "Bearer #{token}") }
|
||||
let(:crop) { create(:crop) }
|
||||
let(:planting) { create(:planting, owner: member) }
|
||||
let(:plant_part) { create(:plant_part) }
|
||||
@@ -156,7 +156,7 @@ RSpec.describe 'Harvests', type: :request do
|
||||
member.api_token.token
|
||||
end
|
||||
let(:headers) { { 'Accept' => 'application/vnd.api+json', 'Content-Type' => 'application/vnd.api+json' } }
|
||||
let(:auth_headers) { headers.merge('Authorization' => "Token token=#{token}") }
|
||||
let(:auth_headers) { headers.merge('Authorization' => "Bearer #{token}") }
|
||||
let(:harvest) { create(:harvest, owner: member) }
|
||||
let(:other_member_harvest) { create(:harvest) }
|
||||
let(:update_params) do
|
||||
@@ -205,7 +205,7 @@ RSpec.describe 'Harvests', type: :request do
|
||||
member.api_token.token
|
||||
end
|
||||
let(:headers) { { 'Accept' => 'application/vnd.api+json', 'Content-Type' => 'application/vnd.api+json' } }
|
||||
let(:auth_headers) { headers.merge('Authorization' => "Token token=#{token}") }
|
||||
let(:auth_headers) { headers.merge('Authorization' => "Bearer #{token}") }
|
||||
let!(:harvest) { create(:harvest, owner: member) }
|
||||
let(:other_member_harvest) { create(:harvest) }
|
||||
|
||||
|
||||
@@ -17,7 +17,8 @@ RSpec.describe 'Members', type: :request do
|
||||
"harvests" => harvests_as_json_api,
|
||||
"photos" => photos_as_json_api,
|
||||
"plantings" => plantings_as_json_api,
|
||||
"seeds" => seeds_as_json_api
|
||||
"seeds" => seeds_as_json_api,
|
||||
"activities" => activities_as_json_api
|
||||
} }
|
||||
end
|
||||
|
||||
@@ -41,6 +42,12 @@ RSpec.describe 'Members', type: :request do
|
||||
"related" => "#{resource_url}/seeds" } }
|
||||
end
|
||||
|
||||
let(:activities_as_json_api) do
|
||||
{ "links" =>
|
||||
{ "self" => "#{resource_url}/relationships/activities",
|
||||
"related" => "#{resource_url}/activities" } }
|
||||
end
|
||||
|
||||
let(:plantings_as_json_api) do
|
||||
{ "links" =>
|
||||
{ "self" =>
|
||||
@@ -74,6 +81,7 @@ RSpec.describe 'Members', type: :request do
|
||||
it { expect(subject['data']['relationships']).to include("seeds" => seeds_as_json_api) }
|
||||
it { expect(subject['data']['relationships']).to include("harvests" => harvests_as_json_api) }
|
||||
it { expect(subject['data']['relationships']).to include("photos" => photos_as_json_api) }
|
||||
it { expect(subject['data']['relationships']).to include("activities" => activities_as_json_api) }
|
||||
it { expect(subject['data']).to eq(member_encoded_as_json_api) }
|
||||
end
|
||||
|
||||
|
||||
@@ -102,7 +102,7 @@ RSpec.describe 'Plantings', type: :request do
|
||||
member.api_token.token
|
||||
end
|
||||
let(:headers) { { 'Accept' => 'application/vnd.api+json', 'Content-Type' => 'application/vnd.api+json' } }
|
||||
let(:auth_headers) { headers.merge('Authorization' => "Token token=#{token}") }
|
||||
let(:auth_headers) { headers.merge('Authorization' => "Bearer #{token}") }
|
||||
let(:crop) { create(:crop) }
|
||||
let(:garden) { create(:garden, owner: member) }
|
||||
let(:planting_params) do
|
||||
@@ -140,7 +140,7 @@ RSpec.describe 'Plantings', type: :request do
|
||||
member.api_token.token
|
||||
end
|
||||
let(:headers) { { 'Accept' => 'application/vnd.api+json', 'Content-Type' => 'application/vnd.api+json' } }
|
||||
let(:auth_headers) { headers.merge('Authorization' => "Token token=#{token}") }
|
||||
let(:auth_headers) { headers.merge('Authorization' => "Bearer #{token}") }
|
||||
let(:planting) { create(:planting, owner: member) }
|
||||
let(:other_member_planting) { create(:planting) }
|
||||
let(:update_params) do
|
||||
@@ -189,7 +189,7 @@ RSpec.describe 'Plantings', type: :request do
|
||||
member.api_token.token
|
||||
end
|
||||
let(:headers) { { 'Accept' => 'application/vnd.api+json', 'Content-Type' => 'application/vnd.api+json' } }
|
||||
let(:auth_headers) { headers.merge('Authorization' => "Token token=#{token}") }
|
||||
let(:auth_headers) { headers.merge('Authorization' => "Bearer #{token}") }
|
||||
let!(:planting) { create(:planting, owner: member) }
|
||||
let(:other_member_planting) { create(:planting) }
|
||||
|
||||
|
||||
@@ -68,7 +68,7 @@ RSpec.describe 'Seeds', type: :request do
|
||||
member.api_token.token
|
||||
end
|
||||
let(:headers) { { 'Accept' => 'application/vnd.api+json', 'Content-Type' => 'application/vnd.api+json' } }
|
||||
let(:auth_headers) { headers.merge('Authorization' => "Token token=#{token}") }
|
||||
let(:auth_headers) { headers.merge('Authorization' => "Bearer #{token}") }
|
||||
let(:crop) { create(:crop) }
|
||||
let(:seed_params) do
|
||||
{
|
||||
@@ -103,7 +103,7 @@ RSpec.describe 'Seeds', type: :request do
|
||||
member.api_token.token
|
||||
end
|
||||
let(:headers) { { 'Accept' => 'application/vnd.api+json', 'Content-Type' => 'application/vnd.api+json' } }
|
||||
let(:auth_headers) { headers.merge('Authorization' => "Token token=#{token}") }
|
||||
let(:auth_headers) { headers.merge('Authorization' => "Bearer #{token}") }
|
||||
let(:crop) { create(:crop) }
|
||||
let(:seed) { create(:seed, owner: member, crop: crop) }
|
||||
let(:other_member_seed) { create(:seed) }
|
||||
@@ -152,7 +152,7 @@ RSpec.describe 'Seeds', type: :request do
|
||||
member.api_token.token
|
||||
end
|
||||
let(:headers) { { 'Accept' => 'application/vnd.api+json', 'Content-Type' => 'application/vnd.api+json' } }
|
||||
let(:auth_headers) { headers.merge('Authorization' => "Token token=#{token}") }
|
||||
let(:auth_headers) { headers.merge('Authorization' => "Bearer #{token}") }
|
||||
let(:crop) { create(:crop) }
|
||||
let!(:seed) { create(:seed, owner: member, crop: crop) }
|
||||
let(:other_member_seed) { create(:seed) }
|
||||
|
||||
35
spec/views/i18n_spec.rb
Normal file
35
spec/views/i18n_spec.rb
Normal file
@@ -0,0 +1,35 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
require 'rails_helper'
|
||||
require 'i18n/tasks'
|
||||
|
||||
RSpec.describe I18n do
|
||||
let(:i18n) { I18n::Tasks::BaseTask.new }
|
||||
let(:missing_keys) { i18n.missing_keys }
|
||||
let(:unused_keys) { i18n.unused_keys }
|
||||
let(:inconsistent_interpolations) { i18n.inconsistent_interpolations }
|
||||
|
||||
it 'does not have missing keys' do
|
||||
expect(missing_keys).to be_empty,
|
||||
"Missing #{missing_keys.leaves.count} i18n keys, run `i18n-tasks missing' to show them"
|
||||
end
|
||||
|
||||
it 'does not have unused keys' do
|
||||
expect(unused_keys).to be_empty,
|
||||
"#{unused_keys.leaves.count} unused i18n keys, run `i18n-tasks unused' to show them"
|
||||
end
|
||||
|
||||
xit 'files are normalized' do
|
||||
non_normalized = i18n.non_normalized_paths
|
||||
error_message = "The following files need to be normalized:\n" \
|
||||
"#{non_normalized.map { |path| " #{path}" }.join("\n")}\n" \
|
||||
"Please run `i18n-tasks normalize' to fix"
|
||||
expect(non_normalized).to be_empty, error_message
|
||||
end
|
||||
|
||||
it 'does not have inconsistent interpolations' do
|
||||
error_message = "#{inconsistent_interpolations.leaves.count} i18n keys have inconsistent interpolations.\n" \
|
||||
"Run `i18n-tasks check-consistent-interpolations' to show them"
|
||||
expect(inconsistent_interpolations).to be_empty, error_message
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user