Merge pull request #3211 from Growstuff/dev

Production release 51
This commit is contained in:
Daniel O'Connor
2023-03-13 12:04:15 +10:30
committed by GitHub
18 changed files with 210 additions and 334 deletions

View File

@@ -92,6 +92,7 @@ submit the change with your pull request.
- André Aubin / [lambda2](https://github.com/lambda2)
- Martina Simicic / [simicic](https://github.com/simicic)
- Rowan Crawford / [wombleton](https://github.com/wombleton)
- Ítalo Pires / [italopires](https://github.com/italopires)
## Bots

View File

@@ -94,7 +94,6 @@ gem "bootstrap_form", ">= 4.5.0"
# For connecting to other services (eg Twitter)
gem 'omniauth', '~> 1.3'
gem 'omniauth-facebook'
gem 'omniauth-flickr', '>= 0.0.15'
gem 'omniauth-twitter'

View File

@@ -1,6 +1,6 @@
GIT
remote: https://github.com/restarone/comfortable-mexican-sofa.git
revision: 456fb8507e9668128529c0302fa2e77e029c1f88
revision: ccf9415ae220453a199759b8ecbb8e9436c75c85
specs:
comfortable_mexican_sofa (2.0.19)
active_link_to (>= 1.0.0)
@@ -26,47 +26,47 @@ GEM
remote: https://rubygems.org/
specs:
abstract_type (0.0.7)
actioncable (7.0.4)
actionpack (= 7.0.4)
activesupport (= 7.0.4)
actioncable (7.0.4.2)
actionpack (= 7.0.4.2)
activesupport (= 7.0.4.2)
nio4r (~> 2.0)
websocket-driver (>= 0.6.1)
actionmailbox (7.0.4)
actionpack (= 7.0.4)
activejob (= 7.0.4)
activerecord (= 7.0.4)
activestorage (= 7.0.4)
activesupport (= 7.0.4)
actionmailbox (7.0.4.2)
actionpack (= 7.0.4.2)
activejob (= 7.0.4.2)
activerecord (= 7.0.4.2)
activestorage (= 7.0.4.2)
activesupport (= 7.0.4.2)
mail (>= 2.7.1)
net-imap
net-pop
net-smtp
actionmailer (7.0.4)
actionpack (= 7.0.4)
actionview (= 7.0.4)
activejob (= 7.0.4)
activesupport (= 7.0.4)
actionmailer (7.0.4.2)
actionpack (= 7.0.4.2)
actionview (= 7.0.4.2)
activejob (= 7.0.4.2)
activesupport (= 7.0.4.2)
mail (~> 2.5, >= 2.5.4)
net-imap
net-pop
net-smtp
rails-dom-testing (~> 2.0)
actionpack (7.0.4)
actionview (= 7.0.4)
activesupport (= 7.0.4)
actionpack (7.0.4.2)
actionview (= 7.0.4.2)
activesupport (= 7.0.4.2)
rack (~> 2.0, >= 2.2.0)
rack-test (>= 0.6.3)
rails-dom-testing (~> 2.0)
rails-html-sanitizer (~> 1.0, >= 1.2.0)
actiontext (7.0.4)
actionpack (= 7.0.4)
activerecord (= 7.0.4)
activestorage (= 7.0.4)
activesupport (= 7.0.4)
actiontext (7.0.4.2)
actionpack (= 7.0.4.2)
activerecord (= 7.0.4.2)
activestorage (= 7.0.4.2)
activesupport (= 7.0.4.2)
globalid (>= 0.6.0)
nokogiri (>= 1.8.5)
actionview (7.0.4)
activesupport (= 7.0.4)
actionview (7.0.4.2)
activesupport (= 7.0.4.2)
builder (~> 3.1)
erubi (~> 1.4)
rails-dom-testing (~> 2.0)
@@ -78,25 +78,25 @@ GEM
activerecord (>= 4.2)
active_record_union (1.3.0)
activerecord (>= 4.0)
active_utils (3.3.19)
active_utils (3.4.0)
activesupport (>= 4.2)
i18n
activejob (7.0.4)
activesupport (= 7.0.4)
activejob (7.0.4.2)
activesupport (= 7.0.4.2)
globalid (>= 0.3.6)
activemodel (7.0.4)
activesupport (= 7.0.4)
activerecord (7.0.4)
activemodel (= 7.0.4)
activesupport (= 7.0.4)
activestorage (7.0.4)
actionpack (= 7.0.4)
activejob (= 7.0.4)
activerecord (= 7.0.4)
activesupport (= 7.0.4)
activemodel (7.0.4.2)
activesupport (= 7.0.4.2)
activerecord (7.0.4.2)
activemodel (= 7.0.4.2)
activesupport (= 7.0.4.2)
activestorage (7.0.4.2)
actionpack (= 7.0.4.2)
activejob (= 7.0.4.2)
activerecord (= 7.0.4.2)
activesupport (= 7.0.4.2)
marcel (~> 1.0)
mini_mime (>= 1.1.0)
activesupport (7.0.4)
activesupport (7.0.4.2)
concurrent-ruby (~> 1.0, >= 1.0.2)
i18n (>= 1.6, < 2)
minitest (>= 5.1)
@@ -113,7 +113,7 @@ GEM
ast (2.4.2)
autoprefixer-rails (10.4.7.0)
execjs (~> 2)
bcrypt (3.1.17)
bcrypt (3.1.18)
better_errors (2.9.1)
coderay (>= 1.0.0)
erubi (>= 1.0.0)
@@ -139,11 +139,11 @@ GEM
actionpack (>= 5.2)
activemodel (>= 5.2)
builder (3.2.4)
bullet (7.0.4)
bullet (7.0.7)
activesupport (>= 3.0.0)
uniform_notifier (~> 1.11)
byebug (11.1.3)
cancancan (3.4.0)
cancancan (3.5.0)
capybara (3.38.0)
addressable
matrix
@@ -167,7 +167,7 @@ GEM
mimemagic (>= 0.3.0)
mini_mime (>= 0.1.3)
ssrf_filter (~> 1.0)
chartkick (4.2.1)
chartkick (5.0.1)
codeclimate-test-reporter (1.0.9)
simplecov (<= 0.13)
coderay (1.1.3)
@@ -183,19 +183,20 @@ GEM
concord (0.1.6)
adamantium (~> 0.2.0)
equalizer (~> 0.0.9)
concurrent-ruby (1.1.10)
concurrent-ruby (1.2.2)
connection_pool (2.3.0)
crass (1.0.6)
csv_shaper (1.3.2)
activesupport (>= 3.0.0)
dalli (3.2.3)
dalli (3.2.4)
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.1)
date (3.3.3)
devise (4.9.0)
bcrypt (~> 3.0)
orm_adapter (~> 0.1)
railties (>= 4.1.0)
@@ -223,7 +224,7 @@ GEM
faraday (~> 1)
multi_json
equalizer (0.0.11)
erubi (1.11.0)
erubi (1.12.0)
erubis (2.7.0)
excon (0.93.1)
execjs (2.8.1)
@@ -232,9 +233,9 @@ GEM
factory_bot_rails (6.2.0)
factory_bot (~> 6.2.0)
railties (>= 5.0.0)
faker (3.0.0)
faker (3.1.1)
i18n (>= 1.8.11, < 2)
faraday (1.10.2)
faraday (1.10.3)
faraday-em_http (~> 1.0)
faraday-em_synchrony (~> 1.0)
faraday-excon (~> 1.1)
@@ -269,7 +270,7 @@ GEM
gibbon (1.2.1)
httparty
multi_json (>= 1.9.0)
globalid (1.0.0)
globalid (1.1.0)
activesupport (>= 5.0)
gravatar-ultimate (2.0.0)
activesupport (>= 2.3.14)
@@ -288,7 +289,7 @@ GEM
activesupport (>= 5.1)
haml (>= 4.0.6)
railties (>= 5.1)
haml_lint (0.43.0)
haml_lint (0.45.0)
haml (>= 4.0, < 6.2)
parallel (~> 1.10)
rainbow
@@ -302,8 +303,8 @@ GEM
multi_json (>= 1.9.2)
webrick
highline (2.0.3)
httparty (0.18.1)
mime-types (~> 3.0)
httparty (0.21.0)
mini_mime (>= 1.0.0)
multi_xml (>= 0.5.2)
i18n (1.12.0)
concurrent-ruby (~> 1.0)
@@ -338,24 +339,26 @@ GEM
concurrent-ruby
railties (>= 4.1)
jsonapi-swagger (0.8.1)
jwt (2.3.0)
kgio (2.11.4)
kramdown (2.4.0)
rexml
launchy (2.5.0)
addressable (~> 2.7)
leaflet-rails (1.9.2)
leaflet-rails (1.9.3)
rails (>= 4.2.0)
letter_opener (1.8.1)
launchy (>= 2.2, < 3)
listen (3.7.1)
listen (3.8.0)
rb-fsevent (~> 0.10, >= 0.10.3)
rb-inotify (~> 0.9, >= 0.9.10)
loofah (2.19.1)
crass (~> 1.0.2)
nokogiri (>= 1.5.9)
mail (2.7.1)
mail (2.8.1)
mini_mime (>= 0.1.1)
net-imap
net-pop
net-smtp
mailboxer (0.15.1)
carrierwave (>= 0.5.8)
rails (>= 5.0.0)
@@ -370,97 +373,84 @@ GEM
memoizable (0.4.2)
thread_safe (~> 0.3, >= 0.3.1)
method_source (1.0.0)
mime-types (3.3.1)
mime-types-data (~> 3.2015)
mime-types-data (3.2020.0512)
mimemagic (0.4.3)
nokogiri (~> 1)
rake
mini_magick (4.11.0)
mini_magick (4.12.0)
mini_mime (1.1.2)
mini_portile2 (2.8.0)
minitest (5.16.3)
mini_portile2 (2.8.1)
minitest (5.17.0)
moneta (1.0.0)
multi_json (1.15.0)
multi_xml (0.6.0)
multipart-post (2.2.3)
net-imap (0.3.1)
net-imap (0.3.4)
date
net-protocol
net-pop (0.1.2)
net-protocol
net-protocol (0.1.3)
net-protocol (0.2.1)
timeout
net-smtp (0.3.3)
net-protocol
nio4r (2.5.8)
nokogiri (1.13.10)
nokogiri (1.14.2)
mini_portile2 (~> 2.8.0)
racc (~> 1.4)
nokogiri (1.13.10-x86_64-linux)
nokogiri (1.14.2-x86_64-linux)
racc (~> 1.4)
oauth (0.5.6)
oauth2 (1.4.9)
faraday (>= 0.17.3, < 3.0)
jwt (>= 1.0, < 3.0)
multi_json (~> 1.3)
multi_xml (~> 0.5)
rack (>= 1.2, < 3)
oj (3.13.23)
oj (3.14.2)
omniauth (1.9.2)
hashie (>= 3.4.6)
rack (>= 1.6.2, < 3)
omniauth-facebook (9.0.0)
omniauth-oauth2 (~> 1.2)
omniauth-flickr (0.0.20)
multi_json (~> 1.12)
omniauth-oauth (~> 1.0)
omniauth-oauth (1.1.0)
oauth
omniauth (~> 1.0)
omniauth-oauth2 (1.7.2)
oauth2 (~> 1.4)
omniauth (>= 1.9, < 3)
omniauth-twitter (1.4.0)
omniauth-oauth (~> 1.1)
rack
orm_adapter (0.5.0)
parallel (1.22.1)
parser (3.1.3.0)
parser (3.2.1.1)
ast (~> 2.4.1)
percy-capybara (5.0.0)
capybara (>= 3)
pg (1.4.5)
pg (1.4.6)
platform-api (3.5.0)
heroics (~> 0.1.1)
moneta (~> 1.0.0)
rate_throttle_client (~> 0.1.0)
popper_js (1.16.1)
public_suffix (5.0.0)
puma (6.0.0)
public_suffix (5.0.1)
puma (6.1.1)
nio4r (~> 2.0)
query_diet (0.7.1)
racc (1.6.1)
rack (2.2.4)
rack-cors (1.1.1)
racc (1.6.2)
rack (2.2.6.3)
rack-cors (2.0.0)
rack (>= 2.0.0)
rack-protection (3.0.4)
rack-protection (3.0.5)
rack
rack-test (2.0.2)
rack (>= 1.3)
rails (7.0.4)
actioncable (= 7.0.4)
actionmailbox (= 7.0.4)
actionmailer (= 7.0.4)
actionpack (= 7.0.4)
actiontext (= 7.0.4)
actionview (= 7.0.4)
activejob (= 7.0.4)
activemodel (= 7.0.4)
activerecord (= 7.0.4)
activestorage (= 7.0.4)
activesupport (= 7.0.4)
rails (7.0.4.2)
actioncable (= 7.0.4.2)
actionmailbox (= 7.0.4.2)
actionmailer (= 7.0.4.2)
actionpack (= 7.0.4.2)
actiontext (= 7.0.4.2)
actionview (= 7.0.4.2)
activejob (= 7.0.4.2)
activemodel (= 7.0.4.2)
activerecord (= 7.0.4.2)
activestorage (= 7.0.4.2)
activesupport (= 7.0.4.2)
bundler (>= 1.15.0)
railties (= 7.0.4)
railties (= 7.0.4.2)
rails-controller-testing (1.0.5)
actionpack (>= 5.0.1.rc1)
actionview (>= 5.0.1.rc1)
@@ -468,9 +458,9 @@ GEM
rails-dom-testing (2.0.3)
activesupport (>= 4.2.0)
nokogiri (>= 1.6)
rails-html-sanitizer (1.4.4)
rails-html-sanitizer (1.5.0)
loofah (~> 2.19, >= 2.19.1)
rails-i18n (7.0.5)
rails-i18n (7.0.6)
i18n (>= 0.7, < 2)
railties (>= 6.0.0, < 8)
rails_12factor (0.0.3)
@@ -478,9 +468,9 @@ GEM
rails_stdout_logging
rails_serve_static_assets (0.0.5)
rails_stdout_logging (0.0.5)
railties (7.0.4)
actionpack (= 7.0.4)
activesupport (= 7.0.4)
railties (7.0.4.2)
actionpack (= 7.0.4.2)
activesupport (= 7.0.4.2)
method_source
rake (>= 12.2)
thor (~> 1.0)
@@ -489,15 +479,15 @@ GEM
raindrops (0.20.0)
rake (13.0.6)
rate_throttle_client (0.1.2)
rb-fsevent (0.11.1)
rb-fsevent (0.11.2)
rb-inotify (0.10.1)
ffi (~> 1.0)
redis-client (0.11.2)
redis-client (0.12.2)
connection_pool
regexp_parser (2.6.1)
responders (3.0.1)
actionpack (>= 5.0)
railties (>= 5.0)
regexp_parser (2.7.0)
responders (3.1.0)
actionpack (>= 5.2)
railties (>= 5.2)
rexml (3.2.5)
rspec (3.11.0)
rspec-core (~> 3.11.0)
@@ -539,25 +529,28 @@ GEM
rswag-ui (2.8.0)
actionpack (>= 3.1, < 7.1)
railties (>= 3.1, < 7.1)
rubocop (1.40.0)
rubocop (1.48.0)
json (~> 2.3)
parallel (~> 1.10)
parser (>= 3.1.2.1)
parser (>= 3.2.0.0)
rainbow (>= 2.2.2, < 4.0)
regexp_parser (>= 1.8, < 3.0)
rexml (>= 3.2.5, < 4.0)
rubocop-ast (>= 1.23.0, < 2.0)
rubocop-ast (>= 1.26.0, < 2.0)
ruby-progressbar (~> 1.7)
unicode-display_width (>= 1.4.0, < 3.0)
rubocop-ast (1.24.0)
parser (>= 3.1.1.0)
rubocop-rails (2.17.3)
unicode-display_width (>= 2.4.0, < 3.0)
rubocop-ast (1.27.0)
parser (>= 3.2.1.0)
rubocop-capybara (2.17.1)
rubocop (~> 1.41)
rubocop-rails (2.18.0)
activesupport (>= 4.2.0)
rack (>= 1.1)
rubocop (>= 1.33.0, < 2.0)
rubocop-rspec (2.16.0)
rubocop-rspec (2.19.0)
rubocop (~> 1.33)
ruby-progressbar (1.11.0)
rubocop-capybara (~> 2.17)
ruby-progressbar (1.13.0)
ruby-units (3.0.0)
ruby-vips (2.1.4)
ffi (~> 1.12)
@@ -584,11 +577,11 @@ GEM
activemodel (>= 5)
elasticsearch (>= 6, < 7.14)
hashie
selenium-webdriver (4.7.1)
selenium-webdriver (4.8.1)
rexml (~> 3.2, >= 3.2.5)
rubyzip (>= 1.2.2, < 3.0)
websocket (~> 1.0)
sidekiq (7.0.2)
sidekiq (7.0.6)
concurrent-ruby (< 2)
connection_pool (>= 2.3.0)
rack (>= 2.2.4)
@@ -608,20 +601,20 @@ GEM
sprockets (>= 3.0.0)
ssrf_filter (1.0.7)
sysexits (1.2.0)
temple (0.9.1)
temple (0.10.0)
terminal-table (3.0.2)
unicode-display_width (>= 1.1.1, < 3)
thor (1.2.1)
thread_safe (0.3.6)
tilt (2.0.11)
tilt (2.1.0)
timecop (0.9.6)
timeout (0.3.0)
timeout (0.3.2)
trollop (1.16.2)
tzinfo (2.0.5)
tzinfo (2.0.6)
concurrent-ruby (~> 1.0)
uglifier (4.2.0)
execjs (>= 0.3.0, < 3)
unicode-display_width (2.3.0)
unicode-display_width (2.4.2)
unicorn (6.1.0)
kgio (~> 2.6)
raindrops (~> 0.7)
@@ -651,7 +644,7 @@ GEM
webrick
xpath (3.2.0)
nokogiri (~> 1.8)
zeitwerk (2.6.6)
zeitwerk (2.6.7)
PLATFORMS
ruby
@@ -716,7 +709,6 @@ DEPENDENCIES
memcachier
oj
omniauth (~> 1.3)
omniauth-facebook
omniauth-flickr (>= 0.0.15)
omniauth-twitter
percy-capybara (~> 5.0.0)

View File

@@ -18,7 +18,6 @@ class MembersController < ApplicationController
@member = Member.confirmed.kept.find_by!(slug: params[:slug])
@twitter_auth = @member.auth('twitter')
@flickr_auth = @member.auth('flickr')
@facebook_auth = @member.auth('facebook')
@posts = @member.posts
@activity = TimelineService.member_query(@member).limit(30)

View File

@@ -9,10 +9,6 @@ require './lib/actions/oauth_signup_action'
# Heavily overlaps with Authentications controller
#
class OmniauthCallbacksController < Devise::OmniauthCallbacksController
def facebook
create
end
def failure
flash[:alert] = "Authentication failed."
redirect_to request.env['omniauth.origin'] || "/"
@@ -32,7 +28,7 @@ class OmniauthCallbacksController < Devise::OmniauthCallbacksController
@authentication = action.establish_authentication(auth, member)
if action.member_created?
raise "Invalid provider" unless %w(facebook twitter flickr).index(auth['provider'].to_s)
raise "Invalid provider" unless %w(twitter flickr).index(auth['provider'].to_s)
session["devise.#{auth['provider']}_data"] = request.env["omniauth.auth"]
sign_in member

View File

@@ -6,7 +6,6 @@ class RegistrationsController < Devise::RegistrationsController
def edit
@twitter_auth = current_member.auth('twitter')
@flickr_auth = current_member.auth('flickr')
@facebook_auth = current_member.auth('facebook')
render "edit"
end

View File

@@ -28,17 +28,3 @@
method: :delete, class: "remove btn btn-danger"
- else
= link_to 'Connect to Flickr', '/members/auth/flickr', class: 'btn'
.row
.col-md-12
%p
= image_tag "facebook_32.png", size: "32x32", alt: 'Facebook logo'
- if @facebook_auth
You are connected to Facebook as
= succeed "." do
= link_to @facebook_auth.name, "https://facebook.com/profile/#{@facebook_auth.uid}"
= link_to "Disconnect", @facebook_auth,
confirm: "Are you sure you want to remove this connection?",
method: :delete, class: "remove btn btn-danger"
- else
= link_to 'Connect to Facebook', '/members/auth/facebook', class: 'btn'

View File

@@ -1,4 +1,4 @@
- if twitter_auth || flickr_auth || facebook_auth || member.show_email
- if twitter_auth || flickr_auth || member.show_email
%h4 Contact
- if twitter_auth
@@ -11,11 +11,6 @@
= image_tag "flickr_32.png", size: "32x32", alt: 'Flickr logo'
= link_to flickr_auth.name, "https://flickr.com/photos/#{flickr_auth.uid}"
- if facebook_auth
%p
= image_tag "facebook_32.png", size: "32x32", alt: 'Facebook logo'
= link_to facebook_auth.name, "https://facebook.com/profile/#{facebook_auth.uid}"
- if member.show_email
%p
Email:

View File

@@ -2,39 +2,39 @@
%h3 Activity
%ul.list-group.list-group-flush
%li.list-group-item
- if !member.gardens.empty?
- if member.gardens.present?
= link_to localize_plural(member.gardens, Garden), member_gardens_path(member)
- else
0 gardens
%li.list-group-item
- if !member.plantings.empty?
- if member.plantings.present?
= link_to localize_plural(member.plantings, Planting), member_plantings_path(member)
- else
0 plantings
%li.list-group-item
- if !member.harvests.empty?
- if member.harvests.present?
= link_to localize_plural(member.harvests, Harvest), member_harvests_path(member)
- else
0 harvests
%li.list-group-item
- if !member.seeds.empty?
- if member.seeds.present?
= link_to localize_plural(member.seeds, Seed), member_seeds_path(member)
- else
0 seeds
%li.list-group-item
- if !member.posts.empty?
- if member.posts.present?
= link_to localize_plural(member.posts, Post), member_posts_path(member)
- else
0 posts
%li.list-group-item
- if !member.followed.empty?
- if member.followed.present?
= link_to localize_plural(member.followed, Follow), member_follows_path(member)
- else
0 following
%li.list-group-item
- if !member.followers.empty?
- if member.followers.present?
= link_to pluralize(member.followers.size, "follower"), member_followers_path(member)
- else
0 followers

View File

@@ -57,8 +57,7 @@
= render "stats", member: @member
.card-footer
= render "contact", member: @member, twitter_auth: @twitter_auth,
flickr_auth: @flickr_auth,
facebook_auth: @facebook_auth
flickr_auth: @flickr_auth
.col-md-10
%section= render "map", member: @member

View File

@@ -104,16 +104,3 @@ Capybara.configure do |config|
end
OmniAuth.config.test_mode = true
# Fake the omniauth
OmniAuth.config.mock_auth[:facebook] = OmniAuth::AuthHash.new(provider: 'facebook',
uid: '123545',
info: {
name: "John Testerson",
nickname: 'JohnnyT',
email: 'example.oauth.facebook@example.com',
image: 'http://findicons.com/files/icons/1072/face_avatars/300/i04.png'
},
credentials: {
token: "token",
secret: "donttell"
})

View File

@@ -233,8 +233,4 @@ Devise.setup do |config|
# When using omniauth, Devise cannot automatically set Omniauth path,
# so you need to do it manually. For the users scope, it would be:
# config.omniauth_path_prefix = "/my_engine/users/auth"
# Later we may wish to ask for user_photos,user_location, however this means we need to be reviewed by facebook
config.omniauth :facebook, ENV['GROWSTUFF_FACEBOOK_KEY'], ENV['GROWSTUFF_FACEBOOK_SECRET'], scope: 'email,public_profile',
display: 'page', info_fields: 'email,name,first_name,last_name,id'
end

View File

@@ -50,10 +50,6 @@ GROWSTUFF_TWITTER_SECRET=""
GROWSTUFF_FLICKR_KEY=""
GROWSTUFF_FLICKR_SECRET=""
# https://developers.facebook.com/
GROWSTUFF_FACEBOOK_KEY=""
GROWSTUFF_FACEBOOK_SECRET=""
# Elasticsearch is used for flexible search and it requires another component
# to be installed. To make it easy for people who don't need to test this feature
# it's been turned off for test and development environment as a default.

View File

@@ -63,7 +63,7 @@ class Growstuff::OauthSignupAction
case auth['provider']
when 'twitter'
auth['info']['nickname']
when 'flickr', 'facebook'
when 'flickr'
auth['info']['name']
else
auth['info']['name']

View File

@@ -82,28 +82,4 @@ describe "signin", js: true do
click_button 'Sign in'
expect(page).to have_content("There are crops waiting to be wrangled.")
end
context "with facebook" do
it "sign in" do
# Ordinarily done by database_cleaner
Member.where(login_name: 'tdawg').delete_all
create(:member, login_name: 'tdawg', email: 'example.oauth.facebook@example.com')
# Start the test
visit root_path
first('.signup a').click
# Click the signup with facebook link
first('a[href="/members/auth/facebook"]').click
# Magic happens!
# See config/environments/test.rb for the fake user
# that we pretended to auth as
# Signed up and logged in
expect(page).to have_current_path root_path, ignore_query: true
expect(page.text).to include("Welcome to #{ENV['GROWSTUFF_SITE_NAME']}, tdawg")
end
end
end

View File

@@ -45,37 +45,4 @@ describe "signup", js: true do
click_button 'Sign up'
expect(page).to have_current_path members_path, ignore_query: true
end
context "with facebook" do
it "sign up" do
# Ordinarily done by database_cleaner
Member.where(login_name: 'tdawg').delete_all
Member.where(email: 'tdawg@hotmail.com').delete_all
Member.where(email: 'example.oauth.facebook@example.com').delete_all
Authentication.where(provider: 'facebook', uid: '123545').delete_all
# Start the test
visit root_path
first('.signup a').click
# Click the signup with facebook link
first('a[href="/members/auth/facebook"]').click
# Magic happens!
# See config/environments/test.rb for the fake user
# that we pretended to auth as
# Confirm page
expect(page).to have_current_path '/members/johnnyt/finish_signup'
fill_in 'Login name', with: 'tdawg'
fill_in 'Email', with: 'tdawg@hotmail.com'
check 'member_tos_agreement'
click_button 'Continue'
# Signed up and logged in
expect(page).to have_current_path root_path, ignore_query: true
expect(page.text).to include("Welcome to #{ENV['GROWSTUFF_SITE_NAME']}, tdawg")
end
end
end

View File

@@ -18,7 +18,9 @@ describe "scientific_names/edit" do
expect(rendered).to have_content "Added by #{member} less than a minute ago."
end
xit { expect(rendered).to have_link member_path(member) }
it "render member link" do
expect(rendered).to have_link member.login_name, href: member_path(member)
end
it "renders the edit scientific_name form" do
assert_select "form", action: scientific_names_path(scientific_name), method: "post" do

View File

@@ -92,13 +92,6 @@
"type": "string",
"description": "Display field",
"required": false
},
{
"name": "fields[crops]",
"in": "query",
"type": "string",
"description": "Display field",
"required": false
}
],
"responses": {
@@ -132,32 +125,32 @@
"name": {
"type": "string",
"x-nullable": false,
"description": null
"description": "Name"
},
"en_wikipedia_url": {
"type": "string",
"x-nullable": true,
"description": null
"description": "Wikipedia URL (English)"
},
"perennial": {
"type": "boolean",
"x-nullable": true,
"description": null
"description": "Is the item perennial? (A plant that lives more than two years)"
},
"median_lifespan": {
"type": "integer",
"x-nullable": true,
"description": null
"description": "Median lifespan"
},
"median_days_to_first_harvest": {
"type": "integer",
"x-nullable": true,
"description": null
"description": "Median days to first harvest"
},
"median_days_to_last_harvest": {
"type": "integer",
"x-nullable": true,
"description": null
"description": "Median days to last harvest"
}
},
"description": "Attributes"
@@ -371,13 +364,6 @@
"type": "string",
"description": "Display field",
"required": false
},
{
"name": "fields[crops]",
"in": "query",
"type": "string",
"description": "Display field",
"required": false
}
],
"responses": {
@@ -413,32 +399,32 @@
"name": {
"type": "string",
"x-nullable": false,
"description": null
"description": "Name"
},
"en_wikipedia_url": {
"type": "string",
"x-nullable": true,
"description": null
"description": "Wikipedia URL (English)"
},
"perennial": {
"type": "boolean",
"x-nullable": true,
"description": null
"description": "Is the item perennial? (A plant that lives more than two years)"
},
"median_lifespan": {
"type": "integer",
"x-nullable": true,
"description": null
"description": "Median lifespan"
},
"median_days_to_first_harvest": {
"type": "integer",
"x-nullable": true,
"description": null
"description": "Median days to first harvest"
},
"median_days_to_last_harvest": {
"type": "integer",
"x-nullable": true,
"description": null
"description": "Median days to last harvest"
}
},
"description": "Attributes"
@@ -666,7 +652,7 @@
"name": {
"type": "string",
"x-nullable": false,
"description": null
"description": "Name"
}
},
"description": "Attributes"
@@ -868,7 +854,7 @@
"name": {
"type": "string",
"x-nullable": false,
"description": null
"description": "Name"
}
},
"description": "Attributes"
@@ -1084,12 +1070,12 @@
"login_name": {
"type": "string",
"x-nullable": true,
"description": null
"description": "Login name"
},
"slug": {
"type": "string",
"x-nullable": true,
"description": null
"description": "Slug"
}
},
"description": "Attributes"
@@ -1345,12 +1331,12 @@
"login_name": {
"type": "string",
"x-nullable": true,
"description": null
"description": "Login name"
},
"slug": {
"type": "string",
"x-nullable": true,
"description": null
"description": "Slug"
}
},
"description": "Attributes"
@@ -1585,32 +1571,32 @@
"harvested_at": {
"type": "string",
"x-nullable": true,
"description": null
"description": "Harvested date time"
},
"description": {
"type": "string",
"x-nullable": true,
"description": null
"description": "Description"
},
"unit": {
"type": "string",
"x-nullable": true,
"description": null
"description": "Unit"
},
"weight_quantity": {
"type": "string",
"x-nullable": true,
"description": null
"description": "Weight/Quanitity"
},
"weight_unit": {
"type": "string",
"x-nullable": true,
"description": null
"description": "Weight Unit"
},
"si_weight": {
"type": "string",
"x-nullable": true,
"description": null
"description": "SI Weight"
}
},
"description": "Attributes"
@@ -1839,32 +1825,32 @@
"harvested_at": {
"type": "string",
"x-nullable": true,
"description": null
"description": "Harvested datetime"
},
"description": {
"type": "string",
"x-nullable": true,
"description": null
"description": "Description"
},
"unit": {
"type": "string",
"x-nullable": true,
"description": null
"description": "Unit"
},
"weight_quantity": {
"type": "string",
"x-nullable": true,
"description": null
"description": "Weight/Quantity"
},
"weight_unit": {
"type": "string",
"x-nullable": true,
"description": null
"description": "Weight Unit"
},
"si_weight": {
"type": "string",
"x-nullable": true,
"description": null
"description": "SI Weight"
}
},
"description": "Attributes"
@@ -2065,47 +2051,47 @@
"description": {
"type": "string",
"x-nullable": true,
"description": null
"description": "Description"
},
"quantity": {
"type": "integer",
"x-nullable": true,
"description": null
"description": "Quanitity"
},
"plant_before": {
"type": "string",
"x-nullable": true,
"description": null
"description": "Plant before"
},
"tradable_to": {
"type": "string",
"x-nullable": true,
"description": null
"description": "Tradeable to"
},
"days_until_maturity_min": {
"type": "integer",
"x-nullable": true,
"description": null
"description": "Days until maturity (min)"
},
"days_until_maturity_max": {
"type": "integer",
"x-nullable": true,
"description": null
"description": "Days until maturity (max)"
},
"organic": {
"type": "string",
"x-nullable": true,
"description": null
"description": "Organic"
},
"gmo": {
"type": "string",
"x-nullable": true,
"description": null
"description": "GMO"
},
"heirloom": {
"type": "string",
"x-nullable": true,
"description": null
"description": "Heirloom"
}
},
"description": "Attributes"
@@ -2280,47 +2266,47 @@
"description": {
"type": "string",
"x-nullable": true,
"description": null
"description": "Description"
},
"quantity": {
"type": "integer",
"x-nullable": true,
"description": null
"description": "Quanity"
},
"plant_before": {
"type": "string",
"x-nullable": true,
"description": null
"description": "Plant before"
},
"tradable_to": {
"type": "string",
"x-nullable": true,
"description": null
"description": "Tradable to"
},
"days_until_maturity_min": {
"type": "integer",
"x-nullable": true,
"description": null
"description": "Days until maturity (min)"
},
"days_until_maturity_max": {
"type": "integer",
"x-nullable": true,
"description": null
"description": "Days until maturity (max)"
},
"organic": {
"type": "string",
"x-nullable": true,
"description": null
"description": "Organic"
},
"gmo": {
"type": "string",
"x-nullable": true,
"description": null
"description": "GMO"
},
"heirloom": {
"type": "string",
"x-nullable": true,
"description": null
"description": "Heirloom"
}
},
"description": "Attributes"
@@ -2537,42 +2523,42 @@
"slug": {
"type": "string",
"x-nullable": true,
"description": null
"description": "Slug"
},
"planted_at": {
"type": "string",
"x-nullable": true,
"description": null
"description": "Planted at"
},
"finished": {
"type": "boolean",
"x-nullable": false,
"description": null
"description": "Finished?"
},
"finished_at": {
"type": "string",
"x-nullable": true,
"description": null
"description": "Finished at"
},
"quantity": {
"type": "integer",
"x-nullable": true,
"description": null
"description": "Quanity"
},
"description": {
"type": "string",
"x-nullable": true,
"description": null
"description": "Description"
},
"sunniness": {
"type": "string",
"x-nullable": true,
"description": null
"description": "Sunniness"
},
"planted_from": {
"type": "string",
"x-nullable": true,
"description": null
"description": "Planted from"
}
},
"description": "Attributes"
@@ -2801,42 +2787,42 @@
"slug": {
"type": "string",
"x-nullable": true,
"description": null
"description": "Slug"
},
"planted_at": {
"type": "string",
"x-nullable": true,
"description": null
"description": "Planted at"
},
"finished": {
"type": "boolean",
"x-nullable": false,
"description": null
"description": "Finished?"
},
"finished_at": {
"type": "string",
"x-nullable": true,
"description": null
"description": "Finished at"
},
"quantity": {
"type": "integer",
"x-nullable": true,
"description": null
"description": "Quantity"
},
"description": {
"type": "string",
"x-nullable": true,
"description": null
"description": "Description"
},
"sunniness": {
"type": "string",
"x-nullable": true,
"description": null
"description": "Sunniness"
},
"planted_from": {
"type": "string",
"x-nullable": true,
"description": null
"description": "Planted from"
}
},
"description": "Attributes"
@@ -3051,27 +3037,27 @@
"thumbnail_url": {
"type": "string",
"x-nullable": false,
"description": null
"description": "Thumbnail URL"
},
"fullsize_url": {
"type": "string",
"x-nullable": false,
"description": null
"description": "Full-size URL"
},
"license_name": {
"type": "string",
"x-nullable": false,
"description": null
"description": "License name"
},
"link_url": {
"type": "string",
"x-nullable": false,
"description": null
"description": "Link URL"
},
"title": {
"type": "string",
"x-nullable": false,
"description": null
"description": "Title"
}
},
"description": "Attributes"
@@ -3300,27 +3286,27 @@
"thumbnail_url": {
"type": "string",
"x-nullable": false,
"description": null
"description": "Thumbnail URL"
},
"fullsize_url": {
"type": "string",
"x-nullable": false,
"description": null
"description": "Full-size URL"
},
"license_name": {
"type": "string",
"x-nullable": false,
"description": null
"description": "License name"
},
"link_url": {
"type": "string",
"x-nullable": false,
"description": null
"description": "Link URL"
},
"title": {
"type": "string",
"x-nullable": false,
"description": null
"description": "Title"
}
},
"description": "Attributes"