Merge branch 'bump-ruby-3.0' of github.com:Growstuff/growstuff into bump-ruby-3.0

This commit is contained in:
Daniel O'Connor
2022-04-16 22:00:49 +09:30
16 changed files with 918 additions and 2063 deletions

View File

@@ -5,7 +5,7 @@ source 'https://rubygems.org'
# Match ruby version in .ruby-version
ruby File.read('.ruby-version')
gem 'rails', '~> 6.0.4.1'
gem 'rails', '~> 6.1.0'
# Keeping old sprockets
# https://github.com/rails/sprockets-rails/issues/444#issuecomment-637817050
@@ -175,7 +175,6 @@ end
group :test do
gem 'codeclimate-test-reporter', require: false
gem 'percy-capybara'
gem 'rails-controller-testing'
gem 'selenium-webdriver'
gem 'timecop'
@@ -185,3 +184,5 @@ end
group :travis do
gem 'platform-api'
end
gem "percy-capybara", "~> 5.0.0"

View File

@@ -26,38 +26,40 @@ GEM
remote: https://rubygems.org/
specs:
abstract_type (0.0.7)
actioncable (6.0.4.7)
actionpack (= 6.0.4.7)
actioncable (6.1.5)
actionpack (= 6.1.5)
activesupport (= 6.1.5)
nio4r (~> 2.0)
websocket-driver (>= 0.6.1)
actionmailbox (6.0.4.7)
actionpack (= 6.0.4.7)
activejob (= 6.0.4.7)
activerecord (= 6.0.4.7)
activestorage (= 6.0.4.7)
activesupport (= 6.0.4.7)
actionmailbox (6.1.5)
actionpack (= 6.1.5)
activejob (= 6.1.5)
activerecord (= 6.1.5)
activestorage (= 6.1.5)
activesupport (= 6.1.5)
mail (>= 2.7.1)
actionmailer (6.0.4.7)
actionpack (= 6.0.4.7)
actionview (= 6.0.4.7)
activejob (= 6.0.4.7)
actionmailer (6.1.5)
actionpack (= 6.1.5)
actionview (= 6.1.5)
activejob (= 6.1.5)
activesupport (= 6.1.5)
mail (~> 2.5, >= 2.5.4)
rails-dom-testing (~> 2.0)
actionpack (6.0.4.7)
actionview (= 6.0.4.7)
activesupport (= 6.0.4.7)
rack (~> 2.0, >= 2.0.8)
actionpack (6.1.5)
actionview (= 6.1.5)
activesupport (= 6.1.5)
rack (~> 2.0, >= 2.0.9)
rack-test (>= 0.6.3)
rails-dom-testing (~> 2.0)
rails-html-sanitizer (~> 1.0, >= 1.2.0)
actiontext (6.0.4.7)
actionpack (= 6.0.4.7)
activerecord (= 6.0.4.7)
activestorage (= 6.0.4.7)
activesupport (= 6.0.4.7)
actiontext (6.1.5)
actionpack (= 6.1.5)
activerecord (= 6.1.5)
activestorage (= 6.1.5)
activesupport (= 6.1.5)
nokogiri (>= 1.8.5)
actionview (6.0.4.7)
activesupport (= 6.0.4.7)
actionview (6.1.5)
activesupport (= 6.1.5)
builder (~> 3.1)
erubi (~> 1.4)
rails-dom-testing (~> 2.0)
@@ -69,50 +71,60 @@ GEM
activerecord (>= 4.2)
active_record_union (1.3.0)
activerecord (>= 4.0)
active_utils (3.3.18)
active_utils (3.3.19)
activesupport (>= 4.2)
i18n
activejob (6.0.4.7)
activesupport (= 6.0.4.7)
activejob (6.1.5)
activesupport (= 6.1.5)
globalid (>= 0.3.6)
activemodel (6.0.4.7)
activesupport (= 6.0.4.7)
activerecord (6.0.4.7)
activemodel (= 6.0.4.7)
activesupport (= 6.0.4.7)
activestorage (6.0.4.7)
actionpack (= 6.0.4.7)
activejob (= 6.0.4.7)
activerecord (= 6.0.4.7)
marcel (~> 1.0.0)
activesupport (6.0.4.7)
activemodel (6.1.5)
activesupport (= 6.1.5)
activerecord (6.1.5)
activemodel (= 6.1.5)
activesupport (= 6.1.5)
activestorage (6.1.5)
actionpack (= 6.1.5)
activejob (= 6.1.5)
activerecord (= 6.1.5)
activesupport (= 6.1.5)
marcel (~> 1.0)
mini_mime (>= 1.1.0)
activesupport (6.1.5)
concurrent-ruby (~> 1.0, >= 1.0.2)
i18n (>= 0.7, < 2)
minitest (~> 5.1)
tzinfo (~> 1.1)
zeitwerk (~> 2.2, >= 2.2.2)
i18n (>= 1.6, < 2)
minitest (>= 5.1)
tzinfo (~> 2.0)
zeitwerk (~> 2.3)
adamantium (0.2.0)
ice_nine (~> 0.11.0)
memoizable (~> 0.4.0)
addressable (2.8.0)
public_suffix (>= 2.0.2, < 5.0)
anima (0.3.1)
anima (0.3.2)
abstract_type (~> 0.0.7)
adamantium (~> 0.2)
equalizer (~> 0.0.11)
ast (2.4.2)
autoprefixer-rails (10.2.4.0)
execjs
bcrypt (3.1.16)
autoprefixer-rails (10.4.2.0)
execjs (~> 2)
bcrypt (3.1.17)
better_errors (2.9.1)
coderay (>= 1.0.0)
erubi (>= 1.0.0)
rack (>= 0.9.0)
better_html (1.0.16)
actionview (>= 4.0)
activesupport (>= 4.0)
ast (~> 2.0)
erubi (~> 1.4)
html_tokenizer (~> 0.0.6)
parser (>= 2.4)
smart_properties
bluecloth (2.2.0)
bonsai-elasticsearch-rails (7.0.1)
elasticsearch-model (< 8)
elasticsearch-rails (< 8)
bootstrap (4.6.0)
bootstrap (4.6.1)
autoprefixer-rails (>= 9.1.0)
popper_js (>= 1.14.3, < 2)
sassc-rails (>= 2.0.0)
@@ -122,13 +134,14 @@ GEM
actionpack (>= 5.2)
activemodel (>= 5.2)
builder (3.2.4)
bullet (6.1.5)
bullet (7.0.1)
activesupport (>= 3.0.0)
uniform_notifier (~> 1.11)
byebug (11.1.3)
cancancan (3.3.0)
capybara (3.35.3)
capybara (3.36.0)
addressable
matrix
mini_mime (>= 0.1.3)
nokogiri (~> 1.8)
rack (>= 1.6.0)
@@ -138,7 +151,7 @@ GEM
capybara-email (3.0.2)
capybara (>= 2.4, < 4.0)
mail
capybara-screenshot (1.0.25)
capybara-screenshot (1.0.26)
capybara (>= 1.0, < 4)
launchy
carrierwave (2.1.1)
@@ -149,8 +162,8 @@ GEM
mimemagic (>= 0.3.0)
mini_mime (>= 0.1.3)
ssrf_filter (~> 1.0)
chartkick (4.0.5)
childprocess (3.0.0)
chartkick (4.1.3)
childprocess (4.1.0)
codeclimate-test-reporter (1.0.9)
simplecov (<= 0.13)
coderay (1.1.3)
@@ -163,7 +176,7 @@ GEM
coffee-script-source (1.12.2)
comfy_bootstrap_form (4.0.9)
rails (>= 5.0.0)
concord (0.1.5)
concord (0.1.6)
adamantium (~> 0.2.0)
equalizer (~> 0.0.9)
concurrent-ruby (1.1.10)
@@ -171,22 +184,22 @@ GEM
crass (1.0.6)
csv_shaper (1.3.2)
activesupport (>= 3.0.0)
dalli (2.7.11)
dalli (3.2.1)
database_cleaner (2.0.1)
database_cleaner-active_record (~> 2.0.0)
database_cleaner-active_record (2.0.0)
activerecord (>= 5.a)
database_cleaner-core (~> 2.0.0)
database_cleaner-core (2.0.1)
devise (4.8.0)
devise (4.8.1)
bcrypt (~> 3.0)
orm_adapter (~> 0.1)
railties (>= 4.1.0)
responders
warden (~> 1.2.3)
diff-lcs (1.4.4)
discard (1.2.0)
activerecord (>= 4.2, < 7)
diff-lcs (1.5.0)
discard (1.2.1)
activerecord (>= 4.2, < 8)
docile (1.1.5)
dotenv (2.7.6)
dotenv-rails (2.7.6)
@@ -209,33 +222,37 @@ GEM
erubi (1.10.0)
erubis (2.7.0)
excon (0.78.1)
execjs (2.7.0)
execjs (2.8.1)
factory_bot (6.2.0)
activesupport (>= 5.0.0)
factory_bot_rails (6.2.0)
factory_bot (~> 6.2.0)
railties (>= 5.0.0)
faker (2.19.0)
i18n (>= 1.6, < 2)
faraday (1.8.0)
faker (2.20.0)
i18n (>= 1.8.11, < 2)
faraday (1.10.0)
faraday-em_http (~> 1.0)
faraday-em_synchrony (~> 1.0)
faraday-excon (~> 1.1)
faraday-httpclient (~> 1.0.1)
faraday-httpclient (~> 1.0)
faraday-multipart (~> 1.0)
faraday-net_http (~> 1.0)
faraday-net_http_persistent (~> 1.1)
faraday-net_http_persistent (~> 1.0)
faraday-patron (~> 1.0)
faraday-rack (~> 1.0)
multipart-post (>= 1.2, < 3)
faraday-retry (~> 1.0)
ruby2_keywords (>= 0.0.4)
faraday-em_http (1.0.0)
faraday-em_synchrony (1.0.0)
faraday-excon (1.1.0)
faraday-httpclient (1.0.1)
faraday-multipart (1.0.3)
multipart-post (>= 1.2, < 3)
faraday-net_http (1.0.1)
faraday-net_http_persistent (1.2.0)
faraday-patron (1.0.0)
faraday-rack (1.0.0)
faraday-retry (1.0.3)
faraday_middleware (1.2.0)
faraday (~> 1.0)
ffi (1.15.5)
@@ -268,13 +285,13 @@ GEM
haml (>= 4.0.6, < 6.0)
html2haml (>= 1.0.1)
railties (>= 5.1)
haml_lint (0.37.1)
haml_lint (0.40.0)
haml (>= 4.0, < 5.3)
parallel (~> 1.10)
rainbow
rubocop (>= 0.50.0)
sysexits (~> 1.1)
hashie (4.1.0)
hashie (5.0.0)
heroics (0.1.1)
erubis (~> 2.0)
excon
@@ -286,14 +303,16 @@ GEM
haml (>= 4.0, < 6)
nokogiri (>= 1.6.0)
ruby_parser (~> 3.5)
html_tokenizer (0.0.7)
httparty (0.18.1)
mime-types (~> 3.0)
multi_xml (>= 0.5.2)
i18n (1.10.0)
concurrent-ruby (~> 1.0)
i18n-tasks (0.9.34)
i18n-tasks (1.0.9)
activesupport (>= 4.0.2)
ast (>= 2.1.0)
better_html (~> 1.0)
erubi
highline (>= 2.0.0)
i18n
@@ -316,7 +335,7 @@ GEM
json (2.3.1)
json-schema (2.8.1)
addressable (>= 2.4)
jsonapi-resources (0.10.5)
jsonapi-resources (0.10.7)
activerecord (>= 4.1)
concurrent-ruby
railties (>= 4.1)
@@ -329,12 +348,12 @@ GEM
addressable (~> 2.7)
leaflet-rails (1.7.0)
rails (>= 4.2.0)
letter_opener (1.7.0)
launchy (~> 2.2)
listen (3.7.0)
letter_opener (1.8.1)
launchy (>= 2.2, < 3)
listen (3.7.1)
rb-fsevent (~> 0.10, >= 0.10.3)
rb-inotify (~> 0.9, >= 0.9.10)
loofah (2.15.0)
loofah (2.16.0)
crass (~> 1.0.2)
nokogiri (>= 1.5.9)
mail (2.7.1)
@@ -348,6 +367,7 @@ GEM
sass (>= 3.5.2)
material_icons (2.2.1)
railties (>= 3.2)
matrix (0.4.2)
memcachier (0.0.2)
memoizable (0.4.2)
thread_safe (~> 0.3, >= 0.3.1)
@@ -367,12 +387,12 @@ GEM
multi_xml (0.6.0)
multipart-post (2.1.1)
nio4r (2.5.8)
nokogiri (1.13.3)
nokogiri (1.13.4)
mini_portile2 (~> 2.8.0)
racc (~> 1.4)
oauth (0.5.6)
oauth2 (1.4.4)
faraday (>= 0.8, < 2.0)
oauth2 (1.4.9)
faraday (>= 0.17.3, < 3.0)
jwt (>= 1.0, < 3.0)
multi_json (~> 1.3)
multi_xml (~> 0.5)
@@ -381,7 +401,7 @@ GEM
omniauth (1.9.1)
hashie (>= 3.4.6)
rack (>= 1.6.2, < 3)
omniauth-facebook (8.0.0)
omniauth-facebook (9.0.0)
omniauth-oauth2 (~> 1.2)
omniauth-flickr (0.0.20)
multi_json (~> 1.12)
@@ -389,17 +409,18 @@ GEM
omniauth-oauth (1.1.0)
oauth
omniauth (~> 1.0)
omniauth-oauth2 (1.7.0)
omniauth-oauth2 (1.7.2)
oauth2 (~> 1.4)
omniauth (~> 1.9)
omniauth (>= 1.9, < 3)
omniauth-twitter (1.4.0)
omniauth-oauth (~> 1.1)
rack
orm_adapter (0.5.0)
parallel (1.20.1)
parser (2.7.2.0)
parallel (1.22.1)
parser (3.1.1.0)
ast (~> 2.4.1)
percy-capybara (4.3.3)
percy-capybara (5.0.0)
capybara (>= 3)
pg (1.3.4)
platform-api (3.3.0)
heroics (~> 0.1.1)
@@ -407,31 +428,31 @@ GEM
rate_throttle_client (~> 0.1.0)
popper_js (1.16.0)
public_suffix (4.0.6)
puma (5.6.2)
puma (5.6.4)
nio4r (~> 2.0)
query_diet (0.7.0)
query_diet (0.7.1)
racc (1.6.0)
rack (2.2.3)
rack-cors (1.1.1)
rack (>= 2.0.0)
rack-protection (2.1.0)
rack-protection (2.2.0)
rack
rack-test (1.1.0)
rack (>= 1.0, < 3)
rails (6.0.4.7)
actioncable (= 6.0.4.7)
actionmailbox (= 6.0.4.7)
actionmailer (= 6.0.4.7)
actionpack (= 6.0.4.7)
actiontext (= 6.0.4.7)
actionview (= 6.0.4.7)
activejob (= 6.0.4.7)
activemodel (= 6.0.4.7)
activerecord (= 6.0.4.7)
activestorage (= 6.0.4.7)
activesupport (= 6.0.4.7)
bundler (>= 1.3.0)
railties (= 6.0.4.7)
rails (6.1.5)
actioncable (= 6.1.5)
actionmailbox (= 6.1.5)
actionmailer (= 6.1.5)
actionpack (= 6.1.5)
actiontext (= 6.1.5)
actionview (= 6.1.5)
activejob (= 6.1.5)
activemodel (= 6.1.5)
activerecord (= 6.1.5)
activestorage (= 6.1.5)
activesupport (= 6.1.5)
bundler (>= 1.15.0)
railties (= 6.1.5)
sprockets-rails (>= 2.0.0)
rails-controller-testing (1.0.5)
actionpack (>= 5.0.1.rc1)
@@ -442,50 +463,50 @@ GEM
nokogiri (>= 1.6)
rails-html-sanitizer (1.4.2)
loofah (~> 2.3)
rails-i18n (6.0.0)
rails-i18n (7.0.3)
i18n (>= 0.7, < 2)
railties (>= 6.0.0, < 7)
railties (>= 6.0.0, < 8)
rails_12factor (0.0.3)
rails_serve_static_assets
rails_stdout_logging
rails_serve_static_assets (0.0.5)
rails_stdout_logging (0.0.5)
railties (6.0.4.7)
actionpack (= 6.0.4.7)
activesupport (= 6.0.4.7)
railties (6.1.5)
actionpack (= 6.1.5)
activesupport (= 6.1.5)
method_source
rake (>= 0.8.7)
thor (>= 0.20.3, < 2.0)
rainbow (3.0.0)
raindrops (0.19.1)
rake (>= 12.2)
thor (~> 1.0)
rainbow (3.1.1)
raindrops (0.20.0)
rake (13.0.6)
rate_throttle_client (0.1.2)
rb-fsevent (0.11.0)
rb-fsevent (0.11.1)
rb-inotify (0.10.1)
ffi (~> 1.0)
redis (4.6.0)
regexp_parser (2.1.1)
regexp_parser (2.2.1)
responders (3.0.1)
actionpack (>= 5.0)
railties (>= 5.0)
rexml (3.2.5)
rspec (3.10.0)
rspec-core (~> 3.10.0)
rspec-expectations (~> 3.10.0)
rspec-mocks (~> 3.10.0)
rspec (3.11.0)
rspec-core (~> 3.11.0)
rspec-expectations (~> 3.11.0)
rspec-mocks (~> 3.11.0)
rspec-activemodel-mocks (1.1.0)
activemodel (>= 3.0)
activesupport (>= 3.0)
rspec-mocks (>= 2.99, < 4.0)
rspec-core (3.10.1)
rspec-support (~> 3.10.0)
rspec-expectations (3.10.1)
rspec-core (3.11.0)
rspec-support (~> 3.11.0)
rspec-expectations (3.11.0)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.10.0)
rspec-mocks (3.10.2)
rspec-support (~> 3.11.0)
rspec-mocks (3.11.0)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.10.0)
rspec-rails (5.0.2)
rspec-support (~> 3.11.0)
rspec-rails (5.1.1)
actionpack (>= 5.2)
activesupport (>= 5.2)
railties (>= 5.2)
@@ -493,21 +514,21 @@ GEM
rspec-expectations (~> 3.10)
rspec-mocks (~> 3.10)
rspec-support (~> 3.10)
rspec-support (3.10.2)
rspectre (0.0.3)
rspec-support (3.11.0)
rspectre (0.0.4)
anima (~> 0.3)
concord (~> 0.1)
parser (~> 2.3)
parser (>= 2.6)
rspec (~> 3.0)
rswag-api (2.4.0)
railties (>= 3.1, < 7.0)
rswag-specs (2.4.0)
activesupport (>= 3.1, < 7.0)
rswag-api (2.5.1)
railties (>= 3.1, < 7.1)
rswag-specs (2.5.1)
activesupport (>= 3.1, < 7.1)
json-schema (~> 2.2)
railties (>= 3.1, < 7.0)
rswag-ui (2.4.0)
actionpack (>= 3.1, < 7.0)
railties (>= 3.1, < 7.0)
railties (>= 3.1, < 7.1)
rswag-ui (2.5.1)
actionpack (>= 3.1, < 7.1)
railties (>= 3.1, < 7.1)
rubocop (0.93.1)
parallel (~> 1.10)
parser (>= 2.7.1.5)
@@ -517,8 +538,8 @@ GEM
rubocop-ast (>= 0.6.0)
ruby-progressbar (~> 1.7)
unicode-display_width (>= 1.4.0, < 2.0)
rubocop-ast (1.4.1)
parser (>= 2.7.1.5)
rubocop-ast (1.16.0)
parser (>= 3.1.1.0)
rubocop-rails (2.9.1)
activesupport (>= 4.2.0)
rack (>= 1.1)
@@ -549,14 +570,15 @@ GEM
sprockets (> 3.0)
sprockets-rails
tilt
scout_apm (4.1.2)
scout_apm (5.1.1)
parser
searchkick (4.6.1)
searchkick (4.6.3)
activemodel (>= 5)
elasticsearch (>= 6, < 7.14)
hashie
selenium-webdriver (3.142.7)
childprocess (>= 0.5, < 4.0)
selenium-webdriver (4.1.0)
childprocess (>= 0.5, < 5.0)
rexml (~> 3.2, >= 3.2.5)
rubyzip (>= 1.2.2)
sexp_processor (4.16.0)
sidekiq (6.4.1)
@@ -568,6 +590,7 @@ GEM
json (>= 1.8, < 3)
simplecov-html (~> 0.10.0)
simplecov-html (0.10.2)
smart_properties (1.17.0)
sprockets (3.7.2)
concurrent-ruby (~> 1.0)
rack (> 1, < 3)
@@ -578,31 +601,31 @@ GEM
ssrf_filter (1.0.7)
sysexits (1.2.0)
temple (0.8.2)
terminal-table (3.0.0)
unicode-display_width (~> 1.1, >= 1.1.1)
terminal-table (3.0.2)
unicode-display_width (>= 1.1.1, < 3)
thor (1.2.1)
thread_safe (0.3.6)
tilt (2.0.10)
timecop (0.9.4)
timecop (0.9.5)
trollop (1.16.2)
tzinfo (1.2.9)
thread_safe (~> 0.1)
tzinfo (2.0.4)
concurrent-ruby (~> 1.0)
uglifier (4.2.0)
execjs (>= 0.3.0, < 3)
unicode-display_width (1.7.0)
unicorn (6.0.0)
unicode-display_width (1.8.0)
unicorn (6.1.0)
kgio (~> 2.6)
raindrops (~> 0.7)
uniform_notifier (1.14.2)
uniform_notifier (1.16.0)
validate_url (1.0.13)
activemodel (>= 3.0.0)
public_suffix
warden (1.2.9)
rack (>= 2.0.9)
webdrivers (4.6.1)
webdrivers (5.0.0)
nokogiri (~> 1.6)
rubyzip (>= 1.3.0)
selenium-webdriver (>= 3.0, < 4.0)
selenium-webdriver (~> 4.0)
webrat (0.7.3)
nokogiri (>= 1.2.0)
rack (>= 1.0)
@@ -685,14 +708,14 @@ DEPENDENCIES
omniauth-facebook
omniauth-flickr (>= 0.0.15)
omniauth-twitter
percy-capybara
percy-capybara (~> 5.0.0)
pg
platform-api
puma
query_diet
rack-cors
rack-protection (>= 2.0.1)
rails (~> 6.0.4.1)
rails (~> 6.1.0)
rails-assets-leaflet.markercluster!
rails-controller-testing
rails_12factor
@@ -728,4 +751,4 @@ RUBY VERSION
ruby 3.0.4p208
BUNDLED WITH
2.3.10
2.3.10

View File

@@ -2,6 +2,6 @@
class ApprovedValidator < ActiveModel::EachValidator
def validate_each(record, attribute, _value)
record.errors[attribute] << (options[:message] || 'must be approved') unless record.crop.try(:approved?)
record.errors.add(attribute, options[:message] || 'must be approved') unless record.crop.try(:approved?)
end
end

View File

@@ -4,17 +4,17 @@
"description": "Growstuff Linters",
"main": "index.js",
"dependencies": {
"@percy/agent": "^0.28.7",
"mdbootstrap": "^4.19.2"
"mdbootstrap": "^4.20.0"
},
"engines": {
"node": ">=6.0.0",
"yarn": ">=0.25.2"
},
"devDependencies": {
"coffeelint": "^2.0.7",
"@coffeelint/cli": "^3.0.0",
"@percy/cli": "^1.0.0-beta.76",
"csslint": "^1.0.5",
"eslint": "^4.14.0",
"eslint": "^5.0.0",
"eslint-config-google": "^0.9.1",
"jshint": "^2.9.4"
},

View File

@@ -7,7 +7,7 @@ describe "forums", js: true do
include_context 'signed in admin'
it "navigating to forum admin with js" do
visit admin_path
Percy.snapshot(page, name: 'Admin page')
page.percy_snapshot(page, name: 'Admin page')
end
end
end

View File

@@ -14,7 +14,7 @@ describe 'Commenting on a post' do
click_button "Post comment"
expect(page).to have_content "comment was successfully created."
expect(page).to have_content "Posted by"
Percy.snapshot(page, name: 'Posting a comment')
page.percy_snapshot(page, name: 'Posting a comment')
end
context "editing a comment" do

View File

@@ -18,7 +18,7 @@ describe "Conversations", :js do
click_link 'Inbox'
end
it { expect(page).to have_content 'something i want to say' }
it { Percy.snapshot(page, name: 'conversations#index') }
it { page.percy_snapshot(page, name: 'conversations#index') }
describe 'deleting' do
before do

View File

@@ -21,7 +21,7 @@ describe "Conversations", :js do
it { expect(page).to have_content 'this is the body' }
it { expect(page).to have_link sender.login_name }
it { Percy.snapshot(page, name: 'conversations#show') }
it { page.percy_snapshot(page, name: 'conversations#show') }
describe 'Replying to the conversation' do
before do

View File

@@ -33,7 +33,7 @@ describe "Alternate names", js: true do
# expect(page.status_code).to equal 200
expect(page).to have_css "option[value='#{crop.id}'][selected=selected]"
fill_in 'Name', with: "alternative aubergine"
Percy.snapshot(page, name: 'Crop wrangler adding alternate name')
page.percy_snapshot(page, name: 'Crop wrangler adding alternate name')
click_on "Save"
# expect(page.status_code).to equal 200
expect(page).to have_content "alternative aubergine"
@@ -77,7 +77,7 @@ describe "Alternate names", js: true do
it "Displays crop rejection message" do
visit alternate_name_path(pending_alt_name)
expect(page).to have_content "This crop was rejected for the following reason: Totally fake"
Percy.snapshot(page, name: 'Rejecting crops')
page.percy_snapshot(page, name: 'Rejecting crops')
end
end
end

View File

@@ -71,7 +71,7 @@ describe "member deletion" do
visit member_path(member)
click_link 'Edit profile'
click_link 'Delete Account'
Percy.snapshot(page, name: 'Account deletion')
page.percy_snapshot(page, name: 'Account deletion')
end
end

View File

@@ -102,7 +102,7 @@ rest of the garden.
describe 'home' do
it 'loads homepage' do
visit root_path
Percy.snapshot(page, name: "#{prefix}/homepage")
page.percy_snapshot(page, name: "#{prefix}/homepage")
end
end
@@ -122,31 +122,31 @@ rest of the garden.
visit crop_path(tomato)
expect(page).to have_text 'tomato'
Percy.snapshot(page, name: "#{prefix}/crops#show")
page.percy_snapshot(page, name: "#{prefix}/crops#show")
end
it 'loads crops#index' do
visit crops_path
Percy.snapshot(page, name: "#{prefix}/crops#index")
page.percy_snapshot(page, name: "#{prefix}/crops#index")
end
end
describe 'plantings' do
it 'loads plantings#index' do
visit plantings_path
Percy.snapshot(page, name: "#{prefix}/plantings#index")
page.percy_snapshot(page, name: "#{prefix}/plantings#index")
end
it 'load another member plantings#show' do
planting = FactoryBot.create :planting, crop: tomato, owner: someone_else, garden: someone_else.gardens.first
visit planting_path(planting)
Percy.snapshot(page, name: "#{prefix}/plantings#show")
page.percy_snapshot(page, name: "#{prefix}/plantings#show")
end
end
describe 'gardens' do
it 'loads gardens#index' do
visit gardens_path
Percy.snapshot(page, name: "#{prefix}/gardens#index")
page.percy_snapshot(page, name: "#{prefix}/gardens#index")
end
it 'gardens#show' do
@@ -161,14 +161,14 @@ rest of the garden.
tomato_planting = FactoryBot.create :planting, garden: garden, owner: member, crop: tomato
tomato_photo.plantings << tomato_planting
visit garden_path(garden)
Percy.snapshot(page, name: "#{prefix}/gardens#show")
page.percy_snapshot(page, name: "#{prefix}/gardens#show")
end
end
describe 'members' do
it 'loads members#index' do
visit members_path
Percy.snapshot(page, name: "#{prefix}/members#index")
page.percy_snapshot(page, name: "#{prefix}/members#index")
end
it 'loads another members#show' do
@@ -178,7 +178,7 @@ rest of the garden.
FactoryBot.create :harvest, owner: someone_else, created_at: 1.day.ago, crop: tomato
visit member_path(someone_else)
Percy.snapshot(page, name: "#{prefix}/members#show")
page.percy_snapshot(page, name: "#{prefix}/members#show")
end
end
@@ -187,7 +187,7 @@ rest of the garden.
FactoryBot.create :comment, post: post
FactoryBot.create :comment, post: post
visit post_path(post)
Percy.snapshot(page, name: "#{prefix}/posts#show")
page.percy_snapshot(page, name: "#{prefix}/posts#show")
end
it 'loads posts#index' do
Member.all.limit(5).each do |member|
@@ -197,7 +197,7 @@ rest of the garden.
FactoryBot.create_list :comment, rand(1..5), post: post
end
visit posts_path
Percy.snapshot(page, name: "#{prefix}/posts#index")
page.percy_snapshot(page, name: "#{prefix}/posts#index")
end
end
@@ -205,7 +205,7 @@ rest of the garden.
it 'loads photos#show' do
tomato_photo.plantings << FactoryBot.create(:planting, owner: member, crop: tomato)
visit photo_path(tomato_photo)
Percy.snapshot(page, name: "#{prefix}/photos#show")
page.percy_snapshot(page, name: "#{prefix}/photos#show")
end
end
end
@@ -217,22 +217,22 @@ rest of the garden.
it 'loads sign in page' do
visit crops_path # some random page
click_link 'Sign in'
Percy.snapshot(page, name: "sign-in")
page.percy_snapshot(page, name: "sign-in")
end
it 'loads sign up page' do
visit crops_path # some random page
click_link 'Sign up'
Percy.snapshot(page, name: "sign-up")
page.percy_snapshot(page, name: "sign-up")
end
it 'loads forgot password' do
visit new_member_password_path
Percy.snapshot(page, name: "forgot-password")
page.percy_snapshot(page, name: "forgot-password")
end
it 'loads new confirmation' do
visit new_member_confirmation_path
Percy.snapshot(page, name: "new-confimation")
page.percy_snapshot(page, name: "new-confimation")
end
end
@@ -244,55 +244,55 @@ rest of the garden.
it 'load my plantings#show' do
planting = FactoryBot.create :planting, crop: tomato, owner: member, garden: member.gardens.first
visit planting_path(planting)
Percy.snapshot(page, name: "#{prefix}/self/plantings#show")
page.percy_snapshot(page, name: "#{prefix}/self/plantings#show")
end
it 'load my members#show' do
visit member_path(member)
Percy.snapshot(page, name: "#{prefix}/self/members#show")
page.percy_snapshot(page, name: "#{prefix}/self/members#show")
end
it 'load my gardens#show' do
garden = FactoryBot.create :garden, name: 'paradise', owner: member
visit garden_path(garden)
Percy.snapshot(page, name: "#{prefix}/self/gardens#show")
page.percy_snapshot(page, name: "#{prefix}/self/gardens#show")
end
describe '#new' do
it 'crops#new' do
visit new_crop_path
Percy.snapshot(page, name: "#{prefix}/crops#new")
page.percy_snapshot(page, name: "#{prefix}/crops#new")
end
it 'gardens#new' do
visit new_garden_path
Percy.snapshot(page, name: "#{prefix}/gardens#new")
page.percy_snapshot(page, name: "#{prefix}/gardens#new")
end
it 'harvests#new' do
visit new_harvest_path
Percy.snapshot(page, name: "#{prefix}/harvests#new")
page.percy_snapshot(page, name: "#{prefix}/harvests#new")
fill_in(id: 'crop', with: 'tom')
Percy.snapshot(page, name: "#{prefix}/harvests#new-autosuggest")
page.percy_snapshot(page, name: "#{prefix}/harvests#new-autosuggest")
end
it 'plantings#new' do
visit new_planting_path
Percy.snapshot(page, name: "#{prefix}/plantings#new")
page.percy_snapshot(page, name: "#{prefix}/plantings#new")
fill_in(id: 'crop', with: 'tom')
Percy.snapshot(page, name: "#{prefix}/plantings#new-autosuggest")
page.percy_snapshot(page, name: "#{prefix}/plantings#new-autosuggest")
end
it 'seeds#new' do
visit new_seed_path
Percy.snapshot(page, name: "#{prefix}/seeds#new")
page.percy_snapshot(page, name: "#{prefix}/seeds#new")
fill_in(id: 'crop', with: 'tom')
Percy.snapshot(page, name: "#{prefix}/seeds#new-autosuggest")
page.percy_snapshot(page, name: "#{prefix}/seeds#new-autosuggest")
end
it 'posts#new' do
visit new_post_path
Percy.snapshot(page, name: "#{prefix}/posts#new")
page.percy_snapshot(page, name: "#{prefix}/posts#new")
end
end
@@ -300,29 +300,29 @@ rest of the garden.
it 'loads gardens#edit' do
garden = FactoryBot.create :garden, owner: member
visit edit_garden_path(garden)
Percy.snapshot(page, name: "#{prefix}/gardens#edit")
page.percy_snapshot(page, name: "#{prefix}/gardens#edit")
end
it 'loads harvests#edit' do
harvest = FactoryBot.create :harvest, owner: member
visit edit_harvest_path(harvest)
Percy.snapshot(page, name: "#{prefix}/harvests#edit")
page.percy_snapshot(page, name: "#{prefix}/harvests#edit")
end
it 'loads planting#edit' do
planting = FactoryBot.create :planting, owner: member
visit edit_planting_path(planting)
Percy.snapshot(page, name: "#{prefix}/plantings#edit")
page.percy_snapshot(page, name: "#{prefix}/plantings#edit")
end
it 'loads posts#edit' do
visit edit_post_path(post)
Percy.snapshot(page, name: "#{prefix}/posts#edit")
page.percy_snapshot(page, name: "#{prefix}/posts#edit")
end
it 'comments#new' do
visit new_comment_path(post_id: post.id)
Percy.snapshot(page, name: "comments#new")
page.percy_snapshot(page, name: "comments#new")
end
end
@@ -331,11 +331,11 @@ rest of the garden.
member.update! login_name: 'percy'
visit root_path
click_on 'Crops'
Percy.snapshot(page, name: "#{prefix}/crops-menu")
page.percy_snapshot(page, name: "#{prefix}/crops-menu")
click_on 'Community'
Percy.snapshot(page, name: "#{prefix}/community-menu")
page.percy_snapshot(page, name: "#{prefix}/community-menu")
click_on 'percy', class: 'nav-link'
Percy.snapshot(page, name: "#{prefix}/member-menu")
page.percy_snapshot(page, name: "#{prefix}/member-menu")
end
end
end
@@ -346,11 +346,11 @@ rest of the garden.
it 'crop wrangling page' do
visit wrangle_crops_path
Percy.snapshot(page, name: 'crops wrangle')
page.percy_snapshot(page, name: 'crops wrangle')
click_link 'Pending approval'
Percy.snapshot(page, name: 'crops pending approval')
page.percy_snapshot(page, name: 'crops pending approval')
click_link 'candy'
Percy.snapshot(page, name: 'editing pending crop')
page.percy_snapshot(page, name: 'editing pending crop')
end
end
@@ -358,36 +358,36 @@ rest of the garden.
include_context 'signed in admin'
before { visit admin_path }
it 'admin page' do
Percy.snapshot(page, name: 'Admin')
page.percy_snapshot(page, name: 'Admin')
end
it 'Roles' do
click_link 'Roles'
Percy.snapshot(page, name: 'Admin Roles')
page.percy_snapshot(page, name: 'Admin Roles')
end
it 'CMS' do
click_link 'CMS'
Percy.snapshot(page, name: 'CMS')
page.percy_snapshot(page, name: 'CMS')
end
it 'Garden Types' do
click_link 'Garden Types'
Percy.snapshot(page, name: 'Admin Garden type')
page.percy_snapshot(page, name: 'Admin Garden type')
end
it 'Alternate names' do
click_link 'Alternate names'
Percy.snapshot(page, name: 'Admin Alternate names')
page.percy_snapshot(page, name: 'Admin Alternate names')
end
it 'Scientific names' do
click_link 'Scientific names'
Percy.snapshot(page, name: 'Admin Scientific names')
page.percy_snapshot(page, name: 'Admin Scientific names')
end
it 'Members' do
click_link 'Members'
Percy.snapshot(page, name: 'Admin Members')
page.percy_snapshot(page, name: 'Admin Members')
end
end
it 'api docs' do
visit '/api-docs'
Percy.snapshot(page, name: 'api docs')
page.percy_snapshot(page, name: 'api docs')
end
end

View File

@@ -15,7 +15,7 @@ describe "new photo page" do
click_link('Add photo')
end
expect(page).to have_text planting.crop.name
Percy.snapshot(page, name: 'Add photo to planting')
page.percy_snapshot(page, name: 'Add photo to planting')
end
end

View File

@@ -46,7 +46,7 @@ describe "show photo page" do
before do
garden.photos << photo
visit photo_path(photo)
Percy.snapshot(page, name: 'Show photo of a garden')
page.percy_snapshot(page, name: 'Show photo of a garden')
end
it { expect(page).to have_link "garden named \"#{garden.name}\" by #{garden.owner}", href: garden_path(garden) }

View File

@@ -39,7 +39,7 @@ describe "User searches" do
expect(page).to have_content "Nearby members"
expect(page).to have_content "Seeds available for trade near Philippines"
expect(page).to have_content "Recent plantings near Philippines"
Percy.snapshot(page, name: 'places map')
page.percy_snapshot(page, name: 'places map')
end
it "goes to members' index page" do

View File

@@ -17,7 +17,7 @@
#
# See http://rubydoc.info/gems/rspec-core/RSpec/Core/Configuration
require 'simplecov'
require 'percy'
require 'percy/capybara'
SimpleCov.start

2527
yarn.lock
View File

File diff suppressed because it is too large Load Diff