From 93bc5255e7d6671582eb05a87312722466780467 Mon Sep 17 00:00:00 2001 From: Daniel O'Connor Date: Fri, 21 Aug 2015 11:21:30 +0930 Subject: [PATCH 001/268] #645 Add facebook omniauth provider --- Gemfile | 1 + Gemfile.lock | 13 +++++++++++++ 2 files changed, 14 insertions(+) diff --git a/Gemfile b/Gemfile index 0f712add6..4efdbd936 100644 --- a/Gemfile +++ b/Gemfile @@ -81,6 +81,7 @@ gem 'bootstrap-datepicker-rails' gem 'omniauth' gem 'omniauth-twitter' gem 'omniauth-flickr', '>= 0.0.15' +gem 'omniauth-facebook' # client for Elasticsearch. Elasticsearch is a flexible # and powerful, distributed, real-time search and analytics engine. diff --git a/Gemfile.lock b/Gemfile.lock index b68e62dbe..2913c6601 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -239,6 +239,7 @@ GEM railties (>= 3.2) sprockets-rails json (1.8.3) + jwt (1.5.1) kaminari (0.16.3) actionpack (>= 3.0.0) activesupport (>= 3.0.0) @@ -283,14 +284,25 @@ GEM nenv (~> 0.1) shellany (~> 0.0) oauth (0.4.7) + oauth2 (1.0.0) + faraday (>= 0.8, < 0.10) + jwt (~> 1.0) + multi_json (~> 1.3) + multi_xml (~> 0.5) + rack (~> 1.2) omniauth (1.2.2) hashie (>= 1.2, < 4) rack (~> 1.0) + omniauth-facebook (2.0.1) + omniauth-oauth2 (~> 1.2) omniauth-flickr (0.0.15) omniauth-oauth (~> 1.0) omniauth-oauth (1.0.1) oauth omniauth (~> 1.0) + omniauth-oauth2 (1.3.1) + oauth2 (~> 1.0) + omniauth (~> 1.2) omniauth-twitter (1.1.0) multi_json (~> 1.3) omniauth-oauth (~> 1.0) @@ -492,6 +504,7 @@ DEPENDENCIES memcachier newrelic_rpm omniauth + omniauth-facebook omniauth-flickr (>= 0.0.15) omniauth-twitter pg From c7f0076ee6116c3877cebb9b77dc804fbc7d9d0d Mon Sep 17 00:00:00 2001 From: Daniel O'Connor Date: Fri, 21 Aug 2015 11:21:44 +0930 Subject: [PATCH 002/268] #645 Add facebook omniauth middleware --- config/initializers/omniauth.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/config/initializers/omniauth.rb b/config/initializers/omniauth.rb index 160efb102..dab64ff11 100644 --- a/config/initializers/omniauth.rb +++ b/config/initializers/omniauth.rb @@ -1,4 +1,5 @@ Rails.application.config.middleware.use OmniAuth::Builder do provider :twitter, ENV['GROWSTUFF_TWITTER_KEY'], ENV['GROWSTUFF_TWITTER_SECRET'] provider :flickr, ENV['GROWSTUFF_FLICKR_KEY'], ENV['GROWSTUFF_FLICKR_SECRET'] + provider :facebook, ENV['FACEBOOK_KEY'], ENV['FACEBOOK_SECRET'] end From 07eb3059929b9bce3d2a85f4aa9215f47122517e Mon Sep 17 00:00:00 2001 From: Daniel O'Connor Date: Fri, 21 Aug 2015 11:25:57 +0930 Subject: [PATCH 003/268] #645 Ask for name, email address only --- config/initializers/omniauth.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/initializers/omniauth.rb b/config/initializers/omniauth.rb index dab64ff11..867c46e98 100644 --- a/config/initializers/omniauth.rb +++ b/config/initializers/omniauth.rb @@ -1,5 +1,5 @@ Rails.application.config.middleware.use OmniAuth::Builder do provider :twitter, ENV['GROWSTUFF_TWITTER_KEY'], ENV['GROWSTUFF_TWITTER_SECRET'] provider :flickr, ENV['GROWSTUFF_FLICKR_KEY'], ENV['GROWSTUFF_FLICKR_SECRET'] - provider :facebook, ENV['FACEBOOK_KEY'], ENV['FACEBOOK_SECRET'] + provider :facebook, ENV['FACEBOOK_KEY'], ENV['FACEBOOK_SECRET'], :scope => 'name,email', :display => 'popup' end From dee7ff34c94d3f34c1765a579db5225fadcf13a6 Mon Sep 17 00:00:00 2001 From: Daniel O'Connor Date: Fri, 21 Aug 2015 11:36:04 +0930 Subject: [PATCH 004/268] #645 Indicate that a member is omniauthable, so devise knows to render sign-in-with-facebook --- app/models/member.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/models/member.rb b/app/models/member.rb index a8af799b1..566b03166 100644 --- a/app/models/member.rb +++ b/app/models/member.rb @@ -46,7 +46,7 @@ class Member < ActiveRecord::Base # :lockable, :timeoutable and :omniauthable devise :database_authenticatable, :registerable, :recoverable, :rememberable, :trackable, :validatable, - :confirmable, :lockable, :timeoutable + :confirmable, :lockable, :timeoutable, :omniauthable # set up geocoding geocoded_by :location From 22d72b13d55a4e0347dad4014df34197dfeb8e02 Mon Sep 17 00:00:00 2001 From: Daniel O'Connor Date: Fri, 21 Aug 2015 11:36:17 +0930 Subject: [PATCH 005/268] #645 Add example keys --- config/application.yml.example | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/config/application.yml.example b/config/application.yml.example index 03e8afe2c..d002c63f2 100644 --- a/config/application.yml.example +++ b/config/application.yml.example @@ -62,6 +62,10 @@ GROWSTUFF_PAYPAL_USERNAME: "dummy" GROWSTUFF_PAYPAL_PASSWORD: "dummy" GROWSTUFF_PAYPAL_SIGNATURE: "dummy" +# 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. From df5689ec18e9a51b2d36b58a7a83588f6d75e613 Mon Sep 17 00:00:00 2001 From: Daniel O'Connor Date: Fri, 21 Aug 2015 11:36:26 +0930 Subject: [PATCH 006/268] #645 Rename --- config/initializers/omniauth.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/initializers/omniauth.rb b/config/initializers/omniauth.rb index 867c46e98..88b8b6cd4 100644 --- a/config/initializers/omniauth.rb +++ b/config/initializers/omniauth.rb @@ -1,5 +1,5 @@ Rails.application.config.middleware.use OmniAuth::Builder do provider :twitter, ENV['GROWSTUFF_TWITTER_KEY'], ENV['GROWSTUFF_TWITTER_SECRET'] provider :flickr, ENV['GROWSTUFF_FLICKR_KEY'], ENV['GROWSTUFF_FLICKR_SECRET'] - provider :facebook, ENV['FACEBOOK_KEY'], ENV['FACEBOOK_SECRET'], :scope => 'name,email', :display => 'popup' + provider :facebook, ENV['GROWSTUFF_FACEBOOK_KEY'], ENV['GROWSTUFF_FACEBOOK_SECRET'], :scope => 'name,email', :display => 'popup' end From 70f48108b45dc2a1caad063cb27cbaf54495429e Mon Sep 17 00:00:00 2001 From: Daniel O'Connor Date: Fri, 21 Aug 2015 12:21:23 +0930 Subject: [PATCH 007/268] #645 Add handling for facebook --- app/controllers/authentications_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/authentications_controller.rb b/app/controllers/authentications_controller.rb index 9a873bebb..3116eca73 100644 --- a/app/controllers/authentications_controller.rb +++ b/app/controllers/authentications_controller.rb @@ -12,7 +12,7 @@ class AuthenticationsController < ApplicationController case auth['provider'] when 'twitter' name = auth['info']['nickname'] - when 'flickr' + when 'flickr', 'facebook' name = auth['info']['name'] else name = auth['info']['name'] From 89b6c47bfb88b71d0b995d81c5a7f2ad950185dc Mon Sep 17 00:00:00 2001 From: Daniel O'Connor Date: Fri, 21 Aug 2015 12:21:55 +0930 Subject: [PATCH 008/268] #645 Configure devise / omniauth in only one spot, to avoid CSRF errors --- config/initializers/devise.rb | 1 + config/initializers/omniauth.rb | 1 - 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/config/initializers/devise.rb b/config/initializers/devise.rb index 801a6677f..85136c5df 100644 --- a/config/initializers/devise.rb +++ b/config/initializers/devise.rb @@ -231,4 +231,5 @@ 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" + config.omniauth :facebook, ENV['GROWSTUFF_FACEBOOK_KEY'], ENV['GROWSTUFF_FACEBOOK_SECRET'], :scope => 'email', :display => 'popup' end diff --git a/config/initializers/omniauth.rb b/config/initializers/omniauth.rb index 88b8b6cd4..160efb102 100644 --- a/config/initializers/omniauth.rb +++ b/config/initializers/omniauth.rb @@ -1,5 +1,4 @@ Rails.application.config.middleware.use OmniAuth::Builder do provider :twitter, ENV['GROWSTUFF_TWITTER_KEY'], ENV['GROWSTUFF_TWITTER_SECRET'] provider :flickr, ENV['GROWSTUFF_FLICKR_KEY'], ENV['GROWSTUFF_FLICKR_SECRET'] - provider :facebook, ENV['GROWSTUFF_FACEBOOK_KEY'], ENV['GROWSTUFF_FACEBOOK_SECRET'], :scope => 'name,email', :display => 'popup' end From 34b4d300144e088cc8fb45ecb44d243c8d42e482 Mon Sep 17 00:00:00 2001 From: Daniel O'Connor Date: Fri, 21 Aug 2015 13:22:49 +0930 Subject: [PATCH 009/268] #645 Enable account creation or authorisation from a facebook signin (and should work for others with minimal extra work) --- .../omniauth_callbacks_controller.rb | 90 +++++++++++++++++++ config/initializers/devise.rb | 2 +- config/routes.rb | 2 +- 3 files changed, 92 insertions(+), 2 deletions(-) create mode 100644 app/controllers/omniauth_callbacks_controller.rb diff --git a/app/controllers/omniauth_callbacks_controller.rb b/app/controllers/omniauth_callbacks_controller.rb new file mode 100644 index 000000000..6cfc98cc0 --- /dev/null +++ b/app/controllers/omniauth_callbacks_controller.rb @@ -0,0 +1,90 @@ +# +# Handle signup or signin +# from various oauth providers +# +# Heavily overlaps with Authentications controller +# +class OmniauthCallbacksController < Devise::OmniauthCallbacksController + def facebook + create + end + def failure + redirect_to request.env['omniauth.origin'] || "/", :flash => {:error => ":("} + end + + private + + # + # Inspects the omniauth information + # and determines if we have an existing member + # (to add authentication to) + # or if this is a new signup + # + # As a side affect, this method sets the @member_created + # variable + # + def member + @member_created = false + + auth = request.env['omniauth.auth'] + + authentication = Authentication.where(provider: auth.provider, uid: auth.uid).first + if authentication && authentication.member.id.present? + member = authentication.member + end + + Member.where(email: auth.info.email).first_or_create do |m| + m.email = auth.info.email + m.password = Devise.friendly_token[0,20] + m.tos_agreement = true + m.login_name = Devise.friendly_token[0,20] # TODO: A better login name to generate + + # m.name = auth.info.name # assuming the user model has a name + # m.image = auth.info.image # assuming the user model has an image + @member_created = true + end + + member + end + + def create + auth = request.env['omniauth.auth'] + @authentication = nil + if auth + + name = '' + case auth['provider'] + when 'twitter' + name = auth['info']['nickname'] + when 'flickr', 'facebook' + name = auth['info']['name'] + else + name = auth['info']['name'] + end + + @authentication = member.authentications + .create_with( + :name => name, + :token => auth['credentials']['token'], + :secret => auth['credentials']['secret'], + ) + .find_or_create_by( + :provider => auth['provider'], + :uid => auth['uid'], + :name => name, + :member_id => member.id + ) + + unless @member_created + sign_in_and_redirect member, :event => :authentication #this will throw if @user is not activated + set_flash_message(:notice, :success, :kind => auth['provider']) if is_navigational_format? + else + session["devise.#{auth['provider']}_data"] = request.env["omniauth.auth"] + redirect_to new_member_registration_url + end + else + flash[:notice] = "Authentication failed." + redirect_to request.env['omniauth.origin'] || edit_member_registration_path + end + end +end \ No newline at end of file diff --git a/config/initializers/devise.rb b/config/initializers/devise.rb index 85136c5df..f372c9190 100644 --- a/config/initializers/devise.rb +++ b/config/initializers/devise.rb @@ -231,5 +231,5 @@ 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" - config.omniauth :facebook, ENV['GROWSTUFF_FACEBOOK_KEY'], ENV['GROWSTUFF_FACEBOOK_SECRET'], :scope => 'email', :display => 'popup' + config.omniauth :facebook, ENV['GROWSTUFF_FACEBOOK_KEY'], ENV['GROWSTUFF_FACEBOOK_SECRET'], :scope => 'email,read_stream', :display => 'page', :info_fields => 'nickname,email,name' end diff --git a/config/routes.rb b/config/routes.rb index 1aa7e772a..9c45749d3 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -4,7 +4,7 @@ Growstuff::Application.routes.draw do resources :plant_parts - devise_for :members, :controllers => { :registrations => "registrations", :passwords => "passwords" } + devise_for :members, :controllers => { :registrations => "registrations", :passwords => "passwords", :omniauth_callbacks => "omniauth_callbacks" } devise_scope :member do get '/members/unsubscribe/:message' => 'members#unsubscribe', :as => 'unsubscribe_member' end From 3a05f75ab0b30c0ea22617407837e281e1b91b9c Mon Sep 17 00:00:00 2001 From: Daniel O'Connor Date: Fri, 21 Aug 2015 13:43:24 +0930 Subject: [PATCH 010/268] #645 Add notes around permissions/scopes of later interest --- config/initializers/devise.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/config/initializers/devise.rb b/config/initializers/devise.rb index f372c9190..a3bc77373 100644 --- a/config/initializers/devise.rb +++ b/config/initializers/devise.rb @@ -231,5 +231,7 @@ 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" - config.omniauth :facebook, ENV['GROWSTUFF_FACEBOOK_KEY'], ENV['GROWSTUFF_FACEBOOK_SECRET'], :scope => 'email,read_stream', :display => 'page', :info_fields => 'nickname,email,name' + + # 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 From 86e9cd0ec60812393b716710473bd7c394b268a3 Mon Sep 17 00:00:00 2001 From: Daniel O'Connor Date: Fri, 21 Aug 2015 13:43:58 +0930 Subject: [PATCH 011/268] #645 Improve error handling and login_name generation. Annoyingly still a change of collisions. --- app/controllers/omniauth_callbacks_controller.rb | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/app/controllers/omniauth_callbacks_controller.rb b/app/controllers/omniauth_callbacks_controller.rb index 6cfc98cc0..de265cf8e 100644 --- a/app/controllers/omniauth_callbacks_controller.rb +++ b/app/controllers/omniauth_callbacks_controller.rb @@ -9,7 +9,8 @@ class OmniauthCallbacksController < Devise::OmniauthCallbacksController create end def failure - redirect_to request.env['omniauth.origin'] || "/", :flash => {:error => ":("} + flash[:error] = "Authentication failed." + redirect_to request.env['omniauth.origin'] || "/" end private @@ -33,16 +34,21 @@ class OmniauthCallbacksController < Devise::OmniauthCallbacksController member = authentication.member end - Member.where(email: auth.info.email).first_or_create do |m| + member = Member.where(email: auth.info.email).first_or_create do |m| m.email = auth.info.email m.password = Devise.friendly_token[0,20] m.tos_agreement = true - m.login_name = Devise.friendly_token[0,20] # TODO: A better login name to generate + # TODO This has a reasonable chance of collision + m.login_name = auth.info.nickname || auth.info.email.split("@").first.gsub(/[^A-Za-z]+/, '_').underscore - # m.name = auth.info.name # assuming the user model has a name + m.skip_confirmation! + + # TODO Assess this later, if we introduce separate modelling for user photos # m.image = auth.info.image # assuming the user model has an image + @member_created = true end + member.save! member end @@ -83,7 +89,6 @@ class OmniauthCallbacksController < Devise::OmniauthCallbacksController redirect_to new_member_registration_url end else - flash[:notice] = "Authentication failed." redirect_to request.env['omniauth.origin'] || edit_member_registration_path end end From ec597d4e6ed676c98e585765d9da40cbf287be9f Mon Sep 17 00:00:00 2001 From: Daniel O'Connor Date: Mon, 24 Aug 2015 11:23:41 +0930 Subject: [PATCH 012/268] #645 Fix minor logic error --- app/controllers/omniauth_callbacks_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/omniauth_callbacks_controller.rb b/app/controllers/omniauth_callbacks_controller.rb index de265cf8e..f1af891f1 100644 --- a/app/controllers/omniauth_callbacks_controller.rb +++ b/app/controllers/omniauth_callbacks_controller.rb @@ -34,7 +34,7 @@ class OmniauthCallbacksController < Devise::OmniauthCallbacksController member = authentication.member end - member = Member.where(email: auth.info.email).first_or_create do |m| + member ||= Member.where(email: auth.info.email).first_or_create do |m| m.email = auth.info.email m.password = Devise.friendly_token[0,20] m.tos_agreement = true From 9a68c7e1c3fa57081786d4ab7feb4b1a87c73bfe Mon Sep 17 00:00:00 2001 From: Daniel O'Connor Date: Mon, 24 Aug 2015 11:41:36 +0930 Subject: [PATCH 013/268] #645 Add a 'finish signup' flow --- app/controllers/members_controller.rb | 14 +++++++- .../omniauth_callbacks_controller.rb | 8 +++++ app/views/members/finish_signup.haml | 33 +++++++++++++++++++ config/routes.rb | 1 + 4 files changed, 55 insertions(+), 1 deletion(-) create mode 100644 app/views/members/finish_signup.haml diff --git a/app/controllers/members_controller.rb b/app/controllers/members_controller.rb index 013ae44de..73bdcc45e 100644 --- a/app/controllers/members_controller.rb +++ b/app/controllers/members_controller.rb @@ -70,10 +70,22 @@ class MembersController < ApplicationController end end + def finish_signup + @member = current_member + if request.patch? && params[:member] + if @member.update(params[:member]) + @member.skip_reconfirmation! + sign_in(@member, :bypass => true) + redirect_to @member, notice: 'Your profile was successfully updated.' + else + @show_errors = true + end + end + end + private def expire_cache_fragments expire_fragment("homepage_stats") end - end diff --git a/app/controllers/omniauth_callbacks_controller.rb b/app/controllers/omniauth_callbacks_controller.rb index f1af891f1..8c0e44509 100644 --- a/app/controllers/omniauth_callbacks_controller.rb +++ b/app/controllers/omniauth_callbacks_controller.rb @@ -92,4 +92,12 @@ class OmniauthCallbacksController < Devise::OmniauthCallbacksController redirect_to request.env['omniauth.origin'] || edit_member_registration_path end end + + def after_sign_in_path_for(resource) + if resource.email_verified? + super resource + else + finish_signup_path(resource) + end + end end \ No newline at end of file diff --git a/app/views/members/finish_signup.haml b/app/views/members/finish_signup.haml new file mode 100644 index 000000000..d629a09b3 --- /dev/null +++ b/app/views/members/finish_signup.haml @@ -0,0 +1,33 @@ +- content_for :title, "Join Growstuff" + +%p Sign up for a Growstuff account to track your veggie garden and connect with other local growers. + += form_for(current_member, :as => 'member', :url => finish_signup_path(current_member), :html => { role: 'form'}) do |f| %> + - if @show_errors && current_member.errors.any? + #error_explanation + - current_member.errors.full_messages.each do |msg| + = msg + %br + .form-group + = f.label :email + .controls + = f.text_field :email, :autofocus => true, :value => '', class: 'form-control input-lg', placeholder: 'Example: email@me.com' + %p.help-block Please confirm your email address. + + .form-group + .col-md-offset-2.col-md-8.checkbox + %label + = f.check_box :tos_agreement + I agree to the + = succeed "." do + = link_to 'Terms of Service', url_for(:action => 'tos', :controller => '/policy') + .form-group + .col-md-offset-2.col-md-8.checkbox + %label + = f.check_box :newsletter, :checked => true + Subscribe to the #{ENV['GROWSTUFF_SITE_NAME']} newsletter + .help-inline + = render :partial => 'newsletter_blurb' + + %div.actions + = f.submit 'Continue', :class => 'btn btn-primary' \ No newline at end of file diff --git a/config/routes.rb b/config/routes.rb index 9c45749d3..7205c4abb 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -8,6 +8,7 @@ Growstuff::Application.routes.draw do devise_scope :member do get '/members/unsubscribe/:message' => 'members#unsubscribe', :as => 'unsubscribe_member' end + match '/members/:id/finish_signup' => 'members#finish_signup', via: [:get, :patch], :as => :finish_signup resources :members From 994296640b6581c2bb77e8a7a3d477a22524d21e Mon Sep 17 00:00:00 2001 From: Daniel O'Connor Date: Mon, 24 Aug 2015 16:20:39 +0930 Subject: [PATCH 014/268] #645 Implement all of finish signup, fix an edge case of an authentication without a member, fix error messages on failed oauth. --- app/controllers/members_controller.rb | 11 ++++++++--- app/controllers/omniauth_callbacks_controller.rb | 8 ++++---- app/models/member.rb | 3 +-- app/views/members/finish_signup.haml | 15 +++++++++++---- 4 files changed, 24 insertions(+), 13 deletions(-) diff --git a/app/controllers/members_controller.rb b/app/controllers/members_controller.rb index 73bdcc45e..0d0b085e2 100644 --- a/app/controllers/members_controller.rb +++ b/app/controllers/members_controller.rb @@ -1,7 +1,7 @@ class MembersController < ApplicationController load_and_authorize_resource - skip_authorize_resource :only => [:nearby, :unsubscribe] + skip_authorize_resource :only => [:nearby, :unsubscribe, :finish_signup] after_action :expire_cache_fragments, :only => :create @@ -73,11 +73,12 @@ class MembersController < ApplicationController def finish_signup @member = current_member if request.patch? && params[:member] - if @member.update(params[:member]) + if @member.update(member_params) @member.skip_reconfirmation! sign_in(@member, :bypass => true) - redirect_to @member, notice: 'Your profile was successfully updated.' + redirect_to root_path, notice: 'Welcome.' else + flash[:alert] = 'Failed to complete signup' @show_errors = true end end @@ -88,4 +89,8 @@ class MembersController < ApplicationController def expire_cache_fragments expire_fragment("homepage_stats") end + + def member_params + params.require(:member).permit(:login_name, :tos_agreement, :email, :newsletter) + end end diff --git a/app/controllers/omniauth_callbacks_controller.rb b/app/controllers/omniauth_callbacks_controller.rb index 8c0e44509..02b37ed84 100644 --- a/app/controllers/omniauth_callbacks_controller.rb +++ b/app/controllers/omniauth_callbacks_controller.rb @@ -9,7 +9,7 @@ class OmniauthCallbacksController < Devise::OmniauthCallbacksController create end def failure - flash[:error] = "Authentication failed." + flash[:alert] = "Authentication failed." redirect_to request.env['omniauth.origin'] || "/" end @@ -30,14 +30,14 @@ class OmniauthCallbacksController < Devise::OmniauthCallbacksController auth = request.env['omniauth.auth'] authentication = Authentication.where(provider: auth.provider, uid: auth.uid).first - if authentication && authentication.member.id.present? + if authentication && authentication.member && authentication.member.id.present? member = authentication.member end member ||= Member.where(email: auth.info.email).first_or_create do |m| m.email = auth.info.email m.password = Devise.friendly_token[0,20] - m.tos_agreement = true + # TODO This has a reasonable chance of collision m.login_name = auth.info.nickname || auth.info.email.split("@").first.gsub(/[^A-Za-z]+/, '_').underscore @@ -94,7 +94,7 @@ class OmniauthCallbacksController < Devise::OmniauthCallbacksController end def after_sign_in_path_for(resource) - if resource.email_verified? + if resource.tos_agreement super resource else finish_signup_path(resource) diff --git a/app/models/member.rb b/app/models/member.rb index 566b03166..058af2a62 100644 --- a/app/models/member.rb +++ b/app/models/member.rb @@ -58,7 +58,7 @@ class Member < ActiveRecord::Base attr_accessor :login # Requires acceptance of the Terms of Service - validates_acceptance_of :tos_agreement, :allow_nil => false, + validates_acceptance_of :tos_agreement, :allow_nil => true, :accept => true validates :login_name, @@ -262,5 +262,4 @@ class Member < ActiveRecord::Base def get_follow(member) self.follows.where(:followed_id => member.id).first if already_following?(member) end - end diff --git a/app/views/members/finish_signup.haml b/app/views/members/finish_signup.haml index d629a09b3..54aa22b4b 100644 --- a/app/views/members/finish_signup.haml +++ b/app/views/members/finish_signup.haml @@ -2,16 +2,23 @@ %p Sign up for a Growstuff account to track your veggie garden and connect with other local growers. -= form_for(current_member, :as => 'member', :url => finish_signup_path(current_member), :html => { role: 'form'}) do |f| %> += form_for(current_member, :as => 'member', :url => finish_signup_path(current_member), :html => { role: 'form'}) do |f| - if @show_errors && current_member.errors.any? - #error_explanation + %div.alert.alert-danger - current_member.errors.full_messages.each do |msg| = msg %br + + .form-group + = f.label :login_name + .controls + = f.text_field :login_name, :autofocus => true, class: 'form-control input-lg' + %p.help-block Choose a login name + .form-group = f.label :email .controls - = f.text_field :email, :autofocus => true, :value => '', class: 'form-control input-lg', placeholder: 'Example: email@me.com' + = f.text_field :email, class: 'form-control input-lg', placeholder: 'Example: email@me.com' %p.help-block Please confirm your email address. .form-group @@ -27,7 +34,7 @@ = f.check_box :newsletter, :checked => true Subscribe to the #{ENV['GROWSTUFF_SITE_NAME']} newsletter .help-inline - = render :partial => 'newsletter_blurb' + = render :partial => 'devise/registrations/newsletter_blurb' %div.actions = f.submit 'Continue', :class => 'btn btn-primary' \ No newline at end of file From 9564866f6d8bd5ebcf23d12ea61a63d1a2bedeb8 Mon Sep 17 00:00:00 2001 From: Daniel O'Connor Date: Mon, 24 Aug 2015 17:33:28 +0930 Subject: [PATCH 015/268] #645 Avoid collisions by using a 20 character random string as a fallback --- app/controllers/omniauth_callbacks_controller.rb | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/app/controllers/omniauth_callbacks_controller.rb b/app/controllers/omniauth_callbacks_controller.rb index 02b37ed84..fd1991042 100644 --- a/app/controllers/omniauth_callbacks_controller.rb +++ b/app/controllers/omniauth_callbacks_controller.rb @@ -38,9 +38,13 @@ class OmniauthCallbacksController < Devise::OmniauthCallbacksController m.email = auth.info.email m.password = Devise.friendly_token[0,20] - # TODO This has a reasonable chance of collision + # First, try the nickname or friendly generate from the email m.login_name = auth.info.nickname || auth.info.email.split("@").first.gsub(/[^A-Za-z]+/, '_').underscore + # Do we have a collision with an existing account? Generate a 20 character long random name + # so the user can update it later + m.login_name = Devise.friendly_token[0,20] if Member.where(login_name: m.login_name).any? + m.skip_confirmation! # TODO Assess this later, if we introduce separate modelling for user photos From 20b89f0d2f01e89854431d8c36b9efdf601437a9 Mon Sep 17 00:00:00 2001 From: Daniel O'Connor Date: Thu, 27 Aug 2015 11:22:34 +0930 Subject: [PATCH 016/268] #556 Default to the oauth provided image on account creation --- app/controllers/omniauth_callbacks_controller.rb | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/app/controllers/omniauth_callbacks_controller.rb b/app/controllers/omniauth_callbacks_controller.rb index fd1991042..216f710f0 100644 --- a/app/controllers/omniauth_callbacks_controller.rb +++ b/app/controllers/omniauth_callbacks_controller.rb @@ -44,11 +44,9 @@ class OmniauthCallbacksController < Devise::OmniauthCallbacksController # Do we have a collision with an existing account? Generate a 20 character long random name # so the user can update it later m.login_name = Devise.friendly_token[0,20] if Member.where(login_name: m.login_name).any? - + m.preferred_avatar_uri = auth.info.image # assuming the user model has an image m.skip_confirmation! - # TODO Assess this later, if we introduce separate modelling for user photos - # m.image = auth.info.image # assuming the user model has an image @member_created = true end From 4983a6dfb3c0dcd4a030c6c83d092124331c4643 Mon Sep 17 00:00:00 2001 From: Daniel O'Connor Date: Thu, 27 Aug 2015 11:42:36 +0930 Subject: [PATCH 017/268] #556 Improve user avatar sizing --- app/helpers/application_helper.rb | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index d8470392d..bf0943c50 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -43,7 +43,20 @@ module ApplicationHelper # Falls back to Gravatar # def avatar_uri(member, size = 150) - return member.preferred_avatar_uri if member.preferred_avatar_uri.present? + if member.preferred_avatar_uri.present? + # Some avatars support different sizes + # http://graph.facebook.com/12345678/picture?width=150&height=150 + uri = URI.parse(member.preferred_avatar_uri) + + if uri.host == 'graph.facebook.com' + uri.query = "&width=#{size}&height=#{size}" + end + + # TODO: Assess twitter - https://dev.twitter.com/overview/general/user-profile-images-and-banners + # TODO: Assess flickr - https://www.flickr.com/services/api/misc.buddyicons.html + + return uri.to_s + end Gravatar.new(member.email).image_url({ :size => size, From f6790a5f9bfa6f88b1e3ed9fbadae4b66cc7329a Mon Sep 17 00:00:00 2001 From: Daniel O'Connor Date: Thu, 27 Aug 2015 11:52:49 +0930 Subject: [PATCH 018/268] #556 When an avatar is set from an oauth provider, don't encourage the user to update gravatar. --- .../devise/registrations/_edit_profile.html.haml | 11 ++++++----- app/views/support/index.html.haml | 4 +++- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/app/views/devise/registrations/_edit_profile.html.haml b/app/views/devise/registrations/_edit_profile.html.haml index aa3ad0ced..003cdbe1e 100644 --- a/app/views/devise/registrations/_edit_profile.html.haml +++ b/app/views/devise/registrations/_edit_profile.html.haml @@ -18,11 +18,12 @@ Profile picture .col-md-8 = render :partial => "members/avatar", :locals => { :member => @member } - %p - %br/ - To change your profile picture, visit - = succeed "." do - = link_to 'gravatar.com', "http://gravatar.com/" + - unless @member.preferred_avatar_uri.present? + %p + %br/ + To change your profile picture, visit + = succeed "." do + = link_to 'gravatar.com', "http://gravatar.com/" .form-group .form-actions.col-md-offset-2.col-md-8 diff --git a/app/views/support/index.html.haml b/app/views/support/index.html.haml index 2b64fd000..19194b197 100644 --- a/app/views/support/index.html.haml +++ b/app/views/support/index.html.haml @@ -61,7 +61,9 @@ ### How do I add a picture to my profile? - Profile pictures are provided [Gravatar](http://gravatar.com Gravatar), a service that provides "Globally Recognised Avatars", run by the people who operate the Wordpress blogging platform. + If you registered via Facebook, we keep in sync with your profile. + + Otherwise, profile pictures are provided by [Gravatar](http://gravatar.com Gravatar), a service that provides "Globally Recognised Avatars", run by the people who operate the Wordpress blogging platform. If you have ever signed up for Gravatar in the past, using the same address as you signed up for Growstuff, you will already have a picture for your profile. From dafee90b24dae88939c8aaba3266c311dd93f8a9 Mon Sep 17 00:00:00 2001 From: Daniel O'Connor Date: Thu, 27 Aug 2015 11:56:37 +0930 Subject: [PATCH 019/268] #645 #556 Add facebook auth management --- app/controllers/registrations_controller.rb | 1 + app/views/devise/registrations/_edit_apps.html.haml | 12 ++++++++++++ 2 files changed, 13 insertions(+) diff --git a/app/controllers/registrations_controller.rb b/app/controllers/registrations_controller.rb index c4883bd4d..7cfe01390 100644 --- a/app/controllers/registrations_controller.rb +++ b/app/controllers/registrations_controller.rb @@ -3,6 +3,7 @@ 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 diff --git a/app/views/devise/registrations/_edit_apps.html.haml b/app/views/devise/registrations/_edit_apps.html.haml index 6445c0bc0..e4d49c9ef 100644 --- a/app/views/devise/registrations/_edit_apps.html.haml +++ b/app/views/devise/registrations/_edit_apps.html.haml @@ -25,3 +25,15 @@ = link_to "Disconnect", @flickr_auth, :confirm => "Are you sure you want to remove this connection?", :method => :delete, :class => "remove" - else =link_to 'Connect to Flickr', '/auth/flickr' + + .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, "http://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" + - else + =link_to 'Connect to Facebook', '/auth/facebook' \ No newline at end of file From afec210219c4ab9127304e9610e9f3fe3fa12380 Mon Sep 17 00:00:00 2001 From: Daniel O'Connor Date: Thu, 27 Aug 2015 12:02:48 +0930 Subject: [PATCH 020/268] #645 #556 Add facebook links --- app/controllers/members_controller.rb | 9 +++++---- app/views/members/_contact.html.haml | 7 ++++++- app/views/members/show.html.haml | 2 +- 3 files changed, 12 insertions(+), 6 deletions(-) diff --git a/app/controllers/members_controller.rb b/app/controllers/members_controller.rb index 0d0b085e2..3fa6604bb 100644 --- a/app/controllers/members_controller.rb +++ b/app/controllers/members_controller.rb @@ -20,10 +20,11 @@ class MembersController < ApplicationController end def show - @member = Member.confirmed.find(params[:id]) - @twitter_auth = @member.auth('twitter') - @flickr_auth = @member.auth('flickr') - @posts = @member.posts + @member = Member.confirmed.find(params[:id]) + @twitter_auth = @member.auth('twitter') + @flickr_auth = @member.auth('flickr') + @facebook_auth = @member.auth('facebook') + @posts = @member.posts # The garden form partial is called from the "New Garden" tab; # it requires a garden to be passed in @garden. # The new garden is not persisted unless Garden#save is called. diff --git a/app/views/members/_contact.html.haml b/app/views/members/_contact.html.haml index e5d24327b..714bf5a92 100644 --- a/app/views/members/_contact.html.haml +++ b/app/views/members/_contact.html.haml @@ -1,4 +1,4 @@ -- if twitter_auth || flickr_auth || member.show_email +- if twitter_auth || flickr_auth || facebook_auth || member.show_email %h4 Contact - if twitter_auth @@ -11,6 +11,11 @@ = image_tag "flickr_32.png", :size => "32x32", :alt => 'Flickr logo' =link_to flickr_auth.name, "http://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, "http://facebook.com/profile/#{facebook_auth.uid}" + - if member.show_email %p Email: diff --git a/app/views/members/show.html.haml b/app/views/members/show.html.haml index 591c2be77..b55d56987 100644 --- a/app/views/members/show.html.haml +++ b/app/views/members/show.html.haml @@ -30,4 +30,4 @@ = render :partial => "avatar", :locals => { :member => @member } = render :partial => "account", :locals => { :member => @member } = render :partial => "stats", :locals => { :member => @member } - = render :partial => "contact", :locals => { :member => @member, :twitter_auth => @twitter_auth, :flickr_auth => @flickr_auth } + = render :partial => "contact", :locals => { :member => @member, :twitter_auth => @twitter_auth, :flickr_auth => @flickr_auth, :facebook_auth => @facebook_auth } From 8a739b31a12994ca54455877d10dd34c7ab99fac Mon Sep 17 00:00:00 2001 From: Daniel O'Connor Date: Thu, 27 Aug 2015 12:18:09 +0930 Subject: [PATCH 021/268] Minor style --- app/controllers/registrations_controller.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/controllers/registrations_controller.rb b/app/controllers/registrations_controller.rb index 7cfe01390..190bc3b19 100644 --- a/app/controllers/registrations_controller.rb +++ b/app/controllers/registrations_controller.rb @@ -1,9 +1,9 @@ class RegistrationsController < Devise::RegistrationsController def edit - @twitter_auth = current_member.auth('twitter') - @flickr_auth = current_member.auth('flickr') - @facebook_auth = current_member.auth('facebook') + @twitter_auth = current_member.auth('twitter') + @flickr_auth = current_member.auth('flickr') + @facebook_auth = current_member.auth('facebook') render "edit" end From 00ca01dc33a2076fc1e697ae66b969ac5148098f Mon Sep 17 00:00:00 2001 From: Daniel O'Connor Date: Tue, 15 Sep 2015 11:20:33 +0930 Subject: [PATCH 022/268] Add coverage of the most basic scenarios around sign up and login --- config/environments/test.rb | 17 +++++++++++++++++ spec/features/signin_spec.rb | 24 ++++++++++++++++++++++++ spec/features/signup_spec.rb | 30 ++++++++++++++++++++++++++++++ 3 files changed, 71 insertions(+) diff --git a/config/environments/test.rb b/config/environments/test.rb index c5c05f8d5..e02b27ce1 100644 --- a/config/environments/test.rb +++ b/config/environments/test.rb @@ -105,3 +105,20 @@ Geocoder::Lookup::Test.add_stub( "Tatooine", []) Capybara.configure do |config| config.always_include_port = true 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" + } +}) \ No newline at end of file diff --git a/spec/features/signin_spec.rb b/spec/features/signin_spec.rb index 4b9220a11..761f0dc93 100644 --- a/spec/features/signin_spec.rb +++ b/spec/features/signin_spec.rb @@ -50,4 +50,28 @@ feature "signin", :js => true do click_button 'Sign in' expect(current_path).to eq new_notification_path end + + context "with facebook" do + scenario "sign in" do + # Ordinarily done by database_cleaner + Member.where(login_name: 'tdawg').delete_all + + member = 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(current_path).to eq root_path + expect(page.text).to include("Welcome to Growstuff (test), tdawg") + end + end end diff --git a/spec/features/signup_spec.rb b/spec/features/signup_spec.rb index 1160f9efb..096af7c37 100644 --- a/spec/features/signup_spec.rb +++ b/spec/features/signup_spec.rb @@ -44,4 +44,34 @@ feature "signup", :js => true do click_button 'Sign up' expect(current_path).to eq members_path end + + context "with facebook" do + scenario "sign up" do + # Ordinarily done by database_cleaner + Member.where(login_name: 'tdawg').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(current_path).to eq '/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(current_path).to eq root_path + expect(page.text).to include("Welcome to Growstuff (test), tdawg") + end + end end From 021cb4f93bd9bf0c4c5cf673f671633f5897acd3 Mon Sep 17 00:00:00 2001 From: Daniel O'Connor Date: Tue, 15 Sep 2015 11:38:20 +0930 Subject: [PATCH 023/268] Use #{ENV['GROWSTUFF_SITE_NAME']} --- spec/features/signin_spec.rb | 2 +- spec/features/signup_spec.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/spec/features/signin_spec.rb b/spec/features/signin_spec.rb index 761f0dc93..f36ee01aa 100644 --- a/spec/features/signin_spec.rb +++ b/spec/features/signin_spec.rb @@ -71,7 +71,7 @@ feature "signin", :js => true do # Signed up and logged in expect(current_path).to eq root_path - expect(page.text).to include("Welcome to Growstuff (test), tdawg") + expect(page.text).to include("Welcome to #{ENV['GROWSTUFF_SITE_NAME']}, tdawg") end end end diff --git a/spec/features/signup_spec.rb b/spec/features/signup_spec.rb index 096af7c37..5d3751a99 100644 --- a/spec/features/signup_spec.rb +++ b/spec/features/signup_spec.rb @@ -71,7 +71,7 @@ feature "signup", :js => true do # Signed up and logged in expect(current_path).to eq root_path - expect(page.text).to include("Welcome to Growstuff (test), tdawg") + expect(page.text).to include("Welcome to #{ENV['GROWSTUFF_SITE_NAME']}, tdawg") end end end From 7256c28038356aef3248b76d1b519c2c96688f57 Mon Sep 17 00:00:00 2001 From: Daniel O'Connor Date: Tue, 15 Sep 2015 12:13:47 +0930 Subject: [PATCH 024/268] Refactor to a separate class, containing domain logic --- .../omniauth_callbacks_controller.rb | 71 ++---------------- lib/actions/oauth_signup_action.rb | 70 ++++++++++++++++++ spec/lib/actions/oauth_signup_action_spec.rb | 72 +++++++++++++++++++ 3 files changed, 149 insertions(+), 64 deletions(-) create mode 100644 lib/actions/oauth_signup_action.rb create mode 100644 spec/lib/actions/oauth_signup_action_spec.rb diff --git a/app/controllers/omniauth_callbacks_controller.rb b/app/controllers/omniauth_callbacks_controller.rb index 216f710f0..13df37c22 100644 --- a/app/controllers/omniauth_callbacks_controller.rb +++ b/app/controllers/omniauth_callbacks_controller.rb @@ -1,3 +1,5 @@ +require './lib/actions/oauth_signup_action' + # # Handle signup or signin # from various oauth providers @@ -15,75 +17,16 @@ class OmniauthCallbacksController < Devise::OmniauthCallbacksController private - # - # Inspects the omniauth information - # and determines if we have an existing member - # (to add authentication to) - # or if this is a new signup - # - # As a side affect, this method sets the @member_created - # variable - # - def member - @member_created = false - - auth = request.env['omniauth.auth'] - - authentication = Authentication.where(provider: auth.provider, uid: auth.uid).first - if authentication && authentication.member && authentication.member.id.present? - member = authentication.member - end - - member ||= Member.where(email: auth.info.email).first_or_create do |m| - m.email = auth.info.email - m.password = Devise.friendly_token[0,20] - - # First, try the nickname or friendly generate from the email - m.login_name = auth.info.nickname || auth.info.email.split("@").first.gsub(/[^A-Za-z]+/, '_').underscore - - # Do we have a collision with an existing account? Generate a 20 character long random name - # so the user can update it later - m.login_name = Devise.friendly_token[0,20] if Member.where(login_name: m.login_name).any? - m.preferred_avatar_uri = auth.info.image # assuming the user model has an image - m.skip_confirmation! - - - @member_created = true - end - member.save! - - member - end - def create auth = request.env['omniauth.auth'] + action = Growstuff::OauthSignupAction.new + @authentication = nil if auth + member = action.find_or_create_from_authorization(auth) + @authentication = action.establish_authentication(auth, member) - name = '' - case auth['provider'] - when 'twitter' - name = auth['info']['nickname'] - when 'flickr', 'facebook' - name = auth['info']['name'] - else - name = auth['info']['name'] - end - - @authentication = member.authentications - .create_with( - :name => name, - :token => auth['credentials']['token'], - :secret => auth['credentials']['secret'], - ) - .find_or_create_by( - :provider => auth['provider'], - :uid => auth['uid'], - :name => name, - :member_id => member.id - ) - - unless @member_created + unless action.member_created? sign_in_and_redirect member, :event => :authentication #this will throw if @user is not activated set_flash_message(:notice, :success, :kind => auth['provider']) if is_navigational_format? else diff --git a/lib/actions/oauth_signup_action.rb b/lib/actions/oauth_signup_action.rb new file mode 100644 index 000000000..144af6002 --- /dev/null +++ b/lib/actions/oauth_signup_action.rb @@ -0,0 +1,70 @@ +class Growstuff::OauthSignupAction + + # + # Inspects the omniauth information + # and determines if we have an existing member + # (to add authentication to) + # or if this is a new signup + # + # As a side affect, this method sets the @member_created + # variable + # + def find_or_create_from_authorization(auth) + member ||= Member.where(email: auth.info.email).first_or_create do |m| + m.email = auth.info.email + m.password = Devise.friendly_token[0,20] + + # First, try the nickname or friendly generate from the email + m.login_name = auth.info.nickname || auth.info.email.split("@").first.gsub(/[^A-Za-z]+/, '_').underscore + + # Do we have a collision with an existing account? Generate a 20 character long random name + # so the user can update it later + m.login_name = Devise.friendly_token[0,20] if Member.where(login_name: m.login_name).any? + m.preferred_avatar_uri = auth.info.image # assuming the user model has an image + m.skip_confirmation! + + @member_created = true + end + + member.save! + + member + end + + # + # For a given auth hash (from omniauth), and a specified member + # See if: + # - The member already has this authentication or + # - We need to create it + # + def establish_authentication(auth, member) + name = '' + case auth['provider'] + when 'twitter' + name = auth['info']['nickname'] + when 'flickr', 'facebook' + name = auth['info']['name'] + else + name = auth['info']['name'] + end + + authentication = member.authentications + .create_with( + :name => name, + :token => auth['credentials']['token'], + :secret => auth['credentials']['secret'], + ) + .find_or_create_by( + :provider => auth['provider'], + :uid => auth['uid'], + :name => name, + :member_id => member.id + ) + + authentication + end + + def member_created? + @member_created + end +end \ No newline at end of file diff --git a/spec/lib/actions/oauth_signup_action_spec.rb b/spec/lib/actions/oauth_signup_action_spec.rb new file mode 100644 index 000000000..345e04c18 --- /dev/null +++ b/spec/lib/actions/oauth_signup_action_spec.rb @@ -0,0 +1,72 @@ +require 'rails_helper' +require './lib/actions/oauth_signup_action' + +describe 'Growstuff::OauthSignupAction' do + before :each do + @action = Growstuff::OauthSignupAction.new + end + + context 'with a valid authentication' do + before :each do + @auth = 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" + } + }) + end + + context 'no existing user' do + before :each do + @auth['info']['email'] = 'no.existing.user@gmail.com' + + Member.where(email: @auth['info']['email']).delete_all + + @member = @action.find_or_create_from_authorization(@auth) + @authentication = @action.establish_authentication(@auth, @member) + end + it 'should create a new user' do + expect(@action.member_created?).to eq true + end + + it 'should set the right email' do + expect(@member.email).to eq @auth['info']['email'] + end + + it 'should generate a login_name' do + expect(@member.login_name).to eq 'JohnnyT' + end + + it 'should set an avatar' do + expect(@member.preferred_avatar_uri).to eq @auth['info']['image'] + end + + it 'should generate a random password' do + expect(@member.password).not_to eq nil + end + + it 'should not agree to the tos' + + it 'should store the uid and provider for the member' do + expect(@authentication.member.id).to eq @member.id + expect(@authentication.provider).to eq 'facebook' + expect(@authentication.uid).to eq '123545' + end + end + + context 'an existing user' do + context 'who has never used oauth' do + end + context 'who has used oauth' do + end + end + end +end \ No newline at end of file From dc983d4863857eabaf835ae980e6c666bba38222 Mon Sep 17 00:00:00 2001 From: Daniel O'Connor Date: Tue, 15 Sep 2015 12:24:37 +0930 Subject: [PATCH 025/268] Add more coverage of various scenarios and expected behaviours --- spec/lib/actions/oauth_signup_action_spec.rb | 76 ++++++++++++++++++++ 1 file changed, 76 insertions(+) diff --git a/spec/lib/actions/oauth_signup_action_spec.rb b/spec/lib/actions/oauth_signup_action_spec.rb index 345e04c18..318b285bd 100644 --- a/spec/lib/actions/oauth_signup_action_spec.rb +++ b/spec/lib/actions/oauth_signup_action_spec.rb @@ -64,8 +64,84 @@ describe 'Growstuff::OauthSignupAction' do context 'an existing user' do context 'who has never used oauth' do + before :each do + @auth['info']['email'] = 'never.used.oauth@yahoo.com' + + Member.where(email: @auth['info']['email']).delete_all + @existing_member = create :member, { + email: @auth['info']['email'], + login_name: 'existing', + preferred_avatar_uri: 'http://cl.jroo.me/z3/W/H/K/e/a.baa-very-cool-hat-you-.jpg' + } + + @member = @action.find_or_create_from_authorization(@auth) + @authentication = @action.establish_authentication(@auth, @member) + end + + it 'should not create a new user' do + expect(@action.member_created?).to eq nil + end + + it 'should locate the existing member by email' do + expect(@member.id).to eq @existing_member.id + end + + it 'should not generate a login_name' do + expect(@member.login_name).to eq 'existing' + end + + it 'should not change the avatar' do + expect(@member.preferred_avatar_uri).to eq 'http://cl.jroo.me/z3/W/H/K/e/a.baa-very-cool-hat-you-.jpg' + end + + it 'should store the uid and provider for the member' do + expect(@authentication.member.id).to eq @member.id + expect(@authentication.provider).to eq 'facebook' + expect(@authentication.uid).to eq '123545' + end end + context 'who has used oauth' do + before :each do + @auth['info']['email'] = 'i.used.oauth.once@coolemail.com' + + Member.where(email: @auth['info']['email']).delete_all + + @existing_member = create :member, { + email: @auth['info']['email'], + login_name: 'schrodingerscat', + preferred_avatar_uri: 'http://cl.jroo.me/z3/W/H/K/e/a.baa-very-cool-hat-you-.jpg' + } + + @existing_authentication = @existing_member.authentications.create({ + provider: 'facebook', + uid: '123545', + member_id: @existing_member.id + }) + + @member = @action.find_or_create_from_authorization(@auth) + @authentication = @action.establish_authentication(@auth, @member) + end + + it 'should not create a new user' do + expect(@action.member_created?).to eq nil + end + + it 'should locate the existing member by uid and provider' do + expect(@member.id).to eq @existing_member.id + end + + it 'should not generate a login_name' do + expect(@member.login_name).to eq 'schrodingerscat' + end + + it 'should not change the avatar' do + expect(@member.preferred_avatar_uri).to eq 'http://cl.jroo.me/z3/W/H/K/e/a.baa-very-cool-hat-you-.jpg' + end + + it 'should locate the existing uid and provider for the member' do + expect(@authentication.id).to eq @existing_authentication.id + end end end end From 222f875c42cb28c8c8bb16821a4a7356ea9af7d1 Mon Sep 17 00:00:00 2001 From: Daniel O'Connor Date: Tue, 15 Sep 2015 12:26:32 +0930 Subject: [PATCH 026/268] Add more coverage of various scenarios and expected behaviours --- spec/lib/actions/oauth_signup_action_spec.rb | 2 ++ 1 file changed, 2 insertions(+) diff --git a/spec/lib/actions/oauth_signup_action_spec.rb b/spec/lib/actions/oauth_signup_action_spec.rb index 318b285bd..2a6f35b4a 100644 --- a/spec/lib/actions/oauth_signup_action_spec.rb +++ b/spec/lib/actions/oauth_signup_action_spec.rb @@ -106,6 +106,7 @@ describe 'Growstuff::OauthSignupAction' do @auth['info']['email'] = 'i.used.oauth.once@coolemail.com' Member.where(email: @auth['info']['email']).delete_all + Authentication.delete_all @existing_member = create :member, { email: @auth['info']['email'], @@ -116,6 +117,7 @@ describe 'Growstuff::OauthSignupAction' do @existing_authentication = @existing_member.authentications.create({ provider: 'facebook', uid: '123545', + name: 'John Testerson', member_id: @existing_member.id }) From a99145b705d7e6f36f11981453bb63b63b0fe83e Mon Sep 17 00:00:00 2001 From: Daniel O'Connor Date: Tue, 15 Sep 2015 12:27:17 +0930 Subject: [PATCH 027/268] Implement pending spec --- spec/lib/actions/oauth_signup_action_spec.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/spec/lib/actions/oauth_signup_action_spec.rb b/spec/lib/actions/oauth_signup_action_spec.rb index 2a6f35b4a..204904e88 100644 --- a/spec/lib/actions/oauth_signup_action_spec.rb +++ b/spec/lib/actions/oauth_signup_action_spec.rb @@ -53,7 +53,9 @@ describe 'Growstuff::OauthSignupAction' do expect(@member.password).not_to eq nil end - it 'should not agree to the tos' + it 'should not agree to the tos' do + expect(@member.tos_agreement).to eq nil + end it 'should store the uid and provider for the member' do expect(@authentication.member.id).to eq @member.id From 0652c40c521e448ca54cae91661c1b4aa64d113d Mon Sep 17 00:00:00 2001 From: Daniel O'Connor Date: Tue, 15 Sep 2015 12:34:20 +0930 Subject: [PATCH 028/268] Avoid test data conflicts causing signup to act as signin-for-existing --- spec/lib/actions/oauth_signup_action_spec.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/spec/lib/actions/oauth_signup_action_spec.rb b/spec/lib/actions/oauth_signup_action_spec.rb index 204904e88..fc9d0f9e6 100644 --- a/spec/lib/actions/oauth_signup_action_spec.rb +++ b/spec/lib/actions/oauth_signup_action_spec.rb @@ -12,8 +12,8 @@ describe 'Growstuff::OauthSignupAction' do 'provider' => 'facebook', 'uid' => '123545', 'info' => { - 'name' => "John Testerson", - 'nickname' => 'JohnnyT', + 'name' => "John Testerson's Brother", + 'nickname' => 'JohnnyB', 'email' => 'example.oauth.facebook@example.com', 'image' => 'http://findicons.com/files/icons/1072/face_avatars/300/i04.png' }, From 4a1bc9f6c05916d18f967645a5b43906d588f94c Mon Sep 17 00:00:00 2001 From: Daniel O'Connor Date: Tue, 15 Sep 2015 12:44:12 +0930 Subject: [PATCH 029/268] Avoid test data conflicts and update expectations --- spec/features/signup_spec.rb | 2 ++ spec/lib/actions/oauth_signup_action_spec.rb | 23 ++++++++++++++++++-- 2 files changed, 23 insertions(+), 2 deletions(-) diff --git a/spec/features/signup_spec.rb b/spec/features/signup_spec.rb index 5d3751a99..2da40334b 100644 --- a/spec/features/signup_spec.rb +++ b/spec/features/signup_spec.rb @@ -49,6 +49,8 @@ feature "signup", :js => true do scenario "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 # Start the test visit root_path diff --git a/spec/lib/actions/oauth_signup_action_spec.rb b/spec/lib/actions/oauth_signup_action_spec.rb index fc9d0f9e6..2495368dd 100644 --- a/spec/lib/actions/oauth_signup_action_spec.rb +++ b/spec/lib/actions/oauth_signup_action_spec.rb @@ -33,6 +33,12 @@ describe 'Growstuff::OauthSignupAction' do @member = @action.find_or_create_from_authorization(@auth) @authentication = @action.establish_authentication(@auth, @member) end + + after :each do + @member.delete + @authentication.delete + end + it 'should create a new user' do expect(@action.member_created?).to eq true end @@ -42,7 +48,7 @@ describe 'Growstuff::OauthSignupAction' do end it 'should generate a login_name' do - expect(@member.login_name).to eq 'JohnnyT' + expect(@member.login_name).to eq 'JohnnyB' end it 'should set an avatar' do @@ -80,6 +86,12 @@ describe 'Growstuff::OauthSignupAction' do @authentication = @action.establish_authentication(@auth, @member) end + after :each do + @existing_member.delete + @member.delete + @authentication.delete + end + it 'should not create a new user' do expect(@action.member_created?).to eq nil end @@ -119,7 +131,7 @@ describe 'Growstuff::OauthSignupAction' do @existing_authentication = @existing_member.authentications.create({ provider: 'facebook', uid: '123545', - name: 'John Testerson', + name: "John Testerson's Brother", member_id: @existing_member.id }) @@ -127,6 +139,13 @@ describe 'Growstuff::OauthSignupAction' do @authentication = @action.establish_authentication(@auth, @member) end + after :each do + @existing_member.delete + @member.delete + @existing_authentication.delete + @authentication.delete + end + it 'should not create a new user' do expect(@action.member_created?).to eq nil end From f81666da5eb699796db13e93497b751f3c63af45 Mon Sep 17 00:00:00 2001 From: Daniel O'Connor Date: Tue, 15 Sep 2015 12:58:35 +0930 Subject: [PATCH 030/268] And cleanup authentications --- spec/features/signup_spec.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/spec/features/signup_spec.rb b/spec/features/signup_spec.rb index 2da40334b..df1cd45fb 100644 --- a/spec/features/signup_spec.rb +++ b/spec/features/signup_spec.rb @@ -51,6 +51,7 @@ feature "signup", :js => true do 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 From 93f9435fb95c7d955f2b34c873d97c0ac3130c6a Mon Sep 17 00:00:00 2001 From: Jim Stallings Date: Sat, 19 Sep 2015 16:24:01 -0400 Subject: [PATCH 031/268] GS-658: sort locale keys, add rake task for it --- config/locales/en.yml | 254 +++++++++++++++++++----------------------- config/locales/ja.yml | 4 +- lib/tasks/i18n.rake | 6 + 3 files changed, 124 insertions(+), 140 deletions(-) create mode 100644 lib/tasks/i18n.rake diff --git a/config/locales/en.yml b/config/locales/en.yml index 8d77afdc8..30b7c2f4f 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -1,153 +1,131 @@ -# Sample localization file for English. Add more files in this directory for other locales. -# See https://github.com/svenfuchs/rails-i18n/tree/master/rails%2Flocale for starting points. - +--- en: - unauthorized: - read: - notification: "You must be signed in to view notifications." - create: - 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." - notification: "Please sign in to send a message." - all: "Please sign in or sign up to create a %{subject}." - manage: - all: "Not authorized to %{action} %{subject}." - - layouts: - header: - skip: "Skip navigation menu" - browse_crops: &browse_crops "Browse Crops" - seeds: "Seeds" - plantings: "Plantings" - harvests: "Harvests" - community_map: "Community Map" - browse_members: "Browse Members" - posts: "Posts" - forums: &forums "Forums" - support_growstuff: "Support Growstuff" - profile: "Profile" - gardens: "Gardens" - account: "Account" - inbox_unread: "Inbox (%{unread_count})" - inbox: "Inbox" - crop_wrangling: "Crop Wrangling" - admin: "Admin" - your_stuff: "Your Stuff (%{unread_count})" - crops: index: - title: *browse_crops subtitle: "%{crops_size} total" - - seeds: + title: Browse Crops + forums: index: - title: - default: "Everyone's seeds" - crop_seeds: "Everyone's %{crop} seeds" - owner_seeds: "%{owner} seeds" - - plantings: - index: - title: - default: "Everyone's plantings" - crop_plantings: "Everyone's %{crop} plantings" - owner_plantings: "%{owner} plantings" - + title: Forums harvests: index: title: - default: "Everyone's harvests" - crop_harvests: "Everyone's %{crop} harvests" + crop_harvests: Everyone's %{crop} harvests + default: Everyone's harvests owner_harvests: "%{owner} harvests" - - places: - index: - title: "%{site_name} Community Map" - - members: - index: - title: "%{site_name} members" - - posts: - index: - title: - default: "Everyone's posts" - author_posts: "%{author} posts" - - shop: - index: - title: "Shop" - - forums: - index: - title: *forums - home: blurb: + already_html: Or %{sign_in} if you already have an account intro: "%{site_name} is a community of food gardeners. We're building an open source platform to help you learn about growing food, track what you plant and harvest, and swap seeds and produce with other gardeners near you." - perks: "Join now for your free garden journal, seed sharing, forums, and more." - sign_up: "Sign up" - already_html: "Or %{sign_in} if you already have an account" - sign_in_linktext: "sign in" - + perks: Join now for your free garden journal, seed sharing, forums, and more. + sign_in_linktext: sign in + sign_up: Sign up crops: - our_crops: "Some of our crops" - recently_planted: "Recently planted" - recently_added: "Recently added crops" - view_all: "View all 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" - - members: - title: "Some of our members" - view_all: "View all members" - - open: - open_source_title: "Open Source" - open_source_body_html: "%{site_name} is open source software, which means that we share this website's code for free with our community and the world. We believe that openness, sustainability, and social good go hand in hand. You can read more about %{why} or check out our code on %{github}." - why_linktext: "why Growstuff is open source" - github_linktext: "Github" - open_data_title: "Open Data and APIs" - open_data_body_html: "We're building a database of crops, planting advice, seed sources, and other information that anyone can use for free, under a %{creative_commons_link}. You can use this data for research, to build apps, or for any purpose at all. Read more about our %{wiki_link} and %{api_docs_link}." - creative_commons_linktext: "Creative Commons license" - wiki_linktext: "open data" - api_docs_linktext: "API documentation" - get_involved_title: "Get Involved" - get_involved_body_html: "We believe in collaboration, and work closely with our members and the wider food-growing community. Our team includes volunteers from all walks of life and all skill levels. To get involved, visit %{talk_link} or find more information on the %{wiki_link}." - talk_linktext: "Growstuff Talk" - wiki_linktext: "Growstuff Wiki" - support_title: "Support Growstuff" - support_body_html: "Growstuff is independent, %{ad_free} and we have no outside investment. You can support our work by %{buy_account}." - ad_free_linktext: "ad-free" - buy_account_linktext: "buying a paid account" - - seeds: - title: "Seeds available to trade" - owner: "Owner" - crop: "Crop" - description: "Description" - trade_to: "Will trade to" - from: "From location" - unspecified: "unspecified" - details: "Details" - view_all: "View all seeds" - - stats: - message_html: "So far, %{member} have planted %{number_crops} %{number_plantings} in %{number_gardens}." - member_linktext: "%{count} members" - number_crops_linktext: "%{count} crops" - number_plantings_linktext: "%{count} times" - number_gardens_linktext: "%{count} gardens" - + discussion: Discussion + forums: Forums + view_all: View all posts index: - welcome: "Welcome to %{site_name}, %{member_name}" - plant: "Plant" - harvest: "Harvest" - add_seeds: "Add seeds" - post: "Post" - edit_profile: "Edit profile" - + add_seeds: Add seeds + edit_profile: Edit profile + harvest: Harvest + plant: Plant + post: Post + welcome: Welcome to %{site_name}, %{member_name} + members: + title: Some of our members + view_all: View all members + open: + ad_free_linktext: ad-free + api_docs_linktext: API documentation + buy_account_linktext: buying a paid account + creative_commons_linktext: Creative Commons license + get_involved_body_html: We believe in collaboration, and work closely with our members and the wider food-growing community. Our team includes volunteers from all walks of life and all skill levels. To get involved, visit %{talk_link} or find more information on the %{wiki_link}. + get_involved_title: Get Involved + github_linktext: Github + open_data_body_html: We're building a database of crops, planting advice, seed sources, and other information that anyone can use for free, under a %{creative_commons_link}. You can use this data for research, to build apps, or for any purpose at all. Read more about our %{wiki_link} and %{api_docs_link}. + open_data_title: Open Data and APIs + open_source_body_html: "%{site_name} is open source software, which means that we share this website's code for free with our community and the world. We believe that openness, sustainability, and social good go hand in hand. You can read more about %{why} or check out our code on %{github}." + open_source_title: Open Source + support_body_html: Growstuff is independent, %{ad_free} and we have no outside investment. You can support our work by %{buy_account}. + support_title: Support Growstuff + talk_linktext: Growstuff Talk + why_linktext: why Growstuff is open source + wiki_linktext: Growstuff Wiki + 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" + message_html: So far, %{member} have planted %{number_crops} %{number_plantings} in %{number_gardens}. + number_crops_linktext: "%{count} crops" + number_gardens_linktext: "%{count} gardens" + number_plantings_linktext: "%{count} times" + layouts: + header: + account: Account + admin: Admin + browse_crops: Browse Crops + browse_members: Browse Members + community_map: Community Map + crop_wrangling: Crop Wrangling + forums: Forums + gardens: Gardens + harvests: Harvests + inbox: Inbox + inbox_unread: Inbox (%{unread_count}) + plantings: Plantings + posts: Posts + profile: Profile + seeds: Seeds + skip: Skip navigation menu + support_growstuff: Support Growstuff + your_stuff: Your Stuff (%{unread_count}) + members: + index: + title: "%{site_name} members" + places: + index: + title: "%{site_name} Community Map" + plantings: + index: + title: + crop_plantings: Everyone's %{crop} plantings + default: Everyone's plantings + owner_plantings: "%{owner} plantings" + posts: + index: + title: + author_posts: "%{author} posts" + default: Everyone's posts + seeds: + index: + title: + crop_seeds: Everyone's %{crop} seeds + default: Everyone's seeds + owner_seeds: "%{owner} seeds" + shop: + index: + title: Shop + 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. + manage: + all: Not authorized to %{action} %{subject}. + read: + notification: You must be signed in to view notifications. diff --git a/config/locales/ja.yml b/config/locales/ja.yml index 925a54399..2a51c32c5 100644 --- a/config/locales/ja.yml +++ b/config/locales/ja.yml @@ -1,5 +1,5 @@ +--- ja: home: - blurb: + blurb: intro: "%{site_name}はガーデナーのコミュニティです。" - \ No newline at end of file diff --git a/lib/tasks/i18n.rake b/lib/tasks/i18n.rake new file mode 100644 index 000000000..447f0a5d3 --- /dev/null +++ b/lib/tasks/i18n.rake @@ -0,0 +1,6 @@ +namespace :i18n do + desc "sort all locale keys" + task normalize: :environment do + `i18n-tasks normalize` + end +end From 98581801c3964c89199566abc2bb8d23892cec64 Mon Sep 17 00:00:00 2001 From: Jim Stallings Date: Sat, 19 Sep 2015 17:45:31 -0400 Subject: [PATCH 032/268] GS-658 - i18n automation POC --- Gemfile | 1 + Gemfile.lock | 11 +++ app/views/layouts/_header.html.haml | 14 ++-- .../layouts/_header.html.i18n-extractor.haml | 78 +++++++++++++++++++ config/locales/en.yml | 32 ++++++-- lib/tasks/i18n.rake | 16 +++- 6 files changed, 137 insertions(+), 15 deletions(-) create mode 100644 app/views/layouts/_header.html.i18n-extractor.haml diff --git a/Gemfile b/Gemfile index 759b1703d..43631a522 100644 --- a/Gemfile +++ b/Gemfile @@ -125,6 +125,7 @@ group :development, :test do gem 'poltergeist', '~> 1.6' # for headless JS testing gem 'i18n-tasks' # adds tests for finding missing and unused translations gem 'selenium-webdriver' + gem 'haml-i18n-extractor' end group :travis do diff --git a/Gemfile.lock b/Gemfile.lock index 54f97ae9b..cc9584247 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -199,6 +199,12 @@ GEM rspec (>= 2.99.0, < 4.0) haml (4.1.0.beta.1) tilt + haml-i18n-extractor (0.5.9) + activesupport + haml + highline + tilt + trollop (= 1.16.2) haml-rails (0.6.0) actionpack (>= 4.0.1) activesupport (>= 4.0.1) @@ -422,6 +428,7 @@ GEM thread_safe (0.3.5) tilt (1.4.1) tins (1.3.3) + trollop (1.16.2) tzinfo (1.2.2) thread_safe (~> 0.1) uglifier (2.5.3) @@ -484,6 +491,7 @@ DEPENDENCIES guard guard-rspec haml + haml-i18n-extractor haml-rails heroku-api i18n-tasks @@ -520,3 +528,6 @@ DEPENDENCIES unicorn webrat will_paginate (~> 3.0) + +BUNDLED WITH + 1.10.6 diff --git a/app/views/layouts/_header.html.haml b/app/views/layouts/_header.html.haml index ddc9c6af2..5523e75fe 100644 --- a/app/views/layouts/_header.html.haml +++ b/app/views/layouts/_header.html.haml @@ -4,7 +4,7 @@ .container .navbar-header %button.navbar-toggle(data-target="#navbar-collapse" data-toggle="collapse") - %span.sr-only Toggle Navigation + %span.sr-only= t('.toggle_navigation') %span.icon-bar %span.icon-bar %span.icon-bar @@ -20,7 +20,7 @@ %ul.nav.navbar-nav.pull-right %li.dropdown< %a.dropdown-toggle{'data-toggle' => 'dropdown', :href => crops_path} - Crops + = t('.crops') %b.caret %ul.dropdown-menu %li= link_to t('.browse_crops'), crops_path @@ -29,7 +29,7 @@ %li= link_to t('.harvests'), harvests_path %li.dropdown< %a.dropdown-toggle{'data-toggle' => 'dropdown', :href => members_path} - Community + = t('.community') %b.caret %ul.dropdown-menu %li= link_to t('.community_map'), places_path @@ -44,7 +44,7 @@ - if current_member.notifications.unread_count > 0 = t('.your_stuff', unread_count: current_member.notifications.unread_count) - else - #{current_member.login_name} + = t('.current_memberlogin_name', :current_memberlogin_name => (current_member.login_name)) %b.caret %ul.dropdown-menu %li= link_to t('.profile'), member_path(current_member) @@ -67,11 +67,11 @@ %li= link_to t('.admin'), admin_path - %li= link_to "Sign out", destroy_member_session_path, :method => :delete + %li= link_to t('.sign_out'), destroy_member_session_path, :method => :delete - else - %li= link_to 'Sign in', new_member_session_path, :id => 'navbar-signin' - %li= link_to 'Sign up', new_member_registration_path, :id => 'navbar-signup' + %li= link_to t('.sign_in'), new_member_session_path, :id => 'navbar-signin' + %li= link_to t('.sign_up'), new_member_registration_path, :id => 'navbar-signup' - # anchor tag for accessibility link to skip the navigation menu diff --git a/app/views/layouts/_header.html.i18n-extractor.haml b/app/views/layouts/_header.html.i18n-extractor.haml new file mode 100644 index 000000000..5523e75fe --- /dev/null +++ b/app/views/layouts/_header.html.i18n-extractor.haml @@ -0,0 +1,78 @@ +.sr-only + =link_to t(".skip"), "#skipnav" +.navbar.navbar-default.navbar-fixed-top(role="navigation") + .container + .navbar-header + %button.navbar-toggle(data-target="#navbar-collapse" data-toggle="collapse") + %span.sr-only= t('.toggle_navigation') + %span.icon-bar + %span.icon-bar + %span.icon-bar + %a.navbar-brand(href=root_path) + = image_tag("growstuff-brand.png", :size => "200x50", :alt => ENV['GROWSTUFF_SITE_NAME']) + = form_tag crops_search_path, :method => :get, :id => 'navbar-search', :class => 'navbar-form pull-right' do + .input + = label_tag :term, "Search crop database:", :class => 'sr-only' + = text_field_tag 'term', nil, :class => 'search-query input-medium form-control', :placeholder => 'Search crops' + = submit_tag "Search", :class => 'btn sr-only' + + .navbar-collapse.collapse#navbar-collapse + %ul.nav.navbar-nav.pull-right + %li.dropdown< + %a.dropdown-toggle{'data-toggle' => 'dropdown', :href => crops_path} + = t('.crops') + %b.caret + %ul.dropdown-menu + %li= link_to t('.browse_crops'), crops_path + %li= link_to t('.seeds'), seeds_path + %li= link_to t('.plantings'), plantings_path + %li= link_to t('.harvests'), harvests_path + %li.dropdown< + %a.dropdown-toggle{'data-toggle' => 'dropdown', :href => members_path} + = t('.community') + %b.caret + %ul.dropdown-menu + %li= link_to t('.community_map'), places_path + %li= link_to t('.browse_members'), members_path + %li= link_to t('.posts'), posts_path + %li= link_to t('.forums'), forums_path + %li= link_to t('.support_growstuff'), shop_path + + - if member_signed_in? + %li.dropdown< + %a.dropdown-toggle{'data-toggle' => 'dropdown', :href => root_path} + - if current_member.notifications.unread_count > 0 + = t('.your_stuff', unread_count: current_member.notifications.unread_count) + - else + = t('.current_memberlogin_name', :current_memberlogin_name => (current_member.login_name)) + %b.caret + %ul.dropdown-menu + %li= link_to t('.profile'), member_path(current_member) + %li= link_to t('.gardens'), gardens_by_owner_path(:owner => current_member.slug) + %li= link_to t('.plantings'), plantings_by_owner_path(:owner => current_member.slug) + %li= link_to t('.harvest'), harvests_by_owner_path(:owner => current_member.slug) + %li= link_to t('.seeds'), seeds_by_owner_path(:owner => current_member.slug) + %li= link_to t('.posts'), posts_by_author_path(:author => current_member.slug) + %li= link_to t('.account'), orders_path + %li + - if current_member.notifications.unread_count > 0 + = link_to(t('.inbox_unread', unread_count: current_member.notifications.unread_count), notifications_path) + - else + = link_to(t('.inbox'), notifications_path) + - if current_member.has_role?(:crop_wrangler) || current_member.has_role?(:admin) + %li{:class => 'divider', :role => 'presentation'} + - if current_member.has_role?(:crop_wrangler) + %li= link_to t('.crop_wrangling'), wrangle_crops_path + - if current_member.has_role?(:admin) + %li= link_to t('.admin'), admin_path + + + %li= link_to t('.sign_out'), destroy_member_session_path, :method => :delete + + - else + %li= link_to t('.sign_in'), new_member_session_path, :id => 'navbar-signin' + %li= link_to t('.sign_up'), new_member_registration_path, :id => 'navbar-signup' + + +- # anchor tag for accessibility link to skip the navigation menu +%a{:name => 'skipnav'} diff --git a/config/locales/en.yml b/config/locales/en.yml index 30b7c2f4f..6d9b47772 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -16,7 +16,9 @@ en: home: blurb: already_html: Or %{sign_in} if you already have an account - intro: "%{site_name} is a community of food gardeners. We're building an open source platform to help you learn about growing food, track what you plant and harvest, and swap seeds and produce with other gardeners near you." + intro: "%{site_name} is a community of food gardeners. We're building an open + source platform to help you learn about growing food, track what you plant + and harvest, and swap seeds and produce with other gardeners near you." perks: Join now for your free garden journal, seed sharing, forums, and more. sign_in_linktext: sign in sign_up: Sign up @@ -44,14 +46,24 @@ en: api_docs_linktext: API documentation buy_account_linktext: buying a paid account creative_commons_linktext: Creative Commons license - get_involved_body_html: We believe in collaboration, and work closely with our members and the wider food-growing community. Our team includes volunteers from all walks of life and all skill levels. To get involved, visit %{talk_link} or find more information on the %{wiki_link}. + get_involved_body_html: We believe in collaboration, and work closely with our + members and the wider food-growing community. Our team includes volunteers + from all walks of life and all skill levels. To get involved, visit %{talk_link} + or find more information on the %{wiki_link}. get_involved_title: Get Involved github_linktext: Github - open_data_body_html: We're building a database of crops, planting advice, seed sources, and other information that anyone can use for free, under a %{creative_commons_link}. You can use this data for research, to build apps, or for any purpose at all. Read more about our %{wiki_link} and %{api_docs_link}. + open_data_body_html: We're building a database of crops, planting advice, seed + sources, and other information that anyone can use for free, under a %{creative_commons_link}. + You can use this data for research, to build apps, or for any purpose at all. Read + more about our %{wiki_link} and %{api_docs_link}. open_data_title: Open Data and APIs - open_source_body_html: "%{site_name} is open source software, which means that we share this website's code for free with our community and the world. We believe that openness, sustainability, and social good go hand in hand. You can read more about %{why} or check out our code on %{github}." + open_source_body_html: "%{site_name} is open source software, which means that + we share this website's code for free with our community and the world. We + believe that openness, sustainability, and social good go hand in hand. You + can read more about %{why} or check out our code on %{github}." open_source_title: Open Source - support_body_html: Growstuff is independent, %{ad_free} and we have no outside investment. You can support our work by %{buy_account}. + support_body_html: Growstuff is independent, %{ad_free} and we have no outside + investment. You can support our work by %{buy_account}. support_title: Support Growstuff talk_linktext: Growstuff Talk why_linktext: why Growstuff is open source @@ -68,7 +80,8 @@ en: view_all: View all seeds stats: member_linktext: "%{count} members" - message_html: So far, %{member} have planted %{number_crops} %{number_plantings} in %{number_gardens}. + message_html: So far, %{member} have planted %{number_crops} %{number_plantings} + in %{number_gardens}. number_crops_linktext: "%{count} crops" number_gardens_linktext: "%{count} gardens" number_plantings_linktext: "%{count} times" @@ -92,6 +105,13 @@ en: skip: Skip navigation menu support_growstuff: Support Growstuff your_stuff: Your Stuff (%{unread_count}) + toggle_navigation: Toggle Navigation + crops: Crops + community: Community + current_memberlogin_name: '"%{current_memberlogin_name}"' + sign_out: Sign out + sign_in: Sign in + sign_up: Sign up members: index: title: "%{site_name} members" diff --git a/lib/tasks/i18n.rake b/lib/tasks/i18n.rake index 447f0a5d3..917cd73f6 100644 --- a/lib/tasks/i18n.rake +++ b/lib/tasks/i18n.rake @@ -1,6 +1,18 @@ namespace :i18n do - desc "sort all locale keys" - task normalize: :environment do + desc "sort all i18n locale keys" + task :normalize do `i18n-tasks normalize` end + + desc "translate haml strings into i18 en locale using haml-i18n-extractor" + task :extractor, [:haml_path] do |t, args| + require 'haml-i18n-extractor' + haml_path = args[:haml_path] + begin + translate = Haml::I18n::Extractor.new(haml_path) + translate.run + rescue Haml::I18n::Extractor::InvalidSyntax + puts "There was an error with #{haml_path}" + end + end end From e02a6e569c0f996ef0859e567fa11102ec0d7850 Mon Sep 17 00:00:00 2001 From: Jim Stallings Date: Sat, 26 Sep 2015 11:54:02 -0400 Subject: [PATCH 033/268] Remove example file, add documentation --- .../layouts/_header.html.i18n-extractor.haml | 78 ------------------- config/locales/README.md | 15 ++++ 2 files changed, 15 insertions(+), 78 deletions(-) delete mode 100644 app/views/layouts/_header.html.i18n-extractor.haml create mode 100644 config/locales/README.md diff --git a/app/views/layouts/_header.html.i18n-extractor.haml b/app/views/layouts/_header.html.i18n-extractor.haml deleted file mode 100644 index 5523e75fe..000000000 --- a/app/views/layouts/_header.html.i18n-extractor.haml +++ /dev/null @@ -1,78 +0,0 @@ -.sr-only - =link_to t(".skip"), "#skipnav" -.navbar.navbar-default.navbar-fixed-top(role="navigation") - .container - .navbar-header - %button.navbar-toggle(data-target="#navbar-collapse" data-toggle="collapse") - %span.sr-only= t('.toggle_navigation') - %span.icon-bar - %span.icon-bar - %span.icon-bar - %a.navbar-brand(href=root_path) - = image_tag("growstuff-brand.png", :size => "200x50", :alt => ENV['GROWSTUFF_SITE_NAME']) - = form_tag crops_search_path, :method => :get, :id => 'navbar-search', :class => 'navbar-form pull-right' do - .input - = label_tag :term, "Search crop database:", :class => 'sr-only' - = text_field_tag 'term', nil, :class => 'search-query input-medium form-control', :placeholder => 'Search crops' - = submit_tag "Search", :class => 'btn sr-only' - - .navbar-collapse.collapse#navbar-collapse - %ul.nav.navbar-nav.pull-right - %li.dropdown< - %a.dropdown-toggle{'data-toggle' => 'dropdown', :href => crops_path} - = t('.crops') - %b.caret - %ul.dropdown-menu - %li= link_to t('.browse_crops'), crops_path - %li= link_to t('.seeds'), seeds_path - %li= link_to t('.plantings'), plantings_path - %li= link_to t('.harvests'), harvests_path - %li.dropdown< - %a.dropdown-toggle{'data-toggle' => 'dropdown', :href => members_path} - = t('.community') - %b.caret - %ul.dropdown-menu - %li= link_to t('.community_map'), places_path - %li= link_to t('.browse_members'), members_path - %li= link_to t('.posts'), posts_path - %li= link_to t('.forums'), forums_path - %li= link_to t('.support_growstuff'), shop_path - - - if member_signed_in? - %li.dropdown< - %a.dropdown-toggle{'data-toggle' => 'dropdown', :href => root_path} - - if current_member.notifications.unread_count > 0 - = t('.your_stuff', unread_count: current_member.notifications.unread_count) - - else - = t('.current_memberlogin_name', :current_memberlogin_name => (current_member.login_name)) - %b.caret - %ul.dropdown-menu - %li= link_to t('.profile'), member_path(current_member) - %li= link_to t('.gardens'), gardens_by_owner_path(:owner => current_member.slug) - %li= link_to t('.plantings'), plantings_by_owner_path(:owner => current_member.slug) - %li= link_to t('.harvest'), harvests_by_owner_path(:owner => current_member.slug) - %li= link_to t('.seeds'), seeds_by_owner_path(:owner => current_member.slug) - %li= link_to t('.posts'), posts_by_author_path(:author => current_member.slug) - %li= link_to t('.account'), orders_path - %li - - if current_member.notifications.unread_count > 0 - = link_to(t('.inbox_unread', unread_count: current_member.notifications.unread_count), notifications_path) - - else - = link_to(t('.inbox'), notifications_path) - - if current_member.has_role?(:crop_wrangler) || current_member.has_role?(:admin) - %li{:class => 'divider', :role => 'presentation'} - - if current_member.has_role?(:crop_wrangler) - %li= link_to t('.crop_wrangling'), wrangle_crops_path - - if current_member.has_role?(:admin) - %li= link_to t('.admin'), admin_path - - - %li= link_to t('.sign_out'), destroy_member_session_path, :method => :delete - - - else - %li= link_to t('.sign_in'), new_member_session_path, :id => 'navbar-signin' - %li= link_to t('.sign_up'), new_member_registration_path, :id => 'navbar-signup' - - -- # anchor tag for accessibility link to skip the navigation menu -%a{:name => 'skipnav'} diff --git a/config/locales/README.md b/config/locales/README.md new file mode 100644 index 000000000..5ce22aa89 --- /dev/null +++ b/config/locales/README.md @@ -0,0 +1,15 @@ +i18n Documentation +=================== + +i18n Automation +------------- +Automate string extraction from haml into locale files using [haml-i18n-extractor](https://github.com/shaiguitar/haml-i18n-extractor) + +```rake i18n:extractor[relative_path_to_view]``` + + +####Example +```rake i18n:extractor[app/views/layouts/_header.html.haml]``` + +* Creates app/views/layouts/_header.html.i18n-extractor.haml with the expected haml changes to localize app/views/layouts/_header.html.haml. After reviewing the changes, copy app/views/layouts/_header.html.i18n-extractor.haml to app/views/layouts/_header.html.haml +* Adds new keys to locales/en.yml From 2f561aaa473120cceb88be3be21fcc657cc7729e Mon Sep 17 00:00:00 2001 From: Jim Stallings Date: Sat, 26 Sep 2015 11:54:51 -0400 Subject: [PATCH 034/268] Add myself to contributors --- CONTRIBUTORS.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md index deab23739..151d061a4 100644 --- a/CONTRIBUTORS.md +++ b/CONTRIBUTORS.md @@ -66,3 +66,4 @@ submit the change with your pull request. - Anthony Atkinson / [sha1sum](https://github.com/sha1sum) - Terence Conquest / [twconquest](https://github.com/twconquest) - Daniel O'Connor / [CloCkWeRX](https://github.com/CloCkWeRX) +- Jim Stallings / [jestallin](https://github.com/jestallin) From 8c624cfacdac07a81ddb7a37c73d6cbd9a3d1211 Mon Sep 17 00:00:00 2001 From: Mackenzie Morgan Date: Thu, 9 Jun 2016 14:13:02 -0400 Subject: [PATCH 035/268] merge --- Gemfile | 1 + 1 file changed, 1 insertion(+) diff --git a/Gemfile b/Gemfile index a06381d0f..0cdbbf65b 100644 --- a/Gemfile +++ b/Gemfile @@ -79,6 +79,7 @@ group :production, :staging do gem 'memcachier' gem 'rails_12factor' # supresses heroku plugin injection gem 'bonsai-elasticsearch-rails' # Integration with Bonsa-Elasticsearch on heroku + gem 'sparkpost_rails' end group :development do From 306cd13723b7354d5863c640ba2e244c38ee17e5 Mon Sep 17 00:00:00 2001 From: Mackenzie Morgan Date: Thu, 9 Jun 2016 14:13:31 -0400 Subject: [PATCH 036/268] add rubocop config with all the things turned on --- .rubocop.yml | 1156 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 1156 insertions(+) create mode 100644 .rubocop.yml diff --git a/.rubocop.yml b/.rubocop.yml new file mode 100644 index 000000000..650f65bf9 --- /dev/null +++ b/.rubocop.yml @@ -0,0 +1,1156 @@ +AllCops: + DisabledByDefault: true + +#################### Lint ################################ + +Lint/AmbiguousOperator: + Description: >- + Checks for ambiguous operators in the first argument of a + method invocation without parentheses. + StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#parens-as-args' + Enabled: true + +Lint/AmbiguousRegexpLiteral: + Description: >- + Checks for ambiguous regexp literals in the first argument of + a method invocation without parenthesis. + Enabled: true + +Lint/AssignmentInCondition: + Description: "Don't use assignment in conditions." + StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#safe-assignment-in-condition' + Enabled: true + +Lint/BlockAlignment: + Description: 'Align block ends correctly.' + Enabled: true + +Lint/CircularArgumentReference: + Description: "Don't refer to the keyword argument in the default value." + Enabled: true + +Lint/ConditionPosition: + Description: >- + Checks for condition placed in a confusing position relative to + the keyword. + StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#same-line-condition' + Enabled: true + +Lint/Debugger: + Description: 'Check for debugger calls.' + Enabled: true + +Lint/DefEndAlignment: + Description: 'Align ends corresponding to defs correctly.' + Enabled: true + +Lint/DeprecatedClassMethods: + Description: 'Check for deprecated class method calls.' + Enabled: true + +Lint/DuplicateMethods: + Description: 'Check for duplicate methods calls.' + Enabled: true + +Lint/EachWithObjectArgument: + Description: 'Check for immutable argument given to each_with_object.' + Enabled: true + +Lint/ElseLayout: + Description: 'Check for odd code arrangement in an else block.' + Enabled: true + +Lint/EmptyEnsure: + Description: 'Checks for empty ensure block.' + Enabled: true + +Lint/EmptyInterpolation: + Description: 'Checks for empty string interpolation.' + Enabled: true + +Lint/EndAlignment: + Description: 'Align ends correctly.' + Enabled: true + +Lint/EndInMethod: + Description: 'END blocks should not be placed inside method definitions.' + Enabled: true + +Lint/EnsureReturn: + Description: 'Do not use return in an ensure block.' + StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-return-ensure' + Enabled: true + +Lint/Eval: + Description: 'The use of eval represents a serious security risk.' + Enabled: true + +Lint/FormatParameterMismatch: + Description: 'The number of parameters to format/sprint must match the fields.' + Enabled: true + +Lint/HandleExceptions: + Description: "Don't suppress exception." + StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#dont-hide-exceptions' + Enabled: true + +Lint/InvalidCharacterLiteral: + Description: >- + Checks for invalid character literals with a non-escaped + whitespace character. + Enabled: true + +Lint/LiteralInCondition: + Description: 'Checks of literals used in conditions.' + Enabled: true + +Lint/LiteralInInterpolation: + Description: 'Checks for literals used in interpolation.' + Enabled: true + +Lint/Loop: + Description: >- + Use Kernel#loop with break rather than begin/end/until or + begin/end/while for post-loop tests. + StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#loop-with-break' + Enabled: true + +Lint/NestedMethodDefinition: + Description: 'Do not use nested method definitions.' + StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-nested-methods' + Enabled: true + +Lint/NonLocalExitFromIterator: + Description: 'Do not use return in iterator to cause non-local exit.' + Enabled: true + +Lint/ParenthesesAsGroupedExpression: + Description: >- + Checks for method calls with a space before the opening + parenthesis. + StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#parens-no-spaces' + Enabled: true + +Lint/RequireParentheses: + Description: >- + Use parentheses in the method call to avoid confusion + about precedence. + Enabled: true + +Lint/RescueException: + Description: 'Avoid rescuing the Exception class.' + StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-blind-rescues' + Enabled: true + +Lint/ShadowingOuterLocalVariable: + Description: >- + Do not use the same name as outer local variable + for block arguments or block local variables. + Enabled: true + +Lint/StringConversionInInterpolation: + Description: 'Checks for Object#to_s usage in string interpolation.' + StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-to-s' + Enabled: true + +Lint/UnderscorePrefixedVariableName: + Description: 'Do not use prefix `_` for a variable that is used.' + Enabled: true + +Lint/UnneededDisable: + Description: >- + Checks for rubocop:disable comments that can be removed. + Note: this cop is not disabled when disabling all cops. + It must be explicitly disabled. + Enabled: true + +Lint/UnusedBlockArgument: + Description: 'Checks for unused block arguments.' + StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#underscore-unused-vars' + Enabled: true + +Lint/UnusedMethodArgument: + Description: 'Checks for unused method arguments.' + StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#underscore-unused-vars' + Enabled: true + +Lint/UnreachableCode: + Description: 'Unreachable code.' + Enabled: true + +Lint/UselessAccessModifier: + Description: 'Checks for useless access modifiers.' + Enabled: true + +Lint/UselessAssignment: + Description: 'Checks for useless assignment to a local variable.' + StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#underscore-unused-vars' + Enabled: true + +Lint/UselessComparison: + Description: 'Checks for comparison of something with itself.' + Enabled: true + +Lint/UselessElseWithoutRescue: + Description: 'Checks for useless `else` in `begin..end` without `rescue`.' + Enabled: true + +Lint/UselessSetterCall: + Description: 'Checks for useless setter call to a local variable.' + Enabled: true + +Lint/Void: + Description: 'Possible use of operator/literal/variable in void context.' + Enabled: true + +###################### Metrics #################################### + +Metrics/AbcSize: + Description: >- + A calculated magnitude based on number of assignments, + branches, and conditions. + Reference: 'http://c2.com/cgi/wiki?AbcMetric' + Enabled: true + Max: 20 + +Metrics/BlockNesting: + Description: 'Avoid excessive block nesting' + StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#three-is-the-number-thou-shalt-count' + Enabled: true + Max: 4 + +Metrics/ClassLength: + Description: 'Avoid classes longer than 250 lines of code.' + Enabled: true + Max: 250 + +Metrics/CyclomaticComplexity: + Description: >- + A complexity metric that is strongly correlated to the number + of test cases needed to validate a method. + Enabled: true + +Metrics/LineLength: + Description: 'Limit lines to 80 characters.' + StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#80-character-limits' + Enabled: true + +Metrics/MethodLength: + Description: 'Avoid methods longer than 10 lines of code.' + StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#short-methods' + Enabled: true + Max: 10 + +Metrics/ModuleLength: + Description: 'Avoid modules longer than 250 lines of code.' + Enabled: true + Max: 250 + +Metrics/ParameterLists: + Description: 'Avoid parameter lists longer than three or four parameters.' + StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#too-many-params' + Enabled: true + +Metrics/PerceivedComplexity: + Description: >- + A complexity metric geared towards measuring complexity for a + human reader. + Enabled: true + +##################### Performance ############################# + +Performance/Count: + Description: >- + Use `count` instead of `select...size`, `reject...size`, + `select...count`, `reject...count`, `select...length`, + and `reject...length`. + Enabled: true + +Performance/Detect: + Description: >- + Use `detect` instead of `select.first`, `find_all.first`, + `select.last`, and `find_all.last`. + Reference: 'https://github.com/JuanitoFatas/fast-ruby#enumerabledetect-vs-enumerableselectfirst-code' + Enabled: true + +Performance/FlatMap: + Description: >- + Use `Enumerable#flat_map` + instead of `Enumerable#map...Array#flatten(1)` + or `Enumberable#collect..Array#flatten(1)` + Reference: 'https://github.com/JuanitoFatas/fast-ruby#enumerablemaparrayflatten-vs-enumerableflat_map-code' + Enabled: true + EnabledForFlattenWithoutParams: true + # If enabled, this cop will warn about usages of + # `flatten` being called without any parameters. + # This can be dangerous since `flat_map` will only flatten 1 level, and + # `flatten` without any parameters can flatten multiple levels. + +Performance/ReverseEach: + Description: 'Use `reverse_each` instead of `reverse.each`.' + Reference: 'https://github.com/JuanitoFatas/fast-ruby#enumerablereverseeach-vs-enumerablereverse_each-code' + Enabled: true + +Performance/Sample: + Description: >- + Use `sample` instead of `shuffle.first`, + `shuffle.last`, and `shuffle[Fixnum]`. + Reference: 'https://github.com/JuanitoFatas/fast-ruby#arrayshufflefirst-vs-arraysample-code' + Enabled: true + +Performance/Size: + Description: >- + Use `size` instead of `count` for counting + the number of elements in `Array` and `Hash`. + Reference: 'https://github.com/JuanitoFatas/fast-ruby#arraycount-vs-arraysize-code' + Enabled: true + +Performance/StringReplacement: + Description: >- + Use `tr` instead of `gsub` when you are replacing the same + number of characters. Use `delete` instead of `gsub` when + you are deleting characters. + Reference: 'https://github.com/JuanitoFatas/fast-ruby#stringgsub-vs-stringtr-code' + Enabled: true + +##################### Rails ################################## + +Rails/ActionFilter: + Description: 'Enforces consistent use of action filter methods.' + Enabled: true + +Rails/Date: + Description: >- + Checks the correct usage of date aware methods, + such as Date.today, Date.current etc. + Enabled: true + +Rails/Delegate: + Description: 'Prefer delegate method for delegations.' + Enabled: true + +Rails/FindBy: + Description: 'Prefer find_by over where.first.' + Enabled: true + +Rails/FindEach: + Description: 'Prefer all.find_each over all.find.' + Enabled: true + +Rails/HasAndBelongsToMany: + Description: 'Prefer has_many :through to has_and_belongs_to_many.' + Enabled: true + +Rails/Output: + Description: 'Checks for calls to puts, print, etc.' + Enabled: true + +Rails/ReadWriteAttribute: + Description: >- + Checks for read_attribute(:attr) and + write_attribute(:attr, val). + Enabled: true + +Rails/ScopeArgs: + Description: 'Checks the arguments of ActiveRecord scopes.' + Enabled: true + +Rails/TimeZone: + Description: 'Checks the correct usage of time zone aware methods.' + StyleGuide: 'https://github.com/bbatsov/rails-style-guide#time' + Reference: 'http://danilenko.org/2012/7/6/rails_timezones' + Enabled: true + +Rails/Validation: + Description: 'Use validates :attribute, hash of validations.' + Enabled: true + +################## Style ################################# + +Style/AccessModifierIndentation: + Description: Check indentation of private/protected visibility modifiers. + StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#indent-public-private-protected' + Enabled: true + +Style/AccessorMethodName: + Description: Check the naming of accessor methods for get_/set_. + Enabled: true + +Style/Alias: + Description: 'Use alias_method instead of alias.' + StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#alias-method' + Enabled: true + +Style/AlignArray: + Description: >- + Align the elements of an array literal if they span more than + one line. + StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#align-multiline-arrays' + Enabled: true + +Style/AlignHash: + Description: >- + Align the elements of a hash literal if they span more than + one line. + Enabled: true + +Style/AlignParameters: + Description: >- + Align the parameters of a method call if they span more + than one line. + StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-double-indent' + Enabled: true + +Style/AndOr: + Description: 'Use &&/|| instead of and/or.' + StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-and-or-or' + Enabled: true + +Style/ArrayJoin: + Description: 'Use Array#join instead of Array#*.' + StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#array-join' + Enabled: true + +Style/AsciiComments: + Description: 'Use only ascii symbols in comments.' + StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#english-comments' + Enabled: true + +Style/AsciiIdentifiers: + Description: 'Use only ascii symbols in identifiers.' + StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#english-identifiers' + Enabled: true + +Style/Attr: + Description: 'Checks for uses of Module#attr.' + StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#attr' + Enabled: true + +Style/BeginBlock: + Description: 'Avoid the use of BEGIN blocks.' + StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-BEGIN-blocks' + Enabled: true + +Style/BarePercentLiterals: + Description: 'Checks if usage of %() or %Q() matches configuration.' + StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#percent-q-shorthand' + Enabled: true + +Style/BlockComments: + Description: 'Do not use block comments.' + StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-block-comments' + Enabled: true + +Style/BlockEndNewline: + Description: 'Put end statement of multiline block on its own line.' + Enabled: true + +Style/BlockDelimiters: + Description: >- + Avoid using {...} for multi-line blocks (multiline chaining is + always ugly). + Prefer {...} over do...end for single-line blocks. + StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#single-line-blocks' + Enabled: true + +Style/BracesAroundHashParameters: + Description: 'Enforce braces style around hash parameters.' + Enabled: true + +Style/CaseEquality: + Description: 'Avoid explicit use of the case equality operator(===).' + StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-case-equality' + Enabled: true + +Style/CaseIndentation: + Description: 'Indentation of when in a case/when/[else/]end.' + StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#indent-when-to-case' + Enabled: true + +Style/CharacterLiteral: + Description: 'Checks for uses of character literals.' + StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-character-literals' + Enabled: true + +Style/ClassAndModuleCamelCase: + Description: 'Use CamelCase for classes and modules.' + StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#camelcase-classes' + Enabled: true + +Style/ClassAndModuleChildren: + Description: 'Checks style of children classes and modules.' + Enabled: true + +Style/ClassCheck: + Description: 'Enforces consistent use of `Object#is_a?` or `Object#kind_of?`.' + Enabled: true + +Style/ClassMethods: + Description: 'Use self when defining module/class methods.' + StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#def-self-class-methods' + Enabled: true + +Style/ClassVars: + Description: 'Avoid the use of class variables.' + StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-class-vars' + Enabled: true + +Style/ClosingParenthesisIndentation: + Description: 'Checks the indentation of hanging closing parentheses.' + Enabled: true + +Style/ColonMethodCall: + Description: 'Do not use :: for method call.' + StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#double-colons' + Enabled: true + +Style/CommandLiteral: + Description: 'Use `` or %x around command literals.' + StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#percent-x' + Enabled: true + +Style/CommentAnnotation: + Description: 'Checks formatting of annotation comments.' + StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#annotate-keywords' + Enabled: true + +Style/CommentIndentation: + Description: 'Indentation of comments.' + Enabled: true + +Style/ConstantName: + Description: 'Constants should use SCREAMING_SNAKE_CASE.' + StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#screaming-snake-case' + Enabled: true + +Style/DefWithParentheses: + Description: 'Use def with parentheses when there are arguments.' + StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#method-parens' + Enabled: true + +Style/DeprecatedHashMethods: + Description: 'Checks for use of deprecated Hash methods.' + StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#hash-key' + Enabled: true + +Style/Documentation: + Description: 'Document classes and non-namespace modules.' + Enabled: true + +Style/DotPosition: + Description: 'Checks the position of the dot in multi-line method calls.' + StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#consistent-multi-line-chains' + Enabled: true + +Style/DoubleNegation: + Description: 'Checks for uses of double negation (!!).' + StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-bang-bang' + Enabled: true + +Style/EachWithObject: + Description: 'Prefer `each_with_object` over `inject` or `reduce`.' + Enabled: true + +Style/ElseAlignment: + Description: 'Align elses and elsifs correctly.' + Enabled: true + +Style/EmptyElse: + Description: 'Avoid empty else-clauses.' + Enabled: true + +Style/EmptyLineBetweenDefs: + Description: 'Use empty lines between defs.' + StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#empty-lines-between-methods' + Enabled: true + +Style/EmptyLines: + Description: "Don't use several empty lines in a row." + Enabled: true + +Style/EmptyLinesAroundAccessModifier: + Description: "Keep blank lines around access modifiers." + Enabled: true + +Style/EmptyLinesAroundBlockBody: + Description: "Keeps track of empty lines around block bodies." + Enabled: true + +Style/EmptyLinesAroundClassBody: + Description: "Keeps track of empty lines around class bodies." + Enabled: true + +Style/EmptyLinesAroundModuleBody: + Description: "Keeps track of empty lines around module bodies." + Enabled: true + +Style/EmptyLinesAroundMethodBody: + Description: "Keeps track of empty lines around method bodies." + Enabled: true + +Style/EmptyLiteral: + Description: 'Prefer literals to Array.new/Hash.new/String.new.' + StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#literal-array-hash' + Enabled: true + +Style/EndBlock: + Description: 'Avoid the use of END blocks.' + StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-END-blocks' + Enabled: true + +Style/EndOfLine: + Description: 'Use Unix-style line endings.' + StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#crlf' + Enabled: true + +Style/EvenOdd: + Description: 'Favor the use of Fixnum#even? && Fixnum#odd?' + StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#predicate-methods' + Enabled: true + +Style/ExtraSpacing: + Description: 'Do not use unnecessary spacing.' + Enabled: true + +Style/FileName: + Description: 'Use snake_case for source file names.' + StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#snake-case-files' + Enabled: true + +Style/InitialIndentation: + Description: >- + Checks the indentation of the first non-blank non-comment line in a file. + Enabled: true + +Style/FirstParameterIndentation: + Description: 'Checks the indentation of the first parameter in a method call.' + Enabled: true + +Style/FlipFlop: + Description: 'Checks for flip flops' + StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-flip-flops' + Enabled: true + +Style/For: + Description: 'Checks use of for or each in multiline loops.' + StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-for-loops' + Enabled: true + +Style/FormatString: + Description: 'Enforce the use of Kernel#sprintf, Kernel#format or String#%.' + StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#sprintf' + Enabled: true + +Style/GlobalVars: + Description: 'Do not introduce global variables.' + StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#instance-vars' + Reference: 'http://www.zenspider.com/Languages/Ruby/QuickRef.html' + Enabled: true + +Style/GuardClause: + Description: 'Check for conditionals that can be replaced with guard clauses' + StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-nested-conditionals' + Enabled: true + +Style/HashSyntax: + Description: >- + Prefer Ruby 1.9 hash syntax { a: 1, b: 2 } over 1.8 syntax + { :a => 1, :b => 2 }. + StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#hash-literals' + Enabled: true + +Style/IfUnlessModifier: + Description: >- + Favor modifier if/unless usage when you have a + single-line body. + StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#if-as-a-modifier' + Enabled: true + +Style/IfWithSemicolon: + Description: 'Do not use if x; .... Use the ternary operator instead.' + StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-semicolon-ifs' + Enabled: true + +Style/IndentationConsistency: + Description: 'Keep indentation straight.' + Enabled: true + +Style/IndentationWidth: + Description: 'Use 2 spaces for indentation.' + StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#spaces-indentation' + Enabled: true + +Style/IndentArray: + Description: >- + Checks the indentation of the first element in an array + literal. + Enabled: true + +Style/IndentHash: + Description: 'Checks the indentation of the first key in a hash literal.' + Enabled: true + +Style/InfiniteLoop: + Description: 'Use Kernel#loop for infinite loops.' + StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#infinite-loop' + Enabled: true + +Style/Lambda: + Description: 'Use the new lambda literal syntax for single-line blocks.' + StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#lambda-multi-line' + Enabled: true + +Style/LambdaCall: + Description: 'Use lambda.call(...) instead of lambda.(...).' + StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#proc-call' + Enabled: true + +Style/LeadingCommentSpace: + Description: 'Comments should start with a space.' + StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#hash-space' + Enabled: true + +Style/LineEndConcatenation: + Description: >- + Use \ instead of + or << to concatenate two string literals at + line end. + Enabled: true + +Style/MethodCallParentheses: + Description: 'Do not use parentheses for method calls with no arguments.' + StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-args-no-parens' + Enabled: true + +Style/MethodDefParentheses: + Description: >- + Checks if the method definitions have or don't have + parentheses. + StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#method-parens' + Enabled: true + +Style/MethodName: + Description: 'Use the configured style when naming methods.' + StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#snake-case-symbols-methods-vars' + Enabled: true + +Style/ModuleFunction: + Description: 'Checks for usage of `extend self` in modules.' + StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#module-function' + Enabled: true + +Style/MultilineBlockChain: + Description: 'Avoid multi-line chains of blocks.' + StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#single-line-blocks' + Enabled: true + +Style/MultilineBlockLayout: + Description: 'Ensures newlines after multiline block do statements.' + Enabled: true + +Style/MultilineIfThen: + Description: 'Do not use then for multi-line if/unless.' + StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-then' + Enabled: true + +Style/MultilineOperationIndentation: + Description: >- + Checks indentation of binary operations that span more than + one line. + Enabled: true + +Style/MultilineTernaryOperator: + Description: >- + Avoid multi-line ?: (the ternary operator); + use if/unless instead. + StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-multiline-ternary' + Enabled: true + +Style/NegatedIf: + Description: >- + Favor unless over if for negative conditions + (or control flow or). + StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#unless-for-negatives' + Enabled: true + +Style/NegatedWhile: + Description: 'Favor until over while for negative conditions.' + StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#until-for-negatives' + Enabled: true + +Style/NestedTernaryOperator: + Description: 'Use one expression per branch in a ternary operator.' + StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-nested-ternary' + Enabled: true + +Style/Next: + Description: 'Use `next` to skip iteration instead of a condition at the end.' + StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-nested-conditionals' + Enabled: true + +Style/NilComparison: + Description: 'Prefer x.nil? to x == nil.' + StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#predicate-methods' + Enabled: true + +Style/NonNilCheck: + Description: 'Checks for redundant nil checks.' + StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-non-nil-checks' + Enabled: true + +Style/Not: + Description: 'Use ! instead of not.' + StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#bang-not-not' + Enabled: true + +Style/NumericLiterals: + Description: >- + Add underscores to large numeric literals to improve their + readability. + StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#underscores-in-numerics' + Enabled: true + +Style/OneLineConditional: + Description: >- + Favor the ternary operator(?:) over + if/then/else/end constructs. + StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#ternary-operator' + Enabled: true + +Style/OpMethod: + Description: 'When defining binary operators, name the argument other.' + StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#other-arg' + Enabled: true + +Style/OptionalArguments: + Description: >- + Checks for optional arguments that do not appear at the end + of the argument list + StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#optional-arguments' + Enabled: true + +Style/ParallelAssignment: + Description: >- + Check for simple usages of parallel assignment. + It will only warn when the number of variables + matches on both sides of the assignment. + This also provides performance benefits + StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#parallel-assignment' + Enabled: true + +Style/ParenthesesAroundCondition: + Description: >- + Don't use parentheses around the condition of an + if/unless/while. + StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-parens-if' + Enabled: true + +Style/PercentLiteralDelimiters: + Description: 'Use `%`-literal delimiters consistently' + StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#percent-literal-braces' + Enabled: true + +Style/PercentQLiterals: + Description: 'Checks if uses of %Q/%q match the configured preference.' + Enabled: true + +Style/PerlBackrefs: + Description: 'Avoid Perl-style regex back references.' + StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-perl-regexp-last-matchers' + Enabled: true + +Style/PredicateName: + Description: 'Check the names of predicate methods.' + StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#bool-methods-qmark' + Enabled: true + +Style/Proc: + Description: 'Use proc instead of Proc.new.' + StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#proc' + Enabled: true + +Style/RaiseArgs: + Description: 'Checks the arguments passed to raise/fail.' + StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#exception-class-messages' + Enabled: true + +Style/RedundantBegin: + Description: "Don't use begin blocks when they are not needed." + StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#begin-implicit' + Enabled: true + +Style/RedundantException: + Description: "Checks for an obsolete RuntimeException argument in raise/fail." + StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-explicit-runtimeerror' + Enabled: true + +Style/RedundantReturn: + Description: "Don't use return where it's not required." + StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-explicit-return' + Enabled: true + +Style/RedundantSelf: + Description: "Don't use self where it's not needed." + StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-self-unless-required' + Enabled: true + +Style/RegexpLiteral: + Description: 'Use / or %r around regular expressions.' + StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#percent-r' + Enabled: true + +Style/RescueEnsureAlignment: + Description: 'Align rescues and ensures correctly.' + Enabled: true + +Style/RescueModifier: + Description: 'Avoid using rescue in its modifier form.' + StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-rescue-modifiers' + Enabled: true + +Style/SelfAssignment: + Description: >- + Checks for places where self-assignment shorthand should have + been used. + StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#self-assignment' + Enabled: true + +Style/Semicolon: + Description: "Don't use semicolons to terminate expressions." + StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-semicolon' + Enabled: true + +Style/SignalException: + Description: 'Checks for proper usage of fail and raise.' + StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#fail-method' + Enabled: true + +Style/SingleLineBlockParams: + Description: 'Enforces the names of some block params.' + StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#reduce-blocks' + Enabled: true + +Style/SingleLineMethods: + Description: 'Avoid single-line methods.' + StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-single-line-methods' + Enabled: true + +Style/SpaceBeforeFirstArg: + Description: >- + Checks that exactly one space is used between a method name + and the first argument for method calls without parentheses. + Enabled: true + +Style/SpaceAfterColon: + Description: 'Use spaces after colons.' + StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#spaces-operators' + Enabled: true + +Style/SpaceAfterComma: + Description: 'Use spaces after commas.' + StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#spaces-operators' + Enabled: true + +Style/SpaceAroundKeyword: + Description: 'Use spaces around keywords.' + Enabled: true + +Style/SpaceAfterMethodName: + Description: >- + Do not put a space between a method name and the opening + parenthesis in a method definition. + StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#parens-no-spaces' + Enabled: true + +Style/SpaceAfterNot: + Description: Tracks redundant space after the ! operator. + StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-space-bang' + Enabled: true + +Style/SpaceAfterSemicolon: + Description: 'Use spaces after semicolons.' + StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#spaces-operators' + Enabled: true + +Style/SpaceBeforeBlockBraces: + Description: >- + Checks that the left block brace has or doesn't have space + before it. + Enabled: true + +Style/SpaceBeforeComma: + Description: 'No spaces before commas.' + Enabled: true + +Style/SpaceBeforeComment: + Description: >- + Checks for missing space between code and a comment on the + same line. + Enabled: true + +Style/SpaceBeforeSemicolon: + Description: 'No spaces before semicolons.' + Enabled: true + +Style/SpaceInsideBlockBraces: + Description: >- + Checks that block braces have or don't have surrounding space. + For blocks taking parameters, checks that the left brace has + or doesn't have trailing space. + Enabled: true + +Style/SpaceAroundBlockParameters: + Description: 'Checks the spacing inside and after block parameters pipes.' + Enabled: true + +Style/SpaceAroundEqualsInParameterDefault: + Description: >- + Checks that the equals signs in parameter default assignments + have or don't have surrounding space depending on + configuration. + StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#spaces-around-equals' + Enabled: true + +Style/SpaceAroundOperators: + Description: 'Use a single space around operators.' + StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#spaces-operators' + Enabled: true + +Style/SpaceInsideBrackets: + Description: 'No spaces after [ or before ].' + StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-spaces-braces' + Enabled: true + +Style/SpaceInsideHashLiteralBraces: + Description: "Use spaces inside hash literal braces - or don't." + StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#spaces-operators' + Enabled: true + +Style/SpaceInsideParens: + Description: 'No spaces after ( or before ).' + StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-spaces-braces' + Enabled: true + +Style/SpaceInsideRangeLiteral: + Description: 'No spaces inside range literals.' + StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-space-inside-range-literals' + Enabled: true + +Style/SpaceInsideStringInterpolation: + Description: 'Checks for padding/surrounding spaces inside string interpolation.' + StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#string-interpolation' + Enabled: true + +Style/SpecialGlobalVars: + Description: 'Avoid Perl-style global variables.' + StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-cryptic-perlisms' + Enabled: true + +Style/StringLiterals: + Description: 'Checks if uses of quotes match the configured preference.' + StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#consistent-string-literals' + Enabled: true + +Style/StringLiteralsInInterpolation: + Description: >- + Checks if uses of quotes inside expressions in interpolated + strings match the configured preference. + Enabled: true + +Style/StructInheritance: + Description: 'Checks for inheritance from Struct.new.' + StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-extend-struct-new' + Enabled: true + +Style/SymbolLiteral: + Description: 'Use plain symbols instead of string symbols when possible.' + Enabled: true + +Style/SymbolProc: + Description: 'Use symbols as procs instead of blocks when possible.' + Enabled: true + +Style/Tab: + Description: 'No hard tabs.' + StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#spaces-indentation' + Enabled: true + +Style/TrailingBlankLines: + Description: 'Checks trailing blank lines and final newline.' + StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#newline-eof' + Enabled: true + +Style/TrailingCommaInArguments: + Description: 'Checks for trailing comma in parameter lists.' + StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-trailing-params-comma' + Enabled: true + +Style/TrailingCommaInLiteral: + Description: 'Checks for trailing comma in literals.' + StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-trailing-array-commas' + Enabled: true + +Style/TrailingWhitespace: + Description: 'Avoid trailing whitespace.' + StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-trailing-whitespace' + Enabled: true + +Style/TrivialAccessors: + Description: 'Prefer attr_* methods to trivial readers/writers.' + StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#attr_family' + Enabled: true + +Style/UnlessElse: + Description: >- + Do not use unless with else. Rewrite these with the positive + case first. + StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-else-with-unless' + Enabled: true + +Style/UnneededCapitalW: + Description: 'Checks for %W when interpolation is not needed.' + Enabled: true + +Style/UnneededPercentQ: + Description: 'Checks for %q/%Q when single quotes or double quotes would do.' + StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#percent-q' + Enabled: true + +Style/TrailingUnderscoreVariable: + Description: >- + Checks for the usage of unneeded trailing underscores at the + end of parallel variable assignment. + Enabled: true + +Style/VariableInterpolation: + Description: >- + Don't interpolate global, instance and class variables + directly in strings. + StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#curlies-interpolate' + Enabled: true + +Style/VariableName: + Description: 'Use the configured style when naming variables.' + StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#snake-case-symbols-methods-vars' + Enabled: true + +Style/WhenThen: + Description: 'Use when x then ... for one-line cases.' + StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#one-line-cases' + Enabled: true + +Style/WhileUntilDo: + Description: 'Checks for redundant do after while or until.' + StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-multiline-while-do' + Enabled: true + +Style/WhileUntilModifier: + Description: >- + Favor modifier while/until usage when you have a + single-line body. + StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#while-as-a-modifier' + Enabled: true + +Style/WordArray: + Description: 'Use %w or %W for arrays of words.' + StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#percent-w' + Enabled: true From 91991f0c67b61b1a00fc88c60b8952ac03beaae2 Mon Sep 17 00:00:00 2001 From: Mackenzie Morgan Date: Thu, 9 Jun 2016 14:25:04 -0400 Subject: [PATCH 037/268] update Gemfile.lock --- Gemfile.lock | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Gemfile.lock b/Gemfile.lock index cf24cadd8..995c35af8 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -392,6 +392,8 @@ GEM simplecov-html (0.10.0) sixarm_ruby_unaccent (1.1.1) slop (3.6.0) + sparkpost_rails (1.4.0) + rails (>= 4.0, < 5.1) sprockets (3.6.0) concurrent-ruby (~> 1.0) rack (> 1, < 3) @@ -497,10 +499,14 @@ DEPENDENCIES ruby-units sass-rails (~> 5.0.4) selenium-webdriver + sparkpost_rails uglifier (~> 2.7.2) unicorn webrat will_paginate (~> 3.0) +RUBY VERSION + ruby 2.3.1p112 + BUNDLED WITH 1.12.5 From 63d89be698ed3785cca3e00581c93e4262bc9e1d Mon Sep 17 00:00:00 2001 From: Mackenzie Date: Mon, 20 Jun 2016 10:34:11 -0400 Subject: [PATCH 038/268] lets encrypt challenge page --- config/routes.rb | 2 ++ 1 file changed, 2 insertions(+) diff --git a/config/routes.rb b/config/routes.rb index b8fee2796..5401ed568 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -83,6 +83,8 @@ Growstuff::Application.routes.draw do get '/admin/newsletter' => 'admin#newsletter', :as => :admin_newsletter get '/admin/:action' => 'admin#:action' + get '/.well-known/acme-challenge/:id' => 'pages#letsencrypt' + # CMS stuff -- must remain LAST comfy_route :cms, path: '/', sitemap: false From 58d40e912d4c4aafb249b81e3df0c9791feab23e Mon Sep 17 00:00:00 2001 From: Mackenzie Morgan Date: Mon, 20 Jun 2016 10:35:38 -0400 Subject: [PATCH 039/268] Tweak rubocop config * turn off line length limit * turn off class documentation requirement * 30 line methods --- .rubocop.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.rubocop.yml b/.rubocop.yml index 650f65bf9..2b3877963 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -233,13 +233,13 @@ Metrics/CyclomaticComplexity: Metrics/LineLength: Description: 'Limit lines to 80 characters.' StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#80-character-limits' - Enabled: true + Enabled: false Metrics/MethodLength: - Description: 'Avoid methods longer than 10 lines of code.' + Description: 'Avoid methods longer than 30 lines of code.' StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#short-methods' Enabled: true - Max: 10 + Max: 30 Metrics/ModuleLength: Description: 'Avoid modules longer than 250 lines of code.' @@ -535,7 +535,7 @@ Style/DeprecatedHashMethods: Style/Documentation: Description: 'Document classes and non-namespace modules.' - Enabled: true + Enabled: false Style/DotPosition: Description: 'Checks the position of the dot in multi-line method calls.' From 5bc6af87c58bc8c3b2df18dc6c854f2433ee0ba2 Mon Sep 17 00:00:00 2001 From: Mackenzie Date: Mon, 20 Jun 2016 10:46:40 -0400 Subject: [PATCH 040/268] challenge code --- app/controllers/pages_controller.rb | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 app/controllers/pages_controller.rb diff --git a/app/controllers/pages_controller.rb b/app/controllers/pages_controller.rb new file mode 100644 index 000000000..1c3f8f92e --- /dev/null +++ b/app/controllers/pages_controller.rb @@ -0,0 +1,6 @@ +class PagesController < ApplicationController + def letsencrypt + # use your code here, not mine + render text: "B4-cHp8zD8RDI8ihZYvqzb2mV6RPSmrQ-clntqc-5Is.dlIPqFhMDCLyQEccczY3roHZ1UWu6UqVeyb9mkRxheU" + end +end From 628ebd6841cd528124681153a2c1c4150fb6a8a2 Mon Sep 17 00:00:00 2001 From: Cesy Date: Tue, 21 Jun 2016 15:05:45 +0100 Subject: [PATCH 041/268] Revert "lets encrypt challenge page" --- config/routes.rb | 2 -- 1 file changed, 2 deletions(-) diff --git a/config/routes.rb b/config/routes.rb index 5401ed568..b8fee2796 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -83,8 +83,6 @@ Growstuff::Application.routes.draw do get '/admin/newsletter' => 'admin#newsletter', :as => :admin_newsletter get '/admin/:action' => 'admin#:action' - get '/.well-known/acme-challenge/:id' => 'pages#letsencrypt' - # CMS stuff -- must remain LAST comfy_route :cms, path: '/', sitemap: false From 7261fae9f26ce6052851855cfafa796dddd8061d Mon Sep 17 00:00:00 2001 From: Cesy Date: Tue, 21 Jun 2016 15:06:02 +0100 Subject: [PATCH 042/268] Revert "challenge code" --- app/controllers/pages_controller.rb | 6 ------ 1 file changed, 6 deletions(-) delete mode 100644 app/controllers/pages_controller.rb diff --git a/app/controllers/pages_controller.rb b/app/controllers/pages_controller.rb deleted file mode 100644 index 1c3f8f92e..000000000 --- a/app/controllers/pages_controller.rb +++ /dev/null @@ -1,6 +0,0 @@ -class PagesController < ApplicationController - def letsencrypt - # use your code here, not mine - render text: "B4-cHp8zD8RDI8ihZYvqzb2mV6RPSmrQ-clntqc-5Is.dlIPqFhMDCLyQEccczY3roHZ1UWu6UqVeyb9mkRxheU" - end -end From 8f5000443fbbc91142e38607d787f976b8ee9a77 Mon Sep 17 00:00:00 2001 From: Daniel O'Connor Date: Fri, 8 Jul 2016 17:45:00 +0930 Subject: [PATCH 043/268] Use navbar-right, and reposition search box to fix mobile layout --- app/views/layouts/_header.html.haml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/app/views/layouts/_header.html.haml b/app/views/layouts/_header.html.haml index ddc9c6af2..f87629a97 100644 --- a/app/views/layouts/_header.html.haml +++ b/app/views/layouts/_header.html.haml @@ -10,14 +10,15 @@ %span.icon-bar %a.navbar-brand(href=root_path) = image_tag("growstuff-brand.png", :size => "200x50", :alt => ENV['GROWSTUFF_SITE_NAME']) - = form_tag crops_search_path, :method => :get, :id => 'navbar-search', :class => 'navbar-form pull-right' do + + .navbar-collapse.collapse#navbar-collapse + = form_tag crops_search_path, :method => :get, :id => 'navbar-search', :class => 'navbar-form navbar-left' do .input = label_tag :term, "Search crop database:", :class => 'sr-only' = text_field_tag 'term', nil, :class => 'search-query input-medium form-control', :placeholder => 'Search crops' = submit_tag "Search", :class => 'btn sr-only' - .navbar-collapse.collapse#navbar-collapse - %ul.nav.navbar-nav.pull-right + %ul.nav.navbar-nav.navbar-right %li.dropdown< %a.dropdown-toggle{'data-toggle' => 'dropdown', :href => crops_path} Crops From 427b98a1579b0d17782c07706ffccd98244677bf Mon Sep 17 00:00:00 2001 From: Daniel O'Connor Date: Fri, 8 Jul 2016 17:59:32 +0930 Subject: [PATCH 044/268] #997 If a harvest doesn't have any photos, try to look at the crop's default photo --- app/models/harvest.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/models/harvest.rb b/app/models/harvest.rb index 8a1fea37b..39a176a45 100644 --- a/app/models/harvest.rb +++ b/app/models/harvest.rb @@ -132,7 +132,7 @@ class Harvest < ActiveRecord::Base end def default_photo - return photos.first + return photos.first || crop.default_photo end end From f0c1d6d4c2eafe38f40a02e6dd3bb37d9bb2dcdf Mon Sep 17 00:00:00 2001 From: Daniel O'Connor Date: Fri, 8 Jul 2016 18:01:53 +0930 Subject: [PATCH 045/268] #997 Use the harvest photo lookup, not the harvest.crop one --- app/views/harvests/_thumbnail.html.haml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/harvests/_thumbnail.html.haml b/app/views/harvests/_thumbnail.html.haml index d21614947..7c5ada9c4 100644 --- a/app/views/harvests/_thumbnail.html.haml +++ b/app/views/harvests/_thumbnail.html.haml @@ -8,7 +8,7 @@ .panel-body .row .col-md-4 - = link_to image_tag((harvest.crop.default_photo ? harvest.crop.default_photo.thumbnail_url : 'placeholder_150.png'), :alt => harvest.crop.name, :class => 'img'), harvest.crop + = link_to image_tag((harvest.default_photo ? harvest.default_photo.thumbnail_url : 'placeholder_150.png'), :alt => harvest.crop.name, :class => 'img'), harvest.crop .col-md-8 %dl.dl-horizontal %dt Crop : From dfa28264c6539ae03a0c77f9a6c7ef46742b2e27 Mon Sep 17 00:00:00 2001 From: Daniel O'Connor Date: Fri, 8 Jul 2016 18:09:53 +0930 Subject: [PATCH 046/268] #1017 When a crop has no photos, look for harvests of the crop with photos. --- app/models/crop.rb | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/app/models/crop.rb b/app/models/crop.rb index 82c11ba9f..0936a1235 100644 --- a/app/models/crop.rb +++ b/app/models/crop.rb @@ -128,7 +128,11 @@ class Crop < ActiveRecord::Base # later we can choose a default photo based on different criteria, # eg. popularity def default_photo - return photos.first + return photos.first if photos.any? + + # Crop has no photos? Look for the msot recent harvest with a photo. + harvest_with_photo = Harvests.where(crop_id: id).joins(:harvest_photos).order('harvests.id DESC'),limit(1).first + return harvest_with_photo.photos.first if harvest_with_photo end # crop.sunniness From 4b87977e2492bdc6c3f521f0f39131123598b852 Mon Sep 17 00:00:00 2001 From: Daniel O'Connor Date: Fri, 8 Jul 2016 18:12:16 +0930 Subject: [PATCH 047/268] It helps to type properly --- app/models/crop.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/models/crop.rb b/app/models/crop.rb index 0936a1235..878d43255 100644 --- a/app/models/crop.rb +++ b/app/models/crop.rb @@ -131,7 +131,7 @@ class Crop < ActiveRecord::Base return photos.first if photos.any? # Crop has no photos? Look for the msot recent harvest with a photo. - harvest_with_photo = Harvests.where(crop_id: id).joins(:harvest_photos).order('harvests.id DESC'),limit(1).first + harvest_with_photo = Harvest.where(crop_id: id).joins(:photos).order('harvests.id DESC').limit(1).first return harvest_with_photo.photos.first if harvest_with_photo end From 6911f7b24b2c47841e2fd12ca0be7d7c83720c23 Mon Sep 17 00:00:00 2001 From: Daniel O'Connor Date: Thu, 21 Jul 2016 12:05:37 +0930 Subject: [PATCH 048/268] Typo --- app/models/crop.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/models/crop.rb b/app/models/crop.rb index 878d43255..ceec55c36 100644 --- a/app/models/crop.rb +++ b/app/models/crop.rb @@ -130,7 +130,7 @@ class Crop < ActiveRecord::Base def default_photo return photos.first if photos.any? - # Crop has no photos? Look for the msot recent harvest with a photo. + # Crop has no photos? Look for the most recent harvest with a photo. harvest_with_photo = Harvest.where(crop_id: id).joins(:photos).order('harvests.id DESC').limit(1).first return harvest_with_photo.photos.first if harvest_with_photo end From 1dba7110570a108acd1fc4c5b3a6eb3a01bb080a Mon Sep 17 00:00:00 2001 From: Daniel O'Connor Date: Thu, 21 Jul 2016 12:13:37 +0930 Subject: [PATCH 049/268] Add more explicit test coverage --- spec/models/crop_spec.rb | 50 ++++++++++++++++++++++++++++++++++++---- 1 file changed, 45 insertions(+), 5 deletions(-) diff --git a/spec/models/crop_spec.rb b/spec/models/crop_spec.rb index 53df996de..c7aaa0d77 100644 --- a/spec/models/crop_spec.rb +++ b/spec/models/crop_spec.rb @@ -108,12 +108,52 @@ describe Crop do end context 'photos' do - it 'has a default photo' do + before :each do @crop = FactoryGirl.create(:tomato) - @planting = FactoryGirl.create(:planting, crop: @crop) - @photo = FactoryGirl.create(:photo) - @planting.photos << @photo - @crop.default_photo.should be_an_instance_of Photo + end + context 'with a planting photo' do + before :each do + @planting = FactoryGirl.create(:planting, crop: @crop) + @photo = FactoryGirl.create(:photo) + @planting.photos << @photo + end + + it 'has a default photo' do + @crop.default_photo.should be_an_instance_of Photo + @crop.default_photo.id.should eq @photo.id + end + end + + context 'with a harvest photo' do + before :each do + @harvest = FactoryGirl.create(:harvest, crop: @crop) + @photo = FactoryGirl.create(:photo) + @harvest.photos << @photo + end + + it 'has a default photo' do + @crop.default_photo.should be_an_instance_of Photo + @crop.default_photo.id.should eq @photo.id + end + + context 'and planting photo' do + before :each do + @planting = FactoryGirl.create(:planting, crop: @crop) + @planting_photo = FactoryGirl.create(:photo) + @planting.photos << @planting_photo + end + + it 'should prefer the planting photo' do + @crop.default_photo.id.should eq @planting_photo.id + end + end + end + + + context 'with no plantings or harvests' do + it 'has no default photo' do + @crop.default_photo.should eq nil + end end end From ff47784aee261ad3ae0857cc8a7a6a971f2130a3 Mon Sep 17 00:00:00 2001 From: Daniel O'Connor Date: Thu, 21 Jul 2016 12:21:56 +0930 Subject: [PATCH 050/268] Add explicit test coverage --- spec/models/harvest_spec.rb | 79 ++++++++++++++++++++++++++++--------- 1 file changed, 60 insertions(+), 19 deletions(-) diff --git a/spec/models/harvest_spec.rb b/spec/models/harvest_spec.rb index 583363aa2..4dbeed752 100644 --- a/spec/models/harvest_spec.rb +++ b/spec/models/harvest_spec.rb @@ -233,31 +233,72 @@ describe Harvest do context 'photos' do - let(:harvest) { FactoryGirl.create(:harvest) } - let(:photo) { FactoryGirl.create(:photo) } - - before do - harvest.photos << photo + before :each do + @harvest = FactoryGirl.create(:harvest) end - it 'has a photo' do - harvest.photos.first.should eq photo + context 'without a photo' do + it 'should have no default photo' do + @harvest.default_photo.should eq nil + end + + context 'and with a crop(planting) photo' do + before :each do + @photo = FactoryGirl.create(:photo) + @planting = FactoryGirl.create(:planting, crop: @harvest.crop) + @planting.photos << @photo + end + + it 'should have a default photo' do + @harvest.default_photo.should eq @photo + end + end end - it 'deletes association with photos when photo is deleted' do - photo.destroy - harvest.reload - harvest.photos.should be_empty - end + context 'with a photo' do + before do + @photo = FactoryGirl.create(:photo) - it 'has a default photo' do - harvest.default_photo.should eq photo - end + @harvest.photos << @photo + end - it 'chooses the most recent photo' do - @photo2 = FactoryGirl.create(:photo) - harvest.photos << @photo2 - harvest.default_photo.should eq @photo2 + it 'has a photo' do + @harvest.photos.first.should eq @photo + end + + it 'deletes association with photos when photo is deleted' do + @photo.destroy + @harvest.reload + @harvest.photos.should be_empty + end + + it 'has a default photo' do + @harvest.default_photo.should eq @photo + end + + context 'and with a crop(planting) photo' do + before :each do + @crop_photo = FactoryGirl.create(:photo) + @planting = FactoryGirl.create(:planting, crop: @harvest.crop) + @planting.photos << @crop_photo + end + + it 'should prefer the harvest photo' do + @harvest.default_photo.should eq @photo + end + end + + + context 'and a second photo' do + before :each do + @photo2 = FactoryGirl.create(:photo) + @harvest.photos << @photo2 + end + + it 'chooses the most recent photo' do + @harvest.default_photo.should eq @photo2 + end + end end end end From d1438d1b2e3a513fa539f2459d0e7c2654459bc7 Mon Sep 17 00:00:00 2001 From: Kristine Nicole Polvoriza Date: Thu, 28 Jul 2016 10:08:12 +0800 Subject: [PATCH 051/268] Fixed the nav header in mobile view --- app/assets/stylesheets/overrides.sass | 22 ++++++++++++++++++++++ app/views/layouts/_header.html.haml | 21 ++++++++++++++------- 2 files changed, 36 insertions(+), 7 deletions(-) diff --git a/app/assets/stylesheets/overrides.sass b/app/assets/stylesheets/overrides.sass index 4b95b2bb6..eb2b8a49d 100644 --- a/app/assets/stylesheets/overrides.sass +++ b/app/assets/stylesheets/overrides.sass @@ -40,6 +40,19 @@ h3 .main padding-right: 1em +.navbar .navbar-form + padding-top: 0 + padding-bottom: 0 + margin-right: 0 + margin-left: 15px + border: 0 + -webkit-box-shadow: none + box-shadow: none + +.img-responsive + max-width: 100% + height: auto + .sidebar border-left: 1px solid darken($beige, 10%) margin-left: -1px @@ -115,6 +128,10 @@ p.stats padding-left: 80px margin-left: auto + .navbar .navbar-form + width: 250px + + #placesmap, #cropmap height: 500px @@ -273,6 +290,11 @@ html, body .navbar .nav > li display: block + .navbar .navbar-form + width: 185px + padding-left: 0 + padding-right: 0 + /* override "info" alert boxes to be green, not blue, on Growstuff */ $state-info-text: darken($green, 10%) $state-info-bg: lighten($green, 50%) diff --git a/app/views/layouts/_header.html.haml b/app/views/layouts/_header.html.haml index f87629a97..5b66c20dc 100644 --- a/app/views/layouts/_header.html.haml +++ b/app/views/layouts/_header.html.haml @@ -8,16 +8,23 @@ %span.icon-bar %span.icon-bar %span.icon-bar - %a.navbar-brand(href=root_path) + %a.navbar-brand.hidden-xs(href=root_path) = image_tag("growstuff-brand.png", :size => "200x50", :alt => ENV['GROWSTUFF_SITE_NAME']) + %a.navbar-brand.visible-xs(href=root_path) + = image_tag("growstuff-apple-touch-icon-precomposed.png", :size => "50x50", :class=>"img-responsive", :alt => ENV['GROWSTUFF_SITE_NAME']) + + .form.navbar-form.pull-left + = form_tag crops_search_path, :method => :get, :id => 'navbar-search' do + = label_tag :term, "Search crop database:", :class => 'sr-only' + .input + .input-group + = text_field_tag 'term', nil, :class => 'search-query input-medium form-control', :placeholder => 'Search crops' + .input-group-btn + %button.btn.btn-default{:style => "height: 34px;"} + = submit_tag "Search", :class => 'btn sr-only' + %span.glyphicon.glyphicon-search .navbar-collapse.collapse#navbar-collapse - = form_tag crops_search_path, :method => :get, :id => 'navbar-search', :class => 'navbar-form navbar-left' do - .input - = label_tag :term, "Search crop database:", :class => 'sr-only' - = text_field_tag 'term', nil, :class => 'search-query input-medium form-control', :placeholder => 'Search crops' - = submit_tag "Search", :class => 'btn sr-only' - %ul.nav.navbar-nav.navbar-right %li.dropdown< %a.dropdown-toggle{'data-toggle' => 'dropdown', :href => crops_path} From e38321aa330315dfc675e9722692a76fa2f59ae6 Mon Sep 17 00:00:00 2001 From: Daniel O'Connor Date: Thu, 28 Jul 2016 14:27:49 +0930 Subject: [PATCH 052/268] #981 Add mapbox access token (on my free 50k views account) and update to v4 --- app/assets/javascripts/crops.js.erb | 3 ++- app/assets/javascripts/members.js.erb | 3 ++- app/assets/javascripts/places.js.erb | 3 ++- config/environments/development.rb | 1 + config/environments/production.rb | 1 + config/environments/staging.rb | 1 + 6 files changed, 9 insertions(+), 3 deletions(-) diff --git a/app/assets/javascripts/crops.js.erb b/app/assets/javascripts/crops.js.erb index c31666d23..9a60dd60c 100644 --- a/app/assets/javascripts/crops.js.erb +++ b/app/assets/javascripts/crops.js.erb @@ -1,6 +1,7 @@ if (document.getElementById("cropmap") !== null) { mapbox_map_id = "<%= Rails.env == 'test' ? 0 : Growstuff::Application.config.mapbox_map_id %>"; - mapbox_base_url = "https://c.tiles.mapbox.com/v3/" + mapbox_map_id + "/{z}/{x}/{y}.png"; + mapbox_access_token = "<%= Rails.env == 'test' ? 0 : Growstuff::Application.config.mapbox_access_token %>"; + mapbox_base_url = "http://a.tiles.mapbox.com/v4/" + mapbox_map_id + "/{z}/{x}/{y}.png?access_token=" + mapbox_access_token; L.Icon.Default.imagePath = '/assets' diff --git a/app/assets/javascripts/members.js.erb b/app/assets/javascripts/members.js.erb index f55f35732..500e79b25 100644 --- a/app/assets/javascripts/members.js.erb +++ b/app/assets/javascripts/members.js.erb @@ -1,6 +1,7 @@ if (document.getElementById("membermap") !== null) { mapbox_map_id = "<%= Rails.env == 'test' ? 0 : Growstuff::Application.config.mapbox_map_id %>"; - mapbox_base_url = "https://c.tiles.mapbox.com/v3/" + mapbox_map_id + "/{z}/{x}/{y}.png"; + mapbox_access_token = "<%= Rails.env == 'test' ? 0 : Growstuff::Application.config.mapbox_access_token %>"; + mapbox_base_url = "http://a.tiles.mapbox.com/v4/" + mapbox_map_id + "/{z}/{x}/{y}.png?access_token=" + mapbox_access_token; L.Icon.Default.imagePath = '/assets' diff --git a/app/assets/javascripts/places.js.erb b/app/assets/javascripts/places.js.erb index 2dba78340..48cb960d7 100644 --- a/app/assets/javascripts/places.js.erb +++ b/app/assets/javascripts/places.js.erb @@ -1,7 +1,8 @@ if (document.getElementById("placesmap") !== null) { places_base_path = "/places"; mapbox_map_id = "<%= Rails.env == 'test' ? 0 : Growstuff::Application.config.mapbox_map_id %>"; - mapbox_base_url = "https://c.tiles.mapbox.com/v3/" + mapbox_map_id + "/{z}/{x}/{y}.png"; + mapbox_access_token = "<%= Rails.env == 'test' ? 0 : Growstuff::Application.config.mapbox_access_token %>"; + mapbox_base_url = "http://a.tiles.mapbox.com/v4/" + mapbox_map_id + "/{z}/{x}/{y}.png?access_token=" + mapbox_access_token; nominatim_base_url = 'http://nominatim.openstreetmap.org/search/'; nominatim_user_agent_email = "<%= Rails.env == 'test' ? 0 : Growstuff::Application.config.user_agent_email %>"; diff --git a/config/environments/development.rb b/config/environments/development.rb index 700771c10..299c3df9d 100644 --- a/config/environments/development.rb +++ b/config/environments/development.rb @@ -61,6 +61,7 @@ Growstuff::Application.configure do # this config variable cannot be put in application.yml as it is needed # by the assets pipeline, which doesn't have access to ENV. config.mapbox_map_id = 'growstuff.i3n2il6a' + config.mapbox_access_token = 'pk.eyJ1IjoiZG9jb25ub3IiLCJhIjoiY2lyNXVoZzM3MDA5eGcxbm5hc3MxbHVsaSJ9.WMxl50FaD29gWKURbdcBCw' config.after_initialize do ActiveMerchant::Billing::Base.mode = :test diff --git a/config/environments/production.rb b/config/environments/production.rb index 618eb8344..3e40a1a24 100644 --- a/config/environments/production.rb +++ b/config/environments/production.rb @@ -89,6 +89,7 @@ Growstuff::Application.configure do # this config variable cannot be put in application.yml as it is needed # by the assets pipeline, which doesn't have access to ENV. config.mapbox_map_id = 'growstuff.i3n2c4ie' + config.mapbox_access_token = 'pk.eyJ1IjoiZG9jb25ub3IiLCJhIjoiY2lyNXVoZzM3MDA5eGcxbm5hc3MxbHVsaSJ9.WMxl50FaD29gWKURbdcBCw' config.after_initialize do ActiveMerchant::Billing::Base.mode = :production diff --git a/config/environments/staging.rb b/config/environments/staging.rb index 8f2352ff4..c009fefa4 100644 --- a/config/environments/staging.rb +++ b/config/environments/staging.rb @@ -87,6 +87,7 @@ Growstuff::Application.configure do # this config variable cannot be put in application.yml as it is needed # by the assets pipeline, which doesn't have access to ENV. config.mapbox_map_id = 'growstuff.i3n2hao7' + config.mapbox_access_token = 'pk.eyJ1IjoiZG9jb25ub3IiLCJhIjoiY2lyNXVoZzM3MDA5eGcxbm5hc3MxbHVsaSJ9.WMxl50FaD29gWKURbdcBCw' config.after_initialize do ActiveMerchant::Billing::Base.mode = :test From 85ff36198b1be4aa1cbd437695602c260e9cb4b1 Mon Sep 17 00:00:00 2001 From: polveenomials Date: Thu, 4 Aug 2016 14:27:49 +0800 Subject: [PATCH 053/268] Added name to the CONTRIBUTORS.md --- CONTRIBUTORS.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md index d893dc537..3c7aaedf0 100644 --- a/CONTRIBUTORS.md +++ b/CONTRIBUTORS.md @@ -70,3 +70,4 @@ submit the change with your pull request. - Eric Tillberg / [Thrillberg](https://github.com/Thrillberg) - Lucas Nogueira / [lucasnogueira](https://github.com/lucasnogueira) - Charley Lewittes / [ctlewitt](https://github.com/ctlewitt) +- Kristine Nicole Polvoriza / [polveenomials](https://github.com/polveenomials) \ No newline at end of file From fdb0e842de8fa0d13de486e9b792c1a0ca746e30 Mon Sep 17 00:00:00 2001 From: Daniel O'Connor Date: Sat, 4 Jun 2016 20:21:20 +0930 Subject: [PATCH 054/268] #864 Add links to google, gardenate --- app/views/crops/show.html.haml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/app/views/crops/show.html.haml b/app/views/crops/show.html.haml index 288629464..31cbdaeb2 100644 --- a/app/views/crops/show.html.haml +++ b/app/views/crops/show.html.haml @@ -91,4 +91,9 @@ %h4 Learn more about #{ @crop.name.pluralize } %ul - %li= link_to 'Wikipedia (English)', @crop.en_wikipedia_url + %li= link_to 'Wikipedia (English)', @crop.en_wikipedia_url, target: "_blank" + %li + = link_to "Gardenate - Planting reminders", "http://www.gardenate.com/plant/#{URI.escape @crop.name}", target: "_blank" + %li + - if current_member && current_member.location + = link_to "Google", "http://www.google.com/search?q=#{URI.escape ["Growing", @crop.name, current_member.location].join(" ")}", target: "_blank" From e4c0ecfb5a5724627a337d0806762012031b7a54 Mon Sep 17 00:00:00 2001 From: Daniel O'Connor Date: Sat, 9 Jul 2016 20:59:47 +0930 Subject: [PATCH 055/268] Add basic test --- spec/features/crops/crop_detail_page_spec.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/spec/features/crops/crop_detail_page_spec.rb b/spec/features/crops/crop_detail_page_spec.rb index d48d60f41..b14006d7c 100644 --- a/spec/features/crops/crop_detail_page_spec.rb +++ b/spec/features/crops/crop_detail_page_spec.rb @@ -135,7 +135,9 @@ feature "crop detail page", js: true do expect(page).to have_content "Learn more about #{ crop.name }" expect(page).to have_link "Wikipedia (English)", href: crop.en_wikipedia_url end - + scenario "has a link to gardenate" do + expect(page).to have_link "Gardenate - Planting reminders", href: "http://www.gardenate.com/plant/#{URI.escape crop.name}" + end end end From 7d3991b2951de4ee495ecdb6429afc392c086eac Mon Sep 17 00:00:00 2001 From: Daniel O'Connor Date: Mon, 15 Aug 2016 21:24:48 +0930 Subject: [PATCH 056/268] #967 Mitigate security concerns with target=_blank via https://www.jitbit.com/alexblog/256-targetblank---the-most-underestimated-vulnerability-ever/ --- app/views/crops/show.html.haml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/crops/show.html.haml b/app/views/crops/show.html.haml index 31cbdaeb2..92f32f432 100644 --- a/app/views/crops/show.html.haml +++ b/app/views/crops/show.html.haml @@ -96,4 +96,4 @@ = link_to "Gardenate - Planting reminders", "http://www.gardenate.com/plant/#{URI.escape @crop.name}", target: "_blank" %li - if current_member && current_member.location - = link_to "Google", "http://www.google.com/search?q=#{URI.escape ["Growing", @crop.name, current_member.location].join(" ")}", target: "_blank" + = link_to "Google", "http://www.google.com/search?q=#{URI.escape ["Growing", @crop.name, current_member.location].join(" ")}", target: "_blank", rel: "noopener noreferrer" From dba6b2a29187c7106da4f4203fce3f6b9c5b4b52 Mon Sep 17 00:00:00 2001 From: Daniel O'Connor Date: Mon, 15 Aug 2016 21:27:29 +0930 Subject: [PATCH 057/268] Mitigate security concerns with target=_blank via https://www.jitbit.com/alexblog/256-targetblank---the-most-underestimated-vulnerability-ever/ --- app/helpers/application_helper.rb | 2 +- app/views/crops/show.html.haml | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 333c84aa8..6b917500e 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -20,7 +20,7 @@ module ApplicationHelper currency = Growstuff::Application.config.currency link = "http://www.wolframalpha.com/input/?i=#{pid}+#{currency}" - link_to "(convert)", link, target: "_blank" + link_to "(convert)", link, target: "_blank", rel: "noopener noreferrer" end def build_alert_classes(alert_type = :info) diff --git a/app/views/crops/show.html.haml b/app/views/crops/show.html.haml index 92f32f432..79b503cf1 100644 --- a/app/views/crops/show.html.haml +++ b/app/views/crops/show.html.haml @@ -91,9 +91,9 @@ %h4 Learn more about #{ @crop.name.pluralize } %ul - %li= link_to 'Wikipedia (English)', @crop.en_wikipedia_url, target: "_blank" + %li= link_to 'Wikipedia (English)', @crop.en_wikipedia_url, target: "_blank", rel: "noopener noreferrer" %li - = link_to "Gardenate - Planting reminders", "http://www.gardenate.com/plant/#{URI.escape @crop.name}", target: "_blank" + = link_to "Gardenate - Planting reminders", "http://www.gardenate.com/plant/#{URI.escape @crop.name}", target: "_blank", rel: "noopener noreferrer" %li - if current_member && current_member.location = link_to "Google", "http://www.google.com/search?q=#{URI.escape ["Growing", @crop.name, current_member.location].join(" ")}", target: "_blank", rel: "noopener noreferrer" From 7308a7cf9aa516ee5a80feb68d51bb39f7b003d4 Mon Sep 17 00:00:00 2001 From: Daniel O'Connor Date: Mon, 15 Aug 2016 21:45:26 +0930 Subject: [PATCH 058/268] Name: actionview Version: 4.2.6 Advisory: CVE-2016-6316 Criticality: Unknown URL: https://groups.google.com/forum/#!topic/rubyonrails-security/I-VWr034ouk Title: Possible XSS Vulnerability in Action View Solution: upgrade to ~> 3.2.22.3, ~> 4.2.7.1, >= 5.0.0.1 Name: activerecord Version: 4.2.6 Advisory: CVE-2016-6317 Criticality: Unknown URL: https://groups.google.com/forum/#!topic/rubyonrails-security/rgO20zYW33s Title: Unsafe Query Generation Risk in Active Record Solution: upgrade to ~> 4.2.7.1 --- Gemfile.lock | 62 ++++++++++++++++++++++++++-------------------------- 1 file changed, 31 insertions(+), 31 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index 0345f4ad7..bec67f472 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,21 +1,21 @@ GEM remote: https://rubygems.org/ specs: - actionmailer (4.2.6) - actionpack (= 4.2.6) - actionview (= 4.2.6) - activejob (= 4.2.6) + actionmailer (4.2.7.1) + actionpack (= 4.2.7.1) + actionview (= 4.2.7.1) + activejob (= 4.2.7.1) mail (~> 2.5, >= 2.5.4) rails-dom-testing (~> 1.0, >= 1.0.5) - actionpack (4.2.6) - actionview (= 4.2.6) - activesupport (= 4.2.6) + actionpack (4.2.7.1) + actionview (= 4.2.7.1) + activesupport (= 4.2.7.1) rack (~> 1.6) rack-test (~> 0.6.2) rails-dom-testing (~> 1.0, >= 1.0.5) rails-html-sanitizer (~> 1.0, >= 1.0.2) - actionview (4.2.6) - activesupport (= 4.2.6) + actionview (4.2.7.1) + activesupport (= 4.2.7.1) builder (~> 3.1) erubis (~> 2.7.0) rails-dom-testing (~> 1.0, >= 1.0.5) @@ -27,22 +27,22 @@ GEM active_utils (3.2.0) activesupport (>= 3.2) i18n - activejob (4.2.6) - activesupport (= 4.2.6) + activejob (4.2.7.1) + activesupport (= 4.2.7.1) globalid (>= 0.3.0) activemerchant (1.59.0) activesupport (>= 3.2.14, < 5.1) builder (>= 2.1.2, < 4.0.0) i18n (>= 0.6.9) nokogiri (~> 1.4) - activemodel (4.2.6) - activesupport (= 4.2.6) + activemodel (4.2.7.1) + activesupport (= 4.2.7.1) builder (~> 3.1) - activerecord (4.2.6) - activemodel (= 4.2.6) - activesupport (= 4.2.6) + activerecord (4.2.7.1) + activemodel (= 4.2.7.1) + activesupport (= 4.2.7.1) arel (~> 6.0) - activesupport (4.2.6) + activesupport (4.2.7.1) i18n (~> 0.7) json (~> 1.7, >= 1.7.7) minitest (~> 5.1) @@ -181,7 +181,7 @@ GEM gibbon (1.2.1) httparty multi_json (>= 1.9.0) - globalid (0.3.6) + globalid (0.3.7) activesupport (>= 4.1.0) gravatar-ultimate (2.0.0) activesupport (>= 2.3.14) @@ -321,16 +321,16 @@ GEM rack (1.6.4) rack-test (0.6.3) rack (>= 1.0) - rails (4.2.6) - actionmailer (= 4.2.6) - actionpack (= 4.2.6) - actionview (= 4.2.6) - activejob (= 4.2.6) - activemodel (= 4.2.6) - activerecord (= 4.2.6) - activesupport (= 4.2.6) + rails (4.2.7.1) + actionmailer (= 4.2.7.1) + actionpack (= 4.2.7.1) + actionview (= 4.2.7.1) + activejob (= 4.2.7.1) + activemodel (= 4.2.7.1) + activerecord (= 4.2.7.1) + activesupport (= 4.2.7.1) bundler (>= 1.3.0, < 2.0) - railties (= 4.2.6) + railties (= 4.2.7.1) sprockets-rails rails-deprecated_sanitizer (1.0.3) activesupport (>= 4.2.0.alpha) @@ -348,9 +348,9 @@ GEM rails_stdout_logging rails_serve_static_assets (0.0.5) rails_stdout_logging (0.0.5) - railties (4.2.6) - actionpack (= 4.2.6) - activesupport (= 4.2.6) + railties (4.2.7.1) + actionpack (= 4.2.7.1) + activesupport (= 4.2.7.1) rake (>= 0.8.7) thor (>= 0.18.1, < 2.0) raindrops (0.16.0) @@ -409,7 +409,7 @@ GEM simplecov-html (~> 0.10.0) simplecov-html (0.10.0) slop (3.6.0) - sprockets (3.6.2) + sprockets (3.7.0) concurrent-ruby (~> 1.0) rack (> 1, < 3) sprockets-rails (3.1.1) From d8ad697d092694046cec366ac8e95ca87052fd58 Mon Sep 17 00:00:00 2001 From: Daniel O'Connor Date: Mon, 15 Aug 2016 21:53:17 +0930 Subject: [PATCH 059/268] Swap tokens --- config/environments/development.rb | 2 +- config/environments/production.rb | 2 +- config/environments/staging.rb | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/config/environments/development.rb b/config/environments/development.rb index 299c3df9d..9df3fd924 100644 --- a/config/environments/development.rb +++ b/config/environments/development.rb @@ -61,7 +61,7 @@ Growstuff::Application.configure do # this config variable cannot be put in application.yml as it is needed # by the assets pipeline, which doesn't have access to ENV. config.mapbox_map_id = 'growstuff.i3n2il6a' - config.mapbox_access_token = 'pk.eyJ1IjoiZG9jb25ub3IiLCJhIjoiY2lyNXVoZzM3MDA5eGcxbm5hc3MxbHVsaSJ9.WMxl50FaD29gWKURbdcBCw' + config.mapbox_access_token = 'pk.eyJ1IjoiZ3Jvd3N0dWZmIiwiYSI6IkdxMkx4alUifQ.n0igaBsw97s14zMa0lwKCA' config.after_initialize do ActiveMerchant::Billing::Base.mode = :test diff --git a/config/environments/production.rb b/config/environments/production.rb index 3e40a1a24..1be89c157 100644 --- a/config/environments/production.rb +++ b/config/environments/production.rb @@ -89,7 +89,7 @@ Growstuff::Application.configure do # this config variable cannot be put in application.yml as it is needed # by the assets pipeline, which doesn't have access to ENV. config.mapbox_map_id = 'growstuff.i3n2c4ie' - config.mapbox_access_token = 'pk.eyJ1IjoiZG9jb25ub3IiLCJhIjoiY2lyNXVoZzM3MDA5eGcxbm5hc3MxbHVsaSJ9.WMxl50FaD29gWKURbdcBCw' + config.mapbox_access_token = ' pk.eyJ1IjoiZ3Jvd3N0dWZmIiwiYSI6IkdxMkx4alUifQ.n0igaBsw97s14zMa0lwKCA' config.after_initialize do ActiveMerchant::Billing::Base.mode = :production diff --git a/config/environments/staging.rb b/config/environments/staging.rb index c009fefa4..004d35167 100644 --- a/config/environments/staging.rb +++ b/config/environments/staging.rb @@ -87,7 +87,7 @@ Growstuff::Application.configure do # this config variable cannot be put in application.yml as it is needed # by the assets pipeline, which doesn't have access to ENV. config.mapbox_map_id = 'growstuff.i3n2hao7' - config.mapbox_access_token = 'pk.eyJ1IjoiZG9jb25ub3IiLCJhIjoiY2lyNXVoZzM3MDA5eGcxbm5hc3MxbHVsaSJ9.WMxl50FaD29gWKURbdcBCw' + config.mapbox_access_token = 'pk.eyJ1IjoiZ3Jvd3N0dWZmIiwiYSI6IkdxMkx4alUifQ.n0igaBsw97s14zMa0lwKCA' config.after_initialize do ActiveMerchant::Billing::Base.mode = :test From 93c47d774e941ee91c7e62864c32ed75276228ba Mon Sep 17 00:00:00 2001 From: Daniel O'Connor Date: Mon, 15 Aug 2016 22:01:56 +0930 Subject: [PATCH 060/268] Upgrade minor gems: kramdown, notifany, httparty, codemirror-rails, bootstrap_form, globalid --- Gemfile.lock | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index 0345f4ad7..3bc31145c 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -70,7 +70,7 @@ GEM bootstrap-sass (3.3.6) autoprefixer-rails (>= 5.2.1) sass (>= 3.3.4) - bootstrap_form (2.3.0) + bootstrap_form (2.5.0) builder (3.2.2) byebug (9.0.5) cancancan (1.15.0) @@ -96,8 +96,8 @@ GEM climate_control (>= 0.0.3, < 1.0) codeclimate-test-reporter (0.6.0) simplecov (>= 0.7.1, < 1.0.0) - codemirror-rails (5.11) - railties (>= 3.0, < 5) + codemirror-rails (5.16.0) + railties (>= 3.0, < 6.0) coderay (1.1.1) coffee-rails (4.1.1) coffee-script (>= 2.2.0) @@ -181,7 +181,7 @@ GEM gibbon (1.2.1) httparty multi_json (>= 1.9.0) - globalid (0.3.6) + globalid (0.3.7) activesupport (>= 4.1.0) gravatar-ultimate (2.0.0) activesupport (>= 2.3.14) @@ -218,8 +218,7 @@ GEM haml (~> 4.0.0) nokogiri (~> 1.6.0) ruby_parser (~> 3.5) - httparty (0.13.7) - json (~> 1.8) + httparty (0.14.0) multi_xml (>= 0.5.2) i18n (0.7.0) i18n-tasks (0.9.5) @@ -246,7 +245,7 @@ GEM actionpack (>= 3.0.0) activesupport (>= 3.0.0) kgio (2.10.0) - kramdown (1.11.1) + kramdown (1.12.0) launchy (2.4.3) addressable (~> 2.3) leaflet-markercluster-rails (0.7.0) @@ -279,7 +278,7 @@ GEM nokogiri (1.6.8) mini_portile2 (~> 2.1.0) pkg-config (~> 1.1.7) - notiffany (0.1.0) + notiffany (0.1.1) nenv (~> 0.1) shellany (~> 0.0) oauth (0.5.1) From 9bbaaa22117e339d805dedca87dbf8adcca0519f Mon Sep 17 00:00:00 2001 From: Daniel O'Connor Date: Mon, 15 Aug 2016 22:04:43 +0930 Subject: [PATCH 061/268] Upgrade excon ffi autoprefixer-rails multi_json mimemagic pry active_utils activemerchant --- Gemfile.lock | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index 3bc31145c..9f70a927d 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -24,13 +24,13 @@ GEM actionpack active_merchant-paypal-bogus-gateway (0.1.0) activemerchant - active_utils (3.2.0) - activesupport (>= 3.2) + active_utils (3.2.2) + activesupport (>= 3.2, < 5.1.0) i18n activejob (4.2.6) activesupport (= 4.2.6) globalid (>= 0.3.0) - activemerchant (1.59.0) + activemerchant (1.60.0) activesupport (>= 3.2.14, < 5.1) builder (>= 2.1.2, < 4.0.0) i18n (>= 0.6.9) @@ -51,7 +51,7 @@ GEM addressable (2.4.0) arel (6.0.3) ast (2.3.0) - autoprefixer-rails (6.3.6.2) + autoprefixer-rails (6.4.0.2) execjs bcrypt (3.1.11) better_errors (2.1.1) @@ -159,7 +159,7 @@ GEM faraday multi_json erubis (2.7.0) - excon (0.50.1) + excon (0.51.0) execjs (2.7.0) factory_girl (4.7.0) activesupport (>= 3.0.0) @@ -168,7 +168,7 @@ GEM railties (>= 3.0.0) faraday (0.9.2) multipart-post (>= 1.2, < 3) - ffi (1.9.10) + ffi (1.9.14) figaro (1.1.1) thor (~> 0.14) flickraw (0.9.9) @@ -311,7 +311,7 @@ GEM capybara (~> 2.1) cliver (~> 0.3.1) websocket-driver (>= 0.2.0) - pry (0.10.3) + pry (0.10.4) coderay (~> 1.1.0) method_source (~> 0.8.1) slop (~> 3.4) From 5354f2732f01f4185f7afd65b279bf6ea8c07580 Mon Sep 17 00:00:00 2001 From: Daniel O'Connor Date: Mon, 15 Aug 2016 22:07:39 +0930 Subject: [PATCH 062/268] Update bootstrap-sass coveralls friendly_id js-routes sass-rails simplecov --- Gemfile.lock | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index 9f70a927d..53ebe467a 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -67,7 +67,7 @@ GEM bootstrap-kaminari-views (0.0.5) kaminari (>= 0.13) rails (>= 3.1) - bootstrap-sass (3.3.6) + bootstrap-sass (3.3.7) autoprefixer-rails (>= 5.2.1) sass (>= 3.3.4) bootstrap_form (2.5.0) @@ -122,12 +122,12 @@ GEM rails-i18n (>= 4.0.0) sass-rails (>= 4.0.3) concurrent-ruby (1.0.2) - coveralls (0.8.13) - json (~> 1.8) - simplecov (~> 0.11.0) + coveralls (0.8.15) + json (>= 1.8, < 3) + simplecov (~> 0.12.0) term-ansicolor (~> 1.3) thor (~> 0.19.1) - tins (~> 1.6.0) + tins (>= 1.6.0, < 2) csv_shaper (1.2.0) activesupport (>= 3.0.0) dalli (2.7.6) @@ -237,7 +237,7 @@ GEM thor (>= 0.14, < 2.0) jquery-ui-rails (5.0.5) railties (>= 3.2.16) - js-routes (1.2.6) + js-routes (1.2.9) railties (>= 3.2) sprockets-rails json (1.8.3) @@ -390,7 +390,7 @@ GEM sexp_processor (~> 4.1) rubyzip (1.2.0) sass (3.4.22) - sass-rails (5.0.5) + sass-rails (5.0.6) railties (>= 4.0.0, < 6) sass (~> 3.1) sprockets (>= 2.8, < 4.0) @@ -402,13 +402,13 @@ GEM websocket (~> 1.0) sexp_processor (4.7.0) shellany (0.0.1) - simplecov (0.11.2) + simplecov (0.12.0) docile (~> 1.1.0) - json (~> 1.8) + json (>= 1.8, < 3) simplecov-html (~> 0.10.0) simplecov-html (0.10.0) slop (3.6.0) - sprockets (3.6.2) + sprockets (3.7.0) concurrent-ruby (~> 1.0) rack (> 1, < 3) sprockets-rails (3.1.1) @@ -422,7 +422,7 @@ GEM thread (0.2.2) thread_safe (0.3.5) tilt (2.0.5) - tins (1.6.0) + tins (1.12.0) tzinfo (1.2.2) thread_safe (~> 0.1) uglifier (2.7.2) From 711ba73d6b29f3862fd6dff97563dc8570b256c1 Mon Sep 17 00:00:00 2001 From: Daniel O'Connor Date: Mon, 15 Aug 2016 22:12:34 +0930 Subject: [PATCH 063/268] Upgrade devise to 4.2 --- Gemfile.lock | 2 +- spec/rails_helper.rb | 2 +- spec/support/devise.rb | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index 53ebe467a..a78625f16 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -133,7 +133,7 @@ GEM dalli (2.7.6) database_cleaner (1.5.3) debug_inspector (0.0.2) - devise (4.1.1) + devise (4.2.0) bcrypt (~> 3.0) orm_adapter (~> 0.1) railties (>= 4.1.0, < 5.1) diff --git a/spec/rails_helper.rb b/spec/rails_helper.rb index dac96d64e..600c5495d 100644 --- a/spec/rails_helper.rb +++ b/spec/rails_helper.rb @@ -96,7 +96,7 @@ RSpec.configure do |config| # controller specs require this to work with Devise # see https://github.com/plataformatec/devise/wiki/How-To%3a-Controllers-and-Views-tests-with-Rails-3-%28and-rspec%29 - config.include Devise::TestHelpers, type: :controller + config.include Devise::Test::ControllerHelpers, type: :controller config.extend ControllerMacros, type: :controller # Allow just create(:factory) instead of needing to specify FactoryGirl.create(:factory) diff --git a/spec/support/devise.rb b/spec/support/devise.rb index 5fffd6c3f..0cf56ea83 100644 --- a/spec/support/devise.rb +++ b/spec/support/devise.rb @@ -1,4 +1,4 @@ RSpec.configure do |config| - config.include Devise::TestHelpers, type: :controller - config.include Devise::TestHelpers, type: :view + config.include Devise::Test::ControllerHelpers, type: :controller + config.include Devise::Test::ControllerHelpers, type: :view end From 58452204aa3ea6523e4465688f49c206b050cf06 Mon Sep 17 00:00:00 2001 From: Daniel O'Connor Date: Mon, 15 Aug 2016 22:42:32 +0930 Subject: [PATCH 064/268] Add links to ebay, which seems to have a variety of seeds to purchase with our affiliate id --- app/views/crops/_find_seeds.html.haml | 4 +++- app/views/crops/show.html.haml | 4 ++-- app/views/seeds/show.html.haml | 8 ++++++-- 3 files changed, 11 insertions(+), 5 deletions(-) diff --git a/app/views/crops/_find_seeds.html.haml b/app/views/crops/_find_seeds.html.haml index 0e31f6916..e005c9d00 100644 --- a/app/views/crops/_find_seeds.html.haml +++ b/app/views/crops/_find_seeds.html.haml @@ -1,7 +1,7 @@ %h4 Find #{ crop.name } seeds - if crop.seeds.empty? %p - There are no seeds available to trade. + There are no seeds available to trade on Growstuff right now. - else %ul - crop.seeds.tradable.each do |seed| @@ -10,6 +10,8 @@ = render :partial => 'members/location', :locals => { :member => seed.owner } %p = link_to "View all #{crop.name} seeds", seeds_by_crop_path(crop) +%p + = link_to "Purchase seeds via Ebay", "http://rover.ebay.com/rover/1/705-53470-19255-0/1?icep_ff3=9&pub=5575213277&toolid=10001&campid=5337940151&customid=&icep_uq=#{URI.escape crop.name}&icep_sellerId=&icep_ex_kw=&icep_sortBy=12&icep_catId=181003&icep_minPrice=&icep_maxPrice=&ipn=psmain&icep_vectorid=229515&kwid=902099&mtid=824&kw=lg", target: "_blank", rel: "noopener noreferrer" - if crop.approved? - if current_member %p= link_to "List #{crop.name} seeds to trade", new_seed_path(:crop_id => crop.id) diff --git a/app/views/crops/show.html.haml b/app/views/crops/show.html.haml index 79b503cf1..e0408d991 100644 --- a/app/views/crops/show.html.haml +++ b/app/views/crops/show.html.haml @@ -94,6 +94,6 @@ %li= link_to 'Wikipedia (English)', @crop.en_wikipedia_url, target: "_blank", rel: "noopener noreferrer" %li = link_to "Gardenate - Planting reminders", "http://www.gardenate.com/plant/#{URI.escape @crop.name}", target: "_blank", rel: "noopener noreferrer" - %li - - if current_member && current_member.location + - if current_member && current_member.location + %li = link_to "Google", "http://www.google.com/search?q=#{URI.escape ["Growing", @crop.name, current_member.location].join(" ")}", target: "_blank", rel: "noopener noreferrer" diff --git a/app/views/seeds/show.html.haml b/app/views/seeds/show.html.haml index e4e55f68e..751a3dc17 100644 --- a/app/views/seeds/show.html.haml +++ b/app/views/seeds/show.html.haml @@ -69,5 +69,9 @@ - if @seed.owner.location %p %small - View other seeds, members and more near - = link_to @seed.owner.location, place_path(@seed.owner.location, anchor: "seeds") \ No newline at end of file + View other seeds, members to trade with and more near + = link_to @seed.owner.location, place_path(@seed.owner.location, anchor: "seeds") + %p + %small + Or + = link_to "purchase seeds via Ebay", "http://rover.ebay.com/rover/1/705-53470-19255-0/1?icep_ff3=9&pub=5575213277&toolid=10001&campid=5337940151&customid=&icep_uq=#{URI.escape @seed.crop.name}&icep_sellerId=&icep_ex_kw=&icep_sortBy=12&icep_catId=181003&icep_minPrice=&icep_maxPrice=&ipn=psmain&icep_vectorid=229515&kwid=902099&mtid=824&kw=lg", target: "_blank", rel: "noopener noreferrer" \ No newline at end of file From 90a88cf69ddd42317a8ff4583d525cf46561fde8 Mon Sep 17 00:00:00 2001 From: Daniel O'Connor Date: Tue, 16 Aug 2016 10:33:23 +0930 Subject: [PATCH 065/268] Fixes #998 Ensure we look at the current control, not the entire collection --- app/assets/javascripts/append_date.js.coffee | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/app/assets/javascripts/append_date.js.coffee b/app/assets/javascripts/append_date.js.coffee index c1be9ce47..470ae7923 100644 --- a/app/assets/javascripts/append_date.js.coffee +++ b/app/assets/javascripts/append_date.js.coffee @@ -8,13 +8,12 @@ jQuery -> el.datepicker({'format': 'yyyy-mm-dd'}) - href = el.attr('href') - el.click (e) -> e.stopPropagation() e.preventDefault() originalText = $(this).text() + href = $(this).attr('href') $(this).text('Confirm without date') $(this).bind('click.confirm', (e) -> @@ -30,6 +29,8 @@ jQuery -> el.one 'changeDate', -> date = $(this).datepicker('getDate') + href = $(this).attr('href') + url = "#{href}&planting[finished_at]=#{date}" link = $("") From 5d70d822eb2086a0f2d97b1524af436e6e90f4ba Mon Sep 17 00:00:00 2001 From: Daniel O'Connor Date: Tue, 16 Aug 2016 10:55:40 +0930 Subject: [PATCH 066/268] #951 Swap to deliver_later implementation --- app/controllers/crops_controller.rb | 6 +++--- app/models/notification.rb | 2 +- lib/tasks/growstuff.rake | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/app/controllers/crops_controller.rb b/app/controllers/crops_controller.rb index 9dd8a3ed4..2833a2bf0 100644 --- a/app/controllers/crops_controller.rb +++ b/app/controllers/crops_controller.rb @@ -144,7 +144,7 @@ class CropsController < ApplicationController end unless current_member.has_role? :crop_wrangler Role.crop_wranglers.each do |w| - Notifier.new_crop_request(w, @crop).deliver_now! + Notifier.new_crop_request(w, @crop).deliver_later! end end @@ -188,8 +188,8 @@ class CropsController < ApplicationController if previous_status == "pending" requester = @crop.requester new_status = @crop.approval_status - Notifier.crop_request_approved(requester, @crop).deliver_now! if new_status == "approved" - Notifier.crop_request_rejected(requester, @crop).deliver_now! if new_status == "rejected" + Notifier.crop_request_approved(requester, @crop).deliver_later! if new_status == "approved" + Notifier.crop_request_rejected(requester, @crop).deliver_later! if new_status == "rejected" end format.html { redirect_to @crop, notice: 'Crop was successfully updated.' } format.json { head :no_content } diff --git a/app/models/notification.rb b/app/models/notification.rb index 7b61e0c45..567867b00 100644 --- a/app/models/notification.rb +++ b/app/models/notification.rb @@ -23,7 +23,7 @@ class Notification < ActiveRecord::Base def send_email if self.recipient.send_notification_email - Notifier.notify(self).deliver_now + Notifier.notify(self).deliver_later end end diff --git a/lib/tasks/growstuff.rake b/lib/tasks/growstuff.rake index 5e0aa6d88..86398cdb5 100644 --- a/lib/tasks/growstuff.rake +++ b/lib/tasks/growstuff.rake @@ -49,7 +49,7 @@ namespace :growstuff do if Date.today.cwday == send_on_day and Date.today.cweek % every_n_weeks == 0 Member.confirmed.find_each do |m| - Notifier.planting_reminder(m).deliver_now! + Notifier.planting_reminder(m).deliver_later! end end end From 4deb895b4cc7ccbcb47e08205ef672e94d354891 Mon Sep 17 00:00:00 2001 From: Daniel O'Connor Date: Tue, 16 Aug 2016 10:59:30 +0930 Subject: [PATCH 067/268] #951 Add sidekiq --- Gemfile | 2 ++ Gemfile.lock | 17 +++++++++++++++++ 2 files changed, 19 insertions(+) diff --git a/Gemfile b/Gemfile index 6dd1d971b..25750b40a 100644 --- a/Gemfile +++ b/Gemfile @@ -38,6 +38,8 @@ gem 'bootstrap-kaminari-views' # bootstrap views for kaminari gem 'activemerchant' gem 'active_utils' +gem 'sidekiq' +gem 'sidekiq-web' # Markdown formatting for updates etc gem 'bluecloth' diff --git a/Gemfile.lock b/Gemfile.lock index bec67f472..9b4e17629 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -122,6 +122,7 @@ GEM rails-i18n (>= 4.0.0) sass-rails (>= 4.0.3) concurrent-ruby (1.0.2) + connection_pool (2.2.0) coveralls (0.8.13) json (~> 1.8) simplecov (~> 0.11.0) @@ -319,6 +320,8 @@ GEM quiet_assets (1.1.0) railties (>= 3.1, < 5.0) rack (1.6.4) + rack-protection (1.5.3) + rack rack-test (0.6.3) rack (>= 1.0) rails (4.2.7.1) @@ -358,6 +361,7 @@ GEM rb-fsevent (0.9.7) rb-inotify (0.9.7) ffi (>= 0.5.0) + redis (3.3.1) responders (2.2.0) railties (>= 4.2.0, < 5.1) rspec (3.4.0) @@ -403,11 +407,22 @@ GEM websocket (~> 1.0) sexp_processor (4.7.0) shellany (0.0.1) + sidekiq (4.1.4) + concurrent-ruby (~> 1.0) + connection_pool (~> 2.2, >= 2.2.0) + redis (~> 3.2, >= 3.2.1) + sinatra (>= 1.4.7) + sidekiq-web (0.0.1) + rails (~> 4.2.0) simplecov (0.11.2) docile (~> 1.1.0) json (~> 1.8) simplecov-html (~> 0.10.0) simplecov-html (0.10.0) + sinatra (1.4.7) + rack (~> 1.5) + rack-protection (~> 1.4) + tilt (>= 1.3, < 3) slop (3.6.0) sprockets (3.7.0) concurrent-ruby (~> 1.0) @@ -514,6 +529,8 @@ DEPENDENCIES ruby-units sass-rails (~> 5.0.4) selenium-webdriver + sidekiq + sidekiq-web uglifier (~> 2.7.2) unicorn webrat From 6b470f180cbcf97aa25327d0da0cde1c2a145e48 Mon Sep 17 00:00:00 2001 From: Daniel O'Connor Date: Tue, 16 Aug 2016 11:01:19 +0930 Subject: [PATCH 068/268] #951 Add sidekiq as our activejob backend --- config/environments/development.rb | 2 ++ config/environments/production.rb | 1 + config/environments/staging.rb | 1 + 3 files changed, 4 insertions(+) diff --git a/config/environments/development.rb b/config/environments/development.rb index 700771c10..d5496158e 100644 --- a/config/environments/development.rb +++ b/config/environments/development.rb @@ -74,4 +74,6 @@ Growstuff::Application.configure do end config.action_controller.action_on_unpermitted_parameters = :raise + + config.active_job.queue_adapter = :sidekiq end diff --git a/config/environments/production.rb b/config/environments/production.rb index 618eb8344..6656203ae 100644 --- a/config/environments/production.rb +++ b/config/environments/production.rb @@ -101,4 +101,5 @@ Growstuff::Application.configure do ::EXPRESS_GATEWAY = ActiveMerchant::Billing::PaypalExpressGateway.new(paypal_options) end + config.active_job.queue_adapter = :sidekiq end diff --git a/config/environments/staging.rb b/config/environments/staging.rb index 8f2352ff4..93cb213e2 100644 --- a/config/environments/staging.rb +++ b/config/environments/staging.rb @@ -99,4 +99,5 @@ Growstuff::Application.configure do ::EXPRESS_GATEWAY = ActiveMerchant::Billing::PaypalExpressGateway.new(paypal_options) end + config.active_job.queue_adapter = :sidekiq end From 5008d356142621bf72b8bcd585fddc6fef657857 Mon Sep 17 00:00:00 2001 From: Daniel O'Connor Date: Tue, 16 Aug 2016 11:02:35 +0930 Subject: [PATCH 069/268] Add sidekiq configuration --- config/initializers/sidekiq.rb | 9 +++++++++ config/sidekiq.yml | 5 +++++ 2 files changed, 14 insertions(+) create mode 100644 config/initializers/sidekiq.rb create mode 100644 config/sidekiq.yml diff --git a/config/initializers/sidekiq.rb b/config/initializers/sidekiq.rb new file mode 100644 index 000000000..074c85f33 --- /dev/null +++ b/config/initializers/sidekiq.rb @@ -0,0 +1,9 @@ +# config/initializers/sidekiq.rb + +Sidekiq.configure_server do |config| + config.redis = { url: 'redis://localhost:6379/0', namespace: "app3_sidekiq_#{Rails.env}" } +end + +Sidekiq.configure_client do |config| + config.redis = { url: 'redis://localhost:6379/0', namespace: "app3_sidekiq_#{Rails.env}" } +end \ No newline at end of file diff --git a/config/sidekiq.yml b/config/sidekiq.yml new file mode 100644 index 000000000..b68d2e2d0 --- /dev/null +++ b/config/sidekiq.yml @@ -0,0 +1,5 @@ +--- +:concurrency: 1 +:queues: + - default + - mailers From ece0fdfe6cb456ec85ac417c0a1ea5f198956e79 Mon Sep 17 00:00:00 2001 From: Daniel O'Connor Date: Tue, 16 Aug 2016 11:08:59 +0930 Subject: [PATCH 070/268] Drop sidekiq web for the moment --- Gemfile | 1 - Gemfile.lock | 3 --- 2 files changed, 4 deletions(-) diff --git a/Gemfile b/Gemfile index 25750b40a..e822e3b7b 100644 --- a/Gemfile +++ b/Gemfile @@ -39,7 +39,6 @@ gem 'bootstrap-kaminari-views' # bootstrap views for kaminari gem 'activemerchant' gem 'active_utils' gem 'sidekiq' -gem 'sidekiq-web' # Markdown formatting for updates etc gem 'bluecloth' diff --git a/Gemfile.lock b/Gemfile.lock index 9b4e17629..5ac3fbe8b 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -412,8 +412,6 @@ GEM connection_pool (~> 2.2, >= 2.2.0) redis (~> 3.2, >= 3.2.1) sinatra (>= 1.4.7) - sidekiq-web (0.0.1) - rails (~> 4.2.0) simplecov (0.11.2) docile (~> 1.1.0) json (~> 1.8) @@ -530,7 +528,6 @@ DEPENDENCIES sass-rails (~> 5.0.4) selenium-webdriver sidekiq - sidekiq-web uglifier (~> 2.7.2) unicorn webrat From 0a722edc88b018e85d06f9ca54c4e8dd379dfff8 Mon Sep 17 00:00:00 2001 From: Daniel O'Connor Date: Tue, 16 Aug 2016 11:45:58 +0930 Subject: [PATCH 071/268] Fix regression from bad merge --- Gemfile.lock | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index 5ac3fbe8b..0cd3f6d40 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -134,7 +134,7 @@ GEM dalli (2.7.6) database_cleaner (1.5.3) debug_inspector (0.0.2) - devise (4.1.1) + devise (4.2.0) bcrypt (~> 3.0) orm_adapter (~> 0.1) railties (>= 4.1.0, < 5.1) @@ -362,7 +362,7 @@ GEM rb-inotify (0.9.7) ffi (>= 0.5.0) redis (3.3.1) - responders (2.2.0) + responders (2.3.0) railties (>= 4.2.0, < 5.1) rspec (3.4.0) rspec-core (~> 3.4.0) From a68ffda7eb2743d83d82fdcf3ebaf45bae3cfe60 Mon Sep 17 00:00:00 2001 From: Daniel O'Connor Date: Mon, 15 Aug 2016 22:01:56 +0930 Subject: [PATCH 072/268] Upgrade minor gems: kramdown, notifany, httparty, codemirror-rails, bootstrap_form, globalid --- Gemfile.lock | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index 0cd3f6d40..a36e4e2eb 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -70,7 +70,7 @@ GEM bootstrap-sass (3.3.6) autoprefixer-rails (>= 5.2.1) sass (>= 3.3.4) - bootstrap_form (2.3.0) + bootstrap_form (2.5.0) builder (3.2.2) byebug (9.0.5) cancancan (1.15.0) @@ -96,8 +96,8 @@ GEM climate_control (>= 0.0.3, < 1.0) codeclimate-test-reporter (0.6.0) simplecov (>= 0.7.1, < 1.0.0) - codemirror-rails (5.11) - railties (>= 3.0, < 5) + codemirror-rails (5.16.0) + railties (>= 3.0, < 6.0) coderay (1.1.1) coffee-rails (4.1.1) coffee-script (>= 2.2.0) @@ -219,8 +219,7 @@ GEM haml (~> 4.0.0) nokogiri (~> 1.6.0) ruby_parser (~> 3.5) - httparty (0.13.7) - json (~> 1.8) + httparty (0.14.0) multi_xml (>= 0.5.2) i18n (0.7.0) i18n-tasks (0.9.5) @@ -247,7 +246,7 @@ GEM actionpack (>= 3.0.0) activesupport (>= 3.0.0) kgio (2.10.0) - kramdown (1.11.1) + kramdown (1.12.0) launchy (2.4.3) addressable (~> 2.3) leaflet-markercluster-rails (0.7.0) @@ -280,7 +279,7 @@ GEM nokogiri (1.6.8) mini_portile2 (~> 2.1.0) pkg-config (~> 1.1.7) - notiffany (0.1.0) + notiffany (0.1.1) nenv (~> 0.1) shellany (~> 0.0) oauth (0.5.1) From 18b4a90690e67388d5877d102200a4ec4a471dc5 Mon Sep 17 00:00:00 2001 From: Daniel O'Connor Date: Mon, 15 Aug 2016 22:04:43 +0930 Subject: [PATCH 073/268] Upgrade excon ffi autoprefixer-rails multi_json mimemagic pry active_utils activemerchant --- Gemfile.lock | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index a36e4e2eb..abb923fd0 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -24,13 +24,13 @@ GEM actionpack active_merchant-paypal-bogus-gateway (0.1.0) activemerchant - active_utils (3.2.0) - activesupport (>= 3.2) + active_utils (3.2.2) + activesupport (>= 3.2, < 5.1.0) i18n activejob (4.2.7.1) activesupport (= 4.2.7.1) globalid (>= 0.3.0) - activemerchant (1.59.0) + activemerchant (1.60.0) activesupport (>= 3.2.14, < 5.1) builder (>= 2.1.2, < 4.0.0) i18n (>= 0.6.9) @@ -51,7 +51,7 @@ GEM addressable (2.4.0) arel (6.0.3) ast (2.3.0) - autoprefixer-rails (6.3.6.2) + autoprefixer-rails (6.4.0.2) execjs bcrypt (3.1.11) better_errors (2.1.1) @@ -160,7 +160,7 @@ GEM faraday multi_json erubis (2.7.0) - excon (0.50.1) + excon (0.51.0) execjs (2.7.0) factory_girl (4.7.0) activesupport (>= 3.0.0) @@ -169,7 +169,7 @@ GEM railties (>= 3.0.0) faraday (0.9.2) multipart-post (>= 1.2, < 3) - ffi (1.9.10) + ffi (1.9.14) figaro (1.1.1) thor (~> 0.14) flickraw (0.9.9) @@ -312,7 +312,7 @@ GEM capybara (~> 2.1) cliver (~> 0.3.1) websocket-driver (>= 0.2.0) - pry (0.10.3) + pry (0.10.4) coderay (~> 1.1.0) method_source (~> 0.8.1) slop (~> 3.4) From e399085a574cc45f0ed756a83a7fb70b3e0e60fb Mon Sep 17 00:00:00 2001 From: Daniel O'Connor Date: Mon, 15 Aug 2016 22:07:39 +0930 Subject: [PATCH 074/268] Update bootstrap-sass coveralls friendly_id js-routes sass-rails simplecov --- Gemfile.lock | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index abb923fd0..89aa54eda 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -67,7 +67,7 @@ GEM bootstrap-kaminari-views (0.0.5) kaminari (>= 0.13) rails (>= 3.1) - bootstrap-sass (3.3.6) + bootstrap-sass (3.3.7) autoprefixer-rails (>= 5.2.1) sass (>= 3.3.4) bootstrap_form (2.5.0) @@ -122,13 +122,12 @@ GEM rails-i18n (>= 4.0.0) sass-rails (>= 4.0.3) concurrent-ruby (1.0.2) - connection_pool (2.2.0) - coveralls (0.8.13) - json (~> 1.8) - simplecov (~> 0.11.0) + coveralls (0.8.15) + json (>= 1.8, < 3) + simplecov (~> 0.12.0) term-ansicolor (~> 1.3) thor (~> 0.19.1) - tins (~> 1.6.0) + tins (>= 1.6.0, < 2) csv_shaper (1.2.0) activesupport (>= 3.0.0) dalli (2.7.6) @@ -238,7 +237,7 @@ GEM thor (>= 0.14, < 2.0) jquery-ui-rails (5.0.5) railties (>= 3.2.16) - js-routes (1.2.6) + js-routes (1.2.9) railties (>= 3.2) sprockets-rails json (1.8.3) @@ -394,7 +393,7 @@ GEM sexp_processor (~> 4.1) rubyzip (1.2.0) sass (3.4.22) - sass-rails (5.0.5) + sass-rails (5.0.6) railties (>= 4.0.0, < 6) sass (~> 3.1) sprockets (>= 2.8, < 4.0) @@ -411,9 +410,9 @@ GEM connection_pool (~> 2.2, >= 2.2.0) redis (~> 3.2, >= 3.2.1) sinatra (>= 1.4.7) - simplecov (0.11.2) + simplecov (0.12.0) docile (~> 1.1.0) - json (~> 1.8) + json (>= 1.8, < 3) simplecov-html (~> 0.10.0) simplecov-html (0.10.0) sinatra (1.4.7) @@ -435,7 +434,7 @@ GEM thread (0.2.2) thread_safe (0.3.5) tilt (2.0.5) - tins (1.6.0) + tins (1.12.0) tzinfo (1.2.2) thread_safe (~> 0.1) uglifier (2.7.2) From 049d7920539184d59cbe0fc6f6628b18887cb040 Mon Sep 17 00:00:00 2001 From: Daniel O'Connor Date: Tue, 16 Aug 2016 12:05:14 +0930 Subject: [PATCH 075/268] Fix Gemfile.lock --- Gemfile.lock | 1 + 1 file changed, 1 insertion(+) diff --git a/Gemfile.lock b/Gemfile.lock index 89aa54eda..4bad7db42 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -122,6 +122,7 @@ GEM rails-i18n (>= 4.0.0) sass-rails (>= 4.0.3) concurrent-ruby (1.0.2) + connection_pool (2.2.0) coveralls (0.8.15) json (>= 1.8, < 3) simplecov (~> 0.12.0) From 1c3016a31ee640ec927e0da5a1199ea5b663e7a1 Mon Sep 17 00:00:00 2001 From: Daniel O'Connor Date: Mon, 22 Aug 2016 16:17:36 +0930 Subject: [PATCH 076/268] Adjust for when running with selenium-webdriver to avoid clicks being placed in the wrong location; and for drivers that don't support blacklisting --- spec/rails_helper.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/spec/rails_helper.rb b/spec/rails_helper.rb index dac96d64e..1fc4fc7ae 100644 --- a/spec/rails_helper.rb +++ b/spec/rails_helper.rb @@ -109,6 +109,8 @@ RSpec.configure do |config| 'mapbox.com', 'okfn.org', 'googlecode.com', - ] + ] if page.driver.browser.respond_to?(:url_blacklist) + + page.driver.browser.manage.window.maximize end end From 9ab79209efad08ab9c6a6acc02ff5013ead62c0a Mon Sep 17 00:00:00 2001 From: Daniel O'Connor Date: Mon, 22 Aug 2016 16:35:41 +0930 Subject: [PATCH 077/268] Adjust TOS url --- app/views/members/finish_signup.haml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/members/finish_signup.haml b/app/views/members/finish_signup.haml index 54aa22b4b..5d88cf43b 100644 --- a/app/views/members/finish_signup.haml +++ b/app/views/members/finish_signup.haml @@ -27,7 +27,7 @@ = f.check_box :tos_agreement I agree to the = succeed "." do - = link_to 'Terms of Service', url_for(:action => 'tos', :controller => '/policy') + = link_to 'Terms of Service', "#{root_url}/policy/tos" .form-group .col-md-offset-2.col-md-8.checkbox %label From c7be0f3b0e4974e4856e3fbc3233f11eae3970ac Mon Sep 17 00:00:00 2001 From: Daniel O'Connor Date: Mon, 22 Aug 2016 16:35:58 +0930 Subject: [PATCH 078/268] Fix redirects and sign the user in if they weren't yet created --- app/controllers/omniauth_callbacks_controller.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/controllers/omniauth_callbacks_controller.rb b/app/controllers/omniauth_callbacks_controller.rb index 13df37c22..f2c54f4b4 100644 --- a/app/controllers/omniauth_callbacks_controller.rb +++ b/app/controllers/omniauth_callbacks_controller.rb @@ -31,7 +31,8 @@ class OmniauthCallbacksController < Devise::OmniauthCallbacksController set_flash_message(:notice, :success, :kind => auth['provider']) if is_navigational_format? else session["devise.#{auth['provider']}_data"] = request.env["omniauth.auth"] - redirect_to new_member_registration_url + sign_in member + redirect_to finish_signup_url(member) end else redirect_to request.env['omniauth.origin'] || edit_member_registration_path From 4e2311e8d7ee2cd036c9c9a6a807e9479ea818cd Mon Sep 17 00:00:00 2001 From: Daniel O'Connor Date: Mon, 22 Aug 2016 16:36:30 +0930 Subject: [PATCH 079/268] Indent --- spec/features/signup_spec.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spec/features/signup_spec.rb b/spec/features/signup_spec.rb index 5e5e2173d..8f3ad45b3 100644 --- a/spec/features/signup_spec.rb +++ b/spec/features/signup_spec.rb @@ -46,7 +46,7 @@ feature "signup", js: true do end context "with facebook" do - scenario "sign up" do + scenario "sign up" do # Ordinarily done by database_cleaner Member.where(login_name: 'tdawg').delete_all Member.where(email: 'tdawg@hotmail.com').delete_all From 4b7cffad04e807d0a06a25f868273b811ddc84a0 Mon Sep 17 00:00:00 2001 From: Daniel O'Connor Date: Mon, 22 Aug 2016 16:42:08 +0930 Subject: [PATCH 080/268] DEPRECATION WARNING: [Devise] bypass option is deprecated and it will be removed in future version of Devise. --- app/controllers/members_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/members_controller.rb b/app/controllers/members_controller.rb index b98681a12..b586e2b55 100644 --- a/app/controllers/members_controller.rb +++ b/app/controllers/members_controller.rb @@ -76,7 +76,7 @@ class MembersController < ApplicationController if request.patch? && params[:member] if @member.update(member_params) @member.skip_reconfirmation! - sign_in(@member, :bypass => true) + bypass_sign_in(@member) redirect_to root_path, notice: 'Welcome.' else flash[:alert] = 'Failed to complete signup' From 20b87e596a7a1b1fbbcaaaee222eb205e047bf27 Mon Sep 17 00:00:00 2001 From: Daniel O'Connor Date: Mon, 22 Aug 2016 18:25:57 +0930 Subject: [PATCH 081/268] Modern syntax --- app/controllers/omniauth_callbacks_controller.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/controllers/omniauth_callbacks_controller.rb b/app/controllers/omniauth_callbacks_controller.rb index f2c54f4b4..fe3e1c6bd 100644 --- a/app/controllers/omniauth_callbacks_controller.rb +++ b/app/controllers/omniauth_callbacks_controller.rb @@ -27,8 +27,8 @@ class OmniauthCallbacksController < Devise::OmniauthCallbacksController @authentication = action.establish_authentication(auth, member) unless action.member_created? - sign_in_and_redirect member, :event => :authentication #this will throw if @user is not activated - set_flash_message(:notice, :success, :kind => auth['provider']) if is_navigational_format? + sign_in_and_redirect member, event: :authentication #this will throw if @user is not activated + set_flash_message(:notice, :success, kind: auth['provider']) if is_navigational_format? else session["devise.#{auth['provider']}_data"] = request.env["omniauth.auth"] sign_in member From 0f034523e164658e88f63d22b5355ec4256674f4 Mon Sep 17 00:00:00 2001 From: Daniel O'Connor Date: Mon, 22 Aug 2016 18:26:08 +0930 Subject: [PATCH 082/268] Only maximize if the driver supports such a thing --- spec/rails_helper.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spec/rails_helper.rb b/spec/rails_helper.rb index 9307441c9..c9ab1e79e 100644 --- a/spec/rails_helper.rb +++ b/spec/rails_helper.rb @@ -111,6 +111,6 @@ RSpec.configure do |config| 'googlecode.com', ] if page.driver.browser.respond_to?(:url_blacklist) - page.driver.browser.manage.window.maximize + page.driver.browser.manage.window.maximize if page.driver.browser.respond_to?(:manage) end end From 87352b04f10badecf2e01c043f0e930262b4790d Mon Sep 17 00:00:00 2001 From: Daniel O'Connor Date: Mon, 22 Aug 2016 18:52:12 +0930 Subject: [PATCH 083/268] Refactor to a method to DRY, even if its not 100% the best spot for it to live long term --- app/controllers/authentications_controller.rb | 11 +-------- lib/actions/oauth_signup_action.rb | 24 ++++++++++++------- 2 files changed, 16 insertions(+), 19 deletions(-) diff --git a/app/controllers/authentications_controller.rb b/app/controllers/authentications_controller.rb index 8b84aa04c..34ed65aa8 100644 --- a/app/controllers/authentications_controller.rb +++ b/app/controllers/authentications_controller.rb @@ -7,16 +7,7 @@ class AuthenticationsController < ApplicationController auth = request.env['omniauth.auth'] @authentication = nil if auth - - name = '' - case auth['provider'] - when 'twitter' - name = auth['info']['nickname'] - when 'flickr', 'facebook' - name = auth['info']['name'] - else - name = auth['info']['name'] - end + name = Growstuff::OauthSignupAction.new.determine_name(auth) @authentication = current_member.authentications .create_with( diff --git a/lib/actions/oauth_signup_action.rb b/lib/actions/oauth_signup_action.rb index 144af6002..8102d53e8 100644 --- a/lib/actions/oauth_signup_action.rb +++ b/lib/actions/oauth_signup_action.rb @@ -38,15 +38,7 @@ class Growstuff::OauthSignupAction # - We need to create it # def establish_authentication(auth, member) - name = '' - case auth['provider'] - when 'twitter' - name = auth['info']['nickname'] - when 'flickr', 'facebook' - name = auth['info']['name'] - else - name = auth['info']['name'] - end + name = determine_name(auth) authentication = member.authentications .create_with( @@ -67,4 +59,18 @@ class Growstuff::OauthSignupAction def member_created? @member_created end + + def determine_name(auth) + name = '' + case auth['provider'] + when 'twitter' + name = auth['info']['nickname'] + when 'flickr', 'facebook' + name = auth['info']['name'] + else + name = auth['info']['name'] + end + + name + end end \ No newline at end of file From b91f0e7f63e9de2a26bc0ac4669bf111b8274519 Mon Sep 17 00:00:00 2001 From: Daniel O'Connor Date: Mon, 22 Aug 2016 18:59:28 +0930 Subject: [PATCH 084/268] Whitelist providers to avoid session data being tampered with --- app/controllers/omniauth_callbacks_controller.rb | 2 ++ 1 file changed, 2 insertions(+) diff --git a/app/controllers/omniauth_callbacks_controller.rb b/app/controllers/omniauth_callbacks_controller.rb index fe3e1c6bd..f6795bdef 100644 --- a/app/controllers/omniauth_callbacks_controller.rb +++ b/app/controllers/omniauth_callbacks_controller.rb @@ -30,6 +30,8 @@ class OmniauthCallbacksController < Devise::OmniauthCallbacksController sign_in_and_redirect member, event: :authentication #this will throw if @user is not activated set_flash_message(:notice, :success, kind: auth['provider']) if is_navigational_format? else + raise "Invalid provider" unless ['facebook', 'twitter', 'flickr'].index(auth['provider'].to_s) + session["devise.#{auth['provider']}_data"] = request.env["omniauth.auth"] sign_in member redirect_to finish_signup_url(member) From 29765ebc195cfeb74382c54110b0a939c7231963 Mon Sep 17 00:00:00 2001 From: Daniel O'Connor Date: Mon, 22 Aug 2016 19:02:27 +0930 Subject: [PATCH 085/268] rubocop --only HashSyntax --auto-correct --- config/initializers/devise.rb | 2 +- lib/actions/oauth_signup_action.rb | 14 +++++++------- .../controllers/notifications_controller_spec.rb | 4 ++-- spec/views/posts/_single.html.haml_spec.rb | 16 ++++++++-------- 4 files changed, 18 insertions(+), 18 deletions(-) diff --git a/config/initializers/devise.rb b/config/initializers/devise.rb index a92ad60fb..d37c92188 100644 --- a/config/initializers/devise.rb +++ b/config/initializers/devise.rb @@ -233,5 +233,5 @@ Devise.setup do |config| # 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' + 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 diff --git a/lib/actions/oauth_signup_action.rb b/lib/actions/oauth_signup_action.rb index 8102d53e8..542c4e6b8 100644 --- a/lib/actions/oauth_signup_action.rb +++ b/lib/actions/oauth_signup_action.rb @@ -42,15 +42,15 @@ class Growstuff::OauthSignupAction authentication = member.authentications .create_with( - :name => name, - :token => auth['credentials']['token'], - :secret => auth['credentials']['secret'], + name: name, + token: auth['credentials']['token'], + secret: auth['credentials']['secret'], ) .find_or_create_by( - :provider => auth['provider'], - :uid => auth['uid'], - :name => name, - :member_id => member.id + provider: auth['provider'], + uid: auth['uid'], + name: name, + member_id: member.id ) authentication diff --git a/spec/controllers/notifications_controller_spec.rb b/spec/controllers/notifications_controller_spec.rb index a7737dad2..de97919c3 100644 --- a/spec/controllers/notifications_controller_spec.rb +++ b/spec/controllers/notifications_controller_spec.rb @@ -81,8 +81,8 @@ describe NotificationsController do describe "GET reply" do it "marks notifications as read" do - notification = FactoryGirl.create(:notification, :recipient_id => subject.current_member.id) - get :reply, {:id => notification.to_param} + notification = FactoryGirl.create(:notification, recipient_id: subject.current_member.id) + get :reply, {id: notification.to_param} # we need to fetch it from the db again, can't test against the old one n = Notification.find(notification.id) n.read.should eq true diff --git a/spec/views/posts/_single.html.haml_spec.rb b/spec/views/posts/_single.html.haml_spec.rb index 14551afc3..eabef90fe 100644 --- a/spec/views/posts/_single.html.haml_spec.rb +++ b/spec/views/posts/_single.html.haml_spec.rb @@ -135,7 +135,7 @@ describe "posts/_single" do @member = FactoryGirl.create(:member) sign_in @member controller.stub(:current_user) { @member } - @post = FactoryGirl.create(:post, :author => @member) + @post = FactoryGirl.create(:post, author: @member) @post.update(body: "I am updated") render_post end @@ -154,10 +154,10 @@ describe "posts/_single" do @member = FactoryGirl.create(:member) sign_in @member controller.stub(:current_user) { @member } - @post = FactoryGirl.create(:post, :author => @member) - @comment = FactoryGirl.create(:comment, :post => @post) + @post = FactoryGirl.create(:post, author: @member) + @comment = FactoryGirl.create(:comment, post: @post) @comment.update(body: "I've been updated") - render :partial => "comments/single", :locals => { :comment => @comment } + render partial: "comments/single", locals: { comment: @comment } end it "shows edited at time" do @@ -174,7 +174,7 @@ describe "posts/_single" do @member = FactoryGirl.create(:member) sign_in @member controller.stub(:current_user) { @member } - @post = FactoryGirl.create(:post, :author => @member) + @post = FactoryGirl.create(:post, author: @member) @post.update(updated_at: @post.created_at) render_post end @@ -189,10 +189,10 @@ describe "posts/_single" do @member = FactoryGirl.create(:member) sign_in @member controller.stub(:current_user) { @member } - @post = FactoryGirl.create(:post, :author => @member) - @comment = FactoryGirl.create(:comment, :post => @post) + @post = FactoryGirl.create(:post, author: @member) + @comment = FactoryGirl.create(:comment, post: @post) @comment.update(updated_at: @comment.created_at) - render :partial => "comments/single", :locals => { :comment => @comment } + render partial: "comments/single", locals: { comment: @comment } end it "does not show edited at" do From 7d3afa005cd6da3f563aa3b4f1859686e83277dc Mon Sep 17 00:00:00 2001 From: Cesy Avon Date: Mon, 22 Aug 2016 14:00:03 +0000 Subject: [PATCH 086/268] Updating a few gems --- Gemfile.lock | 82 ++++++++++++++++++++++++++-------------------------- 1 file changed, 41 insertions(+), 41 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index 962702a70..4a3febf0d 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -62,7 +62,7 @@ GEM debug_inspector (>= 0.0.1) bluecloth (2.2.0) bonsai-elasticsearch-rails (0.0.4) - bootstrap-datepicker-rails (1.6.1.1) + bootstrap-datepicker-rails (1.6.4.1) railties (>= 3.0) bootstrap-kaminari-views (0.0.5) kaminari (>= 0.13) @@ -74,7 +74,7 @@ GEM builder (3.2.2) byebug (9.0.5) cancancan (1.15.0) - capybara (2.7.1) + capybara (2.8.0) addressable mime-types (>= 1.16) nokogiri (>= 1.3.3) @@ -128,7 +128,7 @@ GEM term-ansicolor (~> 1.3) thor (~> 0.19.1) tins (>= 1.6.0, < 2) - csv_shaper (1.2.0) + csv_shaper (1.3.0) activesupport (>= 3.0.0) dalli (2.7.6) database_cleaner (1.5.3) @@ -145,17 +145,17 @@ GEM json thread thread_safe - elasticsearch (1.0.18) - elasticsearch-api (= 1.0.18) - elasticsearch-transport (= 1.0.18) - elasticsearch-api (1.0.18) + elasticsearch (2.0.0) + elasticsearch-api (= 2.0.0) + elasticsearch-transport (= 2.0.0) + elasticsearch-api (2.0.0) multi_json elasticsearch-model (0.1.9) activesupport (> 3) elasticsearch (> 0.4) hashie elasticsearch-rails (0.1.9) - elasticsearch-transport (1.0.18) + elasticsearch-transport (2.0.0) faraday multi_json erubis (2.7.0) @@ -196,7 +196,7 @@ GEM shellany (~> 0.0) thor (>= 0.18.1) guard-compat (1.2.1) - guard-rspec (4.7.2) + guard-rspec (4.7.3) guard (~> 2.1) guard-compat (~> 1.1) rspec (>= 2.99.0, < 4.0) @@ -231,13 +231,13 @@ GEM parser (>= 2.2.3.0) term-ansicolor (>= 1.3.2) terminal-table (>= 1.5.1) - jquery-rails (4.1.1) + jquery-rails (4.2.1) rails-dom-testing (>= 1, < 3) railties (>= 4.2.0) thor (>= 0.14, < 2.0) jquery-ui-rails (5.0.5) railties (>= 3.2.16) - js-routes (1.2.9) + js-routes (1.3.0) railties (>= 3.2) sprockets-rails json (1.8.3) @@ -267,14 +267,14 @@ GEM mime-types (3.1) mime-types-data (~> 3.2015) mime-types-data (3.2016.0521) - mimemagic (0.3.0) + mimemagic (0.3.2) mini_portile2 (2.1.0) minitest (5.9.0) multi_json (1.11.3) multi_xml (0.5.5) multipart-post (2.0.0) nenv (0.3.0) - newrelic_rpm (3.16.0.318) + newrelic_rpm (3.16.1.320) nokogiri (1.6.8) mini_portile2 (~> 2.1.0) pkg-config (~> 1.1.7) @@ -295,12 +295,12 @@ GEM json (~> 1.3) omniauth-oauth (~> 1.1) orm_adapter (0.5.0) - paperclip (4.3.6) - activemodel (>= 3.2.0) - activesupport (>= 3.2.0) + paperclip (5.1.0) + activemodel (>= 4.2.0) + activesupport (>= 4.2.0) cocaine (~> 0.5.5) mime-types - mimemagic (= 0.3.0) + mimemagic (~> 0.3.0) parser (2.3.1.2) ast (~> 2.2) pg (0.18.4) @@ -339,7 +339,7 @@ GEM rails-deprecated_sanitizer (>= 1.0.1) rails-html-sanitizer (1.0.3) loofah (~> 2.0) - rails-i18n (4.0.8) + rails-i18n (4.0.9) i18n (~> 0.7) railties (~> 4.0) rails_12factor (0.0.3) @@ -352,40 +352,40 @@ GEM activesupport (= 4.2.7.1) rake (>= 0.8.7) thor (>= 0.18.1, < 2.0) - raindrops (0.16.0) + raindrops (0.17.0) rake (11.2.2) rb-fsevent (0.9.7) rb-inotify (0.9.7) ffi (>= 0.5.0) - responders (2.2.0) + responders (2.3.0) railties (>= 4.2.0, < 5.1) - rspec (3.4.0) - rspec-core (~> 3.4.0) - rspec-expectations (~> 3.4.0) - rspec-mocks (~> 3.4.0) + rspec (3.5.0) + rspec-core (~> 3.5.0) + rspec-expectations (~> 3.5.0) + rspec-mocks (~> 3.5.0) rspec-activemodel-mocks (1.0.3) activemodel (>= 3.0) activesupport (>= 3.0) rspec-mocks (>= 2.99, < 4.0) - rspec-core (3.4.4) - rspec-support (~> 3.4.0) - rspec-expectations (3.4.0) + rspec-core (3.5.2) + rspec-support (~> 3.5.0) + rspec-expectations (3.5.0) diff-lcs (>= 1.2.0, < 2.0) - rspec-support (~> 3.4.0) - rspec-mocks (3.4.1) + rspec-support (~> 3.5.0) + rspec-mocks (3.5.0) diff-lcs (>= 1.2.0, < 2.0) - rspec-support (~> 3.4.0) - rspec-rails (3.4.2) - actionpack (>= 3.0, < 4.3) - activesupport (>= 3.0, < 4.3) - railties (>= 3.0, < 4.3) - rspec-core (~> 3.4.0) - rspec-expectations (~> 3.4.0) - rspec-mocks (~> 3.4.0) - rspec-support (~> 3.4.0) - rspec-support (3.4.1) - ruby-units (2.0.0) - ruby_dep (1.3.1) + rspec-support (~> 3.5.0) + rspec-rails (3.5.1) + actionpack (>= 3.0) + activesupport (>= 3.0) + railties (>= 3.0) + rspec-core (~> 3.5.0) + rspec-expectations (~> 3.5.0) + rspec-mocks (~> 3.5.0) + rspec-support (~> 3.5.0) + rspec-support (3.5.0) + ruby-units (2.0.1) + ruby_dep (1.4.0) ruby_parser (3.8.2) sexp_processor (~> 4.1) rubyzip (1.2.0) From 3798e386ae0e8426ae1794b064cbff3395e86c5a Mon Sep 17 00:00:00 2001 From: Cesy Avon Date: Mon, 22 Aug 2016 14:14:58 +0000 Subject: [PATCH 087/268] Upgrading rails to 4.2.1 --- Gemfile | 2 +- Gemfile.lock | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Gemfile b/Gemfile index 6dd1d971b..6f962c0e2 100644 --- a/Gemfile +++ b/Gemfile @@ -2,7 +2,7 @@ source 'https://rubygems.org' ruby '2.3.1' -gem 'rails', '~> 4.2.0' +gem 'rails', '~> 4.2.1' gem 'bundler', '>=1.1.5' diff --git a/Gemfile.lock b/Gemfile.lock index 4a3febf0d..391013e67 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -505,7 +505,7 @@ DEPENDENCIES poltergeist (~> 1.6) pry quiet_assets - rails (~> 4.2.0) + rails (~> 4.2.1) rails_12factor rake (>= 10.0.0) rspec-activemodel-mocks From c6413afa6743ef1f13a602688fdde5503e121bb0 Mon Sep 17 00:00:00 2001 From: Brenda Wallace Date: Sun, 11 Sep 2016 14:20:41 +1200 Subject: [PATCH 088/268] allow registration and signin/out on the API --- app/controllers/registrations_controller.rb | 1 + app/controllers/sessions_controller.rb | 2 ++ 2 files changed, 3 insertions(+) diff --git a/app/controllers/registrations_controller.rb b/app/controllers/registrations_controller.rb index da2299ded..f251983eb 100644 --- a/app/controllers/registrations_controller.rb +++ b/app/controllers/registrations_controller.rb @@ -1,4 +1,5 @@ class RegistrationsController < Devise::RegistrationsController + respond_to :json def edit @twitter_auth = current_member.auth('twitter') diff --git a/app/controllers/sessions_controller.rb b/app/controllers/sessions_controller.rb index 99676c86f..cc461f1c3 100644 --- a/app/controllers/sessions_controller.rb +++ b/app/controllers/sessions_controller.rb @@ -1,4 +1,6 @@ class SessionsController < Devise::SessionsController + respond_to :json + def create super do |resource| if Crop.pending_approval.present? && current_member.has_role?(:crop_wrangler) From 3ea8e2294eb2b701eb9c452e3085b889e0f1f093 Mon Sep 17 00:00:00 2001 From: Daniel O'Connor Date: Mon, 12 Sep 2016 21:57:27 +0930 Subject: [PATCH 089/268] Update README.md Fixes #1037 --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index fc4371b73..52f43ba42 100644 --- a/README.md +++ b/README.md @@ -32,7 +32,7 @@ frontend features. We welcome contributions -- see * To set up your development environment, see [Getting started](https://github.com/Growstuff/growstuff/wiki/New-contributor-guide). * We encourage [pair programming](http://wiki.growstuff.org/index.php/Pairing), especially for newer developers. [Find a pair programming partner.](http://talk.growstuff.org/t/find-a-pair-programming-partner/13) * Drop in to our [discussion forums](http://talk.growstuff.org/), IRC or Gitter to chat to other developers, get help, etc. -* You may also be interested in our [API](http://wiki.growstuff.org/index.php/API). +* You may also be interested in our [API](https://github.com/Growstuff/growstuff/wiki/API). ## For designers, writers, researchers, data wranglers, and other contributors From 370f407ad682a5d2782a8ee595dd010c0d7bc7dd Mon Sep 17 00:00:00 2001 From: Brenda Wallace Date: Tue, 13 Sep 2016 19:25:22 +1200 Subject: [PATCH 090/268] Adding Brenda Wallace to contributors --- CONTRIBUTORS.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md index 3c7aaedf0..c66a72b26 100644 --- a/CONTRIBUTORS.md +++ b/CONTRIBUTORS.md @@ -70,4 +70,5 @@ submit the change with your pull request. - Eric Tillberg / [Thrillberg](https://github.com/Thrillberg) - Lucas Nogueira / [lucasnogueira](https://github.com/lucasnogueira) - Charley Lewittes / [ctlewitt](https://github.com/ctlewitt) -- Kristine Nicole Polvoriza / [polveenomials](https://github.com/polveenomials) \ No newline at end of file +- Kristine Nicole Polvoriza / [polveenomials](https://github.com/polveenomials) +- Brenda Walalce / [br3nda](http://github.com/br3nda) From 36c64bd8dceb67e4eef67630c87435ae6b5226e6 Mon Sep 17 00:00:00 2001 From: Daniel O'Connor Date: Wed, 14 Sep 2016 14:57:08 +0930 Subject: [PATCH 091/268] #1038 Add links to OpenFarm --- app/views/crops/show.html.haml | 2 ++ spec/features/crops/crop_detail_page_spec.rb | 5 +++++ 2 files changed, 7 insertions(+) diff --git a/app/views/crops/show.html.haml b/app/views/crops/show.html.haml index e0408d991..eb09ece6e 100644 --- a/app/views/crops/show.html.haml +++ b/app/views/crops/show.html.haml @@ -92,6 +92,8 @@ %h4 Learn more about #{ @crop.name.pluralize } %ul %li= link_to 'Wikipedia (English)', @crop.en_wikipedia_url, target: "_blank", rel: "noopener noreferrer" + %li + = link_to "OpenFarm - Growing guide", "https://openfarm.cc/en/crops/#{URI.escape @crop.name}", target: "_blank", rel: "noopener noreferrer" %li = link_to "Gardenate - Planting reminders", "http://www.gardenate.com/plant/#{URI.escape @crop.name}", target: "_blank", rel: "noopener noreferrer" - if current_member && current_member.location diff --git a/spec/features/crops/crop_detail_page_spec.rb b/spec/features/crops/crop_detail_page_spec.rb index b14006d7c..09dd12c2f 100644 --- a/spec/features/crops/crop_detail_page_spec.rb +++ b/spec/features/crops/crop_detail_page_spec.rb @@ -135,6 +135,11 @@ feature "crop detail page", js: true do expect(page).to have_content "Learn more about #{ crop.name }" expect(page).to have_link "Wikipedia (English)", href: crop.en_wikipedia_url end + + scenario "has a link to OpenFarm" do + expect(page).to have_link "OpenFarm - Growing guide", href: "https://openfarm.cc/en/crops/#{URI.escape crop.name}" + end + scenario "has a link to gardenate" do expect(page).to have_link "Gardenate - Planting reminders", href: "http://www.gardenate.com/plant/#{URI.escape crop.name}" end From 1f005a3d4205fd71fddd1835c003ec8331bea1c6 Mon Sep 17 00:00:00 2001 From: Daniel O'Connor Date: Wed, 14 Sep 2016 21:41:18 +0930 Subject: [PATCH 092/268] Fixes #1042 --- config/environments/production.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/environments/production.rb b/config/environments/production.rb index 51dbd983e..923ff4e7c 100644 --- a/config/environments/production.rb +++ b/config/environments/production.rb @@ -89,7 +89,7 @@ Growstuff::Application.configure do # this config variable cannot be put in application.yml as it is needed # by the assets pipeline, which doesn't have access to ENV. config.mapbox_map_id = 'growstuff.i3n2c4ie' - config.mapbox_access_token = ' pk.eyJ1IjoiZ3Jvd3N0dWZmIiwiYSI6IkdxMkx4alUifQ.n0igaBsw97s14zMa0lwKCA' + config.mapbox_access_token = 'pk.eyJ1IjoiZ3Jvd3N0dWZmIiwiYSI6IkdxMkx4alUifQ.n0igaBsw97s14zMa0lwKCA' config.after_initialize do ActiveMerchant::Billing::Base.mode = :production From 13e491cda7bcfc7631fb6dfc29cfe251269747fe Mon Sep 17 00:00:00 2001 From: Brenda Wallace Date: Sun, 18 Sep 2016 18:33:28 +1200 Subject: [PATCH 093/268] harvest thumbnail title linking to the harvest itself --- app/views/harvests/_thumbnail.html.haml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/harvests/_thumbnail.html.haml b/app/views/harvests/_thumbnail.html.haml index 7c5ada9c4..9af6003c1 100644 --- a/app/views/harvests/_thumbnail.html.haml +++ b/app/views/harvests/_thumbnail.html.haml @@ -1,7 +1,7 @@ .panel.panel-success .panel-heading %h3.panel-title - = link_to "#{harvest.owner.login_name}'s harvest", harvest.owner + = link_to "#{harvest.owner.login_name}'s #{harvest.crop.name} harvest", harvest - if can? :edit, harvest %a.pull-right{:href => edit_harvest_path(harvest), :role => "button", :id => "edit_harvest_glyphicon"} %span.glyphicon.glyphicon-pencil{:title => "Edit"} From faf117b0023146ef74fd39401ecd91c6973ba96a Mon Sep 17 00:00:00 2001 From: Brenda Wallace Date: Mon, 19 Sep 2016 17:59:10 +1200 Subject: [PATCH 094/268] test for link to member's harvest --- spec/features/harvests/browse_harvests_spec.rb | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/spec/features/harvests/browse_harvests_spec.rb b/spec/features/harvests/browse_harvests_spec.rb index 0b4d07f6a..28784d7a8 100644 --- a/spec/features/harvests/browse_harvests_spec.rb +++ b/spec/features/harvests/browse_harvests_spec.rb @@ -2,6 +2,7 @@ require 'rails_helper' feature "browse harvests" do let!(:member) { create :member } + let!(:harvest) { create :harvest, owner: member } background do login_as member @@ -31,5 +32,8 @@ feature "browse harvests" do expect(page).to have_link "Read more" end + it 'links to #show' do + expect(page).to have_link harvest.crop.name, href: harvest_path(harvest) + end end end From 7c1040e7aab1bc9cf5304f87526cef0b54e636b1 Mon Sep 17 00:00:00 2001 From: Brenda Wallace Date: Mon, 19 Sep 2016 21:50:39 +1200 Subject: [PATCH 095/268] Corrected contributor name --- CONTRIBUTORS.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md index c66a72b26..1df2129ff 100644 --- a/CONTRIBUTORS.md +++ b/CONTRIBUTORS.md @@ -71,4 +71,4 @@ submit the change with your pull request. - Lucas Nogueira / [lucasnogueira](https://github.com/lucasnogueira) - Charley Lewittes / [ctlewitt](https://github.com/ctlewitt) - Kristine Nicole Polvoriza / [polveenomials](https://github.com/polveenomials) -- Brenda Walalce / [br3nda](http://github.com/br3nda) +- Brenda Wallace / [br3nda](http://github.com/br3nda) From 099b399b24ead65c894789565b5fcefad2c4d4ae Mon Sep 17 00:00:00 2001 From: Mackenzie Morgan Date: Thu, 6 Oct 2016 22:00:01 -0400 Subject: [PATCH 096/268] bundle --- Gemfile.lock | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Gemfile.lock b/Gemfile.lock index 8094f6c87..2ca0ee862 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -433,6 +433,8 @@ GEM rack-protection (~> 1.4) tilt (>= 1.3, < 3) slop (3.6.0) + sparkpost_rails (1.4.0) + rails (>= 4.0, < 5.1) sprockets (3.7.0) concurrent-ruby (~> 1.0) rack (> 1, < 3) @@ -540,6 +542,7 @@ DEPENDENCIES sass-rails (~> 5.0.4) selenium-webdriver sidekiq + sparkpost_rails uglifier (~> 2.7.2) unicorn webrat From 36c88c3762a4ae38ba7ae41a78f53afd293108d5 Mon Sep 17 00:00:00 2001 From: Miles Gould Date: Fri, 7 Oct 2016 14:48:38 +0100 Subject: [PATCH 097/268] Delete trailing whitespace --- app/models/crop.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/models/crop.rb b/app/models/crop.rb index ceec55c36..81ae98cb5 100644 --- a/app/models/crop.rb +++ b/app/models/crop.rb @@ -316,7 +316,7 @@ class Crop < ActiveRecord::Base if ENV['GROWSTUFF_ELASTICSEARCH'] == "true" search_str = query.nil? ? "" : query.downcase response = __elasticsearch__.search( { - # Finds documents which match any field, but uses the _score from + # Finds documents which match any field, but uses the _score from # the best field insead of adding up _score from each field. query: { multi_match: { From ce2141ddb7d25682998900da8795b5cf965ee9ad Mon Sep 17 00:00:00 2001 From: Miles Gould Date: Fri, 7 Oct 2016 14:49:09 +0100 Subject: [PATCH 098/268] Only initialise Crop.__elasticsearch__ if needed The mere presence of this field was causing any test that ran `FactoryGirl.create :alternate_name` to try to connect to an ElasticSearch server, even if GROWSTUFF_ELASTICSEARCH was false. Fixes #1047 --- app/models/crop.rb | 76 ++++++++++++++++++++++++---------------------- 1 file changed, 39 insertions(+), 37 deletions(-) diff --git a/app/models/crop.rb b/app/models/crop.rb index 81ae98cb5..02acbdcf7 100644 --- a/app/models/crop.rb +++ b/app/models/crop.rb @@ -50,44 +50,46 @@ class Crop < ActiveRecord::Base #################################### # Elastic search configuration - include Elasticsearch::Model - include Elasticsearch::Model::Callbacks - # In order to avoid clashing between different environments, - # use Rails.env as a part of index name (eg. development_growstuff) - index_name [Rails.env, "growstuff"].join('_') - settings index: { number_of_shards: 1 }, - analysis: { - tokenizer: { - gs_edgeNGram_tokenizer: { - type: "edgeNGram", # edgeNGram: NGram match from the start of a token - min_gram: 3, - max_gram: 10, - # token_chars: Elasticsearch will split on characters - # that don’t belong to any of these classes - token_chars: [ "letter", "digit" ] - } - }, - analyzer: { - gs_edgeNGram_analyzer: { - tokenizer: "gs_edgeNGram_tokenizer", - filter: ["lowercase"] - } - }, - } do - mappings dynamic: 'false' do - indexes :id, type: 'long' - indexes :name, type: 'string', analyzer: 'gs_edgeNGram_analyzer' - indexes :approval_status, type: 'string' - indexes :scientific_names do - indexes :scientific_name, - type: 'string', - analyzer: 'gs_edgeNGram_analyzer', - # Disabling field-length norm (norm). If the norm option is turned on(by default), - # higher weigh would be given for shorter fields, which in our case is irrelevant. - norms: { enabled: false } - end - indexes :alternate_names do + if ENV["GROWSTUFF_ELASTICSEARCH"] == "true" + include Elasticsearch::Model + include Elasticsearch::Model::Callbacks + # In order to avoid clashing between different environments, + # use Rails.env as a part of index name (eg. development_growstuff) + index_name [Rails.env, "growstuff"].join('_') + settings index: { number_of_shards: 1 }, + analysis: { + tokenizer: { + gs_edgeNGram_tokenizer: { + type: "edgeNGram", # edgeNGram: NGram match from the start of a token + min_gram: 3, + max_gram: 10, + # token_chars: Elasticsearch will split on characters + # that don’t belong to any of these classes + token_chars: [ "letter", "digit" ] + } + }, + analyzer: { + gs_edgeNGram_analyzer: { + tokenizer: "gs_edgeNGram_tokenizer", + filter: ["lowercase"] + } + }, + } do + mappings dynamic: 'false' do + indexes :id, type: 'long' indexes :name, type: 'string', analyzer: 'gs_edgeNGram_analyzer' + indexes :approval_status, type: 'string' + indexes :scientific_names do + indexes :scientific_name, + type: 'string', + analyzer: 'gs_edgeNGram_analyzer', + # Disabling field-length norm (norm). If the norm option is turned on(by default), + # higher weigh would be given for shorter fields, which in our case is irrelevant. + norms: { enabled: false } + end + indexes :alternate_names do + indexes :name, type: 'string', analyzer: 'gs_edgeNGram_analyzer' + end end end end From 494790bcd463bb91f35191699774c6b7e8cdb6d8 Mon Sep 17 00:00:00 2001 From: Mackenzie Morgan Date: Tue, 11 Oct 2016 15:28:08 -0400 Subject: [PATCH 099/268] moving where clauses into scopes to keep that contained in models --- app/controllers/notifications_controller.rb | 2 +- app/controllers/orders_controller.rb | 2 +- app/models/notification.rb | 4 ++++ app/models/order.rb | 4 ++++ 4 files changed, 10 insertions(+), 2 deletions(-) diff --git a/app/controllers/notifications_controller.rb b/app/controllers/notifications_controller.rb index 57b5836ba..cf50316a6 100644 --- a/app/controllers/notifications_controller.rb +++ b/app/controllers/notifications_controller.rb @@ -5,7 +5,7 @@ class NotificationsController < ApplicationController # GET /notifications def index - @notifications = Notification.where(recipient_id: current_member).page(params[:page]) + @notifications = Notification.find_by_recipient(current_member).page(params[:page]) respond_to do |format| format.html # index.html.erb diff --git a/app/controllers/orders_controller.rb b/app/controllers/orders_controller.rb index 82bb337f9..5de8e46e4 100644 --- a/app/controllers/orders_controller.rb +++ b/app/controllers/orders_controller.rb @@ -4,7 +4,7 @@ class OrdersController < ApplicationController # GET /orders def index - @orders = Order.where(member_id: current_member.id) + @orders = Order.by_member_id(current_member.id) respond_to do |format| format.html # index.html.erb diff --git a/app/models/notification.rb b/app/models/notification.rb index 567867b00..9f9a61257 100644 --- a/app/models/notification.rb +++ b/app/models/notification.rb @@ -11,6 +11,10 @@ class Notification < ActiveRecord::Base before_create :replace_blank_subject after_create :send_email + def self.find_by_recipient(recipient) + where(recipient_id: recipient) + end + def self.unread_count self.unread.size end diff --git a/app/models/order.rb b/app/models/order.rb index f3a4eaafb..acf3a5878 100644 --- a/app/models/order.rb +++ b/app/models/order.rb @@ -12,6 +12,10 @@ class Order < ActiveRecord::Base before_save :standardize_referral_code + def by_member_id(member_id) + where(member_id: member_id) + end + # total price of an order def total sum = 0 From cee3d192e092e1807d8c0e27e773a8f1e26de437 Mon Sep 17 00:00:00 2001 From: Mackenzie Morgan Date: Tue, 11 Oct 2016 16:34:25 -0400 Subject: [PATCH 100/268] test the new order.by_member_id scope --- app/models/order.rb | 2 +- spec/models/order_spec.rb | 13 +++++++++++++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/app/models/order.rb b/app/models/order.rb index acf3a5878..00b0b712d 100644 --- a/app/models/order.rb +++ b/app/models/order.rb @@ -12,7 +12,7 @@ class Order < ActiveRecord::Base before_save :standardize_referral_code - def by_member_id(member_id) + def self.by_member_id(member_id) where(member_id: member_id) end diff --git a/spec/models/order_spec.rb b/spec/models/order_spec.rb index 9291e1a3f..6a74baf11 100644 --- a/spec/models/order_spec.rb +++ b/spec/models/order_spec.rb @@ -8,6 +8,19 @@ describe Order do order_id: @order.id, product_id: @product.id) end + describe '#by_member_id' do + before do + @member1 = FactoryGirl.create(:member) + @member2 = FactoryGirl.create(:member) + @order1 = Order.create!(member_id: @member1.id) + @order2 = Order.create!(member_id: @member2.id) + end + + it "only returns orders belonging to member" do + Order.by_member_id(@member1.id).should eq [@order1] + end + end + it 'has order_items' do @order.order_items.first.should eq @order_item end From c685b970d31e5fd0e81e0e29d1f782e844aabd1a Mon Sep 17 00:00:00 2001 From: Brenda Wallace Date: Sun, 13 Nov 2016 10:07:41 +1300 Subject: [PATCH 101/268] Add rubocop to bundle So we can manage which version of rubocop to use. --- Gemfile | 1 + Gemfile.lock | 13 ++++++++++++- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/Gemfile b/Gemfile index b63bbd54b..1a129416f 100644 --- a/Gemfile +++ b/Gemfile @@ -114,6 +114,7 @@ group :development, :test do gem 'selenium-webdriver' gem "codeclimate-test-reporter", group: :test, require: nil gem "active_merchant-paypal-bogus-gateway" + gem 'rubocop', require: false end group :travis do diff --git a/Gemfile.lock b/Gemfile.lock index 2ca0ee862..8f6230ac2 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -324,6 +324,7 @@ GEM capybara (~> 2.1) cliver (~> 0.3.1) websocket-driver (>= 0.2.0) + powerpack (0.1.1) pry (0.10.4) coderay (~> 1.1.0) method_source (~> 0.8.1) @@ -367,6 +368,7 @@ GEM activesupport (= 4.2.7.1) rake (>= 0.8.7) thor (>= 0.18.1, < 2.0) + rainbow (2.1.0) raindrops (0.17.0) rake (11.2.2) rb-fsevent (0.9.7) @@ -400,6 +402,13 @@ GEM rspec-mocks (~> 3.5.0) rspec-support (~> 3.5.0) rspec-support (3.5.0) + rubocop (0.45.0) + parser (>= 2.3.1.1, < 3.0) + powerpack (~> 0.1) + rainbow (>= 1.99.1, < 3.0) + ruby-progressbar (~> 1.7) + unicode-display_width (~> 1.0, >= 1.0.1) + ruby-progressbar (1.8.1) ruby-units (2.0.1) ruby_dep (1.4.0) ruby_parser (3.8.2) @@ -455,6 +464,7 @@ GEM uglifier (2.7.2) execjs (>= 0.3.0) json (>= 1.8.0) + unicode-display_width (1.1.1) unicorn (5.1.0) kgio (~> 2.6) raindrops (~> 0.7) @@ -538,6 +548,7 @@ DEPENDENCIES rake (>= 10.0.0) rspec-activemodel-mocks rspec-rails + rubocop ruby-units sass-rails (~> 5.0.4) selenium-webdriver @@ -552,4 +563,4 @@ RUBY VERSION ruby 2.3.1p112 BUNDLED WITH - 1.12.5 + 1.13.6 From e312ee27731fbc3bd95755df1215f00060b4c67c Mon Sep 17 00:00:00 2001 From: Brenda Wallace Date: Sun, 13 Nov 2016 10:20:00 +1300 Subject: [PATCH 102/268] All existing rubocop offfenses in a todo file --- .rubocop.yml | 1162 +---------------- .rubocop_todo.yml | 3085 +++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 3092 insertions(+), 1155 deletions(-) create mode 100644 .rubocop_todo.yml diff --git a/.rubocop.yml b/.rubocop.yml index 2b3877963..e39e22fe0 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -1,1156 +1,8 @@ +inherit_from: .rubocop_todo.yml AllCops: - DisabledByDefault: true - -#################### Lint ################################ - -Lint/AmbiguousOperator: - Description: >- - Checks for ambiguous operators in the first argument of a - method invocation without parentheses. - StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#parens-as-args' - Enabled: true - -Lint/AmbiguousRegexpLiteral: - Description: >- - Checks for ambiguous regexp literals in the first argument of - a method invocation without parenthesis. - Enabled: true - -Lint/AssignmentInCondition: - Description: "Don't use assignment in conditions." - StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#safe-assignment-in-condition' - Enabled: true - -Lint/BlockAlignment: - Description: 'Align block ends correctly.' - Enabled: true - -Lint/CircularArgumentReference: - Description: "Don't refer to the keyword argument in the default value." - Enabled: true - -Lint/ConditionPosition: - Description: >- - Checks for condition placed in a confusing position relative to - the keyword. - StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#same-line-condition' - Enabled: true - -Lint/Debugger: - Description: 'Check for debugger calls.' - Enabled: true - -Lint/DefEndAlignment: - Description: 'Align ends corresponding to defs correctly.' - Enabled: true - -Lint/DeprecatedClassMethods: - Description: 'Check for deprecated class method calls.' - Enabled: true - -Lint/DuplicateMethods: - Description: 'Check for duplicate methods calls.' - Enabled: true - -Lint/EachWithObjectArgument: - Description: 'Check for immutable argument given to each_with_object.' - Enabled: true - -Lint/ElseLayout: - Description: 'Check for odd code arrangement in an else block.' - Enabled: true - -Lint/EmptyEnsure: - Description: 'Checks for empty ensure block.' - Enabled: true - -Lint/EmptyInterpolation: - Description: 'Checks for empty string interpolation.' - Enabled: true - -Lint/EndAlignment: - Description: 'Align ends correctly.' - Enabled: true - -Lint/EndInMethod: - Description: 'END blocks should not be placed inside method definitions.' - Enabled: true - -Lint/EnsureReturn: - Description: 'Do not use return in an ensure block.' - StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-return-ensure' - Enabled: true - -Lint/Eval: - Description: 'The use of eval represents a serious security risk.' - Enabled: true - -Lint/FormatParameterMismatch: - Description: 'The number of parameters to format/sprint must match the fields.' - Enabled: true - -Lint/HandleExceptions: - Description: "Don't suppress exception." - StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#dont-hide-exceptions' - Enabled: true - -Lint/InvalidCharacterLiteral: - Description: >- - Checks for invalid character literals with a non-escaped - whitespace character. - Enabled: true - -Lint/LiteralInCondition: - Description: 'Checks of literals used in conditions.' - Enabled: true - -Lint/LiteralInInterpolation: - Description: 'Checks for literals used in interpolation.' - Enabled: true - -Lint/Loop: - Description: >- - Use Kernel#loop with break rather than begin/end/until or - begin/end/while for post-loop tests. - StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#loop-with-break' - Enabled: true - -Lint/NestedMethodDefinition: - Description: 'Do not use nested method definitions.' - StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-nested-methods' - Enabled: true - -Lint/NonLocalExitFromIterator: - Description: 'Do not use return in iterator to cause non-local exit.' - Enabled: true - -Lint/ParenthesesAsGroupedExpression: - Description: >- - Checks for method calls with a space before the opening - parenthesis. - StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#parens-no-spaces' - Enabled: true - -Lint/RequireParentheses: - Description: >- - Use parentheses in the method call to avoid confusion - about precedence. - Enabled: true - -Lint/RescueException: - Description: 'Avoid rescuing the Exception class.' - StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-blind-rescues' - Enabled: true - -Lint/ShadowingOuterLocalVariable: - Description: >- - Do not use the same name as outer local variable - for block arguments or block local variables. - Enabled: true - -Lint/StringConversionInInterpolation: - Description: 'Checks for Object#to_s usage in string interpolation.' - StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-to-s' - Enabled: true - -Lint/UnderscorePrefixedVariableName: - Description: 'Do not use prefix `_` for a variable that is used.' - Enabled: true - -Lint/UnneededDisable: - Description: >- - Checks for rubocop:disable comments that can be removed. - Note: this cop is not disabled when disabling all cops. - It must be explicitly disabled. - Enabled: true - -Lint/UnusedBlockArgument: - Description: 'Checks for unused block arguments.' - StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#underscore-unused-vars' - Enabled: true - -Lint/UnusedMethodArgument: - Description: 'Checks for unused method arguments.' - StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#underscore-unused-vars' - Enabled: true - -Lint/UnreachableCode: - Description: 'Unreachable code.' - Enabled: true - -Lint/UselessAccessModifier: - Description: 'Checks for useless access modifiers.' - Enabled: true - -Lint/UselessAssignment: - Description: 'Checks for useless assignment to a local variable.' - StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#underscore-unused-vars' - Enabled: true - -Lint/UselessComparison: - Description: 'Checks for comparison of something with itself.' - Enabled: true - -Lint/UselessElseWithoutRescue: - Description: 'Checks for useless `else` in `begin..end` without `rescue`.' - Enabled: true - -Lint/UselessSetterCall: - Description: 'Checks for useless setter call to a local variable.' - Enabled: true - -Lint/Void: - Description: 'Possible use of operator/literal/variable in void context.' - Enabled: true - -###################### Metrics #################################### - -Metrics/AbcSize: - Description: >- - A calculated magnitude based on number of assignments, - branches, and conditions. - Reference: 'http://c2.com/cgi/wiki?AbcMetric' - Enabled: true - Max: 20 - -Metrics/BlockNesting: - Description: 'Avoid excessive block nesting' - StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#three-is-the-number-thou-shalt-count' - Enabled: true - Max: 4 - -Metrics/ClassLength: - Description: 'Avoid classes longer than 250 lines of code.' - Enabled: true - Max: 250 - -Metrics/CyclomaticComplexity: - Description: >- - A complexity metric that is strongly correlated to the number - of test cases needed to validate a method. - Enabled: true - -Metrics/LineLength: - Description: 'Limit lines to 80 characters.' - StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#80-character-limits' - Enabled: false - -Metrics/MethodLength: - Description: 'Avoid methods longer than 30 lines of code.' - StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#short-methods' - Enabled: true - Max: 30 - -Metrics/ModuleLength: - Description: 'Avoid modules longer than 250 lines of code.' - Enabled: true - Max: 250 - -Metrics/ParameterLists: - Description: 'Avoid parameter lists longer than three or four parameters.' - StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#too-many-params' - Enabled: true - -Metrics/PerceivedComplexity: - Description: >- - A complexity metric geared towards measuring complexity for a - human reader. - Enabled: true - -##################### Performance ############################# - -Performance/Count: - Description: >- - Use `count` instead of `select...size`, `reject...size`, - `select...count`, `reject...count`, `select...length`, - and `reject...length`. - Enabled: true - -Performance/Detect: - Description: >- - Use `detect` instead of `select.first`, `find_all.first`, - `select.last`, and `find_all.last`. - Reference: 'https://github.com/JuanitoFatas/fast-ruby#enumerabledetect-vs-enumerableselectfirst-code' - Enabled: true - -Performance/FlatMap: - Description: >- - Use `Enumerable#flat_map` - instead of `Enumerable#map...Array#flatten(1)` - or `Enumberable#collect..Array#flatten(1)` - Reference: 'https://github.com/JuanitoFatas/fast-ruby#enumerablemaparrayflatten-vs-enumerableflat_map-code' - Enabled: true - EnabledForFlattenWithoutParams: true - # If enabled, this cop will warn about usages of - # `flatten` being called without any parameters. - # This can be dangerous since `flat_map` will only flatten 1 level, and - # `flatten` without any parameters can flatten multiple levels. - -Performance/ReverseEach: - Description: 'Use `reverse_each` instead of `reverse.each`.' - Reference: 'https://github.com/JuanitoFatas/fast-ruby#enumerablereverseeach-vs-enumerablereverse_each-code' - Enabled: true - -Performance/Sample: - Description: >- - Use `sample` instead of `shuffle.first`, - `shuffle.last`, and `shuffle[Fixnum]`. - Reference: 'https://github.com/JuanitoFatas/fast-ruby#arrayshufflefirst-vs-arraysample-code' - Enabled: true - -Performance/Size: - Description: >- - Use `size` instead of `count` for counting - the number of elements in `Array` and `Hash`. - Reference: 'https://github.com/JuanitoFatas/fast-ruby#arraycount-vs-arraysize-code' - Enabled: true - -Performance/StringReplacement: - Description: >- - Use `tr` instead of `gsub` when you are replacing the same - number of characters. Use `delete` instead of `gsub` when - you are deleting characters. - Reference: 'https://github.com/JuanitoFatas/fast-ruby#stringgsub-vs-stringtr-code' - Enabled: true - -##################### Rails ################################## - -Rails/ActionFilter: - Description: 'Enforces consistent use of action filter methods.' - Enabled: true - -Rails/Date: - Description: >- - Checks the correct usage of date aware methods, - such as Date.today, Date.current etc. - Enabled: true - -Rails/Delegate: - Description: 'Prefer delegate method for delegations.' - Enabled: true - -Rails/FindBy: - Description: 'Prefer find_by over where.first.' - Enabled: true - -Rails/FindEach: - Description: 'Prefer all.find_each over all.find.' - Enabled: true - -Rails/HasAndBelongsToMany: - Description: 'Prefer has_many :through to has_and_belongs_to_many.' - Enabled: true - -Rails/Output: - Description: 'Checks for calls to puts, print, etc.' - Enabled: true - -Rails/ReadWriteAttribute: - Description: >- - Checks for read_attribute(:attr) and - write_attribute(:attr, val). - Enabled: true - -Rails/ScopeArgs: - Description: 'Checks the arguments of ActiveRecord scopes.' - Enabled: true - -Rails/TimeZone: - Description: 'Checks the correct usage of time zone aware methods.' - StyleGuide: 'https://github.com/bbatsov/rails-style-guide#time' - Reference: 'http://danilenko.org/2012/7/6/rails_timezones' - Enabled: true - -Rails/Validation: - Description: 'Use validates :attribute, hash of validations.' - Enabled: true - -################## Style ################################# - -Style/AccessModifierIndentation: - Description: Check indentation of private/protected visibility modifiers. - StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#indent-public-private-protected' - Enabled: true - -Style/AccessorMethodName: - Description: Check the naming of accessor methods for get_/set_. - Enabled: true - -Style/Alias: - Description: 'Use alias_method instead of alias.' - StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#alias-method' - Enabled: true - -Style/AlignArray: - Description: >- - Align the elements of an array literal if they span more than - one line. - StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#align-multiline-arrays' - Enabled: true - -Style/AlignHash: - Description: >- - Align the elements of a hash literal if they span more than - one line. - Enabled: true - -Style/AlignParameters: - Description: >- - Align the parameters of a method call if they span more - than one line. - StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-double-indent' - Enabled: true - -Style/AndOr: - Description: 'Use &&/|| instead of and/or.' - StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-and-or-or' - Enabled: true - -Style/ArrayJoin: - Description: 'Use Array#join instead of Array#*.' - StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#array-join' - Enabled: true - -Style/AsciiComments: - Description: 'Use only ascii symbols in comments.' - StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#english-comments' - Enabled: true - -Style/AsciiIdentifiers: - Description: 'Use only ascii symbols in identifiers.' - StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#english-identifiers' - Enabled: true - -Style/Attr: - Description: 'Checks for uses of Module#attr.' - StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#attr' - Enabled: true - -Style/BeginBlock: - Description: 'Avoid the use of BEGIN blocks.' - StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-BEGIN-blocks' - Enabled: true - -Style/BarePercentLiterals: - Description: 'Checks if usage of %() or %Q() matches configuration.' - StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#percent-q-shorthand' - Enabled: true - -Style/BlockComments: - Description: 'Do not use block comments.' - StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-block-comments' - Enabled: true - -Style/BlockEndNewline: - Description: 'Put end statement of multiline block on its own line.' - Enabled: true - -Style/BlockDelimiters: - Description: >- - Avoid using {...} for multi-line blocks (multiline chaining is - always ugly). - Prefer {...} over do...end for single-line blocks. - StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#single-line-blocks' - Enabled: true - -Style/BracesAroundHashParameters: - Description: 'Enforce braces style around hash parameters.' - Enabled: true - -Style/CaseEquality: - Description: 'Avoid explicit use of the case equality operator(===).' - StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-case-equality' - Enabled: true - -Style/CaseIndentation: - Description: 'Indentation of when in a case/when/[else/]end.' - StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#indent-when-to-case' - Enabled: true - -Style/CharacterLiteral: - Description: 'Checks for uses of character literals.' - StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-character-literals' - Enabled: true - -Style/ClassAndModuleCamelCase: - Description: 'Use CamelCase for classes and modules.' - StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#camelcase-classes' - Enabled: true - -Style/ClassAndModuleChildren: - Description: 'Checks style of children classes and modules.' - Enabled: true - -Style/ClassCheck: - Description: 'Enforces consistent use of `Object#is_a?` or `Object#kind_of?`.' - Enabled: true - -Style/ClassMethods: - Description: 'Use self when defining module/class methods.' - StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#def-self-class-methods' - Enabled: true - -Style/ClassVars: - Description: 'Avoid the use of class variables.' - StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-class-vars' - Enabled: true - -Style/ClosingParenthesisIndentation: - Description: 'Checks the indentation of hanging closing parentheses.' - Enabled: true - -Style/ColonMethodCall: - Description: 'Do not use :: for method call.' - StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#double-colons' - Enabled: true - -Style/CommandLiteral: - Description: 'Use `` or %x around command literals.' - StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#percent-x' - Enabled: true - -Style/CommentAnnotation: - Description: 'Checks formatting of annotation comments.' - StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#annotate-keywords' - Enabled: true - -Style/CommentIndentation: - Description: 'Indentation of comments.' - Enabled: true - -Style/ConstantName: - Description: 'Constants should use SCREAMING_SNAKE_CASE.' - StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#screaming-snake-case' - Enabled: true - -Style/DefWithParentheses: - Description: 'Use def with parentheses when there are arguments.' - StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#method-parens' - Enabled: true - -Style/DeprecatedHashMethods: - Description: 'Checks for use of deprecated Hash methods.' - StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#hash-key' - Enabled: true - -Style/Documentation: - Description: 'Document classes and non-namespace modules.' - Enabled: false - -Style/DotPosition: - Description: 'Checks the position of the dot in multi-line method calls.' - StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#consistent-multi-line-chains' - Enabled: true - -Style/DoubleNegation: - Description: 'Checks for uses of double negation (!!).' - StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-bang-bang' - Enabled: true - -Style/EachWithObject: - Description: 'Prefer `each_with_object` over `inject` or `reduce`.' - Enabled: true - -Style/ElseAlignment: - Description: 'Align elses and elsifs correctly.' - Enabled: true - -Style/EmptyElse: - Description: 'Avoid empty else-clauses.' - Enabled: true - -Style/EmptyLineBetweenDefs: - Description: 'Use empty lines between defs.' - StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#empty-lines-between-methods' - Enabled: true - -Style/EmptyLines: - Description: "Don't use several empty lines in a row." - Enabled: true - -Style/EmptyLinesAroundAccessModifier: - Description: "Keep blank lines around access modifiers." - Enabled: true - -Style/EmptyLinesAroundBlockBody: - Description: "Keeps track of empty lines around block bodies." - Enabled: true - -Style/EmptyLinesAroundClassBody: - Description: "Keeps track of empty lines around class bodies." - Enabled: true - -Style/EmptyLinesAroundModuleBody: - Description: "Keeps track of empty lines around module bodies." - Enabled: true - -Style/EmptyLinesAroundMethodBody: - Description: "Keeps track of empty lines around method bodies." - Enabled: true - -Style/EmptyLiteral: - Description: 'Prefer literals to Array.new/Hash.new/String.new.' - StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#literal-array-hash' - Enabled: true - -Style/EndBlock: - Description: 'Avoid the use of END blocks.' - StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-END-blocks' - Enabled: true - -Style/EndOfLine: - Description: 'Use Unix-style line endings.' - StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#crlf' - Enabled: true - -Style/EvenOdd: - Description: 'Favor the use of Fixnum#even? && Fixnum#odd?' - StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#predicate-methods' - Enabled: true - -Style/ExtraSpacing: - Description: 'Do not use unnecessary spacing.' - Enabled: true - -Style/FileName: - Description: 'Use snake_case for source file names.' - StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#snake-case-files' - Enabled: true - -Style/InitialIndentation: - Description: >- - Checks the indentation of the first non-blank non-comment line in a file. - Enabled: true - -Style/FirstParameterIndentation: - Description: 'Checks the indentation of the first parameter in a method call.' - Enabled: true - -Style/FlipFlop: - Description: 'Checks for flip flops' - StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-flip-flops' - Enabled: true - -Style/For: - Description: 'Checks use of for or each in multiline loops.' - StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-for-loops' - Enabled: true - -Style/FormatString: - Description: 'Enforce the use of Kernel#sprintf, Kernel#format or String#%.' - StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#sprintf' - Enabled: true - -Style/GlobalVars: - Description: 'Do not introduce global variables.' - StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#instance-vars' - Reference: 'http://www.zenspider.com/Languages/Ruby/QuickRef.html' - Enabled: true - -Style/GuardClause: - Description: 'Check for conditionals that can be replaced with guard clauses' - StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-nested-conditionals' - Enabled: true - -Style/HashSyntax: - Description: >- - Prefer Ruby 1.9 hash syntax { a: 1, b: 2 } over 1.8 syntax - { :a => 1, :b => 2 }. - StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#hash-literals' - Enabled: true - -Style/IfUnlessModifier: - Description: >- - Favor modifier if/unless usage when you have a - single-line body. - StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#if-as-a-modifier' - Enabled: true - -Style/IfWithSemicolon: - Description: 'Do not use if x; .... Use the ternary operator instead.' - StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-semicolon-ifs' - Enabled: true - -Style/IndentationConsistency: - Description: 'Keep indentation straight.' - Enabled: true - -Style/IndentationWidth: - Description: 'Use 2 spaces for indentation.' - StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#spaces-indentation' - Enabled: true - -Style/IndentArray: - Description: >- - Checks the indentation of the first element in an array - literal. - Enabled: true - -Style/IndentHash: - Description: 'Checks the indentation of the first key in a hash literal.' - Enabled: true - -Style/InfiniteLoop: - Description: 'Use Kernel#loop for infinite loops.' - StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#infinite-loop' - Enabled: true - -Style/Lambda: - Description: 'Use the new lambda literal syntax for single-line blocks.' - StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#lambda-multi-line' - Enabled: true - -Style/LambdaCall: - Description: 'Use lambda.call(...) instead of lambda.(...).' - StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#proc-call' - Enabled: true - -Style/LeadingCommentSpace: - Description: 'Comments should start with a space.' - StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#hash-space' - Enabled: true - -Style/LineEndConcatenation: - Description: >- - Use \ instead of + or << to concatenate two string literals at - line end. - Enabled: true - -Style/MethodCallParentheses: - Description: 'Do not use parentheses for method calls with no arguments.' - StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-args-no-parens' - Enabled: true - -Style/MethodDefParentheses: - Description: >- - Checks if the method definitions have or don't have - parentheses. - StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#method-parens' - Enabled: true - -Style/MethodName: - Description: 'Use the configured style when naming methods.' - StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#snake-case-symbols-methods-vars' - Enabled: true - -Style/ModuleFunction: - Description: 'Checks for usage of `extend self` in modules.' - StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#module-function' - Enabled: true - -Style/MultilineBlockChain: - Description: 'Avoid multi-line chains of blocks.' - StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#single-line-blocks' - Enabled: true - -Style/MultilineBlockLayout: - Description: 'Ensures newlines after multiline block do statements.' - Enabled: true - -Style/MultilineIfThen: - Description: 'Do not use then for multi-line if/unless.' - StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-then' - Enabled: true - -Style/MultilineOperationIndentation: - Description: >- - Checks indentation of binary operations that span more than - one line. - Enabled: true - -Style/MultilineTernaryOperator: - Description: >- - Avoid multi-line ?: (the ternary operator); - use if/unless instead. - StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-multiline-ternary' - Enabled: true - -Style/NegatedIf: - Description: >- - Favor unless over if for negative conditions - (or control flow or). - StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#unless-for-negatives' - Enabled: true - -Style/NegatedWhile: - Description: 'Favor until over while for negative conditions.' - StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#until-for-negatives' - Enabled: true - -Style/NestedTernaryOperator: - Description: 'Use one expression per branch in a ternary operator.' - StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-nested-ternary' - Enabled: true - -Style/Next: - Description: 'Use `next` to skip iteration instead of a condition at the end.' - StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-nested-conditionals' - Enabled: true - -Style/NilComparison: - Description: 'Prefer x.nil? to x == nil.' - StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#predicate-methods' - Enabled: true - -Style/NonNilCheck: - Description: 'Checks for redundant nil checks.' - StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-non-nil-checks' - Enabled: true - -Style/Not: - Description: 'Use ! instead of not.' - StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#bang-not-not' - Enabled: true - -Style/NumericLiterals: - Description: >- - Add underscores to large numeric literals to improve their - readability. - StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#underscores-in-numerics' - Enabled: true - -Style/OneLineConditional: - Description: >- - Favor the ternary operator(?:) over - if/then/else/end constructs. - StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#ternary-operator' - Enabled: true - -Style/OpMethod: - Description: 'When defining binary operators, name the argument other.' - StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#other-arg' - Enabled: true - -Style/OptionalArguments: - Description: >- - Checks for optional arguments that do not appear at the end - of the argument list - StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#optional-arguments' - Enabled: true - -Style/ParallelAssignment: - Description: >- - Check for simple usages of parallel assignment. - It will only warn when the number of variables - matches on both sides of the assignment. - This also provides performance benefits - StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#parallel-assignment' - Enabled: true - -Style/ParenthesesAroundCondition: - Description: >- - Don't use parentheses around the condition of an - if/unless/while. - StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-parens-if' - Enabled: true - -Style/PercentLiteralDelimiters: - Description: 'Use `%`-literal delimiters consistently' - StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#percent-literal-braces' - Enabled: true - -Style/PercentQLiterals: - Description: 'Checks if uses of %Q/%q match the configured preference.' - Enabled: true - -Style/PerlBackrefs: - Description: 'Avoid Perl-style regex back references.' - StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-perl-regexp-last-matchers' - Enabled: true - -Style/PredicateName: - Description: 'Check the names of predicate methods.' - StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#bool-methods-qmark' - Enabled: true - -Style/Proc: - Description: 'Use proc instead of Proc.new.' - StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#proc' - Enabled: true - -Style/RaiseArgs: - Description: 'Checks the arguments passed to raise/fail.' - StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#exception-class-messages' - Enabled: true - -Style/RedundantBegin: - Description: "Don't use begin blocks when they are not needed." - StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#begin-implicit' - Enabled: true - -Style/RedundantException: - Description: "Checks for an obsolete RuntimeException argument in raise/fail." - StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-explicit-runtimeerror' - Enabled: true - -Style/RedundantReturn: - Description: "Don't use return where it's not required." - StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-explicit-return' - Enabled: true - -Style/RedundantSelf: - Description: "Don't use self where it's not needed." - StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-self-unless-required' - Enabled: true - -Style/RegexpLiteral: - Description: 'Use / or %r around regular expressions.' - StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#percent-r' - Enabled: true - -Style/RescueEnsureAlignment: - Description: 'Align rescues and ensures correctly.' - Enabled: true - -Style/RescueModifier: - Description: 'Avoid using rescue in its modifier form.' - StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-rescue-modifiers' - Enabled: true - -Style/SelfAssignment: - Description: >- - Checks for places where self-assignment shorthand should have - been used. - StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#self-assignment' - Enabled: true - -Style/Semicolon: - Description: "Don't use semicolons to terminate expressions." - StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-semicolon' - Enabled: true - -Style/SignalException: - Description: 'Checks for proper usage of fail and raise.' - StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#fail-method' - Enabled: true - -Style/SingleLineBlockParams: - Description: 'Enforces the names of some block params.' - StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#reduce-blocks' - Enabled: true - -Style/SingleLineMethods: - Description: 'Avoid single-line methods.' - StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-single-line-methods' - Enabled: true - -Style/SpaceBeforeFirstArg: - Description: >- - Checks that exactly one space is used between a method name - and the first argument for method calls without parentheses. - Enabled: true - -Style/SpaceAfterColon: - Description: 'Use spaces after colons.' - StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#spaces-operators' - Enabled: true - -Style/SpaceAfterComma: - Description: 'Use spaces after commas.' - StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#spaces-operators' - Enabled: true - -Style/SpaceAroundKeyword: - Description: 'Use spaces around keywords.' - Enabled: true - -Style/SpaceAfterMethodName: - Description: >- - Do not put a space between a method name and the opening - parenthesis in a method definition. - StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#parens-no-spaces' - Enabled: true - -Style/SpaceAfterNot: - Description: Tracks redundant space after the ! operator. - StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-space-bang' - Enabled: true - -Style/SpaceAfterSemicolon: - Description: 'Use spaces after semicolons.' - StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#spaces-operators' - Enabled: true - -Style/SpaceBeforeBlockBraces: - Description: >- - Checks that the left block brace has or doesn't have space - before it. - Enabled: true - -Style/SpaceBeforeComma: - Description: 'No spaces before commas.' - Enabled: true - -Style/SpaceBeforeComment: - Description: >- - Checks for missing space between code and a comment on the - same line. - Enabled: true - -Style/SpaceBeforeSemicolon: - Description: 'No spaces before semicolons.' - Enabled: true - -Style/SpaceInsideBlockBraces: - Description: >- - Checks that block braces have or don't have surrounding space. - For blocks taking parameters, checks that the left brace has - or doesn't have trailing space. - Enabled: true - -Style/SpaceAroundBlockParameters: - Description: 'Checks the spacing inside and after block parameters pipes.' - Enabled: true - -Style/SpaceAroundEqualsInParameterDefault: - Description: >- - Checks that the equals signs in parameter default assignments - have or don't have surrounding space depending on - configuration. - StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#spaces-around-equals' - Enabled: true - -Style/SpaceAroundOperators: - Description: 'Use a single space around operators.' - StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#spaces-operators' - Enabled: true - -Style/SpaceInsideBrackets: - Description: 'No spaces after [ or before ].' - StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-spaces-braces' - Enabled: true - -Style/SpaceInsideHashLiteralBraces: - Description: "Use spaces inside hash literal braces - or don't." - StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#spaces-operators' - Enabled: true - -Style/SpaceInsideParens: - Description: 'No spaces after ( or before ).' - StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-spaces-braces' - Enabled: true - -Style/SpaceInsideRangeLiteral: - Description: 'No spaces inside range literals.' - StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-space-inside-range-literals' - Enabled: true - -Style/SpaceInsideStringInterpolation: - Description: 'Checks for padding/surrounding spaces inside string interpolation.' - StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#string-interpolation' - Enabled: true - -Style/SpecialGlobalVars: - Description: 'Avoid Perl-style global variables.' - StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-cryptic-perlisms' - Enabled: true - -Style/StringLiterals: - Description: 'Checks if uses of quotes match the configured preference.' - StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#consistent-string-literals' - Enabled: true - -Style/StringLiteralsInInterpolation: - Description: >- - Checks if uses of quotes inside expressions in interpolated - strings match the configured preference. - Enabled: true - -Style/StructInheritance: - Description: 'Checks for inheritance from Struct.new.' - StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-extend-struct-new' - Enabled: true - -Style/SymbolLiteral: - Description: 'Use plain symbols instead of string symbols when possible.' - Enabled: true - -Style/SymbolProc: - Description: 'Use symbols as procs instead of blocks when possible.' - Enabled: true - -Style/Tab: - Description: 'No hard tabs.' - StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#spaces-indentation' - Enabled: true - -Style/TrailingBlankLines: - Description: 'Checks trailing blank lines and final newline.' - StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#newline-eof' - Enabled: true - -Style/TrailingCommaInArguments: - Description: 'Checks for trailing comma in parameter lists.' - StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-trailing-params-comma' - Enabled: true - -Style/TrailingCommaInLiteral: - Description: 'Checks for trailing comma in literals.' - StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-trailing-array-commas' - Enabled: true - -Style/TrailingWhitespace: - Description: 'Avoid trailing whitespace.' - StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-trailing-whitespace' - Enabled: true - -Style/TrivialAccessors: - Description: 'Prefer attr_* methods to trivial readers/writers.' - StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#attr_family' - Enabled: true - -Style/UnlessElse: - Description: >- - Do not use unless with else. Rewrite these with the positive - case first. - StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-else-with-unless' - Enabled: true - -Style/UnneededCapitalW: - Description: 'Checks for %W when interpolation is not needed.' - Enabled: true - -Style/UnneededPercentQ: - Description: 'Checks for %q/%Q when single quotes or double quotes would do.' - StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#percent-q' - Enabled: true - -Style/TrailingUnderscoreVariable: - Description: >- - Checks for the usage of unneeded trailing underscores at the - end of parallel variable assignment. - Enabled: true - -Style/VariableInterpolation: - Description: >- - Don't interpolate global, instance and class variables - directly in strings. - StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#curlies-interpolate' - Enabled: true - -Style/VariableName: - Description: 'Use the configured style when naming variables.' - StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#snake-case-symbols-methods-vars' - Enabled: true - -Style/WhenThen: - Description: 'Use when x then ... for one-line cases.' - StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#one-line-cases' - Enabled: true - -Style/WhileUntilDo: - Description: 'Checks for redundant do after while or until.' - StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-multiline-while-do' - Enabled: true - -Style/WhileUntilModifier: - Description: >- - Favor modifier while/until usage when you have a - single-line body. - StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#while-as-a-modifier' - Enabled: true - -Style/WordArray: - Description: 'Use %w or %W for arrays of words.' - StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#percent-w' - Enabled: true + Include: + - Rakefile + - config.ru + - lib/**/*.rake + Exclude: + - db/schema.rb \ No newline at end of file diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml new file mode 100644 index 000000000..9abe56d2e --- /dev/null +++ b/.rubocop_todo.yml @@ -0,0 +1,3085 @@ +# This configuration was generated by +# `rubocop --auto-gen-config --exclude-limit 500` +# on 2016-11-13 10:16:38 +1300 using RuboCop version 0.45.0. +# The point is for the user to remove these configuration records +# one by one as the offenses are removed from the code base. +# Note that changes in the inspected code, or installation of new +# versions of RuboCop, may require this file to be generated again. + +# Offense count: 2 +Lint/AmbiguousOperator: + Exclude: + - 'spec/factories/member.rb' + +# Offense count: 24 +Lint/AmbiguousRegexpLiteral: + Exclude: + - 'app/models/order.rb' + - 'spec/controllers/admin/orders_controller_spec.rb' + - 'spec/controllers/orders_controller_spec.rb' + - 'spec/features/cms_spec.rb' + - 'spec/lib/haml/filters/escaped_markdown_spec.rb' + - 'spec/lib/haml/filters/growstuff_markdown_spec.rb' + - 'spec/models/comment_spec.rb' + - 'spec/models/planting_spec.rb' + - 'spec/models/post_spec.rb' + - 'spec/views/members/show.rss.haml_spec.rb' + - 'spec/views/posts/show.html.haml_spec.rb' + +# Offense count: 1 +# Configuration parameters: AllowSafeAssignment. +Lint/AssignmentInCondition: + Exclude: + - 'app/models/member.rb' + +# Offense count: 5 +# Cop supports --auto-correct. +# Configuration parameters: AlignWith, SupportedStyles. +# SupportedStyles: either, start_of_block, start_of_line +Lint/BlockAlignment: + Exclude: + - 'spec/controllers/photos_controller_spec.rb' + - 'spec/features/signin_spec.rb' + - 'spec/models/seed_spec.rb' + +# Offense count: 2 +# Cop supports --auto-correct. +Lint/DeprecatedClassMethods: + Exclude: + - 'app/controllers/robots_controller.rb' + - 'config/boot.rb' + +# Offense count: 4 +# Cop supports --auto-correct. +# Configuration parameters: AlignWith, SupportedStyles, AutoCorrect. +# SupportedStyles: keyword, variable, start_of_line +Lint/EndAlignment: + Exclude: + - 'app/controllers/registrations_controller.rb' + - 'app/controllers/robots_controller.rb' + - 'app/helpers/seeds_helper.rb' + - 'db/migrate/20150201052245_create_cms.rb' + +# Offense count: 1 +Lint/HandleExceptions: + Exclude: + - 'lib/tasks/testing.rake' + +# Offense count: 8 +Lint/ParenthesesAsGroupedExpression: + Exclude: + - 'app/mailers/notifier.rb' + - 'spec/features/harvests/browse_harvests_spec.rb' + - 'spec/models/follow_spec.rb' + - 'spec/models/member_spec.rb' + - 'spec/views/plantings/show.html.haml_spec.rb' + +# Offense count: 1 +# Cop supports --auto-correct. +Lint/StringConversionInInterpolation: + Exclude: + - 'spec/views/seeds/index.rss.haml_spec.rb' + +# Offense count: 15 +# Cop supports --auto-correct. +# Configuration parameters: IgnoreEmptyBlocks, AllowUnusedKeywordArguments. +Lint/UnusedBlockArgument: + Exclude: + - 'app/controllers/crops_controller.rb' + - 'app/controllers/sessions_controller.rb' + - 'app/models/post.rb' + - 'config/unicorn.rb' + - 'lib/haml/filters/growstuff_markdown.rb' + +# Offense count: 8 +# Cop supports --auto-correct. +# Configuration parameters: AllowUnusedKeywordArguments, IgnoreEmptyMethods. +Lint/UnusedMethodArgument: + Exclude: + - 'app/controllers/application_controller.rb' + - 'app/controllers/passwords_controller.rb' + - 'app/controllers/registrations_controller.rb' + - 'app/models/crop.rb' + - 'app/validators/approved_validator.rb' + - 'spec/views/plantings/show.html.haml_spec.rb' + +# Offense count: 52 +Lint/UselessAssignment: + Exclude: + - 'app/controllers/crops_controller.rb' + - 'app/models/crop.rb' + - 'app/models/member.rb' + - 'config.rb' + - 'config/compass.rb' + - 'config/setup_load_paths.rb' + - 'db/seeds.rb' + - 'lib/tasks/growstuff.rake' + - 'spec/controllers/admin/orders_controller_spec.rb' + - 'spec/features/signin_spec.rb' + - 'spec/features/unsubscribing_spec.rb' + - 'spec/helpers/gardens_helper_spec.rb' + - 'spec/helpers/notifications_helper_spec.rb' + - 'spec/helpers/seeds_helper_spec.rb' + - 'spec/models/crop_spec.rb' + - 'spec/models/garden_spec.rb' + - 'spec/models/member_spec.rb' + - 'spec/support/controller_macros.rb' + +# Offense count: 5 +Lint/Void: + Exclude: + - 'spec/models/crop_spec.rb' + - 'spec/models/garden_spec.rb' + - 'spec/models/post_spec.rb' + +# Offense count: 59 +Metrics/AbcSize: + Max: 115 + +# Offense count: 5 +# Configuration parameters: CountComments. +Metrics/BlockLength: + Max: 62 + +# Offense count: 6 +# Configuration parameters: CountComments. +Metrics/ClassLength: + Max: 275 + +# Offense count: 6 +Metrics/CyclomaticComplexity: + Max: 11 + +# Offense count: 1108 +# Configuration parameters: AllowHeredoc, AllowURI, URISchemes, IgnoreCopDirectives. +# URISchemes: http, https +Metrics/LineLength: + Max: 223 + +# Offense count: 68 +# Configuration parameters: CountComments. +Metrics/MethodLength: + Max: 104 + +# Offense count: 8 +Metrics/PerceivedComplexity: + Max: 12 + +# Offense count: 5 +# Cop supports --auto-correct. +Performance/StringReplacement: + Exclude: + - 'app/models/garden.rb' + - 'app/models/harvest.rb' + - 'app/models/planting.rb' + - 'app/models/seed.rb' + - 'spec/rails_helper.rb' + +# Offense count: 21 +# Cop supports --auto-correct. +# Configuration parameters: EnforcedStyle, SupportedStyles, Include. +# SupportedStyles: action, filter +# Include: app/controllers/**/*.rb +Rails/ActionFilter: + Exclude: + - 'app/controllers/account_types_controller.rb' + - 'app/controllers/accounts_controller.rb' + - 'app/controllers/alternate_names_controller.rb' + - 'app/controllers/application_controller.rb' + - 'app/controllers/authentications_controller.rb' + - 'app/controllers/comments_controller.rb' + - 'app/controllers/crops_controller.rb' + - 'app/controllers/follows_controller.rb' + - 'app/controllers/gardens_controller.rb' + - 'app/controllers/harvests_controller.rb' + - 'app/controllers/notifications_controller.rb' + - 'app/controllers/order_items_controller.rb' + - 'app/controllers/orders_controller.rb' + - 'app/controllers/photos_controller.rb' + - 'app/controllers/plantings_controller.rb' + - 'app/controllers/posts_controller.rb' + - 'app/controllers/products_controller.rb' + - 'app/controllers/roles_controller.rb' + - 'app/controllers/scientific_names_controller.rb' + - 'app/controllers/seeds_controller.rb' + +# Offense count: 10 +# Configuration parameters: EnforcedStyle, SupportedStyles. +# SupportedStyles: strict, flexible +Rails/Date: + Exclude: + - 'app/controllers/harvests_controller.rb' + - 'app/controllers/plantings_controller.rb' + - 'db/seeds.rb' + - 'lib/tasks/growstuff.rake' + - 'spec/controllers/plantings_controller_spec.rb' + - 'spec/factories/planting.rb' + - 'spec/features/plantings/planting_a_crop_spec.rb' + - 'spec/features/shared_examples/append_date.rb' + +# Offense count: 42 +# Cop supports --auto-correct. +# Configuration parameters: Whitelist. +# Whitelist: find_by_sql +Rails/DynamicFindBy: + Exclude: + - 'app/controllers/alternate_names_controller.rb' + - 'app/controllers/comments_controller.rb' + - 'app/controllers/gardens_controller.rb' + - 'app/controllers/harvests_controller.rb' + - 'app/controllers/notifications_controller.rb' + - 'app/controllers/photos_controller.rb' + - 'app/controllers/plantings_controller.rb' + - 'app/controllers/posts_controller.rb' + - 'app/controllers/scientific_names_controller.rb' + - 'app/controllers/seeds_controller.rb' + - 'app/models/crop.rb' + - 'app/models/member.rb' + - 'app/models/order.rb' + - 'db/seeds.rb' + - 'lib/tasks/growstuff.rake' + - 'spec/controllers/roles_controller_spec.rb' + - 'spec/models/crop_spec.rb' + - 'spec/models/scientific_name_spec.rb' + +# Offense count: 7 +# Cop supports --auto-correct. +# Configuration parameters: Include. +# Include: app/models/**/*.rb +Rails/FindBy: + Exclude: + - 'app/models/member.rb' + - 'app/models/post.rb' + +# Offense count: 11 +# Configuration parameters: Include. +# Include: app/models/**/*.rb +Rails/HasAndBelongsToMany: + Exclude: + - 'app/models/crop.rb' + - 'app/models/garden.rb' + - 'app/models/harvest.rb' + - 'app/models/member.rb' + - 'app/models/photo.rb' + - 'app/models/planting.rb' + - 'app/models/post.rb' + - 'app/models/product.rb' + - 'app/models/role.rb' + +# Offense count: 89 +# Cop supports --auto-correct. +# Configuration parameters: Include. +# Include: spec/**/*, test/**/* +Rails/HttpPositionalArguments: + Exclude: + - 'spec/controllers/admin/orders_controller_spec.rb' + - 'spec/controllers/comments_controller_spec.rb' + - 'spec/controllers/crops_controller_spec.rb' + - 'spec/controllers/harvests_controller_spec.rb' + - 'spec/controllers/member_controller_spec.rb' + - 'spec/controllers/notifications_controller_spec.rb' + - 'spec/controllers/order_items_controller_spec.rb' + - 'spec/controllers/orders_controller_spec.rb' + - 'spec/controllers/photos_controller_spec.rb' + - 'spec/controllers/places_controller_spec.rb' + - 'spec/controllers/plantings_controller_spec.rb' + - 'spec/controllers/posts_controller_spec.rb' + - 'spec/controllers/roles_controller_spec.rb' + - 'spec/controllers/scientific_names_controller_spec.rb' + - 'spec/controllers/seeds_controller_spec.rb' + - 'spec/controllers/shop_controller_spec.rb' + +# Offense count: 15 +# Configuration parameters: Include. +# Include: app/**/*.rb, config/**/*.rb, db/**/*.rb, lib/**/*.rb +Rails/Output: + Exclude: + - 'config/unicorn.rb' + - 'db/seeds.rb' + +# Offense count: 3 +Rails/OutputSafety: + Exclude: + - 'app/helpers/application_helper.rb' + - 'app/helpers/auto_suggest_helper.rb' + - 'app/helpers/gardens_helper.rb' + +# Offense count: 2 +# Cop supports --auto-correct. +Rails/PluralizationGrammar: + Exclude: + - 'spec/features/plantings/planting_a_crop_spec.rb' + - 'spec/models/member_spec.rb' + +# Offense count: 1 +# Cop supports --auto-correct. +# Configuration parameters: EnforcedStyle, SupportedStyles. +# SupportedStyles: referer, referrer +Rails/RequestReferer: + Exclude: + - 'app/controllers/application_controller.rb' + +# Offense count: 9 +# Configuration parameters: EnforcedStyle, SupportedStyles. +# SupportedStyles: strict, flexible +Rails/TimeZone: + Exclude: + - 'app/helpers/plantings_helper.rb' + - 'spec/controllers/accounts_controller_spec.rb' + - 'spec/factories/member.rb' + - 'spec/factories/post.rb' + - 'spec/models/post_spec.rb' + - 'spec/views/plantings/index.html.haml_spec.rb' + +# Offense count: 2 +# Cop supports --auto-correct. +# Configuration parameters: Include. +# Include: app/models/**/*.rb +Rails/Validation: + Exclude: + - 'app/models/member.rb' + - 'app/models/order_item.rb' + +# Offense count: 1 +# Cop supports --auto-correct. +# Configuration parameters: EnforcedStyle, SupportedStyles, IndentationWidth. +# SupportedStyles: outdent, indent +Style/AccessModifierIndentation: + Exclude: + - 'app/controllers/passwords_controller.rb' + +# Offense count: 2 +# Cop supports --auto-correct. +Style/AlignArray: + Exclude: + - 'spec/models/planting_spec.rb' + +# Offense count: 93 +# Cop supports --auto-correct. +# Configuration parameters: EnforcedHashRocketStyle, EnforcedColonStyle, EnforcedLastArgumentHashStyle, SupportedLastArgumentHashStyles. +# SupportedLastArgumentHashStyles: always_inspect, always_ignore, ignore_implicit, ignore_explicit +Style/AlignHash: + Exclude: + - 'app/mailers/notifier.rb' + - 'app/models/crop.rb' + - 'app/models/garden.rb' + - 'app/models/harvest.rb' + - 'app/models/member.rb' + - 'app/models/planting.rb' + - 'app/models/seed.rb' + - 'db/migrate/20150201052245_create_cms.rb' + - 'spec/controllers/photos_controller_spec.rb' + - 'spec/models/harvest_spec.rb' + - 'spec/models/post_spec.rb' + - 'spec/views/notifications/index.html.haml_spec.rb' + - 'spec/views/photos/show.html.haml_spec.rb' + - 'spec/views/places/_map_attribution.html.haml_spec.rb' + - 'spec/views/plantings/show.html.haml_spec.rb' + - 'spec/views/posts/show.html.haml_spec.rb' + +# Offense count: 143 +# Cop supports --auto-correct. +# Configuration parameters: EnforcedStyle, SupportedStyles, IndentationWidth. +# SupportedStyles: with_first_parameter, with_fixed_indentation +Style/AlignParameters: + Exclude: + - 'app/controllers/application_controller.rb' + - 'app/controllers/comments_controller.rb' + - 'app/controllers/gardens_controller.rb' + - 'app/controllers/harvests_controller.rb' + - 'app/controllers/photos_controller.rb' + - 'app/controllers/plantings_controller.rb' + - 'app/controllers/products_controller.rb' + - 'app/helpers/application_helper.rb' + - 'app/models/crop.rb' + - 'app/models/garden.rb' + - 'app/models/harvest.rb' + - 'app/models/member.rb' + - 'app/models/planting.rb' + - 'app/models/post.rb' + - 'app/models/product.rb' + - 'app/models/seed.rb' + - 'db/migrate/20150201052245_create_cms.rb' + - 'lib/tasks/hooks.rake' + - 'spec/controllers/order_items_controller_spec.rb' + - 'spec/helpers/gardens_helper_spec.rb' + - 'spec/helpers/harvests_helper_spec.rb' + - 'spec/helpers/plantings_helper_spec.rb' + - 'spec/helpers/seeds_helper_spec.rb' + - 'spec/models/ability_spec.rb' + - 'spec/models/crop_spec.rb' + - 'spec/models/member_spec.rb' + - 'spec/models/order_spec.rb' + - 'spec/models/plant_part_spec.rb' + - 'spec/models/planting_spec.rb' + - 'spec/models/post_spec.rb' + - 'spec/views/account_types/edit.html.haml_spec.rb' + - 'spec/views/account_types/new.html.haml_spec.rb' + - 'spec/views/account_types/show.html.haml_spec.rb' + - 'spec/views/crops/_grown_for.html.haml_spec.rb' + - 'spec/views/crops/_planting_advice.html.haml_spec.rb' + - 'spec/views/forums/edit.html.haml_spec.rb' + - 'spec/views/harvests/index.html.haml_spec.rb' + - 'spec/views/notifications/index.html.haml_spec.rb' + - 'spec/views/orders/show.html.haml_spec.rb' + - 'spec/views/photos/edit.html.haml_spec.rb' + - 'spec/views/plant_parts/edit.html.haml_spec.rb' + - 'spec/views/plant_parts/new.html.haml_spec.rb' + - 'spec/views/plantings/_form.html.haml_spec.rb' + - 'spec/views/plantings/edit.html.haml_spec.rb' + - 'spec/views/plantings/index.html.haml_spec.rb' + - 'spec/views/plantings/new.html.haml_spec.rb' + - 'spec/views/plantings/show.html.haml_spec.rb' + - 'spec/views/posts/edit.html.haml_spec.rb' + - 'spec/views/posts/index.html.haml_spec.rb' + - 'spec/views/posts/show.html.haml_spec.rb' + - 'spec/views/products/edit.html.haml_spec.rb' + - 'spec/views/products/new.html.haml_spec.rb' + - 'spec/views/roles/edit.html.haml_spec.rb' + - 'spec/views/roles/index.html.haml_spec.rb' + - 'spec/views/roles/new.html.haml_spec.rb' + - 'spec/views/roles/show.html.haml_spec.rb' + - 'spec/views/scientific_names/edit.html.haml_spec.rb' + - 'spec/views/scientific_names/show.html.haml_spec.rb' + - 'spec/views/seeds/show.html.haml_spec.rb' + +# Offense count: 12 +# Cop supports --auto-correct. +# Configuration parameters: EnforcedStyle, SupportedStyles. +# SupportedStyles: always, conditionals +Style/AndOr: + Exclude: + - 'app/models/notification.rb' + - 'app/models/photo.rb' + - 'config/unicorn.rb' + - 'lib/tasks/growstuff.rake' + +# Offense count: 2 +Style/AsciiComments: + Exclude: + - 'app/models/crop.rb' + - 'config/initializers/comfortable_mexican_sofa.rb' + +# Offense count: 5 +# Cop supports --auto-correct. +# Configuration parameters: EnforcedStyle, SupportedStyles. +# SupportedStyles: percent_q, bare_percent +Style/BarePercentLiterals: + Exclude: + - 'app/helpers/auto_suggest_helper.rb' + - 'spec/support/feature_helpers.rb' + +# Offense count: 25 +# Cop supports --auto-correct. +# Configuration parameters: EnforcedStyle, SupportedStyles, ProceduralMethods, FunctionalMethods, IgnoredMethods. +# SupportedStyles: line_count_based, semantic, braces_for_chaining +# ProceduralMethods: benchmark, bm, bmbm, create, each_with_object, measure, new, realtime, tap, with_object +# FunctionalMethods: let, let!, subject, watch +# IgnoredMethods: lambda, proc, it +Style/BlockDelimiters: + Exclude: + - 'app/controllers/alternate_names_controller.rb' + - 'app/controllers/members_controller.rb' + - 'app/controllers/posts_controller.rb' + - 'app/controllers/scientific_names_controller.rb' + - 'spec/controllers/harvests_controller_spec.rb' + - 'spec/controllers/order_items_controller_spec.rb' + - 'spec/controllers/photos_controller_spec.rb' + - 'spec/features/notifications_spec.rb' + - 'spec/models/ability_spec.rb' + - 'spec/models/comment_spec.rb' + - 'spec/models/follow_spec.rb' + - 'spec/models/member_spec.rb' + - 'spec/models/planting_spec.rb' + - 'spec/models/post_spec.rb' + - 'spec/views/crops/edit.html.haml_spec.rb' + +# Offense count: 8 +# Cop supports --auto-correct. +Style/BlockEndNewline: + Exclude: + - 'app/controllers/members_controller.rb' + - 'app/controllers/posts_controller.rb' + - 'spec/models/ability_spec.rb' + - 'spec/models/member_spec.rb' + - 'spec/models/planting_spec.rb' + +# Offense count: 93 +# Cop supports --auto-correct. +# Configuration parameters: EnforcedStyle, SupportedStyles. +# SupportedStyles: braces, no_braces, context_dependent +Style/BracesAroundHashParameters: + Exclude: + - 'app/controllers/admin/orders_controller.rb' + - 'app/controllers/crops_controller.rb' + - 'app/controllers/posts_controller.rb' + - 'app/helpers/application_helper.rb' + - 'app/models/crop.rb' + - 'app/models/member.rb' + - 'app/models/order.rb' + - 'config/environments/test.rb' + - 'spec/controllers/admin/orders_controller_spec.rb' + - 'spec/controllers/comments_controller_spec.rb' + - 'spec/controllers/harvests_controller_spec.rb' + - 'spec/controllers/member_controller_spec.rb' + - 'spec/controllers/notifications_controller_spec.rb' + - 'spec/controllers/order_items_controller_spec.rb' + - 'spec/controllers/orders_controller_spec.rb' + - 'spec/controllers/photos_controller_spec.rb' + - 'spec/controllers/places_controller_spec.rb' + - 'spec/controllers/plantings_controller_spec.rb' + - 'spec/controllers/posts_controller_spec.rb' + - 'spec/controllers/scientific_names_controller_spec.rb' + - 'spec/controllers/seeds_controller_spec.rb' + - 'spec/lib/actions/oauth_signup_action_spec.rb' + - 'spec/views/notifier/notify.html.haml_spec.rb' + - 'spec/views/photos/new.html.haml_spec.rb' + +# Offense count: 13 +# Cop supports --auto-correct. +# Configuration parameters: IndentWhenRelativeTo, SupportedStyles, IndentOneStep, IndentationWidth. +# SupportedStyles: case, end +Style/CaseIndentation: + Exclude: + - 'app/controllers/photos_controller.rb' + - 'app/helpers/application_helper.rb' + - 'app/models/order.rb' + - 'db/migrate/20150201052245_create_cms.rb' + +# Offense count: 4 +# Configuration parameters: EnforcedStyle, SupportedStyles. +# SupportedStyles: nested, compact +Style/ClassAndModuleChildren: + Exclude: + - 'app/controllers/admin/orders_controller.rb' + - 'lib/actions/oauth_signup_action.rb' + - 'lib/haml/filters/escaped_markdown.rb' + - 'lib/haml/filters/growstuff_markdown.rb' + +# Offense count: 8 +# Cop supports --auto-correct. +Style/ClassMethods: + Exclude: + - 'app/models/crop.rb' + - 'app/models/member.rb' + - 'app/models/order.rb' + - 'app/models/planting.rb' + - 'app/models/post.rb' + - 'app/models/seed.rb' + +# Offense count: 90 +# Cop supports --auto-correct. +Style/ClosingParenthesisIndentation: + Exclude: + - 'app/controllers/application_controller.rb' + - 'app/models/account.rb' + - 'app/models/crop.rb' + - 'spec/controllers/order_items_controller_spec.rb' + - 'spec/helpers/gardens_helper_spec.rb' + - 'spec/helpers/harvests_helper_spec.rb' + - 'spec/helpers/plantings_helper_spec.rb' + - 'spec/helpers/seeds_helper_spec.rb' + - 'spec/models/ability_spec.rb' + - 'spec/models/crop_spec.rb' + - 'spec/models/harvest_spec.rb' + - 'spec/models/member_spec.rb' + - 'spec/models/order_spec.rb' + - 'spec/models/plant_part_spec.rb' + - 'spec/models/planting_spec.rb' + - 'spec/models/post_spec.rb' + - 'spec/views/account_types/edit.html.haml_spec.rb' + - 'spec/views/account_types/new.html.haml_spec.rb' + - 'spec/views/account_types/show.html.haml_spec.rb' + - 'spec/views/crops/_grown_for.html.haml_spec.rb' + - 'spec/views/crops/_planting_advice.html.haml_spec.rb' + - 'spec/views/forums/edit.html.haml_spec.rb' + - 'spec/views/harvests/index.html.haml_spec.rb' + - 'spec/views/orders/show.html.haml_spec.rb' + - 'spec/views/photos/edit.html.haml_spec.rb' + - 'spec/views/plant_parts/edit.html.haml_spec.rb' + - 'spec/views/plant_parts/new.html.haml_spec.rb' + - 'spec/views/plantings/_form.html.haml_spec.rb' + - 'spec/views/plantings/edit.html.haml_spec.rb' + - 'spec/views/plantings/index.html.haml_spec.rb' + - 'spec/views/plantings/new.html.haml_spec.rb' + - 'spec/views/plantings/show.html.haml_spec.rb' + - 'spec/views/posts/edit.html.haml_spec.rb' + - 'spec/views/products/edit.html.haml_spec.rb' + - 'spec/views/products/new.html.haml_spec.rb' + - 'spec/views/roles/edit.html.haml_spec.rb' + - 'spec/views/roles/index.html.haml_spec.rb' + - 'spec/views/roles/new.html.haml_spec.rb' + - 'spec/views/roles/show.html.haml_spec.rb' + - 'spec/views/scientific_names/edit.html.haml_spec.rb' + - 'spec/views/scientific_names/show.html.haml_spec.rb' + +# Offense count: 2 +# Cop supports --auto-correct. +Style/ColonMethodCall: + Exclude: + - 'spec/lib/haml/filters/escaped_markdown_spec.rb' + - 'spec/lib/haml/filters/growstuff_markdown_spec.rb' + +# Offense count: 1 +# Cop supports --auto-correct. +# Configuration parameters: Keywords. +# Keywords: TODO, FIXME, OPTIMIZE, HACK, REVIEW +Style/CommentAnnotation: + Exclude: + - 'app/controllers/crops_controller.rb' + +# Offense count: 11 +# Cop supports --auto-correct. +Style/CommentIndentation: + Exclude: + - 'app/controllers/registrations_controller.rb' + - 'app/models/crop.rb' + - 'config/application.rb' + - 'config/initializers/comfortable_mexican_sofa.rb' + - 'config/routes.rb' + - 'spec/factories/comments.rb' + - 'spec/features/footer_spec.rb' + - 'spec/spec_helper.rb' + - 'spec/views/harvests/new.html.haml_spec.rb' + - 'spec/views/members/show.rss.haml_spec.rb' + - 'spec/views/posts/new.html.haml_spec.rb' + +# Offense count: 5 +# Cop supports --auto-correct. +# Configuration parameters: EnforcedStyle, SupportedStyles, SingleLineConditionsOnly. +# SupportedStyles: assign_to_condition, assign_inside_condition +Style/ConditionalAssignment: + Exclude: + - 'app/controllers/crops_controller.rb' + - 'app/controllers/harvests_controller.rb' + - 'app/models/harvest.rb' + - 'app/models/member.rb' + - 'app/controllers/posts_controller.rb' + - 'app/controllers/plantings_controller.rb' + - 'app/controllers/members_controller.rb' + - 'app/controllers/seeds_controller.rb' + +# Offense count: 1 +# Cop supports --auto-correct. +Style/DefWithParentheses: + Exclude: + - 'spec/views/posts/_single.html.haml_spec.rb' + +# Offense count: 178 +Style/Documentation: + Exclude: + - 'spec/**/*' + - 'test/**/*' + - 'app/controllers/account_types_controller.rb' + - 'app/controllers/accounts_controller.rb' + - 'app/controllers/admin/orders_controller.rb' + - 'app/controllers/admin_controller.rb' + - 'app/controllers/alternate_names_controller.rb' + - 'app/controllers/application_controller.rb' + - 'app/controllers/authentications_controller.rb' + - 'app/controllers/comments_controller.rb' + - 'app/controllers/crops_controller.rb' + - 'app/controllers/follows_controller.rb' + - 'app/controllers/forums_controller.rb' + - 'app/controllers/gardens_controller.rb' + - 'app/controllers/harvests_controller.rb' + - 'app/controllers/home_controller.rb' + - 'app/controllers/members_controller.rb' + - 'app/controllers/notifications_controller.rb' + - 'app/controllers/order_items_controller.rb' + - 'app/controllers/orders_controller.rb' + - 'app/controllers/pages_controller.rb' + - 'app/controllers/passwords_controller.rb' + - 'app/controllers/photos_controller.rb' + - 'app/controllers/places_controller.rb' + - 'app/controllers/plant_parts_controller.rb' + - 'app/controllers/plantings_controller.rb' + - 'app/controllers/posts_controller.rb' + - 'app/controllers/products_controller.rb' + - 'app/controllers/registrations_controller.rb' + - 'app/controllers/robots_controller.rb' + - 'app/controllers/roles_controller.rb' + - 'app/controllers/scientific_names_controller.rb' + - 'app/controllers/seeds_controller.rb' + - 'app/controllers/sessions_controller.rb' + - 'app/controllers/shop_controller.rb' + - 'app/helpers/application_helper.rb' + - 'app/helpers/auto_suggest_helper.rb' + - 'app/helpers/crops_helper.rb' + - 'app/helpers/gardens_helper.rb' + - 'app/helpers/harvests_helper.rb' + - 'app/helpers/notifications_helper.rb' + - 'app/helpers/plantings_helper.rb' + - 'app/helpers/seeds_helper.rb' + - 'app/mailers/notifier.rb' + - 'app/models/ability.rb' + - 'app/models/account.rb' + - 'app/models/account_type.rb' + - 'app/models/alternate_name.rb' + - 'app/models/authentication.rb' + - 'app/models/comment.rb' + - 'app/models/crop.rb' + - 'app/models/follow.rb' + - 'app/models/forum.rb' + - 'app/models/garden.rb' + - 'app/models/harvest.rb' + - 'app/models/member.rb' + - 'app/models/notification.rb' + - 'app/models/order.rb' + - 'app/models/order_item.rb' + - 'app/models/photo.rb' + - 'app/models/plant_part.rb' + - 'app/models/planting.rb' + - 'app/models/post.rb' + - 'app/models/product.rb' + - 'app/models/role.rb' + - 'app/models/scientific_name.rb' + - 'app/models/seed.rb' + - 'app/validators/approved_validator.rb' + - 'config/application.rb' + - 'config/initializers/comfortable_mexican_sofa.rb' + - 'db/migrate/20120903092956_devise_create_users.rb' + - 'db/migrate/20120903112806_add_username_to_users.rb' + - 'db/migrate/20121001212604_create_crops.rb' + - 'db/migrate/20121003190731_require_system_name_for_crops.rb' + - 'db/migrate/20121027035231_add_slug_to_crops.rb' + - 'db/migrate/20121105032913_create_gardens.rb' + - 'db/migrate/20121106101718_add_slug_to_users.rb' + - 'db/migrate/20121107012827_create_scientific_names.rb' + - 'db/migrate/20121108105440_create_updates.rb' + - 'db/migrate/20121109130033_add_creation_index_to_updates.rb' + - 'db/migrate/20121203034745_add_tos_agreement_to_users.rb' + - 'db/migrate/20121214224227_add_slug_to_updates.rb' + - 'db/migrate/20121219022554_create_plantings.rb' + - 'db/migrate/20130113045802_rename_updates_to_posts.rb' + - 'db/migrate/20130113060852_rename_users_to_members.rb' + - 'db/migrate/20130113081521_rename_post_member_to_author.rb' + - 'db/migrate/20130113095802_rename_garden_member_to_owner.rb' + - 'db/migrate/20130118031942_add_description_to_gardens.rb' + - 'db/migrate/20130118043431_add_slug_to_plantings.rb' + - 'db/migrate/20130206033956_create_comments.rb' + - 'db/migrate/20130206051328_add_show_email_to_member.rb' + - 'db/migrate/20130208034248_require_fields_for_comments.rb' + - 'db/migrate/20130212001748_add_geo_to_members.rb' + - 'db/migrate/20130212123628_create_notifications.rb' + - 'db/migrate/20130213014511_create_forums.rb' + - 'db/migrate/20130213015708_add_forum_to_posts.rb' + - 'db/migrate/20130214024117_create_roles.rb' + - 'db/migrate/20130214034838_add_members_roles_table.rb' + - 'db/migrate/20130215131921_rename_notification_fields.rb' + - 'db/migrate/20130220044605_add_slug_to_forums.rb' + - 'db/migrate/20130220044642_add_slug_to_roles.rb' + - 'db/migrate/20130222060730_default_read_to_false.rb' + - 'db/migrate/20130326092227_change_planted_at_to_date.rb' + - 'db/migrate/20130327120024_add_send_email_to_member.rb' + - 'db/migrate/20130329045744_add_sunniness_to_planting.rb' + - 'db/migrate/20130404174459_create_authentications.rb' + - 'db/migrate/20130409103549_make_post_subject_non_null.rb' + - 'db/migrate/20130409162140_add_name_to_authentications.rb' + - 'db/migrate/20130507105357_create_products.rb' + - 'db/migrate/20130507110411_create_orders.rb' + - 'db/migrate/20130507113915_add_orders_products_table.rb' + - 'db/migrate/20130508050711_add_completed_to_order.rb' + - 'db/migrate/20130508104506_create_photos.rb' + - 'db/migrate/20130509123711_add_metadata_to_photos.rb' + - 'db/migrate/20130514124515_add_parent_to_crop.rb' + - 'db/migrate/20130515033842_create_order_items.rb' + - 'db/migrate/20130515054017_change_order_member_id_to_integer.rb' + - 'db/migrate/20130515122301_change_prices_to_integers.rb' + - 'db/migrate/20130517015920_create_account_details.rb' + - 'db/migrate/20130517051922_create_account_types.rb' + - 'db/migrate/20130517234458_require_account_type_name.rb' + - 'db/migrate/20130518000339_add_columns_to_product.rb' + - 'db/migrate/20130518002942_rename_account_detail_to_account.rb' + - 'db/migrate/20130529032813_add_express_token_to_orders.rb' + - 'db/migrate/20130531110729_add_photos_plantings_table.rb' + - 'db/migrate/20130601011725_change_flickr_photo_id_to_string.rb' + - 'db/migrate/20130606230333_change_product_description_to_text.rb' + - 'db/migrate/20130606233733_add_recommended_price_to_product.rb' + - 'db/migrate/20130705104238_add_planted_from_to_planting.rb' + - 'db/migrate/20130715110134_create_seeds.rb' + - 'db/migrate/20130718005600_change_use_by_to_plant_before_on_seed.rb' + - 'db/migrate/20130718011247_add_trading_to_seeds.rb' + - 'db/migrate/20130722050836_remove_tradable_from_seeds.rb' + - 'db/migrate/20130723103128_set_default_tradable_to_on_seed.rb' + - 'db/migrate/20130723110702_add_slug_to_seed.rb' + - 'db/migrate/20130809012511_add_bio_to_members.rb' + - 'db/migrate/20130819004549_add_planting_count_to_crop.rb' + - 'db/migrate/20130821011352_add_creator_to_crops.rb' + - 'db/migrate/20130821073736_add_creator_to_scientific_name.rb' + - 'db/migrate/20130826012139_add_owner_to_planting.rb' + - 'db/migrate/20130826023159_add_plantings_count_to_member.rb' + - 'db/migrate/20130827105823_add_newsletter_to_member.rb' + - 'db/migrate/20130913015118_add_referral_code_to_order.rb' + - 'db/migrate/20130917053547_create_harvests.rb' + - 'db/migrate/20130917060257_change_harvest_notes_to_description.rb' + - 'db/migrate/20130917071545_change_harvest_units_to_unit.rb' + - 'db/migrate/20130917075803_add_slug_to_harvests.rb' + - 'db/migrate/20130925050304_add_weight_to_harvests.rb' + - 'db/migrate/20131018101204_rename_system_name_to_name.rb' + - 'db/migrate/20131025104228_add_fields_to_gardens.rb' + - 'db/migrate/20131029053113_add_plant_part_to_harvests.rb' + - 'db/migrate/20131030230908_create_plant_parts.rb' + - 'db/migrate/20131030231202_change_plant_part_to_plant_part_id.rb' + - 'db/migrate/20131031000655_add_slug_to_plant_part.rb' + - 'db/migrate/20140718075753_default_plantings_count_to_zero.rb' + - 'db/migrate/20140829230600_add_finished_to_planting.rb' + - 'db/migrate/20140905001730_add_harvests_photos_table.rb' + - 'db/migrate/20140928044231_add_crops_posts_table.rb' + - 'db/migrate/20140928085713_add_send_planting_reminder_to_member.rb' + - 'db/migrate/20141002022459_create_index_harvest_photos.rb' + - 'db/migrate/20141018111015_create_alternate_names.rb' + - 'db/migrate/20141111130849_create_follows.rb' + - 'db/migrate/20141119130555_change_follows_member_id_to_follower_id.rb' + - 'db/migrate/20150124110540_add_properties_to_seeds.rb' + - 'db/migrate/20150127043022_add_gardens_photos_table.rb' + - 'db/migrate/20150129034206_add_si_weight_to_harvest.rb' + - 'db/migrate/20150130224814_add_requester_to_crops.rb' + - 'db/migrate/20150201052245_create_cms.rb' + - 'db/migrate/20150201053200_add_approval_status_to_crops.rb' + - 'db/migrate/20150201062506_add_reason_for_rejection_to_crops.rb' + - 'db/migrate/20150201064502_add_request_notes_to_crops.rb' + - 'db/migrate/20150209105410_add_rejection_notes_to_crops.rb' + - 'db/migrate/20150625224805_add_days_before_maturity_to_plantings.rb' + - 'db/migrate/20150824145414_add_member_preferred_image.rb' + - 'lib/actions/oauth_signup_action.rb' + - 'lib/geocodable.rb' + - 'lib/haml/filters/escaped_markdown.rb' + - 'lib/haml/filters/growstuff_markdown.rb' + +# Offense count: 10 +# Cop supports --auto-correct. +Style/EachForSimpleLoop: + Exclude: + - 'spec/models/crop_spec.rb' + - 'spec/views/home/_crops.html.haml_spec.rb' + +# Offense count: 2 +# Cop supports --auto-correct. +Style/ElseAlignment: + Exclude: + - 'app/controllers/registrations_controller.rb' + - 'app/helpers/seeds_helper.rb' + +# Offense count: 1 +# Cop supports --auto-correct. +# Configuration parameters: EnforcedStyle, SupportedStyles. +# SupportedStyles: empty, nil, both +Style/EmptyElse: + Exclude: + - 'app/controllers/photos_controller.rb' + +# Offense count: 2 +# Cop supports --auto-correct. +# Configuration parameters: AllowAdjacentOneLineDefs. +Style/EmptyLineBetweenDefs: + Exclude: + - 'app/controllers/omniauth_callbacks_controller.rb' + - 'db/migrate/20130601011725_change_flickr_photo_id_to_string.rb' + +# Offense count: 536 +# Cop supports --auto-correct. +Style/EmptyLines: + Exclude: + - 'app/controllers/gardens_controller.rb' + - 'app/controllers/photos_controller.rb' + - 'app/models/follow.rb' + - 'app/models/member.rb' + - 'app/models/post.rb' + - 'config.rb' + - 'config/application.rb' + - 'config/routes.rb' + - 'db/migrate/20120903092956_devise_create_users.rb' + - 'db/seeds.rb' + - 'lib/tasks/growstuff.rake' + - 'spec/controllers/account_types_controller_spec.rb' + - 'spec/controllers/accounts_controller_spec.rb' + - 'spec/controllers/admin/orders_controller_spec.rb' + - 'spec/controllers/admin_controller_spec.rb' + - 'spec/controllers/authentications_controller_spec.rb' + - 'spec/controllers/comments_controller_spec.rb' + - 'spec/controllers/crops_controller_spec.rb' + - 'spec/controllers/forums_controller_spec.rb' + - 'spec/controllers/gardens_controller_spec.rb' + - 'spec/controllers/harvests_controller_spec.rb' + - 'spec/controllers/home_controller_spec.rb' + - 'spec/controllers/member_controller_spec.rb' + - 'spec/controllers/notifications_controller_spec.rb' + - 'spec/controllers/order_items_controller_spec.rb' + - 'spec/controllers/orders_controller_spec.rb' + - 'spec/controllers/photos_controller_spec.rb' + - 'spec/controllers/places_controller_spec.rb' + - 'spec/controllers/plant_parts_controller_spec.rb' + - 'spec/controllers/plantings_controller_spec.rb' + - 'spec/controllers/posts_controller_spec.rb' + - 'spec/controllers/products_controller_spec.rb' + - 'spec/controllers/registrations_controller_spec.rb' + - 'spec/controllers/roles_controller_spec.rb' + - 'spec/controllers/scientific_names_controller_spec.rb' + - 'spec/controllers/seeds_controller_spec.rb' + - 'spec/controllers/shop_controller_spec.rb' + - 'spec/features/crops/crop_wranglers_spec.rb' + - 'spec/features/signin_spec.rb' + - 'spec/helpers/notifications_helper_spec.rb' + - 'spec/lib/haml/filters/growstuff_markdown_spec.rb' + - 'spec/mailers/notifier_spec.rb' + - 'spec/models/ability_spec.rb' + - 'spec/models/crop_spec.rb' + - 'spec/models/harvest_spec.rb' + - 'spec/models/seed_spec.rb' + - 'spec/views/account_types/edit.html.haml_spec.rb' + - 'spec/views/account_types/index.html.haml_spec.rb' + - 'spec/views/account_types/new.html.haml_spec.rb' + - 'spec/views/account_types/show.html.haml_spec.rb' + - 'spec/views/accounts/edit.html.haml_spec.rb' + - 'spec/views/accounts/index.html.haml_spec.rb' + - 'spec/views/accounts/new.html.haml_spec.rb' + - 'spec/views/accounts/show.html.haml_spec.rb' + - 'spec/views/admin/index_spec.rb' + - 'spec/views/admin/newsletter_spec.rb' + - 'spec/views/admin/orders/index_spec.rb' + - 'spec/views/comments/edit.html.haml_spec.rb' + - 'spec/views/comments/index.html.haml_spec.rb' + - 'spec/views/comments/index.rss.haml_spec.rb' + - 'spec/views/comments/new.html.haml_spec.rb' + - 'spec/views/comments/show.html.haml_spec.rb' + - 'spec/views/crops/_grown_for.html.haml_spec.rb' + - 'spec/views/crops/_planting_advice.html.haml_spec.rb' + - 'spec/views/crops/_popover.html.haml_spec.rb' + - 'spec/views/crops/edit.html.haml_spec.rb' + - 'spec/views/crops/hierarchy.html.haml_spec.rb' + - 'spec/views/crops/index.html.haml_spec.rb' + - 'spec/views/crops/index.rss.haml_spec.rb' + - 'spec/views/crops/new.html.haml_spec.rb' + - 'spec/views/crops/wrangle.html.haml_spec.rb' + - 'spec/views/devise/mailer/confirmation_instructions_spec.rb' + - 'spec/views/devise/mailer/reset_password_instructions_spec.rb' + - 'spec/views/devise/mailer/unlock_instructions_spec.rb' + - 'spec/views/devise/registrations/edit_spec.rb' + - 'spec/views/devise/registrations/new_spec.rb' + - 'spec/views/devise/sessions/new_spec.rb' + - 'spec/views/devise/unlocks/new_spec.rb' + - 'spec/views/forums/edit.html.haml_spec.rb' + - 'spec/views/forums/index.html.haml_spec.rb' + - 'spec/views/forums/new.html.haml_spec.rb' + - 'spec/views/forums/show.html.haml_spec.rb' + - 'spec/views/gardens/edit.html.haml_spec.rb' + - 'spec/views/gardens/new.html.haml_spec.rb' + - 'spec/views/gardens/show.html.haml_spec.rb' + - 'spec/views/harvests/edit.html.haml_spec.rb' + - 'spec/views/harvests/index.html.haml_spec.rb' + - 'spec/views/harvests/new.html.haml_spec.rb' + - 'spec/views/harvests/show.html.haml_spec.rb' + - 'spec/views/home/_blurb.html.haml_spec.rb' + - 'spec/views/home/_crops.html.haml_spec.rb' + - 'spec/views/home/_members.html.haml_spec.rb' + - 'spec/views/home/_seeds.html.haml_spec.rb' + - 'spec/views/home/_stats.html.haml_spec.rb' + - 'spec/views/home/index_spec.rb' + - 'spec/views/layouts/_header_spec.rb' + - 'spec/views/layouts/_meta_spec.rb' + - 'spec/views/layouts/application_spec.rb' + - 'spec/views/members/_location.html.haml_spec.rb' + - 'spec/views/members/index.html.haml_spec.rb' + - 'spec/views/members/show.rss.haml_spec.rb' + - 'spec/views/notifications/index.html.haml_spec.rb' + - 'spec/views/notifications/new.html.haml_spec.rb' + - 'spec/views/notifications/show.html.haml_spec.rb' + - 'spec/views/notifier/notify.html.haml_spec.rb' + - 'spec/views/orders/index.html.haml_spec.rb' + - 'spec/views/orders/show.html.haml_spec.rb' + - 'spec/views/photos/edit.html.haml_spec.rb' + - 'spec/views/photos/index.html.haml_spec.rb' + - 'spec/views/photos/new.html.haml_spec.rb' + - 'spec/views/photos/show.html.haml_spec.rb' + - 'spec/views/places/_map_attribution.html.haml_spec.rb' + - 'spec/views/places/index.html.haml_spec.rb' + - 'spec/views/places/show.html.haml_spec.rb' + - 'spec/views/plant_parts/edit.html.haml_spec.rb' + - 'spec/views/plant_parts/index.html.haml_spec.rb' + - 'spec/views/plant_parts/new.html.haml_spec.rb' + - 'spec/views/plant_parts/show.html.haml_spec.rb' + - 'spec/views/plantings/_form.html.haml_spec.rb' + - 'spec/views/plantings/edit.html.haml_spec.rb' + - 'spec/views/plantings/index.html.haml_spec.rb' + - 'spec/views/plantings/index.rss.haml_spec.rb' + - 'spec/views/plantings/new.html.haml_spec.rb' + - 'spec/views/plantings/show.html.haml_spec.rb' + - 'spec/views/posts/_single.html.haml_spec.rb' + - 'spec/views/posts/edit.html.haml_spec.rb' + - 'spec/views/posts/index.html.haml_spec.rb' + - 'spec/views/posts/index.rss.haml_spec.rb' + - 'spec/views/posts/new.html.haml_spec.rb' + - 'spec/views/posts/show.html.haml_spec.rb' + - 'spec/views/posts/show.rss.haml_spec.rb' + - 'spec/views/products/edit.html.haml_spec.rb' + - 'spec/views/products/index.html.haml_spec.rb' + - 'spec/views/products/new.html.haml_spec.rb' + - 'spec/views/products/show.html.haml_spec.rb' + - 'spec/views/roles/edit.html.haml_spec.rb' + - 'spec/views/roles/index.html.haml_spec.rb' + - 'spec/views/roles/new.html.haml_spec.rb' + - 'spec/views/roles/show.html.haml_spec.rb' + - 'spec/views/scientific_names/edit.html.haml_spec.rb' + - 'spec/views/scientific_names/index.html.haml_spec.rb' + - 'spec/views/scientific_names/new.html.haml_spec.rb' + - 'spec/views/scientific_names/show.html.haml_spec.rb' + - 'spec/views/seeds/edit.html.haml_spec.rb' + - 'spec/views/seeds/index.rss.haml_spec.rb' + - 'spec/views/seeds/new.html.haml_spec.rb' + - 'spec/views/seeds/show.html.haml_spec.rb' + - 'spec/views/shop/index_spec.rb' + +# Offense count: 2 +# Cop supports --auto-correct. +Style/EmptyLinesAroundAccessModifier: + Exclude: + - 'app/controllers/passwords_controller.rb' + - 'app/models/post.rb' + +# Offense count: 314 +# Cop supports --auto-correct. +# Configuration parameters: EnforcedStyle, SupportedStyles. +# SupportedStyles: empty_lines, no_empty_lines +Style/EmptyLinesAroundBlockBody: + Exclude: + - 'config/environments/test.rb' + - 'config/initializers/comfortable_mexican_sofa.rb' + - 'config/routes.rb' + - 'config/unicorn.rb' + - 'lib/tasks/growstuff.rake' + - 'spec/controllers/account_types_controller_spec.rb' + - 'spec/controllers/accounts_controller_spec.rb' + - 'spec/controllers/admin/orders_controller_spec.rb' + - 'spec/controllers/admin_controller_spec.rb' + - 'spec/controllers/authentications_controller_spec.rb' + - 'spec/controllers/comments_controller_spec.rb' + - 'spec/controllers/crops_controller_spec.rb' + - 'spec/controllers/forums_controller_spec.rb' + - 'spec/controllers/gardens_controller_spec.rb' + - 'spec/controllers/harvests_controller_spec.rb' + - 'spec/controllers/home_controller_spec.rb' + - 'spec/controllers/member_controller_spec.rb' + - 'spec/controllers/notifications_controller_spec.rb' + - 'spec/controllers/order_items_controller_spec.rb' + - 'spec/controllers/orders_controller_spec.rb' + - 'spec/controllers/photos_controller_spec.rb' + - 'spec/controllers/places_controller_spec.rb' + - 'spec/controllers/plant_parts_controller_spec.rb' + - 'spec/controllers/plantings_controller_spec.rb' + - 'spec/controllers/posts_controller_spec.rb' + - 'spec/controllers/products_controller_spec.rb' + - 'spec/controllers/registrations_controller_spec.rb' + - 'spec/controllers/roles_controller_spec.rb' + - 'spec/controllers/scientific_names_controller_spec.rb' + - 'spec/controllers/shop_controller_spec.rb' + - 'spec/factories/account_types.rb' + - 'spec/factories/crop.rb' + - 'spec/factories/follows.rb' + - 'spec/factories/garden.rb' + - 'spec/factories/member.rb' + - 'spec/factories/post.rb' + - 'spec/factories/scientific_name.rb' + - 'spec/features/crops/browse_crops_spec.rb' + - 'spec/features/crops/crop_detail_page_spec.rb' + - 'spec/features/crops/crop_wranglers_spec.rb' + - 'spec/features/footer_spec.rb' + - 'spec/features/gardens_spec.rb' + - 'spec/features/harvests/browse_harvests_spec.rb' + - 'spec/features/locale_spec.rb' + - 'spec/features/member_profile_spec.rb' + - 'spec/features/signout_spec.rb' + - 'spec/features/signup_spec.rb' + - 'spec/helpers/harvests_helper_spec.rb' + - 'spec/helpers/notifications_helper_spec.rb' + - 'spec/helpers/plantings_helper_spec.rb' + - 'spec/lib/haml/filters/escaped_markdown_spec.rb' + - 'spec/lib/haml/filters/growstuff_markdown_spec.rb' + - 'spec/mailers/notifier_spec.rb' + - 'spec/models/ability_spec.rb' + - 'spec/models/account_spec.rb' + - 'spec/models/alternate_name_spec.rb' + - 'spec/models/authentication_spec.rb' + - 'spec/models/comment_spec.rb' + - 'spec/models/crop_spec.rb' + - 'spec/models/follow_spec.rb' + - 'spec/models/forum_spec.rb' + - 'spec/models/garden_spec.rb' + - 'spec/models/harvest_spec.rb' + - 'spec/models/member_spec.rb' + - 'spec/models/notification_spec.rb' + - 'spec/models/order_item_spec.rb' + - 'spec/models/order_spec.rb' + - 'spec/models/photo_spec.rb' + - 'spec/models/plant_part_spec.rb' + - 'spec/models/planting_spec.rb' + - 'spec/models/post_spec.rb' + - 'spec/models/product_spec.rb' + - 'spec/models/scientific_name_spec.rb' + - 'spec/models/seed_spec.rb' + - 'spec/routing/account_types_routing_spec.rb' + - 'spec/routing/authentications_routing_spec.rb' + - 'spec/routing/comments_routing_spec.rb' + - 'spec/routing/crops_routing_spec.rb' + - 'spec/routing/follows_routing_spec.rb' + - 'spec/routing/forums_routing_spec.rb' + - 'spec/routing/gardens_routing_spec.rb' + - 'spec/routing/harvests_routing_spec.rb' + - 'spec/routing/notifications_routing_spec.rb' + - 'spec/routing/order_items_routing_spec.rb' + - 'spec/routing/orders_routing_spec.rb' + - 'spec/routing/photos_routing_spec.rb' + - 'spec/routing/plant_parts_routing_spec.rb' + - 'spec/routing/plantings_routing_spec.rb' + - 'spec/routing/products_routing_spec.rb' + - 'spec/routing/roles_routing_spec.rb' + - 'spec/routing/scientific_names_routing_spec.rb' + - 'spec/routing/seeds_routing_spec.rb' + - 'spec/routing/updates_routing_spec.rb' + - 'spec/spec_helper.rb' + - 'spec/support/database_cleaner.rb' + - 'spec/views/comments/index.rss.haml_spec.rb' + - 'spec/views/comments/new.html.haml_spec.rb' + - 'spec/views/crops/_planting_advice.html.haml_spec.rb' + - 'spec/views/crops/_popover.html.haml_spec.rb' + - 'spec/views/crops/edit.html.haml_spec.rb' + - 'spec/views/crops/index.rss.haml_spec.rb' + - 'spec/views/crops/new.html.haml_spec.rb' + - 'spec/views/crops/wrangle.html.haml_spec.rb' + - 'spec/views/devise/confirmations/new_spec.rb' + - 'spec/views/devise/mailer/confirmation_instructions_spec.rb' + - 'spec/views/devise/mailer/reset_password_instructions_spec.rb' + - 'spec/views/devise/registrations/edit_spec.rb' + - 'spec/views/devise/registrations/new_spec.rb' + - 'spec/views/devise/sessions/new_spec.rb' + - 'spec/views/devise/shared/_links_spec.rb' + - 'spec/views/devise/unlocks/new_spec.rb' + - 'spec/views/forums/index.html.haml_spec.rb' + - 'spec/views/gardens/edit.html.haml_spec.rb' + - 'spec/views/gardens/show.html.haml_spec.rb' + - 'spec/views/harvests/index.html.haml_spec.rb' + - 'spec/views/harvests/show.html.haml_spec.rb' + - 'spec/views/home/_blurb.html.haml_spec.rb' + - 'spec/views/home/_members.html.haml_spec.rb' + - 'spec/views/home/index_spec.rb' + - 'spec/views/layouts/_header_spec.rb' + - 'spec/views/layouts/_meta_spec.rb' + - 'spec/views/layouts/application_spec.rb' + - 'spec/views/members/_location.html.haml_spec.rb' + - 'spec/views/members/index.html.haml_spec.rb' + - 'spec/views/members/show.rss.haml_spec.rb' + - 'spec/views/notifications/index.html.haml_spec.rb' + - 'spec/views/notifications/new.html.haml_spec.rb' + - 'spec/views/notifications/show.html.haml_spec.rb' + - 'spec/views/notifier/notify.html.haml_spec.rb' + - 'spec/views/orders/show.html.haml_spec.rb' + - 'spec/views/photos/edit.html.haml_spec.rb' + - 'spec/views/photos/new.html.haml_spec.rb' + - 'spec/views/photos/show.html.haml_spec.rb' + - 'spec/views/places/show.html.haml_spec.rb' + - 'spec/views/plant_parts/index.html.haml_spec.rb' + - 'spec/views/plantings/_form.html.haml_spec.rb' + - 'spec/views/plantings/edit.html.haml_spec.rb' + - 'spec/views/plantings/new.html.haml_spec.rb' + - 'spec/views/posts/_single.html.haml_spec.rb' + - 'spec/views/posts/edit.html.haml_spec.rb' + - 'spec/views/posts/index.rss.haml_spec.rb' + - 'spec/views/posts/new.html.haml_spec.rb' + - 'spec/views/posts/show.html.haml_spec.rb' + - 'spec/views/posts/show.rss.haml_spec.rb' + - 'spec/views/scientific_names/edit.html.haml_spec.rb' + - 'spec/views/scientific_names/new.html.haml_spec.rb' + - 'spec/views/scientific_names/show.html.haml_spec.rb' + - 'spec/views/seeds/index.rss.haml_spec.rb' + - 'spec/views/seeds/new.html.haml_spec.rb' + - 'spec/views/seeds/show.html.haml_spec.rb' + - 'spec/views/shop/index_spec.rb' + +# Offense count: 21 +# Cop supports --auto-correct. +# Configuration parameters: EnforcedStyle, SupportedStyles. +# SupportedStyles: empty_lines, empty_lines_except_namespace, no_empty_lines +Style/EmptyLinesAroundClassBody: + Exclude: + - 'app/controllers/accounts_controller.rb' + - 'app/controllers/application_controller.rb' + - 'app/controllers/home_controller.rb' + - 'app/controllers/passwords_controller.rb' + - 'app/controllers/places_controller.rb' + - 'app/controllers/robots_controller.rb' + - 'app/mailers/notifier.rb' + - 'app/models/account.rb' + - 'app/models/comment.rb' + - 'app/models/crop.rb' + - 'app/models/follow.rb' + - 'app/models/forum.rb' + - 'app/models/garden.rb' + - 'app/models/harvest.rb' + - 'app/models/notification.rb' + - 'app/models/order.rb' + - 'app/models/photo.rb' + - 'app/models/plant_part.rb' + - 'app/models/product.rb' + - 'db/migrate/20130518002942_rename_account_detail_to_account.rb' + - 'lib/actions/oauth_signup_action.rb' + +# Offense count: 14 +# Cop supports --auto-correct. +Style/EmptyLinesAroundMethodBody: + Exclude: + - 'app/controllers/admin/orders_controller.rb' + - 'app/controllers/crops_controller.rb' + - 'app/controllers/follows_controller.rb' + - 'app/controllers/home_controller.rb' + - 'app/controllers/orders_controller.rb' + - 'app/controllers/registrations_controller.rb' + - 'app/models/crop.rb' + - 'app/models/photo.rb' + - 'app/models/seed.rb' + - 'lib/haml/filters/growstuff_markdown.rb' + +# Offense count: 14 +# Cop supports --auto-correct. +# Configuration parameters: EnforcedStyle, SupportedStyles. +# SupportedStyles: empty_lines, empty_lines_except_namespace, no_empty_lines +Style/EmptyLinesAroundModuleBody: + Exclude: + - 'app/helpers/application_helper.rb' + - 'app/helpers/auto_suggest_helper.rb' + - 'app/helpers/gardens_helper.rb' + - 'app/helpers/harvests_helper.rb' + - 'app/helpers/plantings_helper.rb' + - 'app/helpers/seeds_helper.rb' + - 'lib/geocodable.rb' + - 'lib/haml/filters/escaped_markdown.rb' + - 'lib/haml/filters/growstuff_markdown.rb' + - 'spec/support/feature_helpers.rb' + +# Offense count: 1 +# Cop supports --auto-correct. +Style/EmptyLiteral: + Exclude: + - 'app/models/member.rb' + +# Offense count: 23 +# Cop supports --auto-correct. +# Configuration parameters: AllowForAlignment, ForceEqualSignAlignment. +Style/ExtraSpacing: + Exclude: + - 'app/controllers/harvests_controller.rb' + - 'app/controllers/seeds_controller.rb' + - 'app/models/ability.rb' + - 'app/models/crop.rb' + - 'app/models/member.rb' + - 'app/models/post.rb' + - 'bin/rails' + - 'config.ru' + - 'config/environments/test.rb' + - 'db/migrate/20150201052245_create_cms.rb' + - 'script/rails' + - 'spec/features/crops/browse_crops_spec.rb' + - 'spec/lib/actions/oauth_signup_action_spec.rb' + - 'spec/models/planting_spec.rb' + - 'spec/models/role_spec.rb' + - 'spec/views/crops/_planting_advice.html.haml_spec.rb' + - 'spec/views/devise/shared/_links_spec.rb' + - 'spec/views/gardens/show.html.haml_spec.rb' + - 'spec/views/photos/new.html.haml_spec.rb' + +# Offense count: 1 +# Cop supports --auto-correct. +# Configuration parameters: EnforcedStyle, SupportedStyles, IndentationWidth. +# SupportedStyles: consistent, special_for_inner_method_call, special_for_inner_method_call_in_parentheses +Style/FirstParameterIndentation: + Exclude: + - 'db/seeds.rb' + +# Offense count: 1 +# Configuration parameters: EnforcedStyle, SupportedStyles. +# SupportedStyles: for, each +Style/For: + Exclude: + - 'app/models/order.rb' + +# Offense count: 5 +# Configuration parameters: EnforcedStyle, SupportedStyles. +# SupportedStyles: format, sprintf, percent +Style/FormatString: + Exclude: + - 'app/helpers/application_helper.rb' + - 'spec/helpers/application_helper_spec.rb' + - 'spec/views/shop/index_spec.rb' + +# Offense count: 485 +# Cop supports --auto-correct. +# Configuration parameters: EnforcedStyle, SupportedStyles. +# SupportedStyles: when_needed, always +Style/FrozenStringLiteralComment: + Exclude: + - 'Rakefile' + - 'app/controllers/account_types_controller.rb' + - 'app/controllers/accounts_controller.rb' + - 'app/controllers/admin/orders_controller.rb' + - 'app/controllers/admin_controller.rb' + - 'app/controllers/alternate_names_controller.rb' + - 'app/controllers/application_controller.rb' + - 'app/controllers/authentications_controller.rb' + - 'app/controllers/comments_controller.rb' + - 'app/controllers/crops_controller.rb' + - 'app/controllers/follows_controller.rb' + - 'app/controllers/forums_controller.rb' + - 'app/controllers/gardens_controller.rb' + - 'app/controllers/harvests_controller.rb' + - 'app/controllers/home_controller.rb' + - 'app/controllers/members_controller.rb' + - 'app/controllers/notifications_controller.rb' + - 'app/controllers/omniauth_callbacks_controller.rb' + - 'app/controllers/order_items_controller.rb' + - 'app/controllers/orders_controller.rb' + - 'app/controllers/pages_controller.rb' + - 'app/controllers/passwords_controller.rb' + - 'app/controllers/photos_controller.rb' + - 'app/controllers/places_controller.rb' + - 'app/controllers/plant_parts_controller.rb' + - 'app/controllers/plantings_controller.rb' + - 'app/controllers/posts_controller.rb' + - 'app/controllers/products_controller.rb' + - 'app/controllers/registrations_controller.rb' + - 'app/controllers/robots_controller.rb' + - 'app/controllers/roles_controller.rb' + - 'app/controllers/scientific_names_controller.rb' + - 'app/controllers/seeds_controller.rb' + - 'app/controllers/sessions_controller.rb' + - 'app/controllers/shop_controller.rb' + - 'app/helpers/application_helper.rb' + - 'app/helpers/auto_suggest_helper.rb' + - 'app/helpers/crops_helper.rb' + - 'app/helpers/gardens_helper.rb' + - 'app/helpers/harvests_helper.rb' + - 'app/helpers/notifications_helper.rb' + - 'app/helpers/plantings_helper.rb' + - 'app/helpers/seeds_helper.rb' + - 'app/mailers/notifier.rb' + - 'app/models/ability.rb' + - 'app/models/account.rb' + - 'app/models/account_type.rb' + - 'app/models/alternate_name.rb' + - 'app/models/authentication.rb' + - 'app/models/comment.rb' + - 'app/models/crop.rb' + - 'app/models/follow.rb' + - 'app/models/forum.rb' + - 'app/models/garden.rb' + - 'app/models/harvest.rb' + - 'app/models/member.rb' + - 'app/models/notification.rb' + - 'app/models/order.rb' + - 'app/models/order_item.rb' + - 'app/models/photo.rb' + - 'app/models/plant_part.rb' + - 'app/models/planting.rb' + - 'app/models/post.rb' + - 'app/models/product.rb' + - 'app/models/role.rb' + - 'app/models/scientific_name.rb' + - 'app/models/seed.rb' + - 'app/validators/approved_validator.rb' + - 'bin/bundle' + - 'bin/rails' + - 'bin/rake' + - 'config.rb' + - 'config.ru' + - 'config/application.rb' + - 'config/boot.rb' + - 'config/compass.rb' + - 'config/environment.rb' + - 'config/environments/development.rb' + - 'config/environments/production.rb' + - 'config/environments/staging.rb' + - 'config/environments/test.rb' + - 'config/factory_girl.rb' + - 'config/initializers/backtrace_silencers.rb' + - 'config/initializers/comfortable_mexican_sofa.rb' + - 'config/initializers/devise.rb' + - 'config/initializers/escaped_markdown.rb' + - 'config/initializers/friendly_id.rb' + - 'config/initializers/geocoder.rb' + - 'config/initializers/growstuff_markdown.rb' + - 'config/initializers/inflections.rb' + - 'config/initializers/mime_types.rb' + - 'config/initializers/omniauth.rb' + - 'config/initializers/session_store.rb' + - 'config/initializers/sidekiq.rb' + - 'config/initializers/time_formats.rb' + - 'config/initializers/wrap_parameters.rb' + - 'config/routes.rb' + - 'config/setup_load_paths.rb' + - 'config/unicorn.rb' + - 'db/migrate/20120903092956_devise_create_users.rb' + - 'db/migrate/20120903112806_add_username_to_users.rb' + - 'db/migrate/20121001212604_create_crops.rb' + - 'db/migrate/20121003190731_require_system_name_for_crops.rb' + - 'db/migrate/20121027035231_add_slug_to_crops.rb' + - 'db/migrate/20121105032913_create_gardens.rb' + - 'db/migrate/20121106101718_add_slug_to_users.rb' + - 'db/migrate/20121107012827_create_scientific_names.rb' + - 'db/migrate/20121108105440_create_updates.rb' + - 'db/migrate/20121109130033_add_creation_index_to_updates.rb' + - 'db/migrate/20121203034745_add_tos_agreement_to_users.rb' + - 'db/migrate/20121214224227_add_slug_to_updates.rb' + - 'db/migrate/20121219022554_create_plantings.rb' + - 'db/migrate/20130113045802_rename_updates_to_posts.rb' + - 'db/migrate/20130113060852_rename_users_to_members.rb' + - 'db/migrate/20130113081521_rename_post_member_to_author.rb' + - 'db/migrate/20130113095802_rename_garden_member_to_owner.rb' + - 'db/migrate/20130118031942_add_description_to_gardens.rb' + - 'db/migrate/20130118043431_add_slug_to_plantings.rb' + - 'db/migrate/20130206033956_create_comments.rb' + - 'db/migrate/20130206051328_add_show_email_to_member.rb' + - 'db/migrate/20130208034248_require_fields_for_comments.rb' + - 'db/migrate/20130212001748_add_geo_to_members.rb' + - 'db/migrate/20130212123628_create_notifications.rb' + - 'db/migrate/20130213014511_create_forums.rb' + - 'db/migrate/20130213015708_add_forum_to_posts.rb' + - 'db/migrate/20130214024117_create_roles.rb' + - 'db/migrate/20130214034838_add_members_roles_table.rb' + - 'db/migrate/20130215131921_rename_notification_fields.rb' + - 'db/migrate/20130220044605_add_slug_to_forums.rb' + - 'db/migrate/20130220044642_add_slug_to_roles.rb' + - 'db/migrate/20130222060730_default_read_to_false.rb' + - 'db/migrate/20130326092227_change_planted_at_to_date.rb' + - 'db/migrate/20130327120024_add_send_email_to_member.rb' + - 'db/migrate/20130329045744_add_sunniness_to_planting.rb' + - 'db/migrate/20130404174459_create_authentications.rb' + - 'db/migrate/20130409103549_make_post_subject_non_null.rb' + - 'db/migrate/20130409162140_add_name_to_authentications.rb' + - 'db/migrate/20130507105357_create_products.rb' + - 'db/migrate/20130507110411_create_orders.rb' + - 'db/migrate/20130507113915_add_orders_products_table.rb' + - 'db/migrate/20130508050711_add_completed_to_order.rb' + - 'db/migrate/20130508104506_create_photos.rb' + - 'db/migrate/20130509123711_add_metadata_to_photos.rb' + - 'db/migrate/20130514124515_add_parent_to_crop.rb' + - 'db/migrate/20130515033842_create_order_items.rb' + - 'db/migrate/20130515054017_change_order_member_id_to_integer.rb' + - 'db/migrate/20130515122301_change_prices_to_integers.rb' + - 'db/migrate/20130517015920_create_account_details.rb' + - 'db/migrate/20130517051922_create_account_types.rb' + - 'db/migrate/20130517234458_require_account_type_name.rb' + - 'db/migrate/20130518000339_add_columns_to_product.rb' + - 'db/migrate/20130518002942_rename_account_detail_to_account.rb' + - 'db/migrate/20130529032813_add_express_token_to_orders.rb' + - 'db/migrate/20130531110729_add_photos_plantings_table.rb' + - 'db/migrate/20130601011725_change_flickr_photo_id_to_string.rb' + - 'db/migrate/20130606230333_change_product_description_to_text.rb' + - 'db/migrate/20130606233733_add_recommended_price_to_product.rb' + - 'db/migrate/20130705104238_add_planted_from_to_planting.rb' + - 'db/migrate/20130715110134_create_seeds.rb' + - 'db/migrate/20130718005600_change_use_by_to_plant_before_on_seed.rb' + - 'db/migrate/20130718011247_add_trading_to_seeds.rb' + - 'db/migrate/20130722050836_remove_tradable_from_seeds.rb' + - 'db/migrate/20130723103128_set_default_tradable_to_on_seed.rb' + - 'db/migrate/20130723110702_add_slug_to_seed.rb' + - 'db/migrate/20130809012511_add_bio_to_members.rb' + - 'db/migrate/20130819004549_add_planting_count_to_crop.rb' + - 'db/migrate/20130821011352_add_creator_to_crops.rb' + - 'db/migrate/20130821073736_add_creator_to_scientific_name.rb' + - 'db/migrate/20130826012139_add_owner_to_planting.rb' + - 'db/migrate/20130826023159_add_plantings_count_to_member.rb' + - 'db/migrate/20130827105823_add_newsletter_to_member.rb' + - 'db/migrate/20130913015118_add_referral_code_to_order.rb' + - 'db/migrate/20130917053547_create_harvests.rb' + - 'db/migrate/20130917060257_change_harvest_notes_to_description.rb' + - 'db/migrate/20130917071545_change_harvest_units_to_unit.rb' + - 'db/migrate/20130917075803_add_slug_to_harvests.rb' + - 'db/migrate/20130925050304_add_weight_to_harvests.rb' + - 'db/migrate/20131018101204_rename_system_name_to_name.rb' + - 'db/migrate/20131025104228_add_fields_to_gardens.rb' + - 'db/migrate/20131029053113_add_plant_part_to_harvests.rb' + - 'db/migrate/20131030230908_create_plant_parts.rb' + - 'db/migrate/20131030231202_change_plant_part_to_plant_part_id.rb' + - 'db/migrate/20131031000655_add_slug_to_plant_part.rb' + - 'db/migrate/20140718075753_default_plantings_count_to_zero.rb' + - 'db/migrate/20140829230600_add_finished_to_planting.rb' + - 'db/migrate/20140905001730_add_harvests_photos_table.rb' + - 'db/migrate/20140928044231_add_crops_posts_table.rb' + - 'db/migrate/20140928085713_add_send_planting_reminder_to_member.rb' + - 'db/migrate/20141002022459_create_index_harvest_photos.rb' + - 'db/migrate/20141018111015_create_alternate_names.rb' + - 'db/migrate/20141111130849_create_follows.rb' + - 'db/migrate/20141119130555_change_follows_member_id_to_follower_id.rb' + - 'db/migrate/20150124110540_add_properties_to_seeds.rb' + - 'db/migrate/20150127043022_add_gardens_photos_table.rb' + - 'db/migrate/20150129034206_add_si_weight_to_harvest.rb' + - 'db/migrate/20150130224814_add_requester_to_crops.rb' + - 'db/migrate/20150201052245_create_cms.rb' + - 'db/migrate/20150201053200_add_approval_status_to_crops.rb' + - 'db/migrate/20150201062506_add_reason_for_rejection_to_crops.rb' + - 'db/migrate/20150201064502_add_request_notes_to_crops.rb' + - 'db/migrate/20150209105410_add_rejection_notes_to_crops.rb' + - 'db/migrate/20150625224805_add_days_before_maturity_to_plantings.rb' + - 'db/migrate/20150824145414_add_member_preferred_image.rb' + - 'db/seeds.rb' + - 'lib/actions/oauth_signup_action.rb' + - 'lib/geocodable.rb' + - 'lib/haml/filters/escaped_markdown.rb' + - 'lib/haml/filters/growstuff_markdown.rb' + - 'lib/tasks/growstuff.rake' + - 'lib/tasks/hooks.rake' + - 'lib/tasks/testing.rake' + - 'script/check_contributors_md' + - 'script/gemfile_check' + - 'script/heroku_maintenance.rb' + - 'script/rails' + - 'spec/controllers/account_types_controller_spec.rb' + - 'spec/controllers/accounts_controller_spec.rb' + - 'spec/controllers/admin/orders_controller_spec.rb' + - 'spec/controllers/admin_controller_spec.rb' + - 'spec/controllers/authentications_controller_spec.rb' + - 'spec/controllers/comments_controller_spec.rb' + - 'spec/controllers/crops_controller_spec.rb' + - 'spec/controllers/forums_controller_spec.rb' + - 'spec/controllers/gardens_controller_spec.rb' + - 'spec/controllers/harvests_controller_spec.rb' + - 'spec/controllers/home_controller_spec.rb' + - 'spec/controllers/member_controller_spec.rb' + - 'spec/controllers/notifications_controller_spec.rb' + - 'spec/controllers/order_items_controller_spec.rb' + - 'spec/controllers/orders_controller_spec.rb' + - 'spec/controllers/photos_controller_spec.rb' + - 'spec/controllers/places_controller_spec.rb' + - 'spec/controllers/plant_parts_controller_spec.rb' + - 'spec/controllers/plantings_controller_spec.rb' + - 'spec/controllers/posts_controller_spec.rb' + - 'spec/controllers/products_controller_spec.rb' + - 'spec/controllers/registrations_controller_spec.rb' + - 'spec/controllers/robots_controller_spec.rb' + - 'spec/controllers/roles_controller_spec.rb' + - 'spec/controllers/scientific_names_controller_spec.rb' + - 'spec/controllers/seeds_controller_spec.rb' + - 'spec/controllers/shop_controller_spec.rb' + - 'spec/custom_matchers.rb' + - 'spec/factories/account_types.rb' + - 'spec/factories/accounts.rb' + - 'spec/factories/alternate_names.rb' + - 'spec/factories/authentications.rb' + - 'spec/factories/comments.rb' + - 'spec/factories/crop.rb' + - 'spec/factories/follows.rb' + - 'spec/factories/forums.rb' + - 'spec/factories/garden.rb' + - 'spec/factories/harvests.rb' + - 'spec/factories/member.rb' + - 'spec/factories/notifications.rb' + - 'spec/factories/order_items.rb' + - 'spec/factories/orders.rb' + - 'spec/factories/photos.rb' + - 'spec/factories/plant_parts.rb' + - 'spec/factories/planting.rb' + - 'spec/factories/post.rb' + - 'spec/factories/products.rb' + - 'spec/factories/roles.rb' + - 'spec/factories/scientific_name.rb' + - 'spec/factories/seeds.rb' + - 'spec/features/admin/account_types_spec.rb' + - 'spec/features/admin/forums_spec.rb' + - 'spec/features/admin/products_spec.rb' + - 'spec/features/cms_spec.rb' + - 'spec/features/comments/commenting_a_comment_spec.rb' + - 'spec/features/crops/alternate_name_spec.rb' + - 'spec/features/crops/browse_crops_spec.rb' + - 'spec/features/crops/creating_a_crop_spec.rb' + - 'spec/features/crops/crop_detail_page_spec.rb' + - 'spec/features/crops/crop_search_spec.rb' + - 'spec/features/crops/crop_wranglers_spec.rb' + - 'spec/features/crops/crop_wrangling_button_spec.rb' + - 'spec/features/crops/inflections_spec.rb' + - 'spec/features/crops/request_new_crop_spec.rb' + - 'spec/features/following_spec.rb' + - 'spec/features/footer_spec.rb' + - 'spec/features/gardens/adding_gardens_spec.rb' + - 'spec/features/gardens_spec.rb' + - 'spec/features/harvests/browse_harvests_spec.rb' + - 'spec/features/harvests/harvesting_a_crop_spec.rb' + - 'spec/features/locale_spec.rb' + - 'spec/features/member_profile_spec.rb' + - 'spec/features/members_list_spec.rb' + - 'spec/features/notifications_spec.rb' + - 'spec/features/photos/show_photo_spec.rb' + - 'spec/features/places/searching_a_place_spec.rb' + - 'spec/features/planting_reminder_spec.rb' + - 'spec/features/plantings/planting_a_crop_spec.rb' + - 'spec/features/posts/posting_a_post_spec.rb' + - 'spec/features/rss/comments_spec.rb' + - 'spec/features/rss/crops_spec.rb' + - 'spec/features/rss/members_spec.rb' + - 'spec/features/rss/plantings_spec.rb' + - 'spec/features/rss/posts_spec.rb' + - 'spec/features/rss/seeds_spec.rb' + - 'spec/features/scientific_name_spec.rb' + - 'spec/features/seeds/adding_seeds_spec.rb' + - 'spec/features/seeds/misc_seeds_spec.rb' + - 'spec/features/shared_examples/append_date.rb' + - 'spec/features/shared_examples/crop_suggest.rb' + - 'spec/features/signin_spec.rb' + - 'spec/features/signout_spec.rb' + - 'spec/features/signup_spec.rb' + - 'spec/features/unsubscribing_spec.rb' + - 'spec/helpers/application_helper_spec.rb' + - 'spec/helpers/crops_helper_spec.rb' + - 'spec/helpers/gardens_helper_spec.rb' + - 'spec/helpers/harvests_helper_spec.rb' + - 'spec/helpers/notifications_helper_spec.rb' + - 'spec/helpers/plantings_helper_spec.rb' + - 'spec/helpers/seeds_helper_spec.rb' + - 'spec/lib/actions/oauth_signup_action_spec.rb' + - 'spec/lib/haml/filters/escaped_markdown_spec.rb' + - 'spec/lib/haml/filters/growstuff_markdown_spec.rb' + - 'spec/mailers/notifier_spec.rb' + - 'spec/models/ability_spec.rb' + - 'spec/models/account_spec.rb' + - 'spec/models/account_type_spec.rb' + - 'spec/models/alternate_name_spec.rb' + - 'spec/models/authentication_spec.rb' + - 'spec/models/comment_spec.rb' + - 'spec/models/crop_spec.rb' + - 'spec/models/follow_spec.rb' + - 'spec/models/forum_spec.rb' + - 'spec/models/garden_spec.rb' + - 'spec/models/harvest_spec.rb' + - 'spec/models/member_spec.rb' + - 'spec/models/notification_spec.rb' + - 'spec/models/order_item_spec.rb' + - 'spec/models/order_spec.rb' + - 'spec/models/photo_spec.rb' + - 'spec/models/plant_part_spec.rb' + - 'spec/models/planting_spec.rb' + - 'spec/models/post_spec.rb' + - 'spec/models/product_spec.rb' + - 'spec/models/role_spec.rb' + - 'spec/models/scientific_name_spec.rb' + - 'spec/models/seed_spec.rb' + - 'spec/rails_helper.rb' + - 'spec/requests/authentications_spec.rb' + - 'spec/requests/comments_spec.rb' + - 'spec/requests/forums_spec.rb' + - 'spec/requests/gardens_spec.rb' + - 'spec/requests/harvests_spec.rb' + - 'spec/requests/notifications_spec.rb' + - 'spec/requests/photos_spec.rb' + - 'spec/requests/plant_parts_spec.rb' + - 'spec/requests/plantings_spec.rb' + - 'spec/requests/post_spec.rb' + - 'spec/requests/scientific_names_spec.rb' + - 'spec/requests/seeds_spec.rb' + - 'spec/routing/account_types_routing_spec.rb' + - 'spec/routing/authentications_routing_spec.rb' + - 'spec/routing/comments_routing_spec.rb' + - 'spec/routing/crops_routing_spec.rb' + - 'spec/routing/follows_routing_spec.rb' + - 'spec/routing/forums_routing_spec.rb' + - 'spec/routing/gardens_routing_spec.rb' + - 'spec/routing/harvests_routing_spec.rb' + - 'spec/routing/notifications_routing_spec.rb' + - 'spec/routing/order_items_routing_spec.rb' + - 'spec/routing/orders_routing_spec.rb' + - 'spec/routing/photos_routing_spec.rb' + - 'spec/routing/plant_parts_routing_spec.rb' + - 'spec/routing/plantings_routing_spec.rb' + - 'spec/routing/products_routing_spec.rb' + - 'spec/routing/roles_routing_spec.rb' + - 'spec/routing/scientific_names_routing_spec.rb' + - 'spec/routing/seeds_routing_spec.rb' + - 'spec/routing/updates_routing_spec.rb' + - 'spec/spec_helper.rb' + - 'spec/support/controller_macros.rb' + - 'spec/support/database_cleaner.rb' + - 'spec/support/devise.rb' + - 'spec/support/elasticsearch_helpers.rb' + - 'spec/support/feature_helpers.rb' + - 'spec/views/account_types/edit.html.haml_spec.rb' + - 'spec/views/account_types/index.html.haml_spec.rb' + - 'spec/views/account_types/new.html.haml_spec.rb' + - 'spec/views/account_types/show.html.haml_spec.rb' + - 'spec/views/accounts/edit.html.haml_spec.rb' + - 'spec/views/accounts/index.html.haml_spec.rb' + - 'spec/views/accounts/new.html.haml_spec.rb' + - 'spec/views/accounts/show.html.haml_spec.rb' + - 'spec/views/admin/index_spec.rb' + - 'spec/views/admin/newsletter_spec.rb' + - 'spec/views/admin/orders/index_spec.rb' + - 'spec/views/comments/edit.html.haml_spec.rb' + - 'spec/views/comments/index.html.haml_spec.rb' + - 'spec/views/comments/index.rss.haml_spec.rb' + - 'spec/views/comments/new.html.haml_spec.rb' + - 'spec/views/comments/show.html.haml_spec.rb' + - 'spec/views/crops/_grown_for.html.haml_spec.rb' + - 'spec/views/crops/_planting_advice.html.haml_spec.rb' + - 'spec/views/crops/_popover.html.haml_spec.rb' + - 'spec/views/crops/edit.html.haml_spec.rb' + - 'spec/views/crops/hierarchy.html.haml_spec.rb' + - 'spec/views/crops/index.html.haml_spec.rb' + - 'spec/views/crops/index.rss.haml_spec.rb' + - 'spec/views/crops/new.html.haml_spec.rb' + - 'spec/views/crops/wrangle.html.haml_spec.rb' + - 'spec/views/devise/confirmations/new_spec.rb' + - 'spec/views/devise/mailer/confirmation_instructions_spec.rb' + - 'spec/views/devise/mailer/reset_password_instructions_spec.rb' + - 'spec/views/devise/mailer/unlock_instructions_spec.rb' + - 'spec/views/devise/registrations/edit_spec.rb' + - 'spec/views/devise/registrations/new_spec.rb' + - 'spec/views/devise/sessions/new_spec.rb' + - 'spec/views/devise/shared/_links_spec.rb' + - 'spec/views/devise/unlocks/new_spec.rb' + - 'spec/views/forums/edit.html.haml_spec.rb' + - 'spec/views/forums/index.html.haml_spec.rb' + - 'spec/views/forums/new.html.haml_spec.rb' + - 'spec/views/forums/show.html.haml_spec.rb' + - 'spec/views/gardens/edit.html.haml_spec.rb' + - 'spec/views/gardens/new.html.haml_spec.rb' + - 'spec/views/gardens/show.html.haml_spec.rb' + - 'spec/views/harvests/edit.html.haml_spec.rb' + - 'spec/views/harvests/index.html.haml_spec.rb' + - 'spec/views/harvests/new.html.haml_spec.rb' + - 'spec/views/harvests/show.html.haml_spec.rb' + - 'spec/views/home/_blurb.html.haml_spec.rb' + - 'spec/views/home/_crops.html.haml_spec.rb' + - 'spec/views/home/_members.html.haml_spec.rb' + - 'spec/views/home/_seeds.html.haml_spec.rb' + - 'spec/views/home/_stats.html.haml_spec.rb' + - 'spec/views/home/index_spec.rb' + - 'spec/views/layouts/_header_spec.rb' + - 'spec/views/layouts/_meta_spec.rb' + - 'spec/views/layouts/application_spec.rb' + - 'spec/views/members/_location.html.haml_spec.rb' + - 'spec/views/members/index.html.haml_spec.rb' + - 'spec/views/members/show.rss.haml_spec.rb' + - 'spec/views/notifications/index.html.haml_spec.rb' + - 'spec/views/notifications/new.html.haml_spec.rb' + - 'spec/views/notifications/show.html.haml_spec.rb' + - 'spec/views/notifier/notify.html.haml_spec.rb' + - 'spec/views/orders/index.html.haml_spec.rb' + - 'spec/views/orders/show.html.haml_spec.rb' + - 'spec/views/photos/edit.html.haml_spec.rb' + - 'spec/views/photos/index.html.haml_spec.rb' + - 'spec/views/photos/new.html.haml_spec.rb' + - 'spec/views/photos/show.html.haml_spec.rb' + - 'spec/views/places/_map_attribution.html.haml_spec.rb' + - 'spec/views/places/index.html.haml_spec.rb' + - 'spec/views/places/show.html.haml_spec.rb' + - 'spec/views/plant_parts/edit.html.haml_spec.rb' + - 'spec/views/plant_parts/index.html.haml_spec.rb' + - 'spec/views/plant_parts/new.html.haml_spec.rb' + - 'spec/views/plant_parts/show.html.haml_spec.rb' + - 'spec/views/plantings/_form.html.haml_spec.rb' + - 'spec/views/plantings/edit.html.haml_spec.rb' + - 'spec/views/plantings/index.html.haml_spec.rb' + - 'spec/views/plantings/index.rss.haml_spec.rb' + - 'spec/views/plantings/new.html.haml_spec.rb' + - 'spec/views/plantings/show.html.haml_spec.rb' + - 'spec/views/posts/_single.html.haml_spec.rb' + - 'spec/views/posts/edit.html.haml_spec.rb' + - 'spec/views/posts/index.html.haml_spec.rb' + - 'spec/views/posts/index.rss.haml_spec.rb' + - 'spec/views/posts/new.html.haml_spec.rb' + - 'spec/views/posts/show.html.haml_spec.rb' + - 'spec/views/posts/show.rss.haml_spec.rb' + - 'spec/views/products/edit.html.haml_spec.rb' + - 'spec/views/products/index.html.haml_spec.rb' + - 'spec/views/products/new.html.haml_spec.rb' + - 'spec/views/products/show.html.haml_spec.rb' + - 'spec/views/roles/edit.html.haml_spec.rb' + - 'spec/views/roles/index.html.haml_spec.rb' + - 'spec/views/roles/new.html.haml_spec.rb' + - 'spec/views/roles/show.html.haml_spec.rb' + - 'spec/views/scientific_names/edit.html.haml_spec.rb' + - 'spec/views/scientific_names/index.html.haml_spec.rb' + - 'spec/views/scientific_names/new.html.haml_spec.rb' + - 'spec/views/scientific_names/show.html.haml_spec.rb' + - 'spec/views/seeds/edit.html.haml_spec.rb' + - 'spec/views/seeds/index.rss.haml_spec.rb' + - 'spec/views/seeds/new.html.haml_spec.rb' + - 'spec/views/seeds/show.html.haml_spec.rb' + - 'spec/views/shop/index_spec.rb' + +# Offense count: 35 +# Configuration parameters: MinBodyLength. +Style/GuardClause: + Exclude: + - 'app/controllers/members_controller.rb' + - 'app/helpers/harvests_helper.rb' + - 'app/helpers/plantings_helper.rb' + - 'app/mailers/notifier.rb' + - 'app/models/ability.rb' + - 'app/models/account.rb' + - 'app/models/crop.rb' + - 'app/models/garden.rb' + - 'app/models/harvest.rb' + - 'app/models/member.rb' + - 'app/models/notification.rb' + - 'app/models/order.rb' + - 'app/models/order_item.rb' + - 'app/models/photo.rb' + - 'app/models/seed.rb' + - 'app/validators/approved_validator.rb' + - 'config/initializers/comfortable_mexican_sofa.rb' + - 'lib/geocodable.rb' + - 'spec/lib/haml/filters/growstuff_markdown_spec.rb' + - 'spec/support/elasticsearch_helpers.rb' + +# Offense count: 4 +Style/IdenticalConditionalBranches: + Exclude: + - 'app/controllers/crops_controller.rb' + - 'app/controllers/follows_controller.rb' + +# Offense count: 1 +Style/IfInsideElse: + Exclude: + - 'app/models/harvest.rb' + +# Offense count: 26 +# Cop supports --auto-correct. +# Configuration parameters: MaxLineLength. +Style/IfUnlessModifier: + Exclude: + - 'app/controllers/gardens_controller.rb' + - 'app/controllers/shop_controller.rb' + - 'app/helpers/crops_helper.rb' + - 'app/models/crop.rb' + - 'app/models/garden.rb' + - 'app/models/harvest.rb' + - 'app/models/member.rb' + - 'app/models/order.rb' + - 'app/models/planting.rb' + - 'app/models/seed.rb' + - 'config/initializers/geocoder.rb' + - 'lib/tasks/growstuff.rake' + +# Offense count: 18 +# Cop supports --auto-correct. +# Configuration parameters: SupportedStyles, IndentationWidth. +# SupportedStyles: special_inside_parentheses, consistent, align_brackets +Style/IndentArray: + EnforcedStyle: consistent + +# Offense count: 24 +# Cop supports --auto-correct. +# Configuration parameters: EnforcedStyle, SupportedStyles, IndentationWidth. +# SupportedStyles: special_inside_parentheses, consistent, align_braces +Style/IndentHash: + Exclude: + - 'app/controllers/crops_controller.rb' + - 'app/helpers/application_helper.rb' + - 'app/models/crop.rb' + - 'app/models/member.rb' + - 'app/models/order.rb' + - 'config/environments/development.rb' + - 'config/environments/production.rb' + - 'config/environments/staging.rb' + - 'config/environments/test.rb' + - 'spec/controllers/photos_controller_spec.rb' + - 'spec/lib/actions/oauth_signup_action_spec.rb' + +# Offense count: 25 +# Cop supports --auto-correct. +# Configuration parameters: EnforcedStyle, SupportedStyles. +# SupportedStyles: normal, rails +Style/IndentationConsistency: + Exclude: + - 'app/models/crop.rb' + - 'app/models/garden.rb' + - 'app/models/post.rb' + - 'lib/haml/filters/escaped_markdown.rb' + - 'lib/haml/filters/growstuff_markdown.rb' + - 'spec/lib/haml/filters/growstuff_markdown_spec.rb' + - 'spec/models/garden_spec.rb' + - 'spec/support/controller_macros.rb' + - 'spec/views/scientific_names/edit.html.haml_spec.rb' + +# Offense count: 29 +# Cop supports --auto-correct. +# Configuration parameters: Width. +Style/IndentationWidth: + Exclude: + - 'app/controllers/application_controller.rb' + - 'app/controllers/crops_controller.rb' + - 'app/controllers/registrations_controller.rb' + - 'app/controllers/robots_controller.rb' + - 'app/helpers/seeds_helper.rb' + - 'app/models/crop.rb' + - 'config/initializers/comfortable_mexican_sofa.rb' + - 'db/migrate/20121109130033_add_creation_index_to_updates.rb' + - 'db/migrate/20141119130555_change_follows_member_id_to_follower_id.rb' + - 'lib/tasks/hooks.rake' + - 'spec/controllers/harvests_controller_spec.rb' + - 'spec/controllers/photos_controller_spec.rb' + - 'spec/features/signin_spec.rb' + - 'spec/lib/haml/filters/growstuff_markdown_spec.rb' + - 'spec/models/garden_spec.rb' + - 'spec/models/seed_spec.rb' + - 'spec/support/controller_macros.rb' + - 'spec/views/crops/index.html.haml_spec.rb' + - 'spec/views/devise/registrations/new_spec.rb' + - 'spec/views/devise/sessions/new_spec.rb' + - 'spec/views/devise/unlocks/new_spec.rb' + - 'spec/views/posts/_single.html.haml_spec.rb' + +# Offense count: 7 +# Cop supports --auto-correct. +# Configuration parameters: EnforcedStyle, SupportedStyles. +# SupportedStyles: line_count_dependent, lambda, literal +Style/Lambda: + Exclude: + - 'spec/controllers/member_controller_spec.rb' + - 'spec/models/photo_spec.rb' + +# Offense count: 6 +# Cop supports --auto-correct. +Style/LeadingCommentSpace: + Exclude: + - 'app/controllers/application_controller.rb' + - 'app/controllers/omniauth_callbacks_controller.rb' + - 'app/controllers/plantings_controller.rb' + - 'app/controllers/posts_controller.rb' + - 'app/controllers/seeds_controller.rb' + - 'spec/factories/crop.rb' + +# Offense count: 3 +# Cop supports --auto-correct. +Style/MethodCallParentheses: + Exclude: + - 'app/models/photo.rb' + - 'spec/helpers/application_helper_spec.rb' + - 'spec/views/plantings/new.html.haml_spec.rb' + +# Offense count: 2 +# Cop supports --auto-correct. +# Configuration parameters: EnforcedStyle, SupportedStyles. +# SupportedStyles: symmetrical, new_line, same_line +Style/MultilineArrayBraceLayout: + Exclude: + - 'app/models/seed.rb' + +# Offense count: 8 +# Cop supports --auto-correct. +Style/MultilineBlockLayout: + Exclude: + - 'app/controllers/members_controller.rb' + - 'app/controllers/posts_controller.rb' + - 'spec/models/ability_spec.rb' + - 'spec/models/member_spec.rb' + - 'spec/models/planting_spec.rb' + +# Offense count: 7 +# Cop supports --auto-correct. +# Configuration parameters: EnforcedStyle, SupportedStyles. +# SupportedStyles: symmetrical, new_line, same_line +Style/MultilineHashBraceLayout: + Exclude: + - 'app/models/garden.rb' + - 'app/models/harvest.rb' + - 'app/models/planting.rb' + - 'app/models/product.rb' + - 'app/models/seed.rb' + +# Offense count: 1 +# Cop supports --auto-correct. +Style/MultilineIfModifier: + Exclude: + - 'spec/rails_helper.rb' + +# Offense count: 6 +# Cop supports --auto-correct. +Style/MultilineIfThen: + Exclude: + - 'lib/tasks/growstuff.rake' + - 'script/check_contributors_md' + - 'script/gemfile_check' + +# Offense count: 93 +# Cop supports --auto-correct. +# Configuration parameters: EnforcedStyle, SupportedStyles. +# SupportedStyles: symmetrical, new_line, same_line +Style/MultilineMethodCallBraceLayout: + Exclude: + - 'app/controllers/application_controller.rb' + - 'app/controllers/authentications_controller.rb' + - 'app/controllers/seeds_controller.rb' + - 'app/models/account.rb' + - 'app/models/crop.rb' + - 'spec/controllers/order_items_controller_spec.rb' + - 'spec/helpers/gardens_helper_spec.rb' + - 'spec/helpers/harvests_helper_spec.rb' + - 'spec/helpers/plantings_helper_spec.rb' + - 'spec/helpers/seeds_helper_spec.rb' + - 'spec/models/ability_spec.rb' + - 'spec/models/crop_spec.rb' + - 'spec/models/harvest_spec.rb' + - 'spec/models/member_spec.rb' + - 'spec/models/order_spec.rb' + - 'spec/models/plant_part_spec.rb' + - 'spec/models/planting_spec.rb' + - 'spec/models/post_spec.rb' + - 'spec/views/account_types/edit.html.haml_spec.rb' + - 'spec/views/account_types/new.html.haml_spec.rb' + - 'spec/views/account_types/show.html.haml_spec.rb' + - 'spec/views/crops/_grown_for.html.haml_spec.rb' + - 'spec/views/crops/_planting_advice.html.haml_spec.rb' + - 'spec/views/forums/edit.html.haml_spec.rb' + - 'spec/views/harvests/index.html.haml_spec.rb' + - 'spec/views/orders/show.html.haml_spec.rb' + - 'spec/views/photos/edit.html.haml_spec.rb' + - 'spec/views/plant_parts/edit.html.haml_spec.rb' + - 'spec/views/plant_parts/new.html.haml_spec.rb' + - 'spec/views/plantings/_form.html.haml_spec.rb' + - 'spec/views/plantings/edit.html.haml_spec.rb' + - 'spec/views/plantings/index.html.haml_spec.rb' + - 'spec/views/plantings/new.html.haml_spec.rb' + - 'spec/views/plantings/show.html.haml_spec.rb' + - 'spec/views/posts/edit.html.haml_spec.rb' + - 'spec/views/products/edit.html.haml_spec.rb' + - 'spec/views/products/new.html.haml_spec.rb' + - 'spec/views/roles/edit.html.haml_spec.rb' + - 'spec/views/roles/index.html.haml_spec.rb' + - 'spec/views/roles/new.html.haml_spec.rb' + - 'spec/views/roles/show.html.haml_spec.rb' + - 'spec/views/scientific_names/edit.html.haml_spec.rb' + - 'spec/views/scientific_names/show.html.haml_spec.rb' + +# Offense count: 4 +# Cop supports --auto-correct. +# Configuration parameters: EnforcedStyle, SupportedStyles, IndentationWidth. +# SupportedStyles: aligned, indented, indented_relative_to_receiver +Style/MultilineMethodCallIndentation: + Exclude: + - 'app/controllers/authentications_controller.rb' + - 'lib/actions/oauth_signup_action.rb' + +# Offense count: 2 +# Cop supports --auto-correct. +# Configuration parameters: EnforcedStyle, SupportedStyles, IndentationWidth. +# SupportedStyles: aligned, indented +Style/MultilineOperationIndentation: + Exclude: + - 'app/controllers/photos_controller.rb' + - 'app/controllers/registrations_controller.rb' + +# Offense count: 2 +Style/MultilineTernaryOperator: + Exclude: + - 'app/controllers/notifications_controller.rb' + - 'app/controllers/order_items_controller.rb' + +# Offense count: 10 +# Cop supports --auto-correct. +Style/MutableConstant: + Exclude: + - 'app/controllers/members_controller.rb' + - 'app/models/garden.rb' + - 'app/models/harvest.rb' + - 'app/models/planting.rb' + - 'app/models/seed.rb' + +# Offense count: 7 +# Cop supports --auto-correct. +Style/NegatedIf: + Exclude: + - 'app/controllers/crops_controller.rb' + - 'app/helpers/crops_helper.rb' + - 'app/models/crop.rb' + - 'app/models/garden.rb' + - 'script/check_contributors_md' + +# Offense count: 2 +Style/NestedTernaryOperator: + Exclude: + - 'app/controllers/harvests_controller.rb' + - 'app/controllers/plantings_controller.rb' + +# Offense count: 2 +# Cop supports --auto-correct. +# Configuration parameters: EnforcedStyle, MinBodyLength, SupportedStyles. +# SupportedStyles: skip_modifier_ifs, always +Style/Next: + Exclude: + - 'app/models/post.rb' + - 'lib/tasks/growstuff.rake' + +# Offense count: 2 +# Cop supports --auto-correct. +Style/NilComparison: + Exclude: + - 'lib/tasks/growstuff.rake' + +# Offense count: 1 +# Cop supports --auto-correct. +# Configuration parameters: IncludeSemanticChanges. +Style/NonNilCheck: + Exclude: + - 'app/models/harvest.rb' + +# Offense count: 2 +# Cop supports --auto-correct. +# Configuration parameters: EnforcedOctalStyle, SupportedOctalStyles. +# SupportedOctalStyles: zero_with_o, zero_only +Style/NumericLiteralPrefix: + Exclude: + - 'spec/views/plantings/_form.html.haml_spec.rb' + +# Offense count: 3 +# Cop supports --auto-correct. +Style/NumericLiterals: + MinDigits: 9 + +# Offense count: 16 +# Cop supports --auto-correct. +# Configuration parameters: AutoCorrect, EnforcedStyle, SupportedStyles. +# SupportedStyles: predicate, comparison +Style/NumericPredicate: + Exclude: + - 'spec/**/*' + - 'app/helpers/crops_helper.rb' + - 'app/helpers/harvests_helper.rb' + - 'app/helpers/plantings_helper.rb' + - 'app/models/crop.rb' + - 'app/models/garden.rb' + - 'app/models/harvest.rb' + - 'app/models/photo.rb' + - 'lib/tasks/growstuff.rake' + - 'script/check_contributors_md' + +# Offense count: 3 +# Cop supports --auto-correct. +Style/ParallelAssignment: + Exclude: + - 'app/mailers/notifier.rb' + +# Offense count: 8 +# Cop supports --auto-correct. +# Configuration parameters: AllowSafeAssignment. +Style/ParenthesesAroundCondition: + Exclude: + - 'app/controllers/application_controller.rb' + - 'app/controllers/orders_controller.rb' + - 'app/helpers/crops_helper.rb' + - 'app/models/garden.rb' + - 'app/models/member.rb' + - 'config/factory_girl.rb' + +# Offense count: 5 +# Cop supports --auto-correct. +# Configuration parameters: PreferredDelimiters. +Style/PercentLiteralDelimiters: + Exclude: + - 'app/helpers/auto_suggest_helper.rb' + - 'script/check_contributors_md' + - 'spec/features/signin_spec.rb' + - 'spec/features/signout_spec.rb' + +# Offense count: 6 +# Cop supports --auto-correct. +Style/PerlBackrefs: + Exclude: + - 'app/models/post.rb' + - 'lib/haml/filters/growstuff_markdown.rb' + +# Offense count: 3 +# Configuration parameters: NamePrefix, NamePrefixBlacklist, NameWhitelist. +# NamePrefix: is_, has_, have_ +# NamePrefixBlacklist: is_, has_, have_ +# NameWhitelist: is_a? +Style/PredicateName: + Exclude: + - 'spec/**/*' + - 'app/controllers/photos_controller.rb' + - 'app/models/member.rb' + +# Offense count: 1 +# Cop supports --auto-correct. +Style/RedundantBegin: + Exclude: + - 'app/controllers/members_controller.rb' + +# Offense count: 2 +# Cop supports --auto-correct. +Style/RedundantParentheses: + Exclude: + - 'app/helpers/plantings_helper.rb' + - 'app/models/garden.rb' + +# Offense count: 62 +# Cop supports --auto-correct. +# Configuration parameters: AllowMultipleReturnValues. +Style/RedundantReturn: + Exclude: + - 'app/helpers/application_helper.rb' + - 'app/helpers/harvests_helper.rb' + - 'app/helpers/plantings_helper.rb' + - 'app/mailers/notifier.rb' + - 'app/models/account.rb' + - 'app/models/crop.rb' + - 'app/models/forum.rb' + - 'app/models/garden.rb' + - 'app/models/harvest.rb' + - 'app/models/member.rb' + - 'app/models/order.rb' + - 'app/models/photo.rb' + - 'app/models/plant_part.rb' + - 'app/models/planting.rb' + - 'app/models/seed.rb' + - 'lib/haml/filters/escaped_markdown.rb' + - 'lib/haml/filters/growstuff_markdown.rb' + - 'spec/controllers/accounts_controller_spec.rb' + - 'spec/lib/haml/filters/growstuff_markdown_spec.rb' + - 'spec/views/devise/shared/_links_spec.rb' + +# Offense count: 56 +# Cop supports --auto-correct. +Style/RedundantSelf: + Exclude: + - 'app/models/comment.rb' + - 'app/models/crop.rb' + - 'app/models/follow.rb' + - 'app/models/harvest.rb' + - 'app/models/member.rb' + - 'app/models/notification.rb' + - 'app/models/order.rb' + - 'app/models/photo.rb' + - 'app/models/planting.rb' + - 'app/models/post.rb' + - 'app/models/seed.rb' + - 'lib/geocodable.rb' + +# Offense count: 9 +# Cop supports --auto-correct. +# Configuration parameters: EnforcedStyle, SupportedStyles, AllowInnerSlashes. +# SupportedStyles: slashes, percent_r, mixed +Style/RegexpLiteral: + Exclude: + - 'app/models/crop.rb' + - 'spec/lib/haml/filters/growstuff_markdown_spec.rb' + - 'spec/rails_helper.rb' + - 'spec/views/devise/registrations/edit_spec.rb' + - 'spec/views/members/index.html.haml_spec.rb' + - 'spec/views/posts/index.html.haml_spec.rb' + - 'spec/views/posts/show.html.haml_spec.rb' + +# Offense count: 1 +# Cop supports --auto-correct. +Style/SelfAssignment: + Exclude: + - 'app/helpers/crops_helper.rb' + +# Offense count: 20 +# Cop supports --auto-correct. +Style/SpaceAfterComma: + Exclude: + - 'app/models/crop.rb' + - 'db/seeds.rb' + - 'lib/actions/oauth_signup_action.rb' + - 'spec/models/harvest_spec.rb' + - 'spec/rails_helper.rb' + +# Offense count: 6 +# Cop supports --auto-correct. +Style/SpaceAfterNot: + Exclude: + - 'app/helpers/harvests_helper.rb' + - 'app/models/crop.rb' + - 'app/models/garden.rb' + +# Offense count: 2 +# Cop supports --auto-correct. +# Configuration parameters: EnforcedStyleInsidePipes, SupportedStyles. +# SupportedStyles: space, no_space +Style/SpaceAroundBlockParameters: + Exclude: + - 'spec/custom_matchers.rb' + +# Offense count: 14 +# Cop supports --auto-correct. +# Configuration parameters: EnforcedStyle, SupportedStyles. +# SupportedStyles: space, no_space +Style/SpaceAroundEqualsInParameterDefault: + Exclude: + - 'app/helpers/application_helper.rb' + - 'app/helpers/auto_suggest_helper.rb' + - 'app/models/crop.rb' + - 'app/models/member.rb' + - 'app/models/order.rb' + - 'app/models/planting.rb' + - 'spec/lib/haml/filters/growstuff_markdown_spec.rb' + - 'spec/support/controller_macros.rb' + - 'spec/support/feature_helpers.rb' + +# Offense count: 13 +# Cop supports --auto-correct. +# Configuration parameters: AllowForAlignment. +Style/SpaceAroundOperators: + Exclude: + - 'app/controllers/harvests_controller.rb' + - 'app/controllers/seeds_controller.rb' + - 'app/models/planting.rb' + - 'app/models/post.rb' + - 'config/environments/test.rb' + - 'db/seeds.rb' + - 'spec/views/crops/_planting_advice.html.haml_spec.rb' + - 'spec/views/gardens/show.html.haml_spec.rb' + - 'spec/views/harvests/index.html.haml_spec.rb' + - 'spec/views/plantings/index.html.haml_spec.rb' + +# Offense count: 2 +# Cop supports --auto-correct. +# Configuration parameters: EnforcedStyle, SupportedStyles. +# SupportedStyles: space, no_space +Style/SpaceBeforeBlockBraces: + Exclude: + - 'app/models/crop.rb' + - 'app/models/post.rb' + +# Offense count: 1 +# Cop supports --auto-correct. +Style/SpaceBeforeComma: + Exclude: + - 'spec/controllers/member_controller_spec.rb' + +# Offense count: 16 +# Cop supports --auto-correct. +# Configuration parameters: EnforcedStyle, SupportedStyles, EnforcedStyleForEmptyBraces, SpaceBeforeBlockParameters. +# SupportedStyles: space, no_space +Style/SpaceInsideBlockBraces: + Exclude: + - 'app/helpers/crops_helper.rb' + - 'app/models/crop.rb' + - 'app/models/member.rb' + - 'app/models/post.rb' + - 'spec/factories/member.rb' + - 'spec/rails_helper.rb' + - 'spec/support/elasticsearch_helpers.rb' + - 'spec/views/notifications/new.html.haml_spec.rb' + +# Offense count: 43 +# Cop supports --auto-correct. +Style/SpaceInsideBrackets: + Exclude: + - 'app/models/crop.rb' + - 'config/initializers/devise.rb' + - 'spec/controllers/member_controller_spec.rb' + - 'spec/factories/member.rb' + - 'spec/models/crop_spec.rb' + - 'spec/models/member_spec.rb' + - 'spec/views/crops/index.html.haml_spec.rb' + - 'spec/views/crops/wrangle.html.haml_spec.rb' + - 'spec/views/forums/index.html.haml_spec.rb' + - 'spec/views/members/index.html.haml_spec.rb' + - 'spec/views/notifications/index.html.haml_spec.rb' + - 'spec/views/orders/index.html.haml_spec.rb' + - 'spec/views/plantings/index.rss.haml_spec.rb' + - 'spec/views/seeds/index.rss.haml_spec.rb' + +# Offense count: 137 +# Cop supports --auto-correct. +# Configuration parameters: EnforcedStyle, EnforcedStyleForEmptyBraces, SupportedStyles. +# SupportedStyles: space, no_space, compact +Style/SpaceInsideHashLiteralBraces: + Exclude: + - 'app/controllers/admin/orders_controller.rb' + - 'app/controllers/crops_controller.rb' + - 'app/models/crop.rb' + - 'app/models/harvest.rb' + - 'app/models/member.rb' + - 'app/models/planting.rb' + - 'app/models/seed.rb' + - 'db/migrate/20150201052245_create_cms.rb' + - 'lib/geocodable.rb' + - 'spec/controllers/admin/orders_controller_spec.rb' + - 'spec/controllers/comments_controller_spec.rb' + - 'spec/controllers/gardens_controller_spec.rb' + - 'spec/controllers/harvests_controller_spec.rb' + - 'spec/controllers/member_controller_spec.rb' + - 'spec/controllers/notifications_controller_spec.rb' + - 'spec/controllers/order_items_controller_spec.rb' + - 'spec/controllers/orders_controller_spec.rb' + - 'spec/controllers/photos_controller_spec.rb' + - 'spec/controllers/plantings_controller_spec.rb' + - 'spec/controllers/seeds_controller_spec.rb' + - 'spec/views/notifications/show.html.haml_spec.rb' + - 'spec/views/photos/new.html.haml_spec.rb' + - 'spec/views/posts/_single.html.haml_spec.rb' + - 'spec/views/posts/show.html.haml_spec.rb' + +# Offense count: 5 +# Cop supports --auto-correct. +Style/SpaceInsideParens: + Exclude: + - 'app/models/crop.rb' + - 'config/environments/test.rb' + - 'spec/controllers/photos_controller_spec.rb' + - 'spec/lib/haml/filters/growstuff_markdown_spec.rb' + - 'spec/views/posts/edit.html.haml_spec.rb' + +# Offense count: 12 +# Cop supports --auto-correct. +# Configuration parameters: EnforcedStyle, SupportedStyles. +# SupportedStyles: space, no_space +Style/SpaceInsideStringInterpolation: + Exclude: + - 'app/controllers/follows_controller.rb' + - 'app/controllers/robots_controller.rb' + - 'spec/controllers/robots_controller_spec.rb' + - 'spec/features/crops/crop_detail_page_spec.rb' + - 'spec/features/rss/plantings_spec.rb' + - 'spec/features/rss/posts_spec.rb' + - 'spec/features/rss/seeds_spec.rb' + +# Offense count: 2 +# Cop supports --auto-correct. +# Configuration parameters: SupportedStyles. +# SupportedStyles: use_perl_names, use_english_names +Style/SpecialGlobalVars: + EnforcedStyle: use_perl_names + +# Offense count: 3216 +# Cop supports --auto-correct. +# Configuration parameters: EnforcedStyle, SupportedStyles, ConsistentQuotesInMultiline. +# SupportedStyles: single_quotes, double_quotes +Style/StringLiterals: + Exclude: + - 'app/controllers/account_types_controller.rb' + - 'app/controllers/accounts_controller.rb' + - 'app/controllers/alternate_names_controller.rb' + - 'app/controllers/application_controller.rb' + - 'app/controllers/authentications_controller.rb' + - 'app/controllers/comments_controller.rb' + - 'app/controllers/crops_controller.rb' + - 'app/controllers/follows_controller.rb' + - 'app/controllers/forums_controller.rb' + - 'app/controllers/gardens_controller.rb' + - 'app/controllers/harvests_controller.rb' + - 'app/controllers/members_controller.rb' + - 'app/controllers/notifications_controller.rb' + - 'app/controllers/omniauth_callbacks_controller.rb' + - 'app/controllers/order_items_controller.rb' + - 'app/controllers/orders_controller.rb' + - 'app/controllers/pages_controller.rb' + - 'app/controllers/photos_controller.rb' + - 'app/controllers/plant_parts_controller.rb' + - 'app/controllers/plantings_controller.rb' + - 'app/controllers/posts_controller.rb' + - 'app/controllers/products_controller.rb' + - 'app/controllers/registrations_controller.rb' + - 'app/controllers/roles_controller.rb' + - 'app/controllers/scientific_names_controller.rb' + - 'app/controllers/seeds_controller.rb' + - 'app/controllers/sessions_controller.rb' + - 'app/helpers/application_helper.rb' + - 'app/helpers/crops_helper.rb' + - 'app/helpers/gardens_helper.rb' + - 'app/helpers/harvests_helper.rb' + - 'app/helpers/plantings_helper.rb' + - 'app/helpers/seeds_helper.rb' + - 'app/mailers/notifier.rb' + - 'app/models/ability.rb' + - 'app/models/account.rb' + - 'app/models/alternate_name.rb' + - 'app/models/comment.rb' + - 'app/models/crop.rb' + - 'app/models/follow.rb' + - 'app/models/forum.rb' + - 'app/models/garden.rb' + - 'app/models/harvest.rb' + - 'app/models/member.rb' + - 'app/models/notification.rb' + - 'app/models/order.rb' + - 'app/models/order_item.rb' + - 'app/models/photo.rb' + - 'app/models/planting.rb' + - 'app/models/post.rb' + - 'app/models/scientific_name.rb' + - 'app/models/seed.rb' + - 'config.rb' + - 'config/application.rb' + - 'config/environments/test.rb' + - 'config/initializers/devise.rb' + - 'config/initializers/geocoder.rb' + - 'config/initializers/time_formats.rb' + - 'config/routes.rb' + - 'config/setup_load_paths.rb' + - 'db/migrate/20120903092956_devise_create_users.rb' + - 'db/migrate/20150201053200_add_approval_status_to_crops.rb' + - 'db/seeds.rb' + - 'lib/actions/oauth_signup_action.rb' + - 'lib/haml/filters/growstuff_markdown.rb' + - 'lib/tasks/growstuff.rake' + - 'lib/tasks/hooks.rake' + - 'script/gemfile_check' + - 'script/heroku_maintenance.rb' + - 'spec/controllers/account_types_controller_spec.rb' + - 'spec/controllers/accounts_controller_spec.rb' + - 'spec/controllers/admin/orders_controller_spec.rb' + - 'spec/controllers/admin_controller_spec.rb' + - 'spec/controllers/comments_controller_spec.rb' + - 'spec/controllers/crops_controller_spec.rb' + - 'spec/controllers/forums_controller_spec.rb' + - 'spec/controllers/harvests_controller_spec.rb' + - 'spec/controllers/home_controller_spec.rb' + - 'spec/controllers/member_controller_spec.rb' + - 'spec/controllers/notifications_controller_spec.rb' + - 'spec/controllers/order_items_controller_spec.rb' + - 'spec/controllers/orders_controller_spec.rb' + - 'spec/controllers/photos_controller_spec.rb' + - 'spec/controllers/places_controller_spec.rb' + - 'spec/controllers/plantings_controller_spec.rb' + - 'spec/controllers/posts_controller_spec.rb' + - 'spec/controllers/products_controller_spec.rb' + - 'spec/controllers/registrations_controller_spec.rb' + - 'spec/controllers/roles_controller_spec.rb' + - 'spec/controllers/scientific_names_controller_spec.rb' + - 'spec/controllers/seeds_controller_spec.rb' + - 'spec/controllers/shop_controller_spec.rb' + - 'spec/factories/account_types.rb' + - 'spec/factories/alternate_names.rb' + - 'spec/factories/crop.rb' + - 'spec/factories/forums.rb' + - 'spec/factories/garden.rb' + - 'spec/factories/harvests.rb' + - 'spec/factories/member.rb' + - 'spec/factories/notifications.rb' + - 'spec/factories/order_items.rb' + - 'spec/factories/photos.rb' + - 'spec/factories/plant_parts.rb' + - 'spec/factories/planting.rb' + - 'spec/factories/post.rb' + - 'spec/factories/products.rb' + - 'spec/factories/roles.rb' + - 'spec/factories/scientific_name.rb' + - 'spec/factories/seeds.rb' + - 'spec/features/admin/account_types_spec.rb' + - 'spec/features/admin/forums_spec.rb' + - 'spec/features/admin/products_spec.rb' + - 'spec/features/cms_spec.rb' + - 'spec/features/comments/commenting_a_comment_spec.rb' + - 'spec/features/crops/alternate_name_spec.rb' + - 'spec/features/crops/browse_crops_spec.rb' + - 'spec/features/crops/creating_a_crop_spec.rb' + - 'spec/features/crops/crop_detail_page_spec.rb' + - 'spec/features/crops/crop_search_spec.rb' + - 'spec/features/crops/crop_wranglers_spec.rb' + - 'spec/features/crops/crop_wrangling_button_spec.rb' + - 'spec/features/crops/inflections_spec.rb' + - 'spec/features/crops/request_new_crop_spec.rb' + - 'spec/features/following_spec.rb' + - 'spec/features/footer_spec.rb' + - 'spec/features/gardens/adding_gardens_spec.rb' + - 'spec/features/gardens_spec.rb' + - 'spec/features/harvests/browse_harvests_spec.rb' + - 'spec/features/harvests/harvesting_a_crop_spec.rb' + - 'spec/features/locale_spec.rb' + - 'spec/features/member_profile_spec.rb' + - 'spec/features/members_list_spec.rb' + - 'spec/features/notifications_spec.rb' + - 'spec/features/photos/show_photo_spec.rb' + - 'spec/features/places/searching_a_place_spec.rb' + - 'spec/features/planting_reminder_spec.rb' + - 'spec/features/plantings/planting_a_crop_spec.rb' + - 'spec/features/posts/posting_a_post_spec.rb' + - 'spec/features/scientific_name_spec.rb' + - 'spec/features/seeds/adding_seeds_spec.rb' + - 'spec/features/seeds/misc_seeds_spec.rb' + - 'spec/features/shared_examples/append_date.rb' + - 'spec/features/shared_examples/crop_suggest.rb' + - 'spec/features/signin_spec.rb' + - 'spec/features/signout_spec.rb' + - 'spec/features/signup_spec.rb' + - 'spec/features/unsubscribing_spec.rb' + - 'spec/helpers/application_helper_spec.rb' + - 'spec/helpers/crops_helper_spec.rb' + - 'spec/helpers/gardens_helper_spec.rb' + - 'spec/helpers/harvests_helper_spec.rb' + - 'spec/helpers/notifications_helper_spec.rb' + - 'spec/helpers/plantings_helper_spec.rb' + - 'spec/helpers/seeds_helper_spec.rb' + - 'spec/lib/actions/oauth_signup_action_spec.rb' + - 'spec/lib/haml/filters/escaped_markdown_spec.rb' + - 'spec/lib/haml/filters/growstuff_markdown_spec.rb' + - 'spec/mailers/notifier_spec.rb' + - 'spec/models/ability_spec.rb' + - 'spec/models/account_spec.rb' + - 'spec/models/alternate_name_spec.rb' + - 'spec/models/comment_spec.rb' + - 'spec/models/crop_spec.rb' + - 'spec/models/follow_spec.rb' + - 'spec/models/forum_spec.rb' + - 'spec/models/garden_spec.rb' + - 'spec/models/harvest_spec.rb' + - 'spec/models/member_spec.rb' + - 'spec/models/notification_spec.rb' + - 'spec/models/order_item_spec.rb' + - 'spec/models/order_spec.rb' + - 'spec/models/photo_spec.rb' + - 'spec/models/planting_spec.rb' + - 'spec/models/post_spec.rb' + - 'spec/models/product_spec.rb' + - 'spec/models/seed_spec.rb' + - 'spec/rails_helper.rb' + - 'spec/requests/authentications_spec.rb' + - 'spec/requests/comments_spec.rb' + - 'spec/requests/forums_spec.rb' + - 'spec/requests/gardens_spec.rb' + - 'spec/requests/harvests_spec.rb' + - 'spec/requests/notifications_spec.rb' + - 'spec/requests/photos_spec.rb' + - 'spec/requests/plant_parts_spec.rb' + - 'spec/requests/plantings_spec.rb' + - 'spec/requests/post_spec.rb' + - 'spec/requests/scientific_names_spec.rb' + - 'spec/requests/seeds_spec.rb' + - 'spec/routing/account_types_routing_spec.rb' + - 'spec/routing/authentications_routing_spec.rb' + - 'spec/routing/comments_routing_spec.rb' + - 'spec/routing/crops_routing_spec.rb' + - 'spec/routing/follows_routing_spec.rb' + - 'spec/routing/forums_routing_spec.rb' + - 'spec/routing/gardens_routing_spec.rb' + - 'spec/routing/harvests_routing_spec.rb' + - 'spec/routing/notifications_routing_spec.rb' + - 'spec/routing/order_items_routing_spec.rb' + - 'spec/routing/orders_routing_spec.rb' + - 'spec/routing/photos_routing_spec.rb' + - 'spec/routing/plant_parts_routing_spec.rb' + - 'spec/routing/plantings_routing_spec.rb' + - 'spec/routing/products_routing_spec.rb' + - 'spec/routing/roles_routing_spec.rb' + - 'spec/routing/scientific_names_routing_spec.rb' + - 'spec/routing/seeds_routing_spec.rb' + - 'spec/routing/updates_routing_spec.rb' + - 'spec/spec_helper.rb' + - 'spec/support/controller_macros.rb' + - 'spec/support/elasticsearch_helpers.rb' + - 'spec/views/account_types/edit.html.haml_spec.rb' + - 'spec/views/account_types/index.html.haml_spec.rb' + - 'spec/views/account_types/new.html.haml_spec.rb' + - 'spec/views/account_types/show.html.haml_spec.rb' + - 'spec/views/accounts/edit.html.haml_spec.rb' + - 'spec/views/accounts/index.html.haml_spec.rb' + - 'spec/views/accounts/new.html.haml_spec.rb' + - 'spec/views/accounts/show.html.haml_spec.rb' + - 'spec/views/admin/index_spec.rb' + - 'spec/views/admin/newsletter_spec.rb' + - 'spec/views/admin/orders/index_spec.rb' + - 'spec/views/comments/edit.html.haml_spec.rb' + - 'spec/views/comments/index.html.haml_spec.rb' + - 'spec/views/comments/index.rss.haml_spec.rb' + - 'spec/views/comments/new.html.haml_spec.rb' + - 'spec/views/comments/show.html.haml_spec.rb' + - 'spec/views/crops/_grown_for.html.haml_spec.rb' + - 'spec/views/crops/_planting_advice.html.haml_spec.rb' + - 'spec/views/crops/_popover.html.haml_spec.rb' + - 'spec/views/crops/edit.html.haml_spec.rb' + - 'spec/views/crops/hierarchy.html.haml_spec.rb' + - 'spec/views/crops/index.html.haml_spec.rb' + - 'spec/views/crops/index.rss.haml_spec.rb' + - 'spec/views/crops/new.html.haml_spec.rb' + - 'spec/views/crops/wrangle.html.haml_spec.rb' + - 'spec/views/devise/confirmations/new_spec.rb' + - 'spec/views/devise/mailer/confirmation_instructions_spec.rb' + - 'spec/views/devise/mailer/reset_password_instructions_spec.rb' + - 'spec/views/devise/mailer/unlock_instructions_spec.rb' + - 'spec/views/devise/registrations/edit_spec.rb' + - 'spec/views/devise/registrations/new_spec.rb' + - 'spec/views/devise/sessions/new_spec.rb' + - 'spec/views/devise/shared/_links_spec.rb' + - 'spec/views/devise/unlocks/new_spec.rb' + - 'spec/views/forums/edit.html.haml_spec.rb' + - 'spec/views/forums/index.html.haml_spec.rb' + - 'spec/views/forums/new.html.haml_spec.rb' + - 'spec/views/forums/show.html.haml_spec.rb' + - 'spec/views/gardens/edit.html.haml_spec.rb' + - 'spec/views/gardens/new.html.haml_spec.rb' + - 'spec/views/gardens/show.html.haml_spec.rb' + - 'spec/views/harvests/edit.html.haml_spec.rb' + - 'spec/views/harvests/index.html.haml_spec.rb' + - 'spec/views/harvests/new.html.haml_spec.rb' + - 'spec/views/harvests/show.html.haml_spec.rb' + - 'spec/views/home/_blurb.html.haml_spec.rb' + - 'spec/views/home/_crops.html.haml_spec.rb' + - 'spec/views/home/_members.html.haml_spec.rb' + - 'spec/views/home/_seeds.html.haml_spec.rb' + - 'spec/views/home/_stats.html.haml_spec.rb' + - 'spec/views/home/index_spec.rb' + - 'spec/views/layouts/_header_spec.rb' + - 'spec/views/layouts/_meta_spec.rb' + - 'spec/views/layouts/application_spec.rb' + - 'spec/views/members/_location.html.haml_spec.rb' + - 'spec/views/members/index.html.haml_spec.rb' + - 'spec/views/members/show.rss.haml_spec.rb' + - 'spec/views/notifications/index.html.haml_spec.rb' + - 'spec/views/notifications/new.html.haml_spec.rb' + - 'spec/views/notifications/show.html.haml_spec.rb' + - 'spec/views/notifier/notify.html.haml_spec.rb' + - 'spec/views/orders/index.html.haml_spec.rb' + - 'spec/views/orders/show.html.haml_spec.rb' + - 'spec/views/photos/edit.html.haml_spec.rb' + - 'spec/views/photos/index.html.haml_spec.rb' + - 'spec/views/photos/new.html.haml_spec.rb' + - 'spec/views/photos/show.html.haml_spec.rb' + - 'spec/views/places/_map_attribution.html.haml_spec.rb' + - 'spec/views/places/index.html.haml_spec.rb' + - 'spec/views/places/show.html.haml_spec.rb' + - 'spec/views/plant_parts/edit.html.haml_spec.rb' + - 'spec/views/plant_parts/index.html.haml_spec.rb' + - 'spec/views/plant_parts/new.html.haml_spec.rb' + - 'spec/views/plant_parts/show.html.haml_spec.rb' + - 'spec/views/plantings/_form.html.haml_spec.rb' + - 'spec/views/plantings/edit.html.haml_spec.rb' + - 'spec/views/plantings/index.html.haml_spec.rb' + - 'spec/views/plantings/index.rss.haml_spec.rb' + - 'spec/views/plantings/new.html.haml_spec.rb' + - 'spec/views/plantings/show.html.haml_spec.rb' + - 'spec/views/posts/_single.html.haml_spec.rb' + - 'spec/views/posts/edit.html.haml_spec.rb' + - 'spec/views/posts/index.html.haml_spec.rb' + - 'spec/views/posts/index.rss.haml_spec.rb' + - 'spec/views/posts/new.html.haml_spec.rb' + - 'spec/views/posts/show.html.haml_spec.rb' + - 'spec/views/posts/show.rss.haml_spec.rb' + - 'spec/views/products/edit.html.haml_spec.rb' + - 'spec/views/products/index.html.haml_spec.rb' + - 'spec/views/products/new.html.haml_spec.rb' + - 'spec/views/products/show.html.haml_spec.rb' + - 'spec/views/roles/edit.html.haml_spec.rb' + - 'spec/views/roles/index.html.haml_spec.rb' + - 'spec/views/roles/new.html.haml_spec.rb' + - 'spec/views/roles/show.html.haml_spec.rb' + - 'spec/views/scientific_names/edit.html.haml_spec.rb' + - 'spec/views/scientific_names/index.html.haml_spec.rb' + - 'spec/views/scientific_names/new.html.haml_spec.rb' + - 'spec/views/scientific_names/show.html.haml_spec.rb' + - 'spec/views/seeds/edit.html.haml_spec.rb' + - 'spec/views/seeds/index.rss.haml_spec.rb' + - 'spec/views/seeds/new.html.haml_spec.rb' + - 'spec/views/seeds/show.html.haml_spec.rb' + - 'spec/views/shop/index_spec.rb' + +# Offense count: 2 +# Cop supports --auto-correct. +# Configuration parameters: EnforcedStyle, SupportedStyles. +# SupportedStyles: single_quotes, double_quotes +Style/StringLiteralsInInterpolation: + Exclude: + - 'app/models/follow.rb' + - 'app/models/post.rb' + +# Offense count: 9 +# Cop supports --auto-correct. +# Configuration parameters: IgnoredMethods. +# IgnoredMethods: respond_to, define_method +Style/SymbolProc: + Exclude: + - 'app/controllers/crops_controller.rb' + - 'app/models/crop.rb' + - 'app/models/garden.rb' + - 'app/models/harvest.rb' + - 'app/models/planting.rb' + - 'app/models/post.rb' + - 'lib/tasks/growstuff.rake' + +# Offense count: 5 +# Cop supports --auto-correct. +Style/Tab: + Exclude: + - 'app/helpers/seeds_helper.rb' + - 'db/migrate/20141119130555_change_follows_member_id_to_follower_id.rb' + - 'spec/support/controller_macros.rb' + +# Offense count: 1 +# Cop supports --auto-correct. +# Configuration parameters: EnforcedStyle, SupportedStyles, AllowSafeAssignment. +# SupportedStyles: require_parentheses, require_no_parentheses +Style/TernaryParentheses: + Exclude: + - 'app/helpers/plantings_helper.rb' + +# Offense count: 31 +# Cop supports --auto-correct. +# Configuration parameters: EnforcedStyle, SupportedStyles. +# SupportedStyles: final_newline, final_blank_line +Style/TrailingBlankLines: + Exclude: + - 'app/controllers/omniauth_callbacks_controller.rb' + - 'app/controllers/passwords_controller.rb' + - 'app/helpers/application_helper.rb' + - 'app/helpers/seeds_helper.rb' + - 'config.rb' + - 'config/application.rb' + - 'config/environments/test.rb' + - 'config/initializers/geocoder.rb' + - 'config/initializers/sidekiq.rb' + - 'db/migrate/20140928044231_add_crops_posts_table.rb' + - 'db/migrate/20150201052245_create_cms.rb' + - 'lib/actions/oauth_signup_action.rb' + - 'script/check_contributors_md' + - 'spec/features/cms_spec.rb' + - 'spec/features/comments/commenting_a_comment_spec.rb' + - 'spec/features/crops/creating_a_crop_spec.rb' + - 'spec/features/members_list_spec.rb' + - 'spec/features/notifications_spec.rb' + - 'spec/features/photos/show_photo_spec.rb' + - 'spec/features/places/searching_a_place_spec.rb' + - 'spec/features/plantings/planting_a_crop_spec.rb' + - 'spec/features/shared_examples/append_date.rb' + - 'spec/features/unsubscribing_spec.rb' + - 'spec/helpers/plantings_helper_spec.rb' + - 'spec/lib/actions/oauth_signup_action_spec.rb' + - 'spec/models/follow_spec.rb' + - 'spec/support/database_cleaner.rb' + - 'spec/support/feature_helpers.rb' + - 'spec/views/devise/mailer/unlock_instructions_spec.rb' + - 'spec/views/plant_parts/show.html.haml_spec.rb' + - 'spec/views/plantings/_form.html.haml_spec.rb' + +# Offense count: 5 +# Cop supports --auto-correct. +# Configuration parameters: EnforcedStyleForMultiline, SupportedStyles. +# SupportedStyles: comma, consistent_comma, no_comma +Style/TrailingCommaInArguments: + Exclude: + - 'app/models/post.rb' + - 'db/seeds.rb' + - 'lib/actions/oauth_signup_action.rb' + - 'lib/tasks/growstuff.rake' + +# Offense count: 5 +# Cop supports --auto-correct. +# Configuration parameters: EnforcedStyleForMultiline, SupportedStyles. +# SupportedStyles: comma, consistent_comma, no_comma +Style/TrailingCommaInLiteral: + Exclude: + - 'app/models/crop.rb' + - 'config/environments/test.rb' + - 'spec/rails_helper.rb' + +# Offense count: 977 +# Cop supports --auto-correct. +Style/TrailingWhitespace: + Exclude: + - 'app/controllers/account_types_controller.rb' + - 'app/controllers/accounts_controller.rb' + - 'app/controllers/comments_controller.rb' + - 'app/controllers/crops_controller.rb' + - 'app/controllers/harvests_controller.rb' + - 'app/controllers/members_controller.rb' + - 'app/controllers/notifications_controller.rb' + - 'app/controllers/photos_controller.rb' + - 'app/controllers/roles_controller.rb' + - 'app/helpers/seeds_helper.rb' + - 'app/mailers/notifier.rb' + - 'app/models/ability.rb' + - 'app/models/account.rb' + - 'app/models/harvest.rb' + - 'app/models/member.rb' + - 'app/models/order.rb' + - 'app/models/planting.rb' + - 'app/models/post.rb' + - 'config/environments/development.rb' + - 'config/environments/staging.rb' + - 'config/environments/test.rb' + - 'db/migrate/20130326092227_change_planted_at_to_date.rb' + - 'db/migrate/20150201052245_create_cms.rb' + - 'db/seeds.rb' + - 'lib/actions/oauth_signup_action.rb' + - 'lib/tasks/growstuff.rake' + - 'spec/controllers/account_types_controller_spec.rb' + - 'spec/controllers/accounts_controller_spec.rb' + - 'spec/controllers/admin/orders_controller_spec.rb' + - 'spec/controllers/admin_controller_spec.rb' + - 'spec/controllers/authentications_controller_spec.rb' + - 'spec/controllers/comments_controller_spec.rb' + - 'spec/controllers/crops_controller_spec.rb' + - 'spec/controllers/forums_controller_spec.rb' + - 'spec/controllers/gardens_controller_spec.rb' + - 'spec/controllers/harvests_controller_spec.rb' + - 'spec/controllers/home_controller_spec.rb' + - 'spec/controllers/member_controller_spec.rb' + - 'spec/controllers/notifications_controller_spec.rb' + - 'spec/controllers/order_items_controller_spec.rb' + - 'spec/controllers/orders_controller_spec.rb' + - 'spec/controllers/photos_controller_spec.rb' + - 'spec/controllers/places_controller_spec.rb' + - 'spec/controllers/plant_parts_controller_spec.rb' + - 'spec/controllers/plantings_controller_spec.rb' + - 'spec/controllers/posts_controller_spec.rb' + - 'spec/controllers/products_controller_spec.rb' + - 'spec/controllers/registrations_controller_spec.rb' + - 'spec/controllers/roles_controller_spec.rb' + - 'spec/controllers/scientific_names_controller_spec.rb' + - 'spec/controllers/seeds_controller_spec.rb' + - 'spec/controllers/shop_controller_spec.rb' + - 'spec/factories/crop.rb' + - 'spec/factories/follows.rb' + - 'spec/features/admin/forums_spec.rb' + - 'spec/features/admin/products_spec.rb' + - 'spec/features/crops/crop_detail_page_spec.rb' + - 'spec/features/planting_reminder_spec.rb' + - 'spec/features/plantings/planting_a_crop_spec.rb' + - 'spec/features/signin_spec.rb' + - 'spec/features/signup_spec.rb' + - 'spec/helpers/crops_helper_spec.rb' + - 'spec/helpers/notifications_helper_spec.rb' + - 'spec/lib/actions/oauth_signup_action_spec.rb' + - 'spec/models/ability_spec.rb' + - 'spec/models/comment_spec.rb' + - 'spec/models/crop_spec.rb' + - 'spec/models/follow_spec.rb' + - 'spec/models/garden_spec.rb' + - 'spec/models/harvest_spec.rb' + - 'spec/models/member_spec.rb' + - 'spec/models/order_spec.rb' + - 'spec/models/planting_spec.rb' + - 'spec/models/post_spec.rb' + - 'spec/support/controller_macros.rb' + - 'spec/views/account_types/edit.html.haml_spec.rb' + - 'spec/views/account_types/index.html.haml_spec.rb' + - 'spec/views/account_types/new.html.haml_spec.rb' + - 'spec/views/account_types/show.html.haml_spec.rb' + - 'spec/views/accounts/edit.html.haml_spec.rb' + - 'spec/views/accounts/index.html.haml_spec.rb' + - 'spec/views/accounts/new.html.haml_spec.rb' + - 'spec/views/accounts/show.html.haml_spec.rb' + - 'spec/views/admin/index_spec.rb' + - 'spec/views/admin/newsletter_spec.rb' + - 'spec/views/admin/orders/index_spec.rb' + - 'spec/views/comments/edit.html.haml_spec.rb' + - 'spec/views/comments/index.html.haml_spec.rb' + - 'spec/views/comments/index.rss.haml_spec.rb' + - 'spec/views/comments/new.html.haml_spec.rb' + - 'spec/views/comments/show.html.haml_spec.rb' + - 'spec/views/crops/_grown_for.html.haml_spec.rb' + - 'spec/views/crops/_planting_advice.html.haml_spec.rb' + - 'spec/views/crops/_popover.html.haml_spec.rb' + - 'spec/views/crops/edit.html.haml_spec.rb' + - 'spec/views/crops/hierarchy.html.haml_spec.rb' + - 'spec/views/crops/index.html.haml_spec.rb' + - 'spec/views/crops/index.rss.haml_spec.rb' + - 'spec/views/crops/new.html.haml_spec.rb' + - 'spec/views/crops/wrangle.html.haml_spec.rb' + - 'spec/views/devise/mailer/confirmation_instructions_spec.rb' + - 'spec/views/devise/mailer/reset_password_instructions_spec.rb' + - 'spec/views/devise/mailer/unlock_instructions_spec.rb' + - 'spec/views/devise/registrations/edit_spec.rb' + - 'spec/views/devise/registrations/new_spec.rb' + - 'spec/views/devise/sessions/new_spec.rb' + - 'spec/views/devise/unlocks/new_spec.rb' + - 'spec/views/forums/edit.html.haml_spec.rb' + - 'spec/views/forums/index.html.haml_spec.rb' + - 'spec/views/forums/new.html.haml_spec.rb' + - 'spec/views/forums/show.html.haml_spec.rb' + - 'spec/views/gardens/edit.html.haml_spec.rb' + - 'spec/views/gardens/new.html.haml_spec.rb' + - 'spec/views/gardens/show.html.haml_spec.rb' + - 'spec/views/harvests/edit.html.haml_spec.rb' + - 'spec/views/harvests/index.html.haml_spec.rb' + - 'spec/views/harvests/new.html.haml_spec.rb' + - 'spec/views/harvests/show.html.haml_spec.rb' + - 'spec/views/home/_blurb.html.haml_spec.rb' + - 'spec/views/home/_crops.html.haml_spec.rb' + - 'spec/views/home/_members.html.haml_spec.rb' + - 'spec/views/home/_seeds.html.haml_spec.rb' + - 'spec/views/home/_stats.html.haml_spec.rb' + - 'spec/views/home/index_spec.rb' + - 'spec/views/layouts/_meta_spec.rb' + - 'spec/views/layouts/application_spec.rb' + - 'spec/views/members/_location.html.haml_spec.rb' + - 'spec/views/members/show.rss.haml_spec.rb' + - 'spec/views/notifications/index.html.haml_spec.rb' + - 'spec/views/notifications/new.html.haml_spec.rb' + - 'spec/views/notifications/show.html.haml_spec.rb' + - 'spec/views/notifier/notify.html.haml_spec.rb' + - 'spec/views/orders/index.html.haml_spec.rb' + - 'spec/views/orders/show.html.haml_spec.rb' + - 'spec/views/photos/edit.html.haml_spec.rb' + - 'spec/views/photos/index.html.haml_spec.rb' + - 'spec/views/photos/new.html.haml_spec.rb' + - 'spec/views/photos/show.html.haml_spec.rb' + - 'spec/views/places/_map_attribution.html.haml_spec.rb' + - 'spec/views/places/index.html.haml_spec.rb' + - 'spec/views/places/show.html.haml_spec.rb' + - 'spec/views/plant_parts/edit.html.haml_spec.rb' + - 'spec/views/plant_parts/index.html.haml_spec.rb' + - 'spec/views/plant_parts/new.html.haml_spec.rb' + - 'spec/views/plant_parts/show.html.haml_spec.rb' + - 'spec/views/plantings/_form.html.haml_spec.rb' + - 'spec/views/plantings/edit.html.haml_spec.rb' + - 'spec/views/plantings/index.html.haml_spec.rb' + - 'spec/views/plantings/index.rss.haml_spec.rb' + - 'spec/views/plantings/new.html.haml_spec.rb' + - 'spec/views/plantings/show.html.haml_spec.rb' + - 'spec/views/posts/_single.html.haml_spec.rb' + - 'spec/views/posts/edit.html.haml_spec.rb' + - 'spec/views/posts/index.html.haml_spec.rb' + - 'spec/views/posts/index.rss.haml_spec.rb' + - 'spec/views/posts/new.html.haml_spec.rb' + - 'spec/views/posts/show.html.haml_spec.rb' + - 'spec/views/posts/show.rss.haml_spec.rb' + - 'spec/views/products/edit.html.haml_spec.rb' + - 'spec/views/products/index.html.haml_spec.rb' + - 'spec/views/products/new.html.haml_spec.rb' + - 'spec/views/products/show.html.haml_spec.rb' + - 'spec/views/roles/edit.html.haml_spec.rb' + - 'spec/views/roles/index.html.haml_spec.rb' + - 'spec/views/roles/new.html.haml_spec.rb' + - 'spec/views/roles/show.html.haml_spec.rb' + - 'spec/views/scientific_names/edit.html.haml_spec.rb' + - 'spec/views/scientific_names/index.html.haml_spec.rb' + - 'spec/views/scientific_names/new.html.haml_spec.rb' + - 'spec/views/scientific_names/show.html.haml_spec.rb' + - 'spec/views/seeds/edit.html.haml_spec.rb' + - 'spec/views/seeds/index.rss.haml_spec.rb' + - 'spec/views/seeds/new.html.haml_spec.rb' + - 'spec/views/seeds/show.html.haml_spec.rb' + - 'spec/views/shop/index_spec.rb' + +# Offense count: 1 +# Cop supports --auto-correct. +Style/UnlessElse: + Exclude: + - 'app/controllers/omniauth_callbacks_controller.rb' + +# Offense count: 16 +# Cop supports --auto-correct. +Style/UnneededInterpolation: + Exclude: + - 'app/models/crop.rb' + - 'app/models/harvest.rb' + - 'spec/features/crops/crop_wranglers_spec.rb' + - 'spec/features/following_spec.rb' + - 'spec/features/shared_examples/append_date.rb' + - 'spec/models/crop_spec.rb' + - 'spec/models/forum_spec.rb' + - 'spec/models/member_spec.rb' + - 'spec/models/plant_part_spec.rb' + - 'spec/views/layouts/_header_spec.rb' + +# Offense count: 3 +# Cop supports --auto-correct. +Style/UnneededPercentQ: + Exclude: + - 'spec/support/feature_helpers.rb' + +# Offense count: 4 +# Cop supports --auto-correct. +# Configuration parameters: EnforcedStyle, SupportedStyles, MinSize, WordRegex. +# SupportedStyles: percent, brackets +Style/WordArray: + Exclude: + - 'app/controllers/omniauth_callbacks_controller.rb' + - 'app/models/crop.rb' + - 'spec/models/seed_spec.rb' + +# Offense count: 6 +# Cop supports --auto-correct. +Style/ZeroLengthPredicate: + Exclude: + - 'app/models/crop.rb' + - 'app/models/photo.rb' From 2bc9b8c8bb06fb46152f9d59b964b5e59c3bca86 Mon Sep 17 00:00:00 2001 From: Brenda Wallace Date: Sun, 13 Nov 2016 10:20:13 +1300 Subject: [PATCH 103/268] Added rubocop check to travisci --- .travis.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.travis.yml b/.travis.yml index 4b181855a..de144b2ad 100644 --- a/.travis.yml +++ b/.travis.yml @@ -12,6 +12,7 @@ rvm: before_script: - psql -c 'create database growstuff_test;' -U postgres script: +- bundle exec rubocop --display-cop-names --rails - script/gemfile_check - bundle exec script/check_contributors_md - bundle exec rake db:migrate --trace From 97f0d5fc5d726820c6c11d039c74b17b76605981 Mon Sep 17 00:00:00 2001 From: Brenda Wallace Date: Sun, 13 Nov 2016 10:29:13 +1300 Subject: [PATCH 104/268] Add vendor to rubocop exclude path --- .rubocop.yml | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/.rubocop.yml b/.rubocop.yml index e39e22fe0..d39e7933e 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -1,8 +1,9 @@ inherit_from: .rubocop_todo.yml AllCops: Include: - - Rakefile - - config.ru - - lib/**/*.rake + - 'Rakefile' + - 'config.ru' + - 'lib/**/*.rake' Exclude: - - db/schema.rb \ No newline at end of file + - 'db/schema.rb' + - 'vendor/**/*' From d091aecaf166b17f3490f3d1ae9cc866010bff30 Mon Sep 17 00:00:00 2001 From: Brenda Wallace Date: Sun, 13 Nov 2016 10:46:46 +1300 Subject: [PATCH 105/268] Use https for contributor link Hoping this will fix the failing contributor error --- CONTRIBUTORS.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md index 1df2129ff..f4c22eccf 100644 --- a/CONTRIBUTORS.md +++ b/CONTRIBUTORS.md @@ -71,4 +71,4 @@ submit the change with your pull request. - Lucas Nogueira / [lucasnogueira](https://github.com/lucasnogueira) - Charley Lewittes / [ctlewitt](https://github.com/ctlewitt) - Kristine Nicole Polvoriza / [polveenomials](https://github.com/polveenomials) -- Brenda Wallace / [br3nda](http://github.com/br3nda) +- Brenda Wallace / [br3nda](https://github.com/br3nda) From b2977d68066e29f0096bdd47bd526f754ad397cd Mon Sep 17 00:00:00 2001 From: Brenda Wallace Date: Sun, 13 Nov 2016 11:01:31 +1300 Subject: [PATCH 106/268] Search contributors file, case insensitive. --- script/check_contributors_md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/script/check_contributors_md b/script/check_contributors_md index 131daf445..fdd484897 100755 --- a/script/check_contributors_md +++ b/script/check_contributors_md @@ -28,7 +28,7 @@ Please set it using end end -if !system("grep #{author} CONTRIBUTORS.md") then +if !system("grep -i #{author} CONTRIBUTORS.md") then abort %{ Thanks for your contribution, #{author}! Please add your name and GitHub handle to the file CONTRIBUTORS.md, From 9605ec6109b472a1b6057f7cd008ac46191fc961 Mon Sep 17 00:00:00 2001 From: Brenda Wallace Date: Sun, 13 Nov 2016 11:07:57 +1300 Subject: [PATCH 107/268] Pass args to system() to be escaped --- script/check_contributors_md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/script/check_contributors_md b/script/check_contributors_md index fdd484897..128c1c1cb 100755 --- a/script/check_contributors_md +++ b/script/check_contributors_md @@ -28,7 +28,7 @@ Please set it using end end -if !system("grep -i #{author} CONTRIBUTORS.md") then +if !system("grep", "-i", author, "CONTRIBUTORS.md") then abort %{ Thanks for your contribution, #{author}! Please add your name and GitHub handle to the file CONTRIBUTORS.md, From e1f0b649f53bc37b74a8ad8d9f976151b77fa2bb Mon Sep 17 00:00:00 2001 From: Brenda Wallace Date: Sun, 13 Nov 2016 11:10:45 +1300 Subject: [PATCH 108/268] if! -> unless, as code climate suggests --- script/check_contributors_md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/script/check_contributors_md b/script/check_contributors_md index 128c1c1cb..c212c8147 100755 --- a/script/check_contributors_md +++ b/script/check_contributors_md @@ -28,7 +28,7 @@ Please set it using end end -if !system("grep", "-i", author, "CONTRIBUTORS.md") then +unless system("grep", "-i", author, "CONTRIBUTORS.md") then abort %{ Thanks for your contribution, #{author}! Please add your name and GitHub handle to the file CONTRIBUTORS.md, From eecd54c5ea185a1b7307895ac53392083b5e28b8 Mon Sep 17 00:00:00 2001 From: Brenda Wallace Date: Sun, 13 Nov 2016 11:12:24 +1300 Subject: [PATCH 109/268] Use single quotes, as code climate suggests --- script/check_contributors_md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/script/check_contributors_md b/script/check_contributors_md index c212c8147..d108ca56c 100755 --- a/script/check_contributors_md +++ b/script/check_contributors_md @@ -28,7 +28,7 @@ Please set it using end end -unless system("grep", "-i", author, "CONTRIBUTORS.md") then +unless system('grep', '-i', author, 'CONTRIBUTORS.md') then abort %{ Thanks for your contribution, #{author}! Please add your name and GitHub handle to the file CONTRIBUTORS.md, From 1fc1c64f6273e1f054fc0907db580666c0aa697e Mon Sep 17 00:00:00 2001 From: Brenda Wallace Date: Sun, 13 Nov 2016 17:12:45 +1300 Subject: [PATCH 110/268] Ignore rubocop_todo filename in code climate --- .codeclimate.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.codeclimate.yml b/.codeclimate.yml index bca8b1aee..3a369a376 100644 --- a/.codeclimate.yml +++ b/.codeclimate.yml @@ -21,6 +21,10 @@ engines: - javascript fixme: enabled: true + exclude_fingerprints: # rubocop_todo filename + - 63b8552079d106832fbe281566b6d028 + - d38afbaaea3ecaa9a4cf046b07a01cec + - 57ff3968fd371d3e1f75c237d6c78acf ratings: paths: - "**.rb" From dc5d7a867742097ed39d0e0029e804924d3e75c8 Mon Sep 17 00:00:00 2001 From: Brenda Wallace Date: Mon, 14 Nov 2016 14:30:45 +1300 Subject: [PATCH 111/268] Removed duplicate wiki_linktext --- config/locales/en.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/config/locales/en.yml b/config/locales/en.yml index b146f42b1..a0c1530cd 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -134,7 +134,6 @@ en: open_data_title: "Open Data and APIs" open_data_body_html: "We're building a database of crops, planting advice, seed sources, and other information that anyone can use for free, under a %{creative_commons_link}. You can use this data for research, to build apps, or for any purpose at all. Read more about our %{wiki_link} and %{api_docs_link}." creative_commons_linktext: "Creative Commons license" - wiki_linktext: "open data" api_docs_linktext: "API documentation" get_involved_title: "Get Involved" get_involved_body_html: "We believe in collaboration, and work closely with our members and the wider food-growing community. Our team includes volunteers from all walks of life and all skill levels. To get involved, visit %{talk_link} or find more information on the %{wiki_link}." From bdb057ca0f6255a5fdb103734ba51aaf1b086207 Mon Sep 17 00:00:00 2001 From: Brenda Wallace Date: Mon, 14 Nov 2016 15:05:32 +1300 Subject: [PATCH 112/268] Removed all trailing white space --- app/assets/javascripts/append_date.js.coffee | 2 +- app/assets/javascripts/seeds.js.coffee | 1 - app/assets/stylesheets/overrides.sass | 128 +++++++++--------- app/controllers/account_types_controller.rb | 4 +- app/controllers/accounts_controller.rb | 2 +- app/controllers/comments_controller.rb | 2 +- app/controllers/crops_controller.rb | 4 +- app/controllers/harvests_controller.rb | 2 +- app/controllers/members_controller.rb | 4 +- app/controllers/notifications_controller.rb | 2 +- app/controllers/photos_controller.rb | 2 +- app/controllers/roles_controller.rb | 2 +- app/helpers/seeds_helper.rb | 2 +- app/mailers/notifier.rb | 6 +- app/models/ability.rb | 2 +- app/models/account.rb | 2 +- app/models/harvest.rb | 2 +- app/models/member.rb | 2 +- app/models/order.rb | 2 +- app/models/planting.rb | 2 +- app/models/post.rb | 2 +- app/views/alternate_names/_form.html.haml | 2 +- app/views/comments/show.html.haml | 2 +- app/views/crops/_form.html.haml | 4 +- app/views/crops/new.html.haml | 4 +- app/views/crops/show.html.haml | 6 +- app/views/crops/wrangle.html.haml | 2 +- app/views/forums/index.html.haml | 2 +- app/views/gardens/_thumbnail.html.haml | 8 +- app/views/gardens/show.html.haml | 4 +- app/views/harvests/_thumbnail.html.haml | 8 +- app/views/harvests/show.html.haml | 6 +- app/views/home/_stats.html.haml | 2 +- app/views/members/_gardens.html.haml | 6 +- app/views/members/show.html.haml | 6 +- app/views/members/view_followers.html.haml | 6 +- app/views/members/view_follows.html.haml | 4 +- app/views/notifier/new_crop_request.html.haml | 2 +- app/views/places/show.html.haml | 4 +- app/views/plant_parts/show.html.haml | 2 +- app/views/plantings/_thumbnail.html.haml | 2 +- app/views/plantings/index.html.haml | 2 +- app/views/plantings/show.html.haml | 10 +- app/views/posts/show.html.haml | 8 +- app/views/scientific_names/show.html.haml | 2 +- app/views/seeds/_thumbnail.html.haml | 10 +- app/views/seeds/show.html.haml | 2 +- app/views/shop/index.html.haml | 2 - config/environments/development.rb | 2 +- config/environments/staging.rb | 2 +- config/environments/test.rb | 2 +- config/locales/en.yml | 18 +-- config/locales/ja.yml | 3 +- config/newrelic.yml | 74 +++++----- ...0130326092227_change_planted_at_to_date.rb | 2 +- db/migrate/20150201052245_create_cms.rb | 24 ++-- db/seeds.rb | 2 +- db/seeds/crops-00.csv | 2 +- lib/actions/oauth_signup_action.rb | 4 +- lib/tasks/growstuff.rake | 10 +- .../account_types_controller_spec.rb | 14 +- spec/controllers/accounts_controller_spec.rb | 14 +- .../admin/orders_controller_spec.rb | 14 +- spec/controllers/admin_controller_spec.rb | 14 +- .../authentications_controller_spec.rb | 14 +- spec/controllers/comments_controller_spec.rb | 14 +- spec/controllers/crops_controller_spec.rb | 14 +- spec/controllers/forums_controller_spec.rb | 14 +- spec/controllers/gardens_controller_spec.rb | 14 +- spec/controllers/harvests_controller_spec.rb | 16 +-- spec/controllers/home_controller_spec.rb | 14 +- spec/controllers/member_controller_spec.rb | 14 +- .../notifications_controller_spec.rb | 14 +- .../order_items_controller_spec.rb | 14 +- spec/controllers/orders_controller_spec.rb | 14 +- spec/controllers/photos_controller_spec.rb | 14 +- spec/controllers/places_controller_spec.rb | 14 +- .../plant_parts_controller_spec.rb | 14 +- spec/controllers/plantings_controller_spec.rb | 20 +-- spec/controllers/posts_controller_spec.rb | 14 +- spec/controllers/products_controller_spec.rb | 14 +- .../registrations_controller_spec.rb | 14 +- spec/controllers/roles_controller_spec.rb | 14 +- .../scientific_names_controller_spec.rb | 14 +- spec/controllers/seeds_controller_spec.rb | 14 +- spec/controllers/shop_controller_spec.rb | 14 +- spec/factories/crop.rb | 2 +- spec/factories/follows.rb | 2 +- spec/features/admin/forums_spec.rb | 2 +- spec/features/admin/products_spec.rb | 2 +- spec/features/crops/crop_detail_page_spec.rb | 2 +- spec/features/planting_reminder_spec.rb | 2 +- .../plantings/planting_a_crop_spec.rb | 8 +- spec/features/signin_spec.rb | 4 +- spec/features/signup_spec.rb | 6 +- spec/helpers/crops_helper_spec.rb | 2 +- spec/helpers/notifications_helper_spec.rb | 2 +- spec/lib/actions/oauth_signup_action_spec.rb | 8 +- spec/models/ability_spec.rb | 4 +- spec/models/comment_spec.rb | 4 +- spec/models/crop_spec.rb | 2 +- spec/models/follow_spec.rb | 2 +- spec/models/garden_spec.rb | 2 +- spec/models/harvest_spec.rb | 14 +- spec/models/member_spec.rb | 4 +- spec/models/order_spec.rb | 4 +- spec/models/planting_spec.rb | 2 +- spec/models/post_spec.rb | 2 +- spec/support/controller_macros.rb | 2 +- .../account_types/edit.html.haml_spec.rb | 14 +- .../account_types/index.html.haml_spec.rb | 14 +- .../views/account_types/new.html.haml_spec.rb | 14 +- .../account_types/show.html.haml_spec.rb | 14 +- spec/views/accounts/edit.html.haml_spec.rb | 14 +- spec/views/accounts/index.html.haml_spec.rb | 14 +- spec/views/accounts/new.html.haml_spec.rb | 14 +- spec/views/accounts/show.html.haml_spec.rb | 14 +- spec/views/admin/index_spec.rb | 14 +- spec/views/admin/newsletter_spec.rb | 14 +- spec/views/admin/orders/index_spec.rb | 14 +- spec/views/comments/edit.html.haml_spec.rb | 14 +- spec/views/comments/index.html.haml_spec.rb | 14 +- spec/views/comments/index.rss.haml_spec.rb | 14 +- spec/views/comments/new.html.haml_spec.rb | 14 +- spec/views/comments/show.html.haml_spec.rb | 14 +- spec/views/crops/_grown_for.html.haml_spec.rb | 14 +- .../crops/_planting_advice.html.haml_spec.rb | 14 +- spec/views/crops/_popover.html.haml_spec.rb | 14 +- spec/views/crops/edit.html.haml_spec.rb | 14 +- spec/views/crops/hierarchy.html.haml_spec.rb | 14 +- spec/views/crops/index.html.haml_spec.rb | 14 +- spec/views/crops/index.rss.haml_spec.rb | 14 +- spec/views/crops/new.html.haml_spec.rb | 14 +- spec/views/crops/wrangle.html.haml_spec.rb | 14 +- .../mailer/confirmation_instructions_spec.rb | 14 +- .../reset_password_instructions_spec.rb | 14 +- .../devise/mailer/unlock_instructions_spec.rb | 14 +- spec/views/devise/registrations/edit_spec.rb | 14 +- spec/views/devise/registrations/new_spec.rb | 14 +- spec/views/devise/sessions/new_spec.rb | 14 +- spec/views/devise/unlocks/new_spec.rb | 14 +- spec/views/forums/edit.html.haml_spec.rb | 14 +- spec/views/forums/index.html.haml_spec.rb | 14 +- spec/views/forums/new.html.haml_spec.rb | 14 +- spec/views/forums/show.html.haml_spec.rb | 14 +- spec/views/gardens/edit.html.haml_spec.rb | 14 +- spec/views/gardens/new.html.haml_spec.rb | 14 +- spec/views/gardens/show.html.haml_spec.rb | 14 +- spec/views/harvests/edit.html.haml_spec.rb | 14 +- spec/views/harvests/index.html.haml_spec.rb | 14 +- spec/views/harvests/new.html.haml_spec.rb | 14 +- spec/views/harvests/show.html.haml_spec.rb | 14 +- spec/views/home/_blurb.html.haml_spec.rb | 14 +- spec/views/home/_crops.html.haml_spec.rb | 14 +- spec/views/home/_members.html.haml_spec.rb | 14 +- spec/views/home/_seeds.html.haml_spec.rb | 14 +- spec/views/home/_stats.html.haml_spec.rb | 14 +- spec/views/home/index_spec.rb | 14 +- spec/views/layouts/_meta_spec.rb | 14 +- spec/views/layouts/application_spec.rb | 14 +- .../views/members/_location.html.haml_spec.rb | 14 +- spec/views/members/show.rss.haml_spec.rb | 14 +- .../notifications/index.html.haml_spec.rb | 14 +- .../views/notifications/new.html.haml_spec.rb | 14 +- .../notifications/show.html.haml_spec.rb | 14 +- spec/views/notifier/notify.html.haml_spec.rb | 14 +- spec/views/orders/index.html.haml_spec.rb | 14 +- spec/views/orders/show.html.haml_spec.rb | 14 +- spec/views/photos/edit.html.haml_spec.rb | 14 +- spec/views/photos/index.html.haml_spec.rb | 14 +- spec/views/photos/new.html.haml_spec.rb | 14 +- spec/views/photos/show.html.haml_spec.rb | 14 +- .../places/_map_attribution.html.haml_spec.rb | 14 +- spec/views/places/index.html.haml_spec.rb | 14 +- spec/views/places/show.html.haml_spec.rb | 14 +- spec/views/plant_parts/edit.html.haml_spec.rb | 14 +- .../views/plant_parts/index.html.haml_spec.rb | 14 +- spec/views/plant_parts/new.html.haml_spec.rb | 14 +- spec/views/plant_parts/show.html.haml_spec.rb | 14 +- spec/views/plantings/_form.html.haml_spec.rb | 14 +- spec/views/plantings/edit.html.haml_spec.rb | 14 +- spec/views/plantings/index.html.haml_spec.rb | 14 +- spec/views/plantings/index.rss.haml_spec.rb | 14 +- spec/views/plantings/new.html.haml_spec.rb | 14 +- spec/views/plantings/show.html.haml_spec.rb | 14 +- spec/views/posts/_single.html.haml_spec.rb | 14 +- spec/views/posts/edit.html.haml_spec.rb | 14 +- spec/views/posts/index.html.haml_spec.rb | 14 +- spec/views/posts/index.rss.haml_spec.rb | 14 +- spec/views/posts/new.html.haml_spec.rb | 14 +- spec/views/posts/show.html.haml_spec.rb | 18 +-- spec/views/posts/show.rss.haml_spec.rb | 14 +- spec/views/products/edit.html.haml_spec.rb | 14 +- spec/views/products/index.html.haml_spec.rb | 14 +- spec/views/products/new.html.haml_spec.rb | 14 +- spec/views/products/show.html.haml_spec.rb | 14 +- spec/views/roles/edit.html.haml_spec.rb | 14 +- spec/views/roles/index.html.haml_spec.rb | 14 +- spec/views/roles/new.html.haml_spec.rb | 14 +- spec/views/roles/show.html.haml_spec.rb | 14 +- .../scientific_names/edit.html.haml_spec.rb | 14 +- .../scientific_names/index.html.haml_spec.rb | 14 +- .../scientific_names/new.html.haml_spec.rb | 14 +- .../scientific_names/show.html.haml_spec.rb | 14 +- spec/views/seeds/edit.html.haml_spec.rb | 14 +- spec/views/seeds/index.rss.haml_spec.rb | 14 +- spec/views/seeds/new.html.haml_spec.rb | 14 +- spec/views/seeds/show.html.haml_spec.rb | 14 +- spec/views/shop/index_spec.rb | 14 +- 209 files changed, 1148 insertions(+), 1152 deletions(-) diff --git a/app/assets/javascripts/append_date.js.coffee b/app/assets/javascripts/append_date.js.coffee index 470ae7923..64c782a94 100644 --- a/app/assets/javascripts/append_date.js.coffee +++ b/app/assets/javascripts/append_date.js.coffee @@ -5,7 +5,7 @@ jQuery -> el = $('.append-date') - + el.datepicker({'format': 'yyyy-mm-dd'}) el.click (e) -> diff --git a/app/assets/javascripts/seeds.js.coffee b/app/assets/javascripts/seeds.js.coffee index 500c851d9..ab88a1163 100644 --- a/app/assets/javascripts/seeds.js.coffee +++ b/app/assets/javascripts/seeds.js.coffee @@ -42,4 +42,3 @@ $ -> element = document.getElementById(tmp) console.log("%s",tmp) element.remove() - \ No newline at end of file diff --git a/app/assets/stylesheets/overrides.sass b/app/assets/stylesheets/overrides.sass index eb2b8a49d..3261470ca 100644 --- a/app/assets/stylesheets/overrides.sass +++ b/app/assets/stylesheets/overrides.sass @@ -2,7 +2,7 @@ @import "bootstrap" @import "custom_bootstrap/variables" // this padding needs to be done before the responsive stuff is imported -body +body // modifying this for our promotional banner. can be replaced after if // needed. // padding-top: $navbar-height + 15px @@ -19,14 +19,14 @@ body //@import "bootstrap/glyphicons" -.list-inline > li.first +.list-inline > li.first padding-left: 0px -h2 +h2 font-size: 150% -//#subtitle +//#subtitle // color: lighten($brown, 30%) // font-style: italic // font-weight: normal @@ -34,10 +34,10 @@ h2 // padding-left: 1em // padding-top: 0px -h3 +h3 font-size: 120% -.main +.main padding-right: 1em .navbar .navbar-form @@ -59,24 +59,24 @@ h3 padding-left: 1em // this is used for eg. crops and members index pages -.six-across:nth-child(6n+1) +.six-across:nth-child(6n+1) margin-left: 0px -.three-across:nth-child(3n+1) +.three-across:nth-child(3n+1) margin-left: 0px clear: both // let's condense the hero unit a little -.jumbotron +.jumbotron padding-top: 30px padding-bottom: 30px // info under the main heading on homepage -.jumbotron .info +.jumbotron .info padding-top: 15px // signup widget on homepage -.jumbotron .signup +.jumbotron .signup background-color: lighten($green, 40%) border: 1px solid lighten($green, 20%) border-radius: 6px @@ -85,19 +85,19 @@ h3 text-align: center // stats shown on homepage. eg. "999 members..." -p.stats +p.stats font-weight: bold -.member-cards +.member-cards display: flex flex: none flex-wrap: wrap justify-content: space-between -.member-thumbnail +.member-thumbnail padding: .25em - div + div width: 5em display: inline-block vertical-align: top @@ -116,7 +116,7 @@ p.stats margin-left: auto @media (min-width: $screen-md-min) - .planting-thumbnail + .planting-thumbnail dl.planting-attributes font-size: 85% width: 100% @@ -132,10 +132,10 @@ p.stats width: 250px -#placesmap, #cropmap +#placesmap, #cropmap height: 500px -#membermap +#membermap height: 250px .location-not-set @@ -145,23 +145,23 @@ p.stats background-repeat: no-repeat background-position: center -.member-location +.member-location font-size: small font-style: italic -.member-location a +.member-location a color: $brown -.photo-thumbnail +.photo-thumbnail padding: 0 position: relative img width: 100% - - .text + + .text display: none color: #000 position: absolute @@ -169,100 +169,100 @@ p.stats background: rgba(0, 0, 0, 0.8) width: 100% margin: 0 - - p + + p padding: 5px margin: 0 color: #fff - - &:hover - .text + + &:hover + .text display: block -.thumbnail +.thumbnail border: none text-align: center margin-bottom: 1.5em - .member-thumbnail + .member-thumbnail text-align: left - img + img height: 85px width: 85px max-width: 85px - .crop-thumbnail + .crop-thumbnail height: 220px - .cropinfo + .cropinfo display: inline-block max-width: 100% white-space: nowrap line-height: 1em padding-bottom: 2px - .cropname + .cropname overflow: hidden text-overflow: ellipsis - .scientificname + .scientificname font-size: small font-style: italic overflow: hidden text-overflow: ellipsis - .plantingcount + .plantingcount font-size: small - .crop-name a + .crop-name a padding-top: 2px - .scientific-name small + .scientific-name small margin-bottom: -2px -li.crop-hierarchy +li.crop-hierarchy list-style-type: disc -.navbar-brand +.navbar-brand margin: 0px padding: 0px -.navbar-bottom +.navbar-bottom margin: 40px 0px 0px 0px !important // footer -footer - #footer1, #footer2, #footer3 +footer + #footer1, #footer2, #footer3 text-align: left padding-top: 1em padding-bottom: 2em - ul + ul list-style-type: none list-style-position: outside padding-left: 0px margin-left: 0px - - a + + a color: $navbar-default-link-color text-decoration: none - - a:hover + + a:hover color: $navbar-default-link-hover-color - - a:active + + a:active color: $navbar-default-link-active-color - .navbar-bottom.navbar + .navbar-bottom.navbar border-radius: 0 // ensure footer is pushed to bottom of browser window -#maincontainer +#maincontainer min-height: 80% -html, body +html, body height: 100% -.crop-image, .member-image +.crop-image, .member-image width: 100% height: 100% @@ -272,22 +272,22 @@ html, body background: white z-index: $zindex-tooltip -.alert - a +.alert + a font-weight: 800 // Overrides applying only to mobile view. This must be at the end of the overrides file. -@media only screen and (max-width: 767px) - .sidebar +@media only screen and (max-width: 767px) + .sidebar margin-left: 0 border-left: none padding-left: 0 - #map + #map height: 300px - .navbar .nav > li + .navbar .nav > li display: block .navbar .navbar-form @@ -305,7 +305,7 @@ $state-info-bg: lighten($green, 50%) $state-success-text: darken($green, 10%) $state-success-bg: lighten($green, 50%) -.hide +.hide display: none #add-sci_name-row, #remove-sci_name-row, #add-alt_name-row, #remove-alt_name-row @@ -322,14 +322,14 @@ $state-success-bg: lighten($green, 50%) #gardens_panel_body height: 20em -.form-group.required .control-label:before +.form-group.required .control-label:before content: "* " color: red -.margin-bottom +.margin-bottom margin-bottom: 1em -.red +.red color: red .truncate diff --git a/app/controllers/account_types_controller.rb b/app/controllers/account_types_controller.rb index 4c3da9080..073933af4 100644 --- a/app/controllers/account_types_controller.rb +++ b/app/controllers/account_types_controller.rb @@ -1,7 +1,7 @@ class AccountTypesController < ApplicationController before_filter :authenticate_member! load_and_authorize_resource - + # GET /account_types def index @account_types = AccountType.all @@ -70,7 +70,7 @@ class AccountTypesController < ApplicationController end end - private + private def account_type_params params.require(:account_type).permit(:is_paid, :is_permanent_paid, :name) diff --git a/app/controllers/accounts_controller.rb b/app/controllers/accounts_controller.rb index cdfcc2d00..a4904646c 100644 --- a/app/controllers/accounts_controller.rb +++ b/app/controllers/accounts_controller.rb @@ -1,7 +1,7 @@ class AccountsController < ApplicationController before_filter :authenticate_member! load_and_authorize_resource - + # GET /accounts def index @accounts = Account.all diff --git a/app/controllers/comments_controller.rb b/app/controllers/comments_controller.rb index 884727646..0f078e2dd 100644 --- a/app/controllers/comments_controller.rb +++ b/app/controllers/comments_controller.rb @@ -89,7 +89,7 @@ class CommentsController < ApplicationController end end - private + private def comment_params params.require(:comment).permit(:author_id, :body, :post_id) diff --git a/app/controllers/crops_controller.rb b/app/controllers/crops_controller.rb index 2833a2bf0..f6af048e6 100644 --- a/app/controllers/crops_controller.rb +++ b/app/controllers/crops_controller.rb @@ -86,7 +86,7 @@ class CropsController < ApplicationController # TODO RABL or similar one day to avoid presentation logic here owner_structure = { owner: { - only: [:id, :login_name, :location, :latitude, :longitude] + only: [:id, :login_name, :location, :latitude, :longitude] } } render json: @crop.to_json(include: { @@ -184,7 +184,7 @@ class CropsController < ApplicationController sci_name = @crop.scientific_names.create(scientific_name: value, creator_id: current_member.id) end end - + if previous_status == "pending" requester = @crop.requester new_status = @crop.approval_status diff --git a/app/controllers/harvests_controller.rb b/app/controllers/harvests_controller.rb index 13dcedea7..739eed8fe 100644 --- a/app/controllers/harvests_controller.rb +++ b/app/controllers/harvests_controller.rb @@ -1,7 +1,7 @@ class HarvestsController < ApplicationController before_filter :authenticate_member!, except: [:index, :show] load_and_authorize_resource - + # GET /harvests # GET /harvests.json diff --git a/app/controllers/members_controller.rb b/app/controllers/members_controller.rb index b586e2b55..e3c48785e 100644 --- a/app/controllers/members_controller.rb +++ b/app/controllers/members_controller.rb @@ -29,7 +29,7 @@ class MembersController < ApplicationController # it requires a garden to be passed in @garden. # The new garden is not persisted unless Garden#save is called. @garden = Garden.new - + respond_to do |format| format.html # show.html.haml format.json { render json: @member.to_json(only: [:id, :login_name, :bio, :created_at, :slug, :location, :latitude, :longitude]) } @@ -71,7 +71,7 @@ class MembersController < ApplicationController end end - def finish_signup + def finish_signup @member = current_member if request.patch? && params[:member] if @member.update(member_params) diff --git a/app/controllers/notifications_controller.rb b/app/controllers/notifications_controller.rb index 57b5836ba..06346f9d7 100644 --- a/app/controllers/notifications_controller.rb +++ b/app/controllers/notifications_controller.rb @@ -46,7 +46,7 @@ class NotificationsController < ApplicationController @subject = @sender_notification.subject =~ /^Re: / ? @sender_notification.subject : "Re: " + @sender_notification.subject - + respond_to do |format| format.html # reply.html.haml diff --git a/app/controllers/photos_controller.rb b/app/controllers/photos_controller.rb index d64419fcf..2e2f44689 100644 --- a/app/controllers/photos_controller.rb +++ b/app/controllers/photos_controller.rb @@ -108,7 +108,7 @@ class PhotosController < ApplicationController @photo = Photo.find(params[:id]) @photo.destroy flash[:alert] = "Photo successfully deleted." - + respond_to do |format| format.html { redirect_to photos_url } format.json { head :no_content } diff --git a/app/controllers/roles_controller.rb b/app/controllers/roles_controller.rb index c932d75ae..82b554467 100644 --- a/app/controllers/roles_controller.rb +++ b/app/controllers/roles_controller.rb @@ -1,7 +1,7 @@ class RolesController < ApplicationController before_filter :authenticate_member! load_and_authorize_resource - + # GET /roles def index @roles = Role.all diff --git a/app/helpers/seeds_helper.rb b/app/helpers/seeds_helper.rb index 2d4f5a299..5a086953a 100644 --- a/app/helpers/seeds_helper.rb +++ b/app/helpers/seeds_helper.rb @@ -7,5 +7,5 @@ module SeedsHelper truncate(seed.description, length: 130, separator: ' ', omission: '... ') { link_to "Read more", seed_path(seed) } end end - + end \ No newline at end of file diff --git a/app/mailers/notifier.rb b/app/mailers/notifier.rb index e16c4a5fb..e81605912 100644 --- a/app/mailers/notifier.rb +++ b/app/mailers/notifier.rb @@ -12,7 +12,7 @@ class Notifier < ActionMailer::Base @notification = notification @reply_link = reply_link(@notification) - # Encrypting + # Encrypting @signed_message = verifier.generate ({ member_id: @notification.recipient.id, type: :send_notification_email }) mail(to: @notification.recipient.email, @@ -25,7 +25,7 @@ class Notifier < ActionMailer::Base @plantings = @member.plantings.first(5) @harvests = @member.harvests.first(5) - # Encrypting + # Encrypting @signed_message = verifier.generate ({ member_id: @member.id, type: :send_planting_reminder }) if @member.send_planting_reminder @@ -36,7 +36,7 @@ class Notifier < ActionMailer::Base def new_crop_request(member, request) @member, @request = member, request - mail(to: @member.email, subject: "#{@request.requester.login_name} has requested #{@request.name} as a new crop") + mail(to: @member.email, subject: "#{@request.requester.login_name} has requested #{@request.name} as a new crop") end def crop_request_approved(member, crop) diff --git a/app/models/ability.rb b/app/models/ability.rb index 96b4ea69e..d0b9c2f56 100644 --- a/app/models/ability.rb +++ b/app/models/ability.rb @@ -22,7 +22,7 @@ class Ability cannot :read, AccountType # nobody should be able to view unapproved crops unless they - # are wranglers or admins + # are wranglers or admins cannot :read, Crop can :read, Crop, approval_status: "approved" # scientific names should only be viewable if associated crop is approved diff --git a/app/models/account.rb b/app/models/account.rb index bfbf60e5d..926640b30 100644 --- a/app/models/account.rb +++ b/app/models/account.rb @@ -8,7 +8,7 @@ class Account < ActiveRecord::Base before_create do |account| unless account.account_type - account.account_type = AccountType.find_or_create_by(name: + account.account_type = AccountType.find_or_create_by(name: Growstuff::Application.config.default_account_type ) end diff --git a/app/models/harvest.rb b/app/models/harvest.rb index 39a176a45..3370d62a1 100644 --- a/app/models/harvest.rb +++ b/app/models/harvest.rb @@ -67,7 +67,7 @@ class Harvest < ActiveRecord::Base before_save :set_si_weight - # we're storing the harvest weight in kilograms in the db too + # we're storing the harvest weight in kilograms in the db too # to make data manipulation easier def set_si_weight if self.weight_unit != nil diff --git a/app/models/member.rb b/app/models/member.rb index df1aa2d2a..5db62f2d7 100644 --- a/app/models/member.rb +++ b/app/models/member.rb @@ -183,7 +183,7 @@ class Member < ActiveRecord::Base # Returns a hash of Flickr photosets' ids and titles def flickr_sets - sets = Hash.new + sets = Hash.new flickr.photosets.getList.each do |p| sets[p.title] = p.id end diff --git a/app/models/order.rb b/app/models/order.rb index f3a4eaafb..8ccdaa9db 100644 --- a/app/models/order.rb +++ b/app/models/order.rb @@ -17,7 +17,7 @@ class Order < ActiveRecord::Base sum = 0 for i in order_items do subtotal = i.price * i.quantity - sum += subtotal + sum += subtotal end return sum end diff --git a/app/models/planting.rb b/app/models/planting.rb index 7d048ca1d..e8eb55635 100644 --- a/app/models/planting.rb +++ b/app/models/planting.rb @@ -104,7 +104,7 @@ class Planting < ActiveRecord::Base if differences.compact.empty? nil - else + else differences.compact.sum/differences.compact.size end end diff --git a/app/models/post.rb b/app/models/post.rb index 60d08f816..776a35c7c 100644 --- a/app/models/post.rb +++ b/app/models/post.rb @@ -77,7 +77,7 @@ class Post < ActiveRecord::Base # find crop case-insensitively crop = Crop.where('lower(name) = ?', $1.downcase).first # create association - self.crops << crop if crop && !self.crops.include?(crop) + self.crops << crop if crop && !self.crops.include?(crop) end end end diff --git a/app/views/alternate_names/_form.html.haml b/app/views/alternate_names/_form.html.haml index cb33660b5..3d3855e60 100644 --- a/app/views/alternate_names/_form.html.haml +++ b/app/views/alternate_names/_form.html.haml @@ -21,7 +21,7 @@ = f.label :name, :class => 'control-label col-md-2' .col-md-8 = f.text_field :name, :class => 'form-control' - + .form-group .form-actions.col-md-offset-2.col-md-8 = f.submit 'Save', :class => 'btn btn-primary' \ No newline at end of file diff --git a/app/views/comments/show.html.haml b/app/views/comments/show.html.haml index 84cd72159..fd92fd4c2 100644 --- a/app/views/comments/show.html.haml +++ b/app/views/comments/show.html.haml @@ -1,6 +1,6 @@ = content_for :title, @comment.post.subject - content_for :opengraph do - = tag("meta", property: "og:image", content: avatar_uri(@comment.post.author, 200)) + = tag("meta", property: "og:image", content: avatar_uri(@comment.post.author, 200)) = tag("meta", property: "og:image:user_generated", content: "true") = tag("meta", property: "og:title", content: @comment.post.subject) = tag("meta", property: "og:description", content: strip_tags(@comment.post.body).split(' ')[0..20].join(' ')) diff --git a/app/views/crops/_form.html.haml b/app/views/crops/_form.html.haml index 99fa8648e..830a84238 100644 --- a/app/views/crops/_form.html.haml +++ b/app/views/crops/_form.html.haml @@ -48,7 +48,7 @@ Scientific names = button_tag "+", :id => "add-sci_name-row", :type => "button" = button_tag "-", :id => "remove-sci_name-row", :type => "button" - + .form-group#scientific_names - @crop.scientific_names.each.with_index do |sci, index| .template.col-md-12{ :id => "sci_template[#{index+1}]" } @@ -64,7 +64,7 @@ = button_tag "+", :id => "add-alt_name-row", :type => "button" = button_tag "-", :id => "remove-alt_name-row", :type => "button" - .form-group#alternate_names + .form-group#alternate_names - @crop.alternate_names.each.with_index do |alt, index| .template.col-md-12{ :id => "alt_template[#{index+1}]" } .col-md-2 diff --git a/app/views/crops/new.html.haml b/app/views/crops/new.html.haml index f472c4791..bd4f6e613 100644 --- a/app/views/crops/new.html.haml +++ b/app/views/crops/new.html.haml @@ -1,7 +1,7 @@ -- content_for :title, (can?(:wrangle, @crop) ? "New crop" : "Suggest a crop") +- content_for :title, (can?(:wrangle, @crop) ? "New crop" : "Suggest a crop") - unless can? :wrangler, @crop - + %p Thanks for taking the time to suggest a crop! Our crop database is managed by volunteers, and we appreciate your help. Here are some things to consider when suggesting a new crop: %ul diff --git a/app/views/crops/show.html.haml b/app/views/crops/show.html.haml index eb09ece6e..ec578db14 100644 --- a/app/views/crops/show.html.haml +++ b/app/views/crops/show.html.haml @@ -2,7 +2,7 @@ - content_for :subtitle, @crop.default_scientific_name - content_for :opengraph do - @crop.photos.each do |photo| - = tag("meta", property: "og:image", content: photo.fullsize_url) + = tag("meta", property: "og:image", content: photo.fullsize_url) = tag("meta", property: "og:title", content: @crop.name) = tag("meta", property: "og:type", content: "website") = tag("meta", property: "og:url", content: request.original_url) @@ -92,9 +92,9 @@ %h4 Learn more about #{ @crop.name.pluralize } %ul %li= link_to 'Wikipedia (English)', @crop.en_wikipedia_url, target: "_blank", rel: "noopener noreferrer" - %li + %li = link_to "OpenFarm - Growing guide", "https://openfarm.cc/en/crops/#{URI.escape @crop.name}", target: "_blank", rel: "noopener noreferrer" - %li + %li = link_to "Gardenate - Planting reminders", "http://www.gardenate.com/plant/#{URI.escape @crop.name}", target: "_blank", rel: "noopener noreferrer" - if current_member && current_member.location %li diff --git a/app/views/crops/wrangle.html.haml b/app/views/crops/wrangle.html.haml index 4c0448b01..6b983a7e1 100644 --- a/app/views/crops/wrangle.html.haml +++ b/app/views/crops/wrangle.html.haml @@ -24,7 +24,7 @@ %li{:class => @approval_status == "rejected" ? 'active' : ''} = link_to "Rejected", wrangle_crops_path(:approval_status => "rejected") -%h2 +%h2 - if @approval_status == "pending" Requested Crops - elsif @approval_status == "rejected" diff --git a/app/views/forums/index.html.haml b/app/views/forums/index.html.haml index 39b4f269d..69a3024ce 100644 --- a/app/views/forums/index.html.haml +++ b/app/views/forums/index.html.haml @@ -1,4 +1,4 @@ -- content_for :title, t('.title') +- content_for :title, t('.title') - if can? :create, Forum %p diff --git a/app/views/gardens/_thumbnail.html.haml b/app/views/gardens/_thumbnail.html.haml index ef9209802..8c00d25ec 100644 --- a/app/views/gardens/_thumbnail.html.haml +++ b/app/views/gardens/_thumbnail.html.haml @@ -11,17 +11,17 @@ = link_to image_tag((garden.default_photo ? garden.default_photo.thumbnail_url : 'placeholder_150.png'), :alt => garden.name, :class => 'img'), garden .col-md-8 %dl.dl-horizontal - %dt Name : + %dt Name : %dd= link_to garden.name, garden - %dt Location : + %dt Location : %dd - if garden.location.blank? not specified - else = link_to garden.location, place_path(garden.location, anchor: "gardens") - %dt Area : + %dt Area : %dd= garden.area.nil? ? "not specified" : pluralize(garden.area, garden.area_unit) - %dt Active? : + %dt Active? : %dd= garden.active ? "Yes" : "No" .col-md-12 %b diff --git a/app/views/gardens/show.html.haml b/app/views/gardens/show.html.haml index 882f0dfde..146a66f00 100644 --- a/app/views/gardens/show.html.haml +++ b/app/views/gardens/show.html.haml @@ -40,8 +40,8 @@ %p No description available yet. - if can? :edit, @garden - %p - Why not + %p + Why not = link_to 'tell us more.', edit_garden_path(@garden) - if @garden.photos.size > 0 or (can? :edit, @garden and can? :create, Photo) diff --git a/app/views/harvests/_thumbnail.html.haml b/app/views/harvests/_thumbnail.html.haml index 9af6003c1..0f908e642 100644 --- a/app/views/harvests/_thumbnail.html.haml +++ b/app/views/harvests/_thumbnail.html.haml @@ -11,13 +11,13 @@ = link_to image_tag((harvest.default_photo ? harvest.default_photo.thumbnail_url : 'placeholder_150.png'), :alt => harvest.crop.name, :class => 'img'), harvest.crop .col-md-8 %dl.dl-horizontal - %dt Crop : + %dt Crop : %dd= link_to harvest.crop.name, harvest.crop - %dt Plant part : + %dt Plant part : %dd= link_to harvest.plant_part, harvest.plant_part - %dt Quantity : + %dt Quantity : %dd= display_quantity(harvest) - %dt Harvest date : + %dt Harvest date : %dd= harvest.harvested_at .panel-footer %dt Description diff --git a/app/views/harvests/show.html.haml b/app/views/harvests/show.html.haml index f4e6220d8..deb53d6e1 100644 --- a/app/views/harvests/show.html.haml +++ b/app/views/harvests/show.html.haml @@ -1,7 +1,7 @@ =content_for :title, "#{@harvest.crop} harvested by #{@harvest.owner}" - content_for :opengraph do - @harvest.photos.each do |photo| - = tag("meta", property: "og:image", content: photo.fullsize_url) + = tag("meta", property: "og:image", content: photo.fullsize_url) = tag("meta", property: "og:image:user_generated", content: "true") = tag("meta", property: "og:title", content: "#{@harvest.crop} harvested by #{@harvest.owner}") = tag("meta", property: "og:type", content: "website") @@ -17,8 +17,8 @@ = link_to "view all #{@harvest.owner}'s harvests", harvests_by_owner_path(:owner => @harvest.owner.slug) %p %b Plant part: - - if @harvest.plant_part - = link_to @harvest.plant_part, @harvest.plant_part + - if @harvest.plant_part + = link_to @harvest.plant_part, @harvest.plant_part - else not specified %p diff --git a/app/views/home/_stats.html.haml b/app/views/home/_stats.html.haml index 53ffd2492..ee334b86d 100644 --- a/app/views/home/_stats.html.haml +++ b/app/views/home/_stats.html.haml @@ -2,7 +2,7 @@ %p.stats = t('.message_html', { member: link_to(t('.member_linktext', count: Member.confirmed.size.to_i), members_path), number_crops: link_to(t('.number_crops_linktext', count: Crop.count.to_i), crops_path), - number_plantings: link_to(t('.number_plantings_linktext', count: Planting.count.to_i), plantings_path), + number_plantings: link_to(t('.number_plantings_linktext', count: Planting.count.to_i), plantings_path), number_gardens: link_to(t('.number_gardens_linktext', count: Garden.count.to_i), gardens_path) }) diff --git a/app/views/members/_gardens.html.haml b/app/views/members/_gardens.html.haml index cfb5e22cb..6dfeaa1c8 100644 --- a/app/views/members/_gardens.html.haml +++ b/app/views/members/_gardens.html.haml @@ -7,7 +7,7 @@ - first_garden = false = link_to g.name, "#garden#{g.id}", 'data-toggle' => 'tab' - if current_member == member - %li.navbar-right + %li.navbar-right = link_to new_garden_path, class: 'btn' do Add New Garden .tab-content{style: "padding-top: 1em"} @@ -25,8 +25,8 @@ %p No description available yet. - if can? :edit, g - %p - Why not + %p + Why not = link_to 'tell us more.', edit_garden_path(g) diff --git a/app/views/members/show.html.haml b/app/views/members/show.html.haml index 334cd2d33..0e5a93c93 100644 --- a/app/views/members/show.html.haml +++ b/app/views/members/show.html.haml @@ -1,9 +1,9 @@ - content_for :title, @member.login_name - content_for :subtitle, @member.location - content_for :opengraph do - = tag("meta", property: "og:image", content: avatar_uri(@member, 200)) - = tag("meta", property: "og:image:user_generated", content: "true") - = tag("meta", property: "og:title", content: @member.login_name) + = tag("meta", property: "og:image", content: avatar_uri(@member, 200)) + = tag("meta", property: "og:image:user_generated", content: "true") + = tag("meta", property: "og:title", content: @member.login_name) = tag("meta", property: "og:type", content: "profile") = tag("meta", property: "og:url", content: request.original_url) = tag("meta", property: "og:site_name", content: ENV['GROWSTUFF_SITE_NAME']) diff --git a/app/views/members/view_followers.html.haml b/app/views/members/view_followers.html.haml index 6600c737c..aeea18b8c 100644 --- a/app/views/members/view_followers.html.haml +++ b/app/views/members/view_followers.html.haml @@ -7,10 +7,10 @@ .row .col-md-12 - @followers.each do |f| - .col-md-4.three-across - .thumbnail + .col-md-4.three-across + .thumbnail = render :partial => "members/thumbnail", :locals => { :member => f } - + %div.pagination = page_entries_info @followers = will_paginate @followers diff --git a/app/views/members/view_follows.html.haml b/app/views/members/view_follows.html.haml index cd0c522de..a5f293737 100644 --- a/app/views/members/view_follows.html.haml +++ b/app/views/members/view_follows.html.haml @@ -7,8 +7,8 @@ .row .col-md-12 - @follows.each do |f| - .col-md-4.three-across - .thumbnail + .col-md-4.three-across + .thumbnail = render :partial => "members/thumbnail", :locals => { :member => f } %div.pagination diff --git a/app/views/notifier/new_crop_request.html.haml b/app/views/notifier/new_crop_request.html.haml index 0e8c65ab7..3c2959f10 100644 --- a/app/views/notifier/new_crop_request.html.haml +++ b/app/views/notifier/new_crop_request.html.haml @@ -2,7 +2,7 @@ %p Hello #{@member.login_name}, -%p +%p #{@request.requester.login_name} has requested a new crop on #{site_name}. %ul diff --git a/app/views/places/show.html.haml b/app/views/places/show.html.haml index d37da8433..25564cf9c 100644 --- a/app/views/places/show.html.haml +++ b/app/views/places/show.html.haml @@ -1,6 +1,6 @@ -content_for :title, "#{ENV['GROWSTUFF_SITE_NAME']} community near #{@place}" - content_for :opengraph do - = tag("meta", property: "og:title", content: "#{ENV['GROWSTUFF_SITE_NAME']} community near #{@place}") + = tag("meta", property: "og:title", content: "#{ENV['GROWSTUFF_SITE_NAME']} community near #{@place}") = tag("meta", property: "og:type", content: "website") = tag("meta", property: "og:url", content: request.original_url) = tag("meta", property: "og:site_name", content: ENV['GROWSTUFF_SITE_NAME']) @@ -34,7 +34,7 @@ #plantings %h3= "Recent plantings near #{@place}" - + - plantings = [] - @nearby_members.first(10).each do |member| diff --git a/app/views/plant_parts/show.html.haml b/app/views/plant_parts/show.html.haml index c24cf6ea0..c2427059c 100644 --- a/app/views/plant_parts/show.html.haml +++ b/app/views/plant_parts/show.html.haml @@ -1,6 +1,6 @@ - content_for :title, @plant_part.name.titlecase - content_for :opengraph do - = tag("meta", property: "og:title", content: @plant_part.name.titlecase) + = tag("meta", property: "og:title", content: @plant_part.name.titlecase) = tag("meta", property: "og:type", content: "website") = tag("meta", property: "og:url", content: request.original_url) = tag("meta", property: "og:site_name", content: ENV['GROWSTUFF_SITE_NAME']) diff --git a/app/views/plantings/_thumbnail.html.haml b/app/views/plantings/_thumbnail.html.haml index 3ae1ee084..1afdf0b49 100644 --- a/app/views/plantings/_thumbnail.html.haml +++ b/app/views/plantings/_thumbnail.html.haml @@ -13,7 +13,7 @@ %dd= link_to planting.garden.name, planting.garden %dt Planted on: %dd= planting.planted_at - %dt Quantity: + %dt Quantity: %dd= "#{display_planting_quantity(planting)}" %dt Finished on: %dd= "#{display_finished(planting)}" diff --git a/app/views/plantings/index.html.haml b/app/views/plantings/index.html.haml index 14c319a5b..fca0d15b9 100644 --- a/app/views/plantings/index.html.haml +++ b/app/views/plantings/index.html.haml @@ -1,4 +1,4 @@ -- content_for :title, @owner ? t('.title.owner_plantings', owner: @owner) : @crop ? t('.title.crop_plantings', crop: @crop.name) : t('.title.default') +- content_for :title, @owner ? t('.title.owner_plantings', owner: @owner) : @crop ? t('.title.crop_plantings', crop: @crop.name) : t('.title.default') - if @owner = link_to "View #{@owner}'s profile >>", member_path(@owner) diff --git a/app/views/plantings/show.html.haml b/app/views/plantings/show.html.haml index 6ad55ff15..20b850978 100644 --- a/app/views/plantings/show.html.haml +++ b/app/views/plantings/show.html.haml @@ -1,10 +1,10 @@ =content_for :title, "#{@planting.crop} in #{@planting.location}" - content_for :opengraph do - @planting.crop.photos.each do |photo| - = tag("meta", property: "og:image", content: photo.fullsize_url) - = tag("meta", property: "og:title", content: "#{@planting.crop} in #{@planting.location}") + = tag("meta", property: "og:image", content: photo.fullsize_url) + = tag("meta", property: "og:title", content: "#{@planting.crop} in #{@planting.location}") - if @planting.description - = tag("meta", property: "og:description", content: @planting.description) + = tag("meta", property: "og:description", content: @planting.description) = tag("meta", property: "og:type", content: "website") = tag("meta", property: "og:url", content: request.original_url) = tag("meta", property: "og:site_name", content: ENV['GROWSTUFF_SITE_NAME']) @@ -31,11 +31,11 @@ %dt Quantity: %dd ="#{display_planting_quantity(@planting)}" - + - if !@planting.planted_from.blank? %dt Planted from: %dd= "#{display_planted_from(@planting)}" - + %dt Sun or shade? %dd - sunniness = @planting.sunniness.blank? ? "not specified" : @planting.sunniness diff --git a/app/views/posts/show.html.haml b/app/views/posts/show.html.haml index 6e0ee6161..a12eff8fa 100644 --- a/app/views/posts/show.html.haml +++ b/app/views/posts/show.html.haml @@ -1,8 +1,8 @@ = content_for :title, @post.subject - content_for :opengraph do - = tag("meta", property: "og:image", content: avatar_uri(@post.author, 200)) - = tag("meta", property: "og:description", content: "#{strip_tags(@post.body).split(' ')[0..20].join(' ')}...") - = tag("meta", property: "og:title", content: @post.subject) + = tag("meta", property: "og:image", content: avatar_uri(@post.author, 200)) + = tag("meta", property: "og:description", content: "#{strip_tags(@post.body).split(' ')[0..20].join(' ')}...") + = tag("meta", property: "og:title", content: @post.subject) = tag("meta", property: "og:type", content: "article") = tag("meta", property: "og:url", content: request.original_url) = tag("meta", property: "og:site_name", content: ENV['GROWSTUFF_SITE_NAME']) @@ -18,7 +18,7 @@ = link_to 'hundreds of different crops', crops_url and a community from all around the world. - = render :partial => "shared/signin_signup", + = render :partial => "shared/signin_signup", :locals => { :to => "or to start using #{ENV["GROWSTUFF_SITE_NAME"]} to track what you're planting and harvesting" } = render :partial => "single", :locals => { :post => @post, :subject => false, :hide_comments => true } diff --git a/app/views/scientific_names/show.html.haml b/app/views/scientific_names/show.html.haml index b5d9c332f..bcf71c4ca 100644 --- a/app/views/scientific_names/show.html.haml +++ b/app/views/scientific_names/show.html.haml @@ -2,7 +2,7 @@ - @scientific_name.crop.photos.each do |photo| = tag("meta", property: "og:image", content: photo.fullsize_url) - = tag("meta", property: "og:title", content: @scientific_name.scientific_name) + = tag("meta", property: "og:title", content: @scientific_name.scientific_name) = tag("meta", property: "og:type", content: "website") = tag("meta", property: "og:url", content: request.original_url) = tag("meta", property: "og:site_name", content: ENV['GROWSTUFF_SITE_NAME']) diff --git a/app/views/seeds/_thumbnail.html.haml b/app/views/seeds/_thumbnail.html.haml index 7bc5f6ad2..90743d46a 100644 --- a/app/views/seeds/_thumbnail.html.haml +++ b/app/views/seeds/_thumbnail.html.haml @@ -11,15 +11,15 @@ = link_to image_tag((seed.crop.default_photo ? seed.crop.default_photo.thumbnail_url : 'placeholder_150.png'), :alt => seed.crop.name, :class => 'img'), seed.crop .col-md-8 %dl.dl-horizontal - %dt Crop : + %dt Crop : %dd= link_to seed.crop.name, seed.crop - %dt Plant before : + %dt Plant before : %dd= seed.plant_before - %dt Quantity : + %dt Quantity : %dd= seed.quantity - %dt Will trade to : + %dt Will trade to : %dd= seed.tradable_to - %dt From location : + %dt From location : %dd= seed.owner.location %dt Owner : %dd= link_to seed.owner.login_name, seed.owner diff --git a/app/views/seeds/show.html.haml b/app/views/seeds/show.html.haml index 751a3dc17..adbdc0159 100644 --- a/app/views/seeds/show.html.haml +++ b/app/views/seeds/show.html.haml @@ -73,5 +73,5 @@ = link_to @seed.owner.location, place_path(@seed.owner.location, anchor: "seeds") %p %small - Or + Or = link_to "purchase seeds via Ebay", "http://rover.ebay.com/rover/1/705-53470-19255-0/1?icep_ff3=9&pub=5575213277&toolid=10001&campid=5337940151&customid=&icep_uq=#{URI.escape @seed.crop.name}&icep_sellerId=&icep_ex_kw=&icep_sortBy=12&icep_catId=181003&icep_minPrice=&icep_maxPrice=&ipn=psmain&icep_vectorid=229515&kwid=902099&mtid=824&kw=lg", target: "_blank", rel: "noopener noreferrer" \ No newline at end of file diff --git a/app/views/shop/index.html.haml b/app/views/shop/index.html.haml index da7008d69..1c8da326a 100644 --- a/app/views/shop/index.html.haml +++ b/app/views/shop/index.html.haml @@ -81,5 +81,3 @@ or =link_to "sign up", new_member_registration_path to purchase. - - diff --git a/config/environments/development.rb b/config/environments/development.rb index 4867e476c..344fddc63 100644 --- a/config/environments/development.rb +++ b/config/environments/development.rb @@ -31,7 +31,7 @@ Growstuff::Application.configure do # Expands the lines which load the assets config.assets.debug = true - # Asset digests allow you to set far-future HTTP expiration dates on all assets, + # Asset digests allow you to set far-future HTTP expiration dates on all assets, # yet still be able to expire them through the digest params. config.assets.digest = true diff --git a/config/environments/staging.rb b/config/environments/staging.rb index 8b69fb273..467b626d1 100644 --- a/config/environments/staging.rb +++ b/config/environments/staging.rb @@ -2,7 +2,7 @@ Growstuff::Application.configure do # Settings specified here will take precedence over those in config/application.rb config.action_controller.action_on_unpermitted_parameters = :raise - + # Eager load code on boot. This eager loads most of Rails and # your application in memory, allowing both threaded web servers # and those relying on copy on write to perform better. diff --git a/config/environments/test.rb b/config/environments/test.rb index a6fcb43d3..c2e0d8f96 100644 --- a/config/environments/test.rb +++ b/config/environments/test.rb @@ -38,7 +38,7 @@ Growstuff::Application.configure do # Raises error for missing translations # config.action_view.raise_on_missing_translations = true - + # Growstuff config config.action_mailer.default_url_options = { host: 'localhost:8080' } diff --git a/config/locales/en.yml b/config/locales/en.yml index b146f42b1..c72f88d9f 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -49,7 +49,7 @@ en: seeds: index: - title: + title: default: "Everyone's seeds" crop_seeds: "Everyone's %{crop} seeds" owner_seeds: "%{owner} seeds" @@ -62,7 +62,7 @@ en: plantings: index: - title: + title: default: "Everyone's plantings" crop_plantings: "Everyone's %{crop} plantings" owner_plantings: "%{owner} plantings" @@ -82,22 +82,22 @@ en: owner_harvests: "%{owner} harvests" places: - index: - title: "%{site_name} Community Map" + index: + title: "%{site_name} Community Map" members: - index: - title: "%{site_name} members" + index: + title: "%{site_name} members" posts: - index: + index: title: - default: "Everyone's posts" + default: "Everyone's posts" author_posts: "%{author} posts" shop: index: - title: "Shop" + title: "Shop" forums: index: diff --git a/config/locales/ja.yml b/config/locales/ja.yml index 925a54399..fa240b7c3 100644 --- a/config/locales/ja.yml +++ b/config/locales/ja.yml @@ -1,5 +1,4 @@ ja: home: - blurb: + blurb: intro: "%{site_name}はガーデナーのコミュニティです。" - \ No newline at end of file diff --git a/config/newrelic.yml b/config/newrelic.yml index 4e1be6e68..63500e405 100644 --- a/config/newrelic.yml +++ b/config/newrelic.yml @@ -6,7 +6,7 @@ common: &default_settings # account. This key binds your Agent's data to your account in the # New Relic service. license_key: '<%= ENV["NEW_RELIC_LICENSE_KEY"] %>' - + # Agent Enabled (Rails Only) # Use this setting to force the agent to run or not run. # Default is 'auto' which means the agent will install and run only @@ -16,7 +16,7 @@ common: &default_settings # Valid values are true, false and auto. # # agent_enabled: auto - + # Application Name Set this to be the name of your application as # you'd like it show up in New Relic. The service will then auto-map # instances of your application into an "application" on your @@ -31,12 +31,12 @@ common: &default_settings # app_name: # - Ajax Service # - All Services - # + # app_name: <%= ENV["NEW_RELIC_APP_NAME"] %> - # When "true", the agent collects performance data about your - # application and reports this data to the New Relic service at - # newrelic.com. This global switch is normally overridden for each + # When "true", the agent collects performance data about your + # application and reports this data to the New Relic service at + # newrelic.com. This global switch is normally overridden for each # environment below. (formerly called 'enabled') monitor_mode: true @@ -54,7 +54,7 @@ common: &default_settings # '/var/log/') The agent will attempt to create this directory if it # does not exist. # log_file_path: 'log' - + # Optionally set the name of the log file, defaults to 'newrelic_agent.log' # log_file_name: 'newrelic_agent.log' @@ -77,28 +77,28 @@ common: &default_settings # use a non-blocking lookup, so in a worst case, if you have DNS # problems, your app may block indefinitely. # verify_certificate: true - + # Set your application's Apdex threshold value with the 'apdex_t' # setting, in seconds. The apdex_t value determines the buckets used - # to compute your overall Apdex score. + # to compute your overall Apdex score. # Requests that take less than apdex_t seconds to process will be # classified as Satisfying transactions; more than apdex_t seconds # as Tolerating transactions; and more than four times the apdex_t - # value as Frustrating transactions. + # value as Frustrating transactions. # For more about the Apdex standard, see # http://newrelic.com/docs/general/apdex apdex_t: 0.5 - + #============================== Browser Monitoring =============================== # New Relic Real User Monitoring gives you insight into the performance real users are # experiencing with your website. This is accomplished by measuring the time it takes for # your users' browsers to download and render your web pages by injecting a small amount - # of JavaScript code into the header and footer of each page. + # of JavaScript code into the header and footer of each page. browser_monitoring: - # By default the agent automatically injects the monitoring JavaScript - # into web pages. Set this attribute to false to turn off this behavior. - auto_instrument: true + # By default the agent automatically injects the monitoring JavaScript + # into web pages. Set this attribute to false to turn off this behavior. + auto_instrument: true # Proxy settings for connecting to the service. # @@ -110,14 +110,14 @@ common: &default_settings # proxy_user: # proxy_pass: - + # Tells transaction tracer and error collector (when enabled) # whether or not to capture HTTP params. When true, frameworks can # exclude HTTP parameters from being captured. # Rails: the RoR filter_parameter_logging excludes parameters # Java: create a config setting called "ignored_params" and set it to # a comma separated list of HTTP parameter names. - # ex: ignored_params: credit_card, ssn, password + # ex: ignored_params: credit_card, ssn, password capture_params: false @@ -126,12 +126,12 @@ common: &default_settings # minute. Included in the transaction is the exact call sequence of # the transactions including any SQL statements issued. transaction_tracer: - + # Transaction tracer is enabled by default. Set this to false to # turn it off. This feature is only available at the Professional # and above product levels. enabled: true - + # Threshold in seconds for when to collect a transaction # trace. When the response time of a controller action exceeds # this threshold, a transaction trace will be recorded and sent to @@ -139,13 +139,13 @@ common: &default_settings # "apdex_f", which will use the threshold for an dissatisfying # Apdex controller action - four times the Apdex T value. transaction_threshold: apdex_f - + # When transaction tracer is on, SQL statements can optionally be # recorded. The recorder has three modes, "off" which sends no # SQL, "raw" which sends the SQL statement in its original form, # and "obfuscated", which strips out numeric and string literals record_sql: obfuscated - + # Threshold in seconds for when to collect stack trace for a SQL # call. In other words, when SQL statements exceed this threshold, # then capture and send the current stack trace. This is @@ -157,24 +157,24 @@ common: &default_settings # set to false when using other adapters. # explain_enabled: true - # Threshold for query execution time below which query plans will not + # Threshold for query execution time below which query plans will not # not be captured. Relevant only when `explain_enabled` is true. # explain_threshold: 0.5 - + # Error collector captures information about uncaught exceptions and # sends them to the service for viewing error_collector: - + # Error collector is enabled by default. Set this to false to turn # it off. This feature is only available at the Professional and above # product levels enabled: true - - # Rails Only - tells error collector whether or not to capture a - # source snippet around the place of the error when errors are View + + # Rails Only - tells error collector whether or not to capture a + # source snippet around the place of the error when errors are View # related. - capture_source: true - + capture_source: true + # To stop specific errors from reporting to New Relic, set this property # to comma separated values. Default is to ignore routing errors # which are how 404's get triggered. @@ -185,7 +185,7 @@ common: &default_settings # won't run. Useful when you are using the agent to monitor an # external resource # disable_samplers: true - + # If you aren't interested in visibility in these areas, you can # disable the instrumentation to reduce overhead. # @@ -199,8 +199,8 @@ common: &default_settings # overhead slightly on every memcached call, and can have security # implications if your memcached keys are sensitive # capture_memcache_keys: true - - # Certain types of instrumentation such as GC stats will not work if + + # Certain types of instrumentation such as GC stats will not work if # you are running multi-threaded. Please let us know. # multi_threaded = false @@ -216,19 +216,19 @@ common: &default_settings development: <<: *default_settings - # Turn off communication to New Relic service in development mode (also + # Turn off communication to New Relic service in development mode (also # 'enabled'). - # NOTE: for initial evaluation purposes, you may want to temporarily + # NOTE: for initial evaluation purposes, you may want to temporarily # turn the agent on in development mode. monitor_mode: false - # Rails Only - when running in Developer Mode, the New Relic Agent will + # Rails Only - when running in Developer Mode, the New Relic Agent will # present performance information on the last 100 transactions you have # executed since starting the mongrel. # NOTE: There is substantial overhead when running in developer mode. - # Do not use for production or load testing. + # Do not use for production or load testing. developer_mode: true - + # Enable textmate links # textmate: true diff --git a/db/migrate/20130326092227_change_planted_at_to_date.rb b/db/migrate/20130326092227_change_planted_at_to_date.rb index 9fb361a0e..bf14c624d 100644 --- a/db/migrate/20130326092227_change_planted_at_to_date.rb +++ b/db/migrate/20130326092227_change_planted_at_to_date.rb @@ -1,5 +1,5 @@ class ChangePlantedAtToDate < ActiveRecord::Migration def change change_column :plantings, :planted_at, :date - end + end end diff --git a/db/migrate/20150201052245_create_cms.rb b/db/migrate/20150201052245_create_cms.rb index edebc41fe..585e52396 100644 --- a/db/migrate/20150201052245_create_cms.rb +++ b/db/migrate/20150201052245_create_cms.rb @@ -1,14 +1,14 @@ class CreateCms < ActiveRecord::Migration - + def self.up - + text_limit = case ActiveRecord::Base.connection.adapter_name when 'PostgreSQL' { } else { limit: 16777215 } end - + # -- Sites -------------------------------------------------------------- create_table :comfy_cms_sites do |t| t.string :label, null: false @@ -20,7 +20,7 @@ class CreateCms < ActiveRecord::Migration end add_index :comfy_cms_sites, :hostname add_index :comfy_cms_sites, :is_mirrored - + # -- Layouts ------------------------------------------------------------ create_table :comfy_cms_layouts do |t| t.integer :site_id, null: false @@ -37,7 +37,7 @@ class CreateCms < ActiveRecord::Migration end add_index :comfy_cms_layouts, [:parent_id, :position] add_index :comfy_cms_layouts, [:site_id, :identifier], unique: true - + # -- Pages -------------------------------------------------------------- create_table :comfy_cms_pages do |t| t.integer :site_id, null: false @@ -56,7 +56,7 @@ class CreateCms < ActiveRecord::Migration end add_index :comfy_cms_pages, [:site_id, :full_path] add_index :comfy_cms_pages, [:parent_id, :position] - + # -- Page Blocks -------------------------------------------------------- create_table :comfy_cms_blocks do |t| t.string :identifier, null: false @@ -66,7 +66,7 @@ class CreateCms < ActiveRecord::Migration end add_index :comfy_cms_blocks, [:identifier] add_index :comfy_cms_blocks, [:blockable_id, :blockable_type] - + # -- Snippets ----------------------------------------------------------- create_table :comfy_cms_snippets do |t| t.integer :site_id, null: false @@ -79,7 +79,7 @@ class CreateCms < ActiveRecord::Migration end add_index :comfy_cms_snippets, [:site_id, :identifier], unique: true add_index :comfy_cms_snippets, [:site_id, :position] - + # -- Files -------------------------------------------------------------- create_table :comfy_cms_files do |t| t.integer :site_id, null: false @@ -96,7 +96,7 @@ class CreateCms < ActiveRecord::Migration add_index :comfy_cms_files, [:site_id, :file_file_name] add_index :comfy_cms_files, [:site_id, :position] add_index :comfy_cms_files, [:site_id, :block_id] - + # -- Revisions ----------------------------------------------------------- create_table :comfy_cms_revisions, force: true do |t| t.string :record_type, null: false @@ -106,7 +106,7 @@ class CreateCms < ActiveRecord::Migration end add_index :comfy_cms_revisions, [:record_type, :record_id, :created_at], name: 'index_cms_revisions_on_rtype_and_rid_and_created_at' - + # -- Categories --------------------------------------------------------- create_table :comfy_cms_categories, force: true do |t| t.integer :site_id, null: false @@ -115,7 +115,7 @@ class CreateCms < ActiveRecord::Migration end add_index :comfy_cms_categories, [:site_id, :categorized_type, :label], unique: true, name: 'index_cms_categories_on_site_id_and_cat_type_and_label' - + create_table :comfy_cms_categorizations, force: true do |t| t.integer :category_id, null: false t.string :categorized_type, null: false @@ -124,7 +124,7 @@ class CreateCms < ActiveRecord::Migration add_index :comfy_cms_categorizations, [:category_id, :categorized_type, :categorized_id], unique: true, name: 'index_cms_categorizations_on_cat_id_and_catd_type_and_catd_id' end - + def self.down drop_table :comfy_cms_sites drop_table :comfy_cms_layouts diff --git a/db/seeds.rb b/db/seeds.rb index f1b8d67cb..c718a544b 100644 --- a/db/seeds.rb +++ b/db/seeds.rb @@ -89,7 +89,7 @@ def load_test_users row = CSV.parse(suburb_file.readline) suburb,country,state,latitude,longitude = row[0] - # Using 'update_column' method instead of 'update' so that + # Using 'update_column' method instead of 'update' so that # it avoids accessing Geocoding service for faster processing @user.gardens.first.update_columns(location: suburb, latitude: latitude, longitude: longitude) @user.update_columns(location: suburb, latitude: latitude, longitude: longitude) diff --git a/db/seeds/crops-00.csv b/db/seeds/crops-00.csv index adad852cb..86b668785 100644 --- a/db/seeds/crops-00.csv +++ b/db/seeds/crops-00.csv @@ -205,7 +205,7 @@ summer savory,https://en.wikipedia.org/wiki/Summer_savory,,Satureja hortensis sunflowers,https://en.wikipedia.org/wiki/Sunflower,,Helianthus annuus sweet potato,https://en.wikipedia.org/wiki/Sweet_potato,,Ipomoea batatas Swiss chard,https://en.wikipedia.org/wiki/Swiss_chard,,Beta vulgaris var. cicla -tamarillo,https://en.wikipedia.org/wiki/Tamarillo,,Solanum betaceum +tamarillo,https://en.wikipedia.org/wiki/Tamarillo,,Solanum betaceum tamarind,https://en.wikipedia.org/wiki/Tamarind,,Tamarindus indica tangerine,https://en.wikipedia.org/wiki/Tangerine,,Citrus tangerina tansy,https://en.wikipedia.org/wiki/Tansy,,Tanacetum vulgare diff --git a/lib/actions/oauth_signup_action.rb b/lib/actions/oauth_signup_action.rb index 542c4e6b8..626d4c6c3 100644 --- a/lib/actions/oauth_signup_action.rb +++ b/lib/actions/oauth_signup_action.rb @@ -2,7 +2,7 @@ class Growstuff::OauthSignupAction # # Inspects the omniauth information - # and determines if we have an existing member + # and determines if we have an existing member # (to add authentication to) # or if this is a new signup # @@ -27,7 +27,7 @@ class Growstuff::OauthSignupAction end member.save! - + member end diff --git a/lib/tasks/growstuff.rake b/lib/tasks/growstuff.rake index 86398cdb5..1e3a8188e 100644 --- a/lib/tasks/growstuff.rake +++ b/lib/tasks/growstuff.rake @@ -103,31 +103,31 @@ namespace :growstuff do is_paid: false, is_permanent_paid: false ) - @paid_account = AccountType.find_or_create_by( + @paid_account = AccountType.find_or_create_by( name: "Paid", is_paid: true, is_permanent_paid: false ) - @seed_account = AccountType.find_or_create_by( + @seed_account = AccountType.find_or_create_by( name: "Seed", is_paid: true, is_permanent_paid: true ) - @staff_account = AccountType.find_or_create_by( + @staff_account = AccountType.find_or_create_by( name: "Staff", is_paid: true, is_permanent_paid: true ) puts "Adding products..." - Product.find_or_create_by( + Product.find_or_create_by( name: "Annual subscription", description: "An annual subscription gives you access to paid account features for one year. Does not auto-renew.", min_price: 3000, account_type_id: @paid_account.id, paid_months: 12 ) - Product.find_or_create_by( + Product.find_or_create_by( name: "Seed account", description: "A seed account helps Growstuff grow in its early days. It gives you all the features of a paid account, in perpetuity. This account type never expires.", min_price: 15000, diff --git a/spec/controllers/account_types_controller_spec.rb b/spec/controllers/account_types_controller_spec.rb index eca67cfbc..4fd0450aa 100644 --- a/spec/controllers/account_types_controller_spec.rb +++ b/spec/controllers/account_types_controller_spec.rb @@ -1,13 +1,13 @@ ## DEPRECATION NOTICE: Do not add new tests to this file! ## -## View and controller tests are deprecated in the Growstuff project. -## We no longer write new view and controller tests, but instead write -## feature tests (in spec/features) using Capybara (https://github.com/jnicklas/capybara). -## These test the full stack, behaving as a browser, and require less complicated setup -## to run. Please feel free to delete old view/controller tests as they are reimplemented -## in feature tests. +## View and controller tests are deprecated in the Growstuff project. +## We no longer write new view and controller tests, but instead write +## feature tests (in spec/features) using Capybara (https://github.com/jnicklas/capybara). +## These test the full stack, behaving as a browser, and require less complicated setup +## to run. Please feel free to delete old view/controller tests as they are reimplemented +## in feature tests. ## -## If you submit a pull request containing new view or controller tests, it will not be +## If you submit a pull request containing new view or controller tests, it will not be ## merged. diff --git a/spec/controllers/accounts_controller_spec.rb b/spec/controllers/accounts_controller_spec.rb index d3ea69f87..e8d6648e5 100644 --- a/spec/controllers/accounts_controller_spec.rb +++ b/spec/controllers/accounts_controller_spec.rb @@ -1,13 +1,13 @@ ## DEPRECATION NOTICE: Do not add new tests to this file! ## -## View and controller tests are deprecated in the Growstuff project. -## We no longer write new view and controller tests, but instead write -## feature tests (in spec/features) using Capybara (https://github.com/jnicklas/capybara). -## These test the full stack, behaving as a browser, and require less complicated setup -## to run. Please feel free to delete old view/controller tests as they are reimplemented -## in feature tests. +## View and controller tests are deprecated in the Growstuff project. +## We no longer write new view and controller tests, but instead write +## feature tests (in spec/features) using Capybara (https://github.com/jnicklas/capybara). +## These test the full stack, behaving as a browser, and require less complicated setup +## to run. Please feel free to delete old view/controller tests as they are reimplemented +## in feature tests. ## -## If you submit a pull request containing new view or controller tests, it will not be +## If you submit a pull request containing new view or controller tests, it will not be ## merged. diff --git a/spec/controllers/admin/orders_controller_spec.rb b/spec/controllers/admin/orders_controller_spec.rb index 28fe0203a..b5e66b3b1 100644 --- a/spec/controllers/admin/orders_controller_spec.rb +++ b/spec/controllers/admin/orders_controller_spec.rb @@ -1,13 +1,13 @@ ## DEPRECATION NOTICE: Do not add new tests to this file! ## -## View and controller tests are deprecated in the Growstuff project. -## We no longer write new view and controller tests, but instead write -## feature tests (in spec/features) using Capybara (https://github.com/jnicklas/capybara). -## These test the full stack, behaving as a browser, and require less complicated setup -## to run. Please feel free to delete old view/controller tests as they are reimplemented -## in feature tests. +## View and controller tests are deprecated in the Growstuff project. +## We no longer write new view and controller tests, but instead write +## feature tests (in spec/features) using Capybara (https://github.com/jnicklas/capybara). +## These test the full stack, behaving as a browser, and require less complicated setup +## to run. Please feel free to delete old view/controller tests as they are reimplemented +## in feature tests. ## -## If you submit a pull request containing new view or controller tests, it will not be +## If you submit a pull request containing new view or controller tests, it will not be ## merged. diff --git a/spec/controllers/admin_controller_spec.rb b/spec/controllers/admin_controller_spec.rb index d939b9f6b..bb669d80c 100644 --- a/spec/controllers/admin_controller_spec.rb +++ b/spec/controllers/admin_controller_spec.rb @@ -1,13 +1,13 @@ ## DEPRECATION NOTICE: Do not add new tests to this file! ## -## View and controller tests are deprecated in the Growstuff project. -## We no longer write new view and controller tests, but instead write -## feature tests (in spec/features) using Capybara (https://github.com/jnicklas/capybara). -## These test the full stack, behaving as a browser, and require less complicated setup -## to run. Please feel free to delete old view/controller tests as they are reimplemented -## in feature tests. +## View and controller tests are deprecated in the Growstuff project. +## We no longer write new view and controller tests, but instead write +## feature tests (in spec/features) using Capybara (https://github.com/jnicklas/capybara). +## These test the full stack, behaving as a browser, and require less complicated setup +## to run. Please feel free to delete old view/controller tests as they are reimplemented +## in feature tests. ## -## If you submit a pull request containing new view or controller tests, it will not be +## If you submit a pull request containing new view or controller tests, it will not be ## merged. diff --git a/spec/controllers/authentications_controller_spec.rb b/spec/controllers/authentications_controller_spec.rb index e3dd39447..91de89aae 100644 --- a/spec/controllers/authentications_controller_spec.rb +++ b/spec/controllers/authentications_controller_spec.rb @@ -1,13 +1,13 @@ ## DEPRECATION NOTICE: Do not add new tests to this file! ## -## View and controller tests are deprecated in the Growstuff project. -## We no longer write new view and controller tests, but instead write -## feature tests (in spec/features) using Capybara (https://github.com/jnicklas/capybara). -## These test the full stack, behaving as a browser, and require less complicated setup -## to run. Please feel free to delete old view/controller tests as they are reimplemented -## in feature tests. +## View and controller tests are deprecated in the Growstuff project. +## We no longer write new view and controller tests, but instead write +## feature tests (in spec/features) using Capybara (https://github.com/jnicklas/capybara). +## These test the full stack, behaving as a browser, and require less complicated setup +## to run. Please feel free to delete old view/controller tests as they are reimplemented +## in feature tests. ## -## If you submit a pull request containing new view or controller tests, it will not be +## If you submit a pull request containing new view or controller tests, it will not be ## merged. diff --git a/spec/controllers/comments_controller_spec.rb b/spec/controllers/comments_controller_spec.rb index 3e60a642b..36b77fdf9 100644 --- a/spec/controllers/comments_controller_spec.rb +++ b/spec/controllers/comments_controller_spec.rb @@ -1,13 +1,13 @@ ## DEPRECATION NOTICE: Do not add new tests to this file! ## -## View and controller tests are deprecated in the Growstuff project. -## We no longer write new view and controller tests, but instead write -## feature tests (in spec/features) using Capybara (https://github.com/jnicklas/capybara). -## These test the full stack, behaving as a browser, and require less complicated setup -## to run. Please feel free to delete old view/controller tests as they are reimplemented -## in feature tests. +## View and controller tests are deprecated in the Growstuff project. +## We no longer write new view and controller tests, but instead write +## feature tests (in spec/features) using Capybara (https://github.com/jnicklas/capybara). +## These test the full stack, behaving as a browser, and require less complicated setup +## to run. Please feel free to delete old view/controller tests as they are reimplemented +## in feature tests. ## -## If you submit a pull request containing new view or controller tests, it will not be +## If you submit a pull request containing new view or controller tests, it will not be ## merged. diff --git a/spec/controllers/crops_controller_spec.rb b/spec/controllers/crops_controller_spec.rb index 894858057..876c289d4 100644 --- a/spec/controllers/crops_controller_spec.rb +++ b/spec/controllers/crops_controller_spec.rb @@ -1,13 +1,13 @@ ## DEPRECATION NOTICE: Do not add new tests to this file! ## -## View and controller tests are deprecated in the Growstuff project. -## We no longer write new view and controller tests, but instead write -## feature tests (in spec/features) using Capybara (https://github.com/jnicklas/capybara). -## These test the full stack, behaving as a browser, and require less complicated setup -## to run. Please feel free to delete old view/controller tests as they are reimplemented -## in feature tests. +## View and controller tests are deprecated in the Growstuff project. +## We no longer write new view and controller tests, but instead write +## feature tests (in spec/features) using Capybara (https://github.com/jnicklas/capybara). +## These test the full stack, behaving as a browser, and require less complicated setup +## to run. Please feel free to delete old view/controller tests as they are reimplemented +## in feature tests. ## -## If you submit a pull request containing new view or controller tests, it will not be +## If you submit a pull request containing new view or controller tests, it will not be ## merged. diff --git a/spec/controllers/forums_controller_spec.rb b/spec/controllers/forums_controller_spec.rb index 6d52321a5..233654d53 100644 --- a/spec/controllers/forums_controller_spec.rb +++ b/spec/controllers/forums_controller_spec.rb @@ -1,13 +1,13 @@ ## DEPRECATION NOTICE: Do not add new tests to this file! ## -## View and controller tests are deprecated in the Growstuff project. -## We no longer write new view and controller tests, but instead write -## feature tests (in spec/features) using Capybara (https://github.com/jnicklas/capybara). -## These test the full stack, behaving as a browser, and require less complicated setup -## to run. Please feel free to delete old view/controller tests as they are reimplemented -## in feature tests. +## View and controller tests are deprecated in the Growstuff project. +## We no longer write new view and controller tests, but instead write +## feature tests (in spec/features) using Capybara (https://github.com/jnicklas/capybara). +## These test the full stack, behaving as a browser, and require less complicated setup +## to run. Please feel free to delete old view/controller tests as they are reimplemented +## in feature tests. ## -## If you submit a pull request containing new view or controller tests, it will not be +## If you submit a pull request containing new view or controller tests, it will not be ## merged. diff --git a/spec/controllers/gardens_controller_spec.rb b/spec/controllers/gardens_controller_spec.rb index 4e9d0fc1c..869cbad98 100644 --- a/spec/controllers/gardens_controller_spec.rb +++ b/spec/controllers/gardens_controller_spec.rb @@ -1,13 +1,13 @@ ## DEPRECATION NOTICE: Do not add new tests to this file! ## -## View and controller tests are deprecated in the Growstuff project. -## We no longer write new view and controller tests, but instead write -## feature tests (in spec/features) using Capybara (https://github.com/jnicklas/capybara). -## These test the full stack, behaving as a browser, and require less complicated setup -## to run. Please feel free to delete old view/controller tests as they are reimplemented -## in feature tests. +## View and controller tests are deprecated in the Growstuff project. +## We no longer write new view and controller tests, but instead write +## feature tests (in spec/features) using Capybara (https://github.com/jnicklas/capybara). +## These test the full stack, behaving as a browser, and require less complicated setup +## to run. Please feel free to delete old view/controller tests as they are reimplemented +## in feature tests. ## -## If you submit a pull request containing new view or controller tests, it will not be +## If you submit a pull request containing new view or controller tests, it will not be ## merged. diff --git a/spec/controllers/harvests_controller_spec.rb b/spec/controllers/harvests_controller_spec.rb index 80822c564..753f6fbee 100644 --- a/spec/controllers/harvests_controller_spec.rb +++ b/spec/controllers/harvests_controller_spec.rb @@ -1,13 +1,13 @@ ## DEPRECATION NOTICE: Do not add new tests to this file! ## -## View and controller tests are deprecated in the Growstuff project. -## We no longer write new view and controller tests, but instead write -## feature tests (in spec/features) using Capybara (https://github.com/jnicklas/capybara). -## These test the full stack, behaving as a browser, and require less complicated setup -## to run. Please feel free to delete old view/controller tests as they are reimplemented -## in feature tests. +## View and controller tests are deprecated in the Growstuff project. +## We no longer write new view and controller tests, but instead write +## feature tests (in spec/features) using Capybara (https://github.com/jnicklas/capybara). +## These test the full stack, behaving as a browser, and require less complicated setup +## to run. Please feel free to delete old view/controller tests as they are reimplemented +## in feature tests. ## -## If you submit a pull request containing new view or controller tests, it will not be +## If you submit a pull request containing new view or controller tests, it will not be ## merged. @@ -36,7 +36,7 @@ describe HarvestsController do @maize = FactoryGirl.create(:maize) @harvest1 = FactoryGirl.create(:harvest, owner_id: @member1.id, crop_id: @tomato.id) @harvest2 = FactoryGirl.create(:harvest, owner_id: @member2.id, crop_id: @maize.id) - end + end it "assigns all harvests as @harvests" do get :index, {} diff --git a/spec/controllers/home_controller_spec.rb b/spec/controllers/home_controller_spec.rb index 8d4aa3569..ba3d4fce8 100644 --- a/spec/controllers/home_controller_spec.rb +++ b/spec/controllers/home_controller_spec.rb @@ -1,13 +1,13 @@ ## DEPRECATION NOTICE: Do not add new tests to this file! ## -## View and controller tests are deprecated in the Growstuff project. -## We no longer write new view and controller tests, but instead write -## feature tests (in spec/features) using Capybara (https://github.com/jnicklas/capybara). -## These test the full stack, behaving as a browser, and require less complicated setup -## to run. Please feel free to delete old view/controller tests as they are reimplemented -## in feature tests. +## View and controller tests are deprecated in the Growstuff project. +## We no longer write new view and controller tests, but instead write +## feature tests (in spec/features) using Capybara (https://github.com/jnicklas/capybara). +## These test the full stack, behaving as a browser, and require less complicated setup +## to run. Please feel free to delete old view/controller tests as they are reimplemented +## in feature tests. ## -## If you submit a pull request containing new view or controller tests, it will not be +## If you submit a pull request containing new view or controller tests, it will not be ## merged. diff --git a/spec/controllers/member_controller_spec.rb b/spec/controllers/member_controller_spec.rb index be178341e..77912b2df 100644 --- a/spec/controllers/member_controller_spec.rb +++ b/spec/controllers/member_controller_spec.rb @@ -1,13 +1,13 @@ ## DEPRECATION NOTICE: Do not add new tests to this file! ## -## View and controller tests are deprecated in the Growstuff project. -## We no longer write new view and controller tests, but instead write -## feature tests (in spec/features) using Capybara (https://github.com/jnicklas/capybara). -## These test the full stack, behaving as a browser, and require less complicated setup -## to run. Please feel free to delete old view/controller tests as they are reimplemented -## in feature tests. +## View and controller tests are deprecated in the Growstuff project. +## We no longer write new view and controller tests, but instead write +## feature tests (in spec/features) using Capybara (https://github.com/jnicklas/capybara). +## These test the full stack, behaving as a browser, and require less complicated setup +## to run. Please feel free to delete old view/controller tests as they are reimplemented +## in feature tests. ## -## If you submit a pull request containing new view or controller tests, it will not be +## If you submit a pull request containing new view or controller tests, it will not be ## merged. diff --git a/spec/controllers/notifications_controller_spec.rb b/spec/controllers/notifications_controller_spec.rb index de97919c3..c4366bf6a 100644 --- a/spec/controllers/notifications_controller_spec.rb +++ b/spec/controllers/notifications_controller_spec.rb @@ -1,13 +1,13 @@ ## DEPRECATION NOTICE: Do not add new tests to this file! ## -## View and controller tests are deprecated in the Growstuff project. -## We no longer write new view and controller tests, but instead write -## feature tests (in spec/features) using Capybara (https://github.com/jnicklas/capybara). -## These test the full stack, behaving as a browser, and require less complicated setup -## to run. Please feel free to delete old view/controller tests as they are reimplemented -## in feature tests. +## View and controller tests are deprecated in the Growstuff project. +## We no longer write new view and controller tests, but instead write +## feature tests (in spec/features) using Capybara (https://github.com/jnicklas/capybara). +## These test the full stack, behaving as a browser, and require less complicated setup +## to run. Please feel free to delete old view/controller tests as they are reimplemented +## in feature tests. ## -## If you submit a pull request containing new view or controller tests, it will not be +## If you submit a pull request containing new view or controller tests, it will not be ## merged. diff --git a/spec/controllers/order_items_controller_spec.rb b/spec/controllers/order_items_controller_spec.rb index f081c85b7..4170e140e 100644 --- a/spec/controllers/order_items_controller_spec.rb +++ b/spec/controllers/order_items_controller_spec.rb @@ -1,13 +1,13 @@ ## DEPRECATION NOTICE: Do not add new tests to this file! ## -## View and controller tests are deprecated in the Growstuff project. -## We no longer write new view and controller tests, but instead write -## feature tests (in spec/features) using Capybara (https://github.com/jnicklas/capybara). -## These test the full stack, behaving as a browser, and require less complicated setup -## to run. Please feel free to delete old view/controller tests as they are reimplemented -## in feature tests. +## View and controller tests are deprecated in the Growstuff project. +## We no longer write new view and controller tests, but instead write +## feature tests (in spec/features) using Capybara (https://github.com/jnicklas/capybara). +## These test the full stack, behaving as a browser, and require less complicated setup +## to run. Please feel free to delete old view/controller tests as they are reimplemented +## in feature tests. ## -## If you submit a pull request containing new view or controller tests, it will not be +## If you submit a pull request containing new view or controller tests, it will not be ## merged. diff --git a/spec/controllers/orders_controller_spec.rb b/spec/controllers/orders_controller_spec.rb index 81e74a5b5..cb408b051 100644 --- a/spec/controllers/orders_controller_spec.rb +++ b/spec/controllers/orders_controller_spec.rb @@ -1,13 +1,13 @@ ## DEPRECATION NOTICE: Do not add new tests to this file! ## -## View and controller tests are deprecated in the Growstuff project. -## We no longer write new view and controller tests, but instead write -## feature tests (in spec/features) using Capybara (https://github.com/jnicklas/capybara). -## These test the full stack, behaving as a browser, and require less complicated setup -## to run. Please feel free to delete old view/controller tests as they are reimplemented -## in feature tests. +## View and controller tests are deprecated in the Growstuff project. +## We no longer write new view and controller tests, but instead write +## feature tests (in spec/features) using Capybara (https://github.com/jnicklas/capybara). +## These test the full stack, behaving as a browser, and require less complicated setup +## to run. Please feel free to delete old view/controller tests as they are reimplemented +## in feature tests. ## -## If you submit a pull request containing new view or controller tests, it will not be +## If you submit a pull request containing new view or controller tests, it will not be ## merged. diff --git a/spec/controllers/photos_controller_spec.rb b/spec/controllers/photos_controller_spec.rb index e73ba5317..0b1c3699e 100644 --- a/spec/controllers/photos_controller_spec.rb +++ b/spec/controllers/photos_controller_spec.rb @@ -1,13 +1,13 @@ ## DEPRECATION NOTICE: Do not add new tests to this file! ## -## View and controller tests are deprecated in the Growstuff project. -## We no longer write new view and controller tests, but instead write -## feature tests (in spec/features) using Capybara (https://github.com/jnicklas/capybara). -## These test the full stack, behaving as a browser, and require less complicated setup -## to run. Please feel free to delete old view/controller tests as they are reimplemented -## in feature tests. +## View and controller tests are deprecated in the Growstuff project. +## We no longer write new view and controller tests, but instead write +## feature tests (in spec/features) using Capybara (https://github.com/jnicklas/capybara). +## These test the full stack, behaving as a browser, and require less complicated setup +## to run. Please feel free to delete old view/controller tests as they are reimplemented +## in feature tests. ## -## If you submit a pull request containing new view or controller tests, it will not be +## If you submit a pull request containing new view or controller tests, it will not be ## merged. diff --git a/spec/controllers/places_controller_spec.rb b/spec/controllers/places_controller_spec.rb index 4c8c34d3c..9dc3110e5 100644 --- a/spec/controllers/places_controller_spec.rb +++ b/spec/controllers/places_controller_spec.rb @@ -1,13 +1,13 @@ ## DEPRECATION NOTICE: Do not add new tests to this file! ## -## View and controller tests are deprecated in the Growstuff project. -## We no longer write new view and controller tests, but instead write -## feature tests (in spec/features) using Capybara (https://github.com/jnicklas/capybara). -## These test the full stack, behaving as a browser, and require less complicated setup -## to run. Please feel free to delete old view/controller tests as they are reimplemented -## in feature tests. +## View and controller tests are deprecated in the Growstuff project. +## We no longer write new view and controller tests, but instead write +## feature tests (in spec/features) using Capybara (https://github.com/jnicklas/capybara). +## These test the full stack, behaving as a browser, and require less complicated setup +## to run. Please feel free to delete old view/controller tests as they are reimplemented +## in feature tests. ## -## If you submit a pull request containing new view or controller tests, it will not be +## If you submit a pull request containing new view or controller tests, it will not be ## merged. diff --git a/spec/controllers/plant_parts_controller_spec.rb b/spec/controllers/plant_parts_controller_spec.rb index 75b2ad53d..4784cfbdf 100644 --- a/spec/controllers/plant_parts_controller_spec.rb +++ b/spec/controllers/plant_parts_controller_spec.rb @@ -1,13 +1,13 @@ ## DEPRECATION NOTICE: Do not add new tests to this file! ## -## View and controller tests are deprecated in the Growstuff project. -## We no longer write new view and controller tests, but instead write -## feature tests (in spec/features) using Capybara (https://github.com/jnicklas/capybara). -## These test the full stack, behaving as a browser, and require less complicated setup -## to run. Please feel free to delete old view/controller tests as they are reimplemented -## in feature tests. +## View and controller tests are deprecated in the Growstuff project. +## We no longer write new view and controller tests, but instead write +## feature tests (in spec/features) using Capybara (https://github.com/jnicklas/capybara). +## These test the full stack, behaving as a browser, and require less complicated setup +## to run. Please feel free to delete old view/controller tests as they are reimplemented +## in feature tests. ## -## If you submit a pull request containing new view or controller tests, it will not be +## If you submit a pull request containing new view or controller tests, it will not be ## merged. diff --git a/spec/controllers/plantings_controller_spec.rb b/spec/controllers/plantings_controller_spec.rb index 68514b634..d7d143498 100644 --- a/spec/controllers/plantings_controller_spec.rb +++ b/spec/controllers/plantings_controller_spec.rb @@ -1,13 +1,13 @@ ## DEPRECATION NOTICE: Do not add new tests to this file! ## -## View and controller tests are deprecated in the Growstuff project. -## We no longer write new view and controller tests, but instead write -## feature tests (in spec/features) using Capybara (https://github.com/jnicklas/capybara). -## These test the full stack, behaving as a browser, and require less complicated setup -## to run. Please feel free to delete old view/controller tests as they are reimplemented -## in feature tests. +## View and controller tests are deprecated in the Growstuff project. +## We no longer write new view and controller tests, but instead write +## feature tests (in spec/features) using Capybara (https://github.com/jnicklas/capybara). +## These test the full stack, behaving as a browser, and require less complicated setup +## to run. Please feel free to delete old view/controller tests as they are reimplemented +## in feature tests. ## -## If you submit a pull request containing new view or controller tests, it will not be +## If you submit a pull request containing new view or controller tests, it will not be ## merged. @@ -32,11 +32,11 @@ describe PlantingsController do @member1 = FactoryGirl.create(:member) @member2 = FactoryGirl.create(:member) @tomato = FactoryGirl.create(:tomato) - @maize = FactoryGirl.create(:maize) + @maize = FactoryGirl.create(:maize) @planting1 = FactoryGirl.create(:planting, crop: @tomato, owner: @member1) @planting2 = FactoryGirl.create(:planting, crop: @maize, owner: @member2) end - + it "assigns all plantings as @plantings" do get :index, {} assigns(:plantings).should =~ [@planting1, @planting2] @@ -51,7 +51,7 @@ describe PlantingsController do it "picks up crop from params and shows the plantings for the crop only" do get :index, {crop: @maize.name} assigns(:crop).should eq @maize - assigns(:plantings).should eq [@planting2] + assigns(:plantings).should eq [@planting2] end end diff --git a/spec/controllers/posts_controller_spec.rb b/spec/controllers/posts_controller_spec.rb index b53a67f40..6074d0655 100644 --- a/spec/controllers/posts_controller_spec.rb +++ b/spec/controllers/posts_controller_spec.rb @@ -1,13 +1,13 @@ ## DEPRECATION NOTICE: Do not add new tests to this file! ## -## View and controller tests are deprecated in the Growstuff project. -## We no longer write new view and controller tests, but instead write -## feature tests (in spec/features) using Capybara (https://github.com/jnicklas/capybara). -## These test the full stack, behaving as a browser, and require less complicated setup -## to run. Please feel free to delete old view/controller tests as they are reimplemented -## in feature tests. +## View and controller tests are deprecated in the Growstuff project. +## We no longer write new view and controller tests, but instead write +## feature tests (in spec/features) using Capybara (https://github.com/jnicklas/capybara). +## These test the full stack, behaving as a browser, and require less complicated setup +## to run. Please feel free to delete old view/controller tests as they are reimplemented +## in feature tests. ## -## If you submit a pull request containing new view or controller tests, it will not be +## If you submit a pull request containing new view or controller tests, it will not be ## merged. diff --git a/spec/controllers/products_controller_spec.rb b/spec/controllers/products_controller_spec.rb index f8ca75083..ad56da174 100644 --- a/spec/controllers/products_controller_spec.rb +++ b/spec/controllers/products_controller_spec.rb @@ -1,13 +1,13 @@ ## DEPRECATION NOTICE: Do not add new tests to this file! ## -## View and controller tests are deprecated in the Growstuff project. -## We no longer write new view and controller tests, but instead write -## feature tests (in spec/features) using Capybara (https://github.com/jnicklas/capybara). -## These test the full stack, behaving as a browser, and require less complicated setup -## to run. Please feel free to delete old view/controller tests as they are reimplemented -## in feature tests. +## View and controller tests are deprecated in the Growstuff project. +## We no longer write new view and controller tests, but instead write +## feature tests (in spec/features) using Capybara (https://github.com/jnicklas/capybara). +## These test the full stack, behaving as a browser, and require less complicated setup +## to run. Please feel free to delete old view/controller tests as they are reimplemented +## in feature tests. ## -## If you submit a pull request containing new view or controller tests, it will not be +## If you submit a pull request containing new view or controller tests, it will not be ## merged. diff --git a/spec/controllers/registrations_controller_spec.rb b/spec/controllers/registrations_controller_spec.rb index ac9990254..053c67b8c 100644 --- a/spec/controllers/registrations_controller_spec.rb +++ b/spec/controllers/registrations_controller_spec.rb @@ -1,13 +1,13 @@ ## DEPRECATION NOTICE: Do not add new tests to this file! ## -## View and controller tests are deprecated in the Growstuff project. -## We no longer write new view and controller tests, but instead write -## feature tests (in spec/features) using Capybara (https://github.com/jnicklas/capybara). -## These test the full stack, behaving as a browser, and require less complicated setup -## to run. Please feel free to delete old view/controller tests as they are reimplemented -## in feature tests. +## View and controller tests are deprecated in the Growstuff project. +## We no longer write new view and controller tests, but instead write +## feature tests (in spec/features) using Capybara (https://github.com/jnicklas/capybara). +## These test the full stack, behaving as a browser, and require less complicated setup +## to run. Please feel free to delete old view/controller tests as they are reimplemented +## in feature tests. ## -## If you submit a pull request containing new view or controller tests, it will not be +## If you submit a pull request containing new view or controller tests, it will not be ## merged. diff --git a/spec/controllers/roles_controller_spec.rb b/spec/controllers/roles_controller_spec.rb index 7a5e5fce8..402d1c61c 100644 --- a/spec/controllers/roles_controller_spec.rb +++ b/spec/controllers/roles_controller_spec.rb @@ -1,13 +1,13 @@ ## DEPRECATION NOTICE: Do not add new tests to this file! ## -## View and controller tests are deprecated in the Growstuff project. -## We no longer write new view and controller tests, but instead write -## feature tests (in spec/features) using Capybara (https://github.com/jnicklas/capybara). -## These test the full stack, behaving as a browser, and require less complicated setup -## to run. Please feel free to delete old view/controller tests as they are reimplemented -## in feature tests. +## View and controller tests are deprecated in the Growstuff project. +## We no longer write new view and controller tests, but instead write +## feature tests (in spec/features) using Capybara (https://github.com/jnicklas/capybara). +## These test the full stack, behaving as a browser, and require less complicated setup +## to run. Please feel free to delete old view/controller tests as they are reimplemented +## in feature tests. ## -## If you submit a pull request containing new view or controller tests, it will not be +## If you submit a pull request containing new view or controller tests, it will not be ## merged. diff --git a/spec/controllers/scientific_names_controller_spec.rb b/spec/controllers/scientific_names_controller_spec.rb index ab40494fb..ec8ff53cd 100644 --- a/spec/controllers/scientific_names_controller_spec.rb +++ b/spec/controllers/scientific_names_controller_spec.rb @@ -1,13 +1,13 @@ ## DEPRECATION NOTICE: Do not add new tests to this file! ## -## View and controller tests are deprecated in the Growstuff project. -## We no longer write new view and controller tests, but instead write -## feature tests (in spec/features) using Capybara (https://github.com/jnicklas/capybara). -## These test the full stack, behaving as a browser, and require less complicated setup -## to run. Please feel free to delete old view/controller tests as they are reimplemented -## in feature tests. +## View and controller tests are deprecated in the Growstuff project. +## We no longer write new view and controller tests, but instead write +## feature tests (in spec/features) using Capybara (https://github.com/jnicklas/capybara). +## These test the full stack, behaving as a browser, and require less complicated setup +## to run. Please feel free to delete old view/controller tests as they are reimplemented +## in feature tests. ## -## If you submit a pull request containing new view or controller tests, it will not be +## If you submit a pull request containing new view or controller tests, it will not be ## merged. diff --git a/spec/controllers/seeds_controller_spec.rb b/spec/controllers/seeds_controller_spec.rb index bfb880477..fbf57fc81 100644 --- a/spec/controllers/seeds_controller_spec.rb +++ b/spec/controllers/seeds_controller_spec.rb @@ -1,13 +1,13 @@ ## DEPRECATION NOTICE: Do not add new tests to this file! ## -## View and controller tests are deprecated in the Growstuff project. -## We no longer write new view and controller tests, but instead write -## feature tests (in spec/features) using Capybara (https://github.com/jnicklas/capybara). -## These test the full stack, behaving as a browser, and require less complicated setup -## to run. Please feel free to delete old view/controller tests as they are reimplemented -## in feature tests. +## View and controller tests are deprecated in the Growstuff project. +## We no longer write new view and controller tests, but instead write +## feature tests (in spec/features) using Capybara (https://github.com/jnicklas/capybara). +## These test the full stack, behaving as a browser, and require less complicated setup +## to run. Please feel free to delete old view/controller tests as they are reimplemented +## in feature tests. ## -## If you submit a pull request containing new view or controller tests, it will not be +## If you submit a pull request containing new view or controller tests, it will not be ## merged. diff --git a/spec/controllers/shop_controller_spec.rb b/spec/controllers/shop_controller_spec.rb index a02d4fbad..7abdbd5d7 100644 --- a/spec/controllers/shop_controller_spec.rb +++ b/spec/controllers/shop_controller_spec.rb @@ -1,13 +1,13 @@ ## DEPRECATION NOTICE: Do not add new tests to this file! ## -## View and controller tests are deprecated in the Growstuff project. -## We no longer write new view and controller tests, but instead write -## feature tests (in spec/features) using Capybara (https://github.com/jnicklas/capybara). -## These test the full stack, behaving as a browser, and require less complicated setup -## to run. Please feel free to delete old view/controller tests as they are reimplemented -## in feature tests. +## View and controller tests are deprecated in the Growstuff project. +## We no longer write new view and controller tests, but instead write +## feature tests (in spec/features) using Capybara (https://github.com/jnicklas/capybara). +## These test the full stack, behaving as a browser, and require less complicated setup +## to run. Please feel free to delete old view/controller tests as they are reimplemented +## in feature tests. ## -## If you submit a pull request containing new view or controller tests, it will not be +## If you submit a pull request containing new view or controller tests, it will not be ## merged. diff --git a/spec/factories/crop.rb b/spec/factories/crop.rb index c2ba35046..5857c9828 100644 --- a/spec/factories/crop.rb +++ b/spec/factories/crop.rb @@ -54,7 +54,7 @@ FactoryGirl.define do factory :uppercasecrop do name "Swiss chard" end - + factory :autoloaded_crop do creator "cropbot" end diff --git a/spec/factories/follows.rb b/spec/factories/follows.rb index 6de32b7a1..4bf6b33ac 100644 --- a/spec/factories/follows.rb +++ b/spec/factories/follows.rb @@ -1,6 +1,6 @@ FactoryGirl.define do factory :follow do - follower + follower followed end diff --git a/spec/features/admin/forums_spec.rb b/spec/features/admin/forums_spec.rb index a385289a6..1ff1398a4 100644 --- a/spec/features/admin/forums_spec.rb +++ b/spec/features/admin/forums_spec.rb @@ -4,7 +4,7 @@ feature "forums", js: true do context "as an admin user" do let(:member) { create :admin_member } let(:forum) { create :forum } - + background do login_as member end diff --git a/spec/features/admin/products_spec.rb b/spec/features/admin/products_spec.rb index 0fc9bdb5a..849762ad8 100644 --- a/spec/features/admin/products_spec.rb +++ b/spec/features/admin/products_spec.rb @@ -4,7 +4,7 @@ feature "products" do context "admin user" do let(:member) { create :admin_member } let(:product) { create :product } - + background do login_as member end diff --git a/spec/features/crops/crop_detail_page_spec.rb b/spec/features/crops/crop_detail_page_spec.rb index 09dd12c2f..ef07fb99c 100644 --- a/spec/features/crops/crop_detail_page_spec.rb +++ b/spec/features/crops/crop_detail_page_spec.rb @@ -2,7 +2,7 @@ require 'rails_helper' feature "crop detail page", js: true do let(:crop) { create :crop } - + subject { visit crop_path(crop) } context "varieties" do diff --git a/spec/features/planting_reminder_spec.rb b/spec/features/planting_reminder_spec.rb index 4cba3cb51..3b407c3df 100644 --- a/spec/features/planting_reminder_spec.rb +++ b/spec/features/planting_reminder_spec.rb @@ -5,7 +5,7 @@ feature "Planting reminder email", :js do let(:member) { create :member } let(:mail) { Notifier.planting_reminder(member) } - # Unfortunately, we can't use the default url options for ActionMailer as configured in + # Unfortunately, we can't use the default url options for ActionMailer as configured in # test.rb, since this isn't a mailer spec. def self.default_url_options { host: 'localhost', port: 8080 } diff --git a/spec/features/plantings/planting_a_crop_spec.rb b/spec/features/plantings/planting_a_crop_spec.rb index 7c51af70f..79e8a8599 100644 --- a/spec/features/plantings/planting_a_crop_spec.rb +++ b/spec/features/plantings/planting_a_crop_spec.rb @@ -191,12 +191,12 @@ feature "Planting a crop", :js do fill_in "Finished date", with: "2014-08-30" # Trigger click instead of using Capybara"s uncheck - # because a date selection widget is overlapping + # because a date selection widget is overlapping # the checkbox preventing interaction. find("#planting_finished").trigger 'click' end - # Javascript removes the finished at date when the + # Javascript removes the finished at date when the # planting is marked unfinished. expect(find("#planting_finished_at").value).to eq("") @@ -204,7 +204,7 @@ feature "Planting a crop", :js do find("#planting_finished").trigger 'click' end - # The finished at date was cached in Javascript in + # The finished at date was cached in Javascript in # case the user clicks unfinished accidentally. expect(find("#planting_finished_at").value).to eq("2014-08-30") @@ -272,7 +272,7 @@ feature "Planting a crop", :js do describe "Marking a planting as finished from the list page" do let(:path) { plantings_path } let(:link_text) { "Mark as finished" } - + it_behaves_like "append date" end end diff --git a/spec/features/signin_spec.rb b/spec/features/signin_spec.rb index 2000d29e1..0424f85bb 100644 --- a/spec/features/signin_spec.rb +++ b/spec/features/signin_spec.rb @@ -70,13 +70,13 @@ feature "signin", js: true do member = create :member, login_name: 'tdawg', email: 'example.oauth.facebook@example.com' # Start the test - visit root_path + visit root_path first('.signup a').click # Click the signup with facebook link first('a[href="/members/auth/facebook"]').click - # Magic happens! + # Magic happens! # See config/environments/test.rb for the fake user # that we pretended to auth as diff --git a/spec/features/signup_spec.rb b/spec/features/signup_spec.rb index 8f3ad45b3..d3ebaad8d 100644 --- a/spec/features/signup_spec.rb +++ b/spec/features/signup_spec.rb @@ -34,7 +34,7 @@ feature "signup", js: true do end scenario "sign up for new account without accepting TOS" do - visit root_path + visit root_path first('.signup a').click # click the 'Sign up' button in the middle of the page fill_in 'Login name', with: 'person123' fill_in 'Email', with: 'gardener@example.com' @@ -54,13 +54,13 @@ feature "signup", js: true do Authentication.where(provider: 'facebook', uid: '123545').delete_all # Start the test - visit root_path + visit root_path first('.signup a').click # Click the signup with facebook link first('a[href="/members/auth/facebook"]').click - # Magic happens! + # Magic happens! # See config/environments/test.rb for the fake user # that we pretended to auth as diff --git a/spec/helpers/crops_helper_spec.rb b/spec/helpers/crops_helper_spec.rb index ff4b753bf..67714f4f0 100644 --- a/spec/helpers/crops_helper_spec.rb +++ b/spec/helpers/crops_helper_spec.rb @@ -26,7 +26,7 @@ describe CropsHelper do context "with an quantity of seeds" do before do a_different_crop = create :apple - + create :seed, crop: @crop, quantity: 20, owner: @member create :seed, crop: @crop, quantity: 13, owner: @member diff --git a/spec/helpers/notifications_helper_spec.rb b/spec/helpers/notifications_helper_spec.rb index 109bf0c87..abbc17b0b 100644 --- a/spec/helpers/notifications_helper_spec.rb +++ b/spec/helpers/notifications_helper_spec.rb @@ -3,7 +3,7 @@ require 'rails_helper' describe NotificationsHelper do describe "reply_link" do - let(:member) { FactoryGirl.create(:member) } + let(:member) { FactoryGirl.create(:member) } it "replies to PMs with PMs" do notification = FactoryGirl.create(:notification, recipient_id: member.id, post_id: nil) diff --git a/spec/lib/actions/oauth_signup_action_spec.rb b/spec/lib/actions/oauth_signup_action_spec.rb index 2495368dd..7ea84ceb3 100644 --- a/spec/lib/actions/oauth_signup_action_spec.rb +++ b/spec/lib/actions/oauth_signup_action_spec.rb @@ -66,7 +66,7 @@ describe 'Growstuff::OauthSignupAction' do it 'should store the uid and provider for the member' do expect(@authentication.member.id).to eq @member.id expect(@authentication.provider).to eq 'facebook' - expect(@authentication.uid).to eq '123545' + expect(@authentication.uid).to eq '123545' end end @@ -77,7 +77,7 @@ describe 'Growstuff::OauthSignupAction' do Member.where(email: @auth['info']['email']).delete_all @existing_member = create :member, { - email: @auth['info']['email'], + email: @auth['info']['email'], login_name: 'existing', preferred_avatar_uri: 'http://cl.jroo.me/z3/W/H/K/e/a.baa-very-cool-hat-you-.jpg' } @@ -111,7 +111,7 @@ describe 'Growstuff::OauthSignupAction' do it 'should store the uid and provider for the member' do expect(@authentication.member.id).to eq @member.id expect(@authentication.provider).to eq 'facebook' - expect(@authentication.uid).to eq '123545' + expect(@authentication.uid).to eq '123545' end end @@ -123,7 +123,7 @@ describe 'Growstuff::OauthSignupAction' do Authentication.delete_all @existing_member = create :member, { - email: @auth['info']['email'], + email: @auth['info']['email'], login_name: 'schrodingerscat', preferred_avatar_uri: 'http://cl.jroo.me/z3/W/H/K/e/a.baa-very-cool-hat-you-.jpg' } diff --git a/spec/models/ability_spec.rb b/spec/models/ability_spec.rb index f31f7f845..53a820bd3 100644 --- a/spec/models/ability_spec.rb +++ b/spec/models/ability_spec.rb @@ -262,7 +262,7 @@ describe Ability do let(:role) { FactoryGirl.create(:admin) } - before do + before do member.roles << role end @@ -297,7 +297,7 @@ describe Ability do context 'admin' do let(:role) { FactoryGirl.create(:admin) } - + before do member.roles << role end diff --git a/spec/models/comment_spec.rb b/spec/models/comment_spec.rb index f3c94860e..d26653f0d 100644 --- a/spec/models/comment_spec.rb +++ b/spec/models/comment_spec.rb @@ -3,7 +3,7 @@ require 'rails_helper' describe Comment do context "basic" do - + let(:comment) { FactoryGirl.create(:comment) } it "belongs to a post" do @@ -16,7 +16,7 @@ describe Comment do end context "notifications" do - + let(:comment) { FactoryGirl.create(:comment) } it "sends a notification when a comment is posted" do diff --git a/spec/models/crop_spec.rb b/spec/models/crop_spec.rb index c7aaa0d77..4d59bdc68 100644 --- a/spec/models/crop_spec.rb +++ b/spec/models/crop_spec.rb @@ -364,7 +364,7 @@ describe Crop do end context "search" do - + let(:mushroom) { FactoryGirl.create(:crop, name: 'mushroom') } before do diff --git a/spec/models/follow_spec.rb b/spec/models/follow_spec.rb index 7bebbc7f3..d0b74b1e6 100644 --- a/spec/models/follow_spec.rb +++ b/spec/models/follow_spec.rb @@ -1,7 +1,7 @@ require 'spec_helper' describe Follow do - + before(:each) do @member1 = FactoryGirl.create(:member) @member2 = FactoryGirl.create(:member) diff --git a/spec/models/garden_spec.rb b/spec/models/garden_spec.rb index 1332e7287..866e9bd7e 100644 --- a/spec/models/garden_spec.rb +++ b/spec/models/garden_spec.rb @@ -37,7 +37,7 @@ describe Garden do end context "featured plantings" do - + let(:tomato) { FactoryGirl.create(:tomato) } let(:maize) { FactoryGirl.create(:maize) } let(:chard) { FactoryGirl.create(:chard) } diff --git a/spec/models/harvest_spec.rb b/spec/models/harvest_spec.rb index 4dbeed752..3933b752a 100644 --- a/spec/models/harvest_spec.rb +++ b/spec/models/harvest_spec.rb @@ -161,7 +161,7 @@ describe Harvest do end it "1 individual apricot" do - @h = FactoryGirl.create(:harvest, crop: crop, + @h = FactoryGirl.create(:harvest, crop: crop, quantity: 1, unit: 'individual', weight_quantity: nil, @@ -171,7 +171,7 @@ describe Harvest do end it "10 individual apricots" do - @h = FactoryGirl.create(:harvest, crop: crop, + @h = FactoryGirl.create(:harvest, crop: crop, quantity: 10, unit: 'individual', weight_quantity: nil, @@ -181,7 +181,7 @@ describe Harvest do end it "1 bushel of apricots" do - @h = FactoryGirl.create(:harvest, crop: crop, + @h = FactoryGirl.create(:harvest, crop: crop, quantity: 1, unit: 'bushel', weight_quantity: nil, @@ -191,7 +191,7 @@ describe Harvest do end it "1.5 bushels of apricots" do - @h = FactoryGirl.create(:harvest, crop: crop, + @h = FactoryGirl.create(:harvest, crop: crop, quantity: 1.5, unit: 'bushel', weight_quantity: nil, @@ -201,7 +201,7 @@ describe Harvest do end it "10 bushels of apricots" do - @h = FactoryGirl.create(:harvest, crop: crop, + @h = FactoryGirl.create(:harvest, crop: crop, quantity: 10, unit: 'bushel', weight_quantity: nil, @@ -211,7 +211,7 @@ describe Harvest do end it "apricots weighing 1.2 kg" do - @h = FactoryGirl.create(:harvest, crop: crop, + @h = FactoryGirl.create(:harvest, crop: crop, quantity: nil, unit: nil, weight_quantity: 1.2, @@ -221,7 +221,7 @@ describe Harvest do end it "10 bushels of apricots weighing 100 kg" do - @h = FactoryGirl.create(:harvest, crop: crop, + @h = FactoryGirl.create(:harvest, crop: crop, quantity: 10, unit: 'bushel', weight_quantity: 100, diff --git a/spec/models/member_spec.rb b/spec/models/member_spec.rb index dfb413df0..8689b4f0e 100644 --- a/spec/models/member_spec.rb +++ b/spec/models/member_spec.rb @@ -380,11 +380,11 @@ describe 'member' do end context 'member who followed another member' do - + let(:member1) { FactoryGirl.create(:member) } let(:member2) { FactoryGirl.create(:member) } - let(:member3) { FactoryGirl.create(:member) } + let(:member3) { FactoryGirl.create(:member) } before do @follow = member1.follows.create(follower_id: member1.id, followed_id: member2.id) diff --git a/spec/models/order_spec.rb b/spec/models/order_spec.rb index 9291e1a3f..0f12d9b2f 100644 --- a/spec/models/order_spec.rb +++ b/spec/models/order_spec.rb @@ -47,7 +47,7 @@ describe Order do @order_item1 = FactoryGirl.create(:order_item, order_id: @order.id, product_id: @product.id, price: 1111, quantity: 1) - @order.total.should eq 1111 + @order.total.should eq 1111 end it "gives the correct total for quantities more than 1" do @@ -61,7 +61,7 @@ describe Order do @order_item1 = FactoryGirl.create(:order_item, order_id: @order.id, product_id: @product.id, price: 1111, quantity: 2) - @order.total.should eq 2222 + @order.total.should eq 2222 end it "formats order items for activemerchant" do diff --git a/spec/models/planting_spec.rb b/spec/models/planting_spec.rb index 3663f8c29..97bfcbe2c 100644 --- a/spec/models/planting_spec.rb +++ b/spec/models/planting_spec.rb @@ -76,7 +76,7 @@ describe Planting do it 'should not be calculated for plantings with an unknown days before maturity' do @planting = FactoryGirl.build(:planting, days_before_maturity: nil) - @planting.percentage_grown.should be nil + @planting.percentage_grown.should be nil end end diff --git a/spec/models/post_spec.rb b/spec/models/post_spec.rb index 8fa53fffe..2c4e7ae95 100644 --- a/spec/models/post_spec.rb +++ b/spec/models/post_spec.rb @@ -70,7 +70,7 @@ describe Post do before do Time.stub(now: Time.now) end - + let(:post) { FactoryGirl.create(:post, created_at: 1.day.ago) } it "sets recent activity to post time" do diff --git a/spec/support/controller_macros.rb b/spec/support/controller_macros.rb index 2e8162705..6860e8ac7 100644 --- a/spec/support/controller_macros.rb +++ b/spec/support/controller_macros.rb @@ -1,7 +1,7 @@ # Taken unashamedly from https://github.com/plataformatec/devise/wiki/How-To%3a-Controllers-and-Views-tests-with-Rails-3-%28and-rspec%29 module ControllerMacros def login_member(member_factory=:member) - + let(:member) { member = FactoryGirl.create(member_factory || :member) } before(:each) do diff --git a/spec/views/account_types/edit.html.haml_spec.rb b/spec/views/account_types/edit.html.haml_spec.rb index f8fa80cc3..6ab88a3b7 100644 --- a/spec/views/account_types/edit.html.haml_spec.rb +++ b/spec/views/account_types/edit.html.haml_spec.rb @@ -1,13 +1,13 @@ ## DEPRECATION NOTICE: Do not add new tests to this file! ## -## View and controller tests are deprecated in the Growstuff project. -## We no longer write new view and controller tests, but instead write -## feature tests (in spec/features) using Capybara (https://github.com/jnicklas/capybara). -## These test the full stack, behaving as a browser, and require less complicated setup -## to run. Please feel free to delete old view/controller tests as they are reimplemented -## in feature tests. +## View and controller tests are deprecated in the Growstuff project +## We no longer write new view and controller tests, but instead write +## feature tests (in spec/features) using Capybara (https://github.com/jnicklas/capybara). +## These test the full stack, behaving as a browser, and require less complicated setup +## to run. Please feel free to delete old view/controller tests as they are reimplemented +## in feature tests. ## -## If you submit a pull request containing new view or controller tests, it will not be +## If you submit a pull request containing new view or controller tests, it will not be ## merged. diff --git a/spec/views/account_types/index.html.haml_spec.rb b/spec/views/account_types/index.html.haml_spec.rb index 76a83d269..fb583fc5d 100644 --- a/spec/views/account_types/index.html.haml_spec.rb +++ b/spec/views/account_types/index.html.haml_spec.rb @@ -1,13 +1,13 @@ ## DEPRECATION NOTICE: Do not add new tests to this file! ## -## View and controller tests are deprecated in the Growstuff project. -## We no longer write new view and controller tests, but instead write -## feature tests (in spec/features) using Capybara (https://github.com/jnicklas/capybara). -## These test the full stack, behaving as a browser, and require less complicated setup -## to run. Please feel free to delete old view/controller tests as they are reimplemented -## in feature tests. +## View and controller tests are deprecated in the Growstuff project +## We no longer write new view and controller tests, but instead write +## feature tests (in spec/features) using Capybara (https://github.com/jnicklas/capybara). +## These test the full stack, behaving as a browser, and require less complicated setup +## to run. Please feel free to delete old view/controller tests as they are reimplemented +## in feature tests. ## -## If you submit a pull request containing new view or controller tests, it will not be +## If you submit a pull request containing new view or controller tests, it will not be ## merged. diff --git a/spec/views/account_types/new.html.haml_spec.rb b/spec/views/account_types/new.html.haml_spec.rb index 8ec9fc1ff..ea3864926 100644 --- a/spec/views/account_types/new.html.haml_spec.rb +++ b/spec/views/account_types/new.html.haml_spec.rb @@ -1,13 +1,13 @@ ## DEPRECATION NOTICE: Do not add new tests to this file! ## -## View and controller tests are deprecated in the Growstuff project. -## We no longer write new view and controller tests, but instead write -## feature tests (in spec/features) using Capybara (https://github.com/jnicklas/capybara). -## These test the full stack, behaving as a browser, and require less complicated setup -## to run. Please feel free to delete old view/controller tests as they are reimplemented -## in feature tests. +## View and controller tests are deprecated in the Growstuff project +## We no longer write new view and controller tests, but instead write +## feature tests (in spec/features) using Capybara (https://github.com/jnicklas/capybara). +## These test the full stack, behaving as a browser, and require less complicated setup +## to run. Please feel free to delete old view/controller tests as they are reimplemented +## in feature tests. ## -## If you submit a pull request containing new view or controller tests, it will not be +## If you submit a pull request containing new view or controller tests, it will not be ## merged. diff --git a/spec/views/account_types/show.html.haml_spec.rb b/spec/views/account_types/show.html.haml_spec.rb index bfbd50243..e04be6b75 100644 --- a/spec/views/account_types/show.html.haml_spec.rb +++ b/spec/views/account_types/show.html.haml_spec.rb @@ -1,13 +1,13 @@ ## DEPRECATION NOTICE: Do not add new tests to this file! ## -## View and controller tests are deprecated in the Growstuff project. -## We no longer write new view and controller tests, but instead write -## feature tests (in spec/features) using Capybara (https://github.com/jnicklas/capybara). -## These test the full stack, behaving as a browser, and require less complicated setup -## to run. Please feel free to delete old view/controller tests as they are reimplemented -## in feature tests. +## View and controller tests are deprecated in the Growstuff project +## We no longer write new view and controller tests, but instead write +## feature tests (in spec/features) using Capybara (https://github.com/jnicklas/capybara). +## These test the full stack, behaving as a browser, and require less complicated setup +## to run. Please feel free to delete old view/controller tests as they are reimplemented +## in feature tests. ## -## If you submit a pull request containing new view or controller tests, it will not be +## If you submit a pull request containing new view or controller tests, it will not be ## merged. diff --git a/spec/views/accounts/edit.html.haml_spec.rb b/spec/views/accounts/edit.html.haml_spec.rb index 2f265658f..bff632495 100644 --- a/spec/views/accounts/edit.html.haml_spec.rb +++ b/spec/views/accounts/edit.html.haml_spec.rb @@ -1,13 +1,13 @@ ## DEPRECATION NOTICE: Do not add new tests to this file! ## -## View and controller tests are deprecated in the Growstuff project. -## We no longer write new view and controller tests, but instead write -## feature tests (in spec/features) using Capybara (https://github.com/jnicklas/capybara). -## These test the full stack, behaving as a browser, and require less complicated setup -## to run. Please feel free to delete old view/controller tests as they are reimplemented -## in feature tests. +## View and controller tests are deprecated in the Growstuff project +## We no longer write new view and controller tests, but instead write +## feature tests (in spec/features) using Capybara (https://github.com/jnicklas/capybara). +## These test the full stack, behaving as a browser, and require less complicated setup +## to run. Please feel free to delete old view/controller tests as they are reimplemented +## in feature tests. ## -## If you submit a pull request containing new view or controller tests, it will not be +## If you submit a pull request containing new view or controller tests, it will not be ## merged. diff --git a/spec/views/accounts/index.html.haml_spec.rb b/spec/views/accounts/index.html.haml_spec.rb index 60b2cf6f6..cde04c48b 100644 --- a/spec/views/accounts/index.html.haml_spec.rb +++ b/spec/views/accounts/index.html.haml_spec.rb @@ -1,13 +1,13 @@ ## DEPRECATION NOTICE: Do not add new tests to this file! ## -## View and controller tests are deprecated in the Growstuff project. -## We no longer write new view and controller tests, but instead write -## feature tests (in spec/features) using Capybara (https://github.com/jnicklas/capybara). -## These test the full stack, behaving as a browser, and require less complicated setup -## to run. Please feel free to delete old view/controller tests as they are reimplemented -## in feature tests. +## View and controller tests are deprecated in the Growstuff project +## We no longer write new view and controller tests, but instead write +## feature tests (in spec/features) using Capybara (https://github.com/jnicklas/capybara). +## These test the full stack, behaving as a browser, and require less complicated setup +## to run. Please feel free to delete old view/controller tests as they are reimplemented +## in feature tests. ## -## If you submit a pull request containing new view or controller tests, it will not be +## If you submit a pull request containing new view or controller tests, it will not be ## merged. diff --git a/spec/views/accounts/new.html.haml_spec.rb b/spec/views/accounts/new.html.haml_spec.rb index f51649226..669017206 100644 --- a/spec/views/accounts/new.html.haml_spec.rb +++ b/spec/views/accounts/new.html.haml_spec.rb @@ -1,13 +1,13 @@ ## DEPRECATION NOTICE: Do not add new tests to this file! ## -## View and controller tests are deprecated in the Growstuff project. -## We no longer write new view and controller tests, but instead write -## feature tests (in spec/features) using Capybara (https://github.com/jnicklas/capybara). -## These test the full stack, behaving as a browser, and require less complicated setup -## to run. Please feel free to delete old view/controller tests as they are reimplemented -## in feature tests. +## View and controller tests are deprecated in the Growstuff project +## We no longer write new view and controller tests, but instead write +## feature tests (in spec/features) using Capybara (https://github.com/jnicklas/capybara). +## These test the full stack, behaving as a browser, and require less complicated setup +## to run. Please feel free to delete old view/controller tests as they are reimplemented +## in feature tests. ## -## If you submit a pull request containing new view or controller tests, it will not be +## If you submit a pull request containing new view or controller tests, it will not be ## merged. diff --git a/spec/views/accounts/show.html.haml_spec.rb b/spec/views/accounts/show.html.haml_spec.rb index 7b4e273d1..e5932cae6 100644 --- a/spec/views/accounts/show.html.haml_spec.rb +++ b/spec/views/accounts/show.html.haml_spec.rb @@ -1,13 +1,13 @@ ## DEPRECATION NOTICE: Do not add new tests to this file! ## -## View and controller tests are deprecated in the Growstuff project. -## We no longer write new view and controller tests, but instead write -## feature tests (in spec/features) using Capybara (https://github.com/jnicklas/capybara). -## These test the full stack, behaving as a browser, and require less complicated setup -## to run. Please feel free to delete old view/controller tests as they are reimplemented -## in feature tests. +## View and controller tests are deprecated in the Growstuff project +## We no longer write new view and controller tests, but instead write +## feature tests (in spec/features) using Capybara (https://github.com/jnicklas/capybara). +## These test the full stack, behaving as a browser, and require less complicated setup +## to run. Please feel free to delete old view/controller tests as they are reimplemented +## in feature tests. ## -## If you submit a pull request containing new view or controller tests, it will not be +## If you submit a pull request containing new view or controller tests, it will not be ## merged. diff --git a/spec/views/admin/index_spec.rb b/spec/views/admin/index_spec.rb index 79ac5d965..981170249 100644 --- a/spec/views/admin/index_spec.rb +++ b/spec/views/admin/index_spec.rb @@ -1,13 +1,13 @@ ## DEPRECATION NOTICE: Do not add new tests to this file! ## -## View and controller tests are deprecated in the Growstuff project. -## We no longer write new view and controller tests, but instead write -## feature tests (in spec/features) using Capybara (https://github.com/jnicklas/capybara). -## These test the full stack, behaving as a browser, and require less complicated setup -## to run. Please feel free to delete old view/controller tests as they are reimplemented -## in feature tests. +## View and controller tests are deprecated in the Growstuff project +## We no longer write new view and controller tests, but instead write +## feature tests (in spec/features) using Capybara (https://github.com/jnicklas/capybara). +## These test the full stack, behaving as a browser, and require less complicated setup +## to run. Please feel free to delete old view/controller tests as they are reimplemented +## in feature tests. ## -## If you submit a pull request containing new view or controller tests, it will not be +## If you submit a pull request containing new view or controller tests, it will not be ## merged. diff --git a/spec/views/admin/newsletter_spec.rb b/spec/views/admin/newsletter_spec.rb index 55f02d0fa..a98e8ef49 100644 --- a/spec/views/admin/newsletter_spec.rb +++ b/spec/views/admin/newsletter_spec.rb @@ -1,13 +1,13 @@ ## DEPRECATION NOTICE: Do not add new tests to this file! ## -## View and controller tests are deprecated in the Growstuff project. -## We no longer write new view and controller tests, but instead write -## feature tests (in spec/features) using Capybara (https://github.com/jnicklas/capybara). -## These test the full stack, behaving as a browser, and require less complicated setup -## to run. Please feel free to delete old view/controller tests as they are reimplemented -## in feature tests. +## View and controller tests are deprecated in the Growstuff project +## We no longer write new view and controller tests, but instead write +## feature tests (in spec/features) using Capybara (https://github.com/jnicklas/capybara). +## These test the full stack, behaving as a browser, and require less complicated setup +## to run. Please feel free to delete old view/controller tests as they are reimplemented +## in feature tests. ## -## If you submit a pull request containing new view or controller tests, it will not be +## If you submit a pull request containing new view or controller tests, it will not be ## merged. diff --git a/spec/views/admin/orders/index_spec.rb b/spec/views/admin/orders/index_spec.rb index 55d55773d..fa354a583 100644 --- a/spec/views/admin/orders/index_spec.rb +++ b/spec/views/admin/orders/index_spec.rb @@ -1,13 +1,13 @@ ## DEPRECATION NOTICE: Do not add new tests to this file! ## -## View and controller tests are deprecated in the Growstuff project. -## We no longer write new view and controller tests, but instead write -## feature tests (in spec/features) using Capybara (https://github.com/jnicklas/capybara). -## These test the full stack, behaving as a browser, and require less complicated setup -## to run. Please feel free to delete old view/controller tests as they are reimplemented -## in feature tests. +## View and controller tests are deprecated in the Growstuff project +## We no longer write new view and controller tests, but instead write +## feature tests (in spec/features) using Capybara (https://github.com/jnicklas/capybara). +## These test the full stack, behaving as a browser, and require less complicated setup +## to run. Please feel free to delete old view/controller tests as they are reimplemented +## in feature tests. ## -## If you submit a pull request containing new view or controller tests, it will not be +## If you submit a pull request containing new view or controller tests, it will not be ## merged. diff --git a/spec/views/comments/edit.html.haml_spec.rb b/spec/views/comments/edit.html.haml_spec.rb index d6e7ccb2a..167168271 100644 --- a/spec/views/comments/edit.html.haml_spec.rb +++ b/spec/views/comments/edit.html.haml_spec.rb @@ -1,13 +1,13 @@ ## DEPRECATION NOTICE: Do not add new tests to this file! ## -## View and controller tests are deprecated in the Growstuff project. -## We no longer write new view and controller tests, but instead write -## feature tests (in spec/features) using Capybara (https://github.com/jnicklas/capybara). -## These test the full stack, behaving as a browser, and require less complicated setup -## to run. Please feel free to delete old view/controller tests as they are reimplemented -## in feature tests. +## View and controller tests are deprecated in the Growstuff project +## We no longer write new view and controller tests, but instead write +## feature tests (in spec/features) using Capybara (https://github.com/jnicklas/capybara). +## These test the full stack, behaving as a browser, and require less complicated setup +## to run. Please feel free to delete old view/controller tests as they are reimplemented +## in feature tests. ## -## If you submit a pull request containing new view or controller tests, it will not be +## If you submit a pull request containing new view or controller tests, it will not be ## merged. diff --git a/spec/views/comments/index.html.haml_spec.rb b/spec/views/comments/index.html.haml_spec.rb index 4b8cbf72f..e0eb907cc 100644 --- a/spec/views/comments/index.html.haml_spec.rb +++ b/spec/views/comments/index.html.haml_spec.rb @@ -1,13 +1,13 @@ ## DEPRECATION NOTICE: Do not add new tests to this file! ## -## View and controller tests are deprecated in the Growstuff project. -## We no longer write new view and controller tests, but instead write -## feature tests (in spec/features) using Capybara (https://github.com/jnicklas/capybara). -## These test the full stack, behaving as a browser, and require less complicated setup -## to run. Please feel free to delete old view/controller tests as they are reimplemented -## in feature tests. +## View and controller tests are deprecated in the Growstuff project +## We no longer write new view and controller tests, but instead write +## feature tests (in spec/features) using Capybara (https://github.com/jnicklas/capybara). +## These test the full stack, behaving as a browser, and require less complicated setup +## to run. Please feel free to delete old view/controller tests as they are reimplemented +## in feature tests. ## -## If you submit a pull request containing new view or controller tests, it will not be +## If you submit a pull request containing new view or controller tests, it will not be ## merged. diff --git a/spec/views/comments/index.rss.haml_spec.rb b/spec/views/comments/index.rss.haml_spec.rb index 9c61e9f2d..f2fe2c4d9 100644 --- a/spec/views/comments/index.rss.haml_spec.rb +++ b/spec/views/comments/index.rss.haml_spec.rb @@ -1,13 +1,13 @@ ## DEPRECATION NOTICE: Do not add new tests to this file! ## -## View and controller tests are deprecated in the Growstuff project. -## We no longer write new view and controller tests, but instead write -## feature tests (in spec/features) using Capybara (https://github.com/jnicklas/capybara). -## These test the full stack, behaving as a browser, and require less complicated setup -## to run. Please feel free to delete old view/controller tests as they are reimplemented -## in feature tests. +## View and controller tests are deprecated in the Growstuff project +## We no longer write new view and controller tests, but instead write +## feature tests (in spec/features) using Capybara (https://github.com/jnicklas/capybara). +## These test the full stack, behaving as a browser, and require less complicated setup +## to run. Please feel free to delete old view/controller tests as they are reimplemented +## in feature tests. ## -## If you submit a pull request containing new view or controller tests, it will not be +## If you submit a pull request containing new view or controller tests, it will not be ## merged. diff --git a/spec/views/comments/new.html.haml_spec.rb b/spec/views/comments/new.html.haml_spec.rb index d86d304cf..a33eed8ae 100644 --- a/spec/views/comments/new.html.haml_spec.rb +++ b/spec/views/comments/new.html.haml_spec.rb @@ -1,13 +1,13 @@ ## DEPRECATION NOTICE: Do not add new tests to this file! ## -## View and controller tests are deprecated in the Growstuff project. -## We no longer write new view and controller tests, but instead write -## feature tests (in spec/features) using Capybara (https://github.com/jnicklas/capybara). -## These test the full stack, behaving as a browser, and require less complicated setup -## to run. Please feel free to delete old view/controller tests as they are reimplemented -## in feature tests. +## View and controller tests are deprecated in the Growstuff project +## We no longer write new view and controller tests, but instead write +## feature tests (in spec/features) using Capybara (https://github.com/jnicklas/capybara). +## These test the full stack, behaving as a browser, and require less complicated setup +## to run. Please feel free to delete old view/controller tests as they are reimplemented +## in feature tests. ## -## If you submit a pull request containing new view or controller tests, it will not be +## If you submit a pull request containing new view or controller tests, it will not be ## merged. diff --git a/spec/views/comments/show.html.haml_spec.rb b/spec/views/comments/show.html.haml_spec.rb index 80b59d33d..f69a635d3 100644 --- a/spec/views/comments/show.html.haml_spec.rb +++ b/spec/views/comments/show.html.haml_spec.rb @@ -1,13 +1,13 @@ ## DEPRECATION NOTICE: Do not add new tests to this file! ## -## View and controller tests are deprecated in the Growstuff project. -## We no longer write new view and controller tests, but instead write -## feature tests (in spec/features) using Capybara (https://github.com/jnicklas/capybara). -## These test the full stack, behaving as a browser, and require less complicated setup -## to run. Please feel free to delete old view/controller tests as they are reimplemented -## in feature tests. +## View and controller tests are deprecated in the Growstuff project +## We no longer write new view and controller tests, but instead write +## feature tests (in spec/features) using Capybara (https://github.com/jnicklas/capybara). +## These test the full stack, behaving as a browser, and require less complicated setup +## to run. Please feel free to delete old view/controller tests as they are reimplemented +## in feature tests. ## -## If you submit a pull request containing new view or controller tests, it will not be +## If you submit a pull request containing new view or controller tests, it will not be ## merged. diff --git a/spec/views/crops/_grown_for.html.haml_spec.rb b/spec/views/crops/_grown_for.html.haml_spec.rb index 10a36aff9..81009b7e5 100644 --- a/spec/views/crops/_grown_for.html.haml_spec.rb +++ b/spec/views/crops/_grown_for.html.haml_spec.rb @@ -1,13 +1,13 @@ ## DEPRECATION NOTICE: Do not add new tests to this file! ## -## View and controller tests are deprecated in the Growstuff project. -## We no longer write new view and controller tests, but instead write -## feature tests (in spec/features) using Capybara (https://github.com/jnicklas/capybara). -## These test the full stack, behaving as a browser, and require less complicated setup -## to run. Please feel free to delete old view/controller tests as they are reimplemented -## in feature tests. +## View and controller tests are deprecated in the Growstuff project +## We no longer write new view and controller tests, but instead write +## feature tests (in spec/features) using Capybara (https://github.com/jnicklas/capybara). +## These test the full stack, behaving as a browser, and require less complicated setup +## to run. Please feel free to delete old view/controller tests as they are reimplemented +## in feature tests. ## -## If you submit a pull request containing new view or controller tests, it will not be +## If you submit a pull request containing new view or controller tests, it will not be ## merged. diff --git a/spec/views/crops/_planting_advice.html.haml_spec.rb b/spec/views/crops/_planting_advice.html.haml_spec.rb index 77e7e1b38..2abed9015 100644 --- a/spec/views/crops/_planting_advice.html.haml_spec.rb +++ b/spec/views/crops/_planting_advice.html.haml_spec.rb @@ -1,13 +1,13 @@ ## DEPRECATION NOTICE: Do not add new tests to this file! ## -## View and controller tests are deprecated in the Growstuff project. -## We no longer write new view and controller tests, but instead write -## feature tests (in spec/features) using Capybara (https://github.com/jnicklas/capybara). -## These test the full stack, behaving as a browser, and require less complicated setup -## to run. Please feel free to delete old view/controller tests as they are reimplemented -## in feature tests. +## View and controller tests are deprecated in the Growstuff project +## We no longer write new view and controller tests, but instead write +## feature tests (in spec/features) using Capybara (https://github.com/jnicklas/capybara). +## These test the full stack, behaving as a browser, and require less complicated setup +## to run. Please feel free to delete old view/controller tests as they are reimplemented +## in feature tests. ## -## If you submit a pull request containing new view or controller tests, it will not be +## If you submit a pull request containing new view or controller tests, it will not be ## merged. diff --git a/spec/views/crops/_popover.html.haml_spec.rb b/spec/views/crops/_popover.html.haml_spec.rb index 3ef9660f6..bad5008a1 100644 --- a/spec/views/crops/_popover.html.haml_spec.rb +++ b/spec/views/crops/_popover.html.haml_spec.rb @@ -1,13 +1,13 @@ ## DEPRECATION NOTICE: Do not add new tests to this file! ## -## View and controller tests are deprecated in the Growstuff project. -## We no longer write new view and controller tests, but instead write -## feature tests (in spec/features) using Capybara (https://github.com/jnicklas/capybara). -## These test the full stack, behaving as a browser, and require less complicated setup -## to run. Please feel free to delete old view/controller tests as they are reimplemented -## in feature tests. +## View and controller tests are deprecated in the Growstuff project +## We no longer write new view and controller tests, but instead write +## feature tests (in spec/features) using Capybara (https://github.com/jnicklas/capybara). +## These test the full stack, behaving as a browser, and require less complicated setup +## to run. Please feel free to delete old view/controller tests as they are reimplemented +## in feature tests. ## -## If you submit a pull request containing new view or controller tests, it will not be +## If you submit a pull request containing new view or controller tests, it will not be ## merged. diff --git a/spec/views/crops/edit.html.haml_spec.rb b/spec/views/crops/edit.html.haml_spec.rb index 98957fc85..464041a66 100644 --- a/spec/views/crops/edit.html.haml_spec.rb +++ b/spec/views/crops/edit.html.haml_spec.rb @@ -1,13 +1,13 @@ ## DEPRECATION NOTICE: Do not add new tests to this file! ## -## View and controller tests are deprecated in the Growstuff project. -## We no longer write new view and controller tests, but instead write -## feature tests (in spec/features) using Capybara (https://github.com/jnicklas/capybara). -## These test the full stack, behaving as a browser, and require less complicated setup -## to run. Please feel free to delete old view/controller tests as they are reimplemented -## in feature tests. +## View and controller tests are deprecated in the Growstuff project +## We no longer write new view and controller tests, but instead write +## feature tests (in spec/features) using Capybara (https://github.com/jnicklas/capybara). +## These test the full stack, behaving as a browser, and require less complicated setup +## to run. Please feel free to delete old view/controller tests as they are reimplemented +## in feature tests. ## -## If you submit a pull request containing new view or controller tests, it will not be +## If you submit a pull request containing new view or controller tests, it will not be ## merged. diff --git a/spec/views/crops/hierarchy.html.haml_spec.rb b/spec/views/crops/hierarchy.html.haml_spec.rb index 32bfc4248..076d13b64 100644 --- a/spec/views/crops/hierarchy.html.haml_spec.rb +++ b/spec/views/crops/hierarchy.html.haml_spec.rb @@ -1,13 +1,13 @@ ## DEPRECATION NOTICE: Do not add new tests to this file! ## -## View and controller tests are deprecated in the Growstuff project. -## We no longer write new view and controller tests, but instead write -## feature tests (in spec/features) using Capybara (https://github.com/jnicklas/capybara). -## These test the full stack, behaving as a browser, and require less complicated setup -## to run. Please feel free to delete old view/controller tests as they are reimplemented -## in feature tests. +## View and controller tests are deprecated in the Growstuff project +## We no longer write new view and controller tests, but instead write +## feature tests (in spec/features) using Capybara (https://github.com/jnicklas/capybara). +## These test the full stack, behaving as a browser, and require less complicated setup +## to run. Please feel free to delete old view/controller tests as they are reimplemented +## in feature tests. ## -## If you submit a pull request containing new view or controller tests, it will not be +## If you submit a pull request containing new view or controller tests, it will not be ## merged. diff --git a/spec/views/crops/index.html.haml_spec.rb b/spec/views/crops/index.html.haml_spec.rb index 0a779241d..6db358f54 100644 --- a/spec/views/crops/index.html.haml_spec.rb +++ b/spec/views/crops/index.html.haml_spec.rb @@ -1,13 +1,13 @@ ## DEPRECATION NOTICE: Do not add new tests to this file! ## -## View and controller tests are deprecated in the Growstuff project. -## We no longer write new view and controller tests, but instead write -## feature tests (in spec/features) using Capybara (https://github.com/jnicklas/capybara). -## These test the full stack, behaving as a browser, and require less complicated setup -## to run. Please feel free to delete old view/controller tests as they are reimplemented -## in feature tests. +## View and controller tests are deprecated in the Growstuff project +## We no longer write new view and controller tests, but instead write +## feature tests (in spec/features) using Capybara (https://github.com/jnicklas/capybara). +## These test the full stack, behaving as a browser, and require less complicated setup +## to run. Please feel free to delete old view/controller tests as they are reimplemented +## in feature tests. ## -## If you submit a pull request containing new view or controller tests, it will not be +## If you submit a pull request containing new view or controller tests, it will not be ## merged. diff --git a/spec/views/crops/index.rss.haml_spec.rb b/spec/views/crops/index.rss.haml_spec.rb index b07eab95a..d7b139b7f 100644 --- a/spec/views/crops/index.rss.haml_spec.rb +++ b/spec/views/crops/index.rss.haml_spec.rb @@ -1,13 +1,13 @@ ## DEPRECATION NOTICE: Do not add new tests to this file! ## -## View and controller tests are deprecated in the Growstuff project. -## We no longer write new view and controller tests, but instead write -## feature tests (in spec/features) using Capybara (https://github.com/jnicklas/capybara). -## These test the full stack, behaving as a browser, and require less complicated setup -## to run. Please feel free to delete old view/controller tests as they are reimplemented -## in feature tests. +## View and controller tests are deprecated in the Growstuff project +## We no longer write new view and controller tests, but instead write +## feature tests (in spec/features) using Capybara (https://github.com/jnicklas/capybara). +## These test the full stack, behaving as a browser, and require less complicated setup +## to run. Please feel free to delete old view/controller tests as they are reimplemented +## in feature tests. ## -## If you submit a pull request containing new view or controller tests, it will not be +## If you submit a pull request containing new view or controller tests, it will not be ## merged. diff --git a/spec/views/crops/new.html.haml_spec.rb b/spec/views/crops/new.html.haml_spec.rb index 8b5484235..0b01ae76a 100644 --- a/spec/views/crops/new.html.haml_spec.rb +++ b/spec/views/crops/new.html.haml_spec.rb @@ -1,13 +1,13 @@ ## DEPRECATION NOTICE: Do not add new tests to this file! ## -## View and controller tests are deprecated in the Growstuff project. -## We no longer write new view and controller tests, but instead write -## feature tests (in spec/features) using Capybara (https://github.com/jnicklas/capybara). -## These test the full stack, behaving as a browser, and require less complicated setup -## to run. Please feel free to delete old view/controller tests as they are reimplemented -## in feature tests. +## View and controller tests are deprecated in the Growstuff project +## We no longer write new view and controller tests, but instead write +## feature tests (in spec/features) using Capybara (https://github.com/jnicklas/capybara). +## These test the full stack, behaving as a browser, and require less complicated setup +## to run. Please feel free to delete old view/controller tests as they are reimplemented +## in feature tests. ## -## If you submit a pull request containing new view or controller tests, it will not be +## If you submit a pull request containing new view or controller tests, it will not be ## merged. diff --git a/spec/views/crops/wrangle.html.haml_spec.rb b/spec/views/crops/wrangle.html.haml_spec.rb index e4f41b8c8..a8e7612b6 100644 --- a/spec/views/crops/wrangle.html.haml_spec.rb +++ b/spec/views/crops/wrangle.html.haml_spec.rb @@ -1,13 +1,13 @@ ## DEPRECATION NOTICE: Do not add new tests to this file! ## -## View and controller tests are deprecated in the Growstuff project. -## We no longer write new view and controller tests, but instead write -## feature tests (in spec/features) using Capybara (https://github.com/jnicklas/capybara). -## These test the full stack, behaving as a browser, and require less complicated setup -## to run. Please feel free to delete old view/controller tests as they are reimplemented -## in feature tests. +## View and controller tests are deprecated in the Growstuff project +## We no longer write new view and controller tests, but instead write +## feature tests (in spec/features) using Capybara (https://github.com/jnicklas/capybara). +## These test the full stack, behaving as a browser, and require less complicated setup +## to run. Please feel free to delete old view/controller tests as they are reimplemented +## in feature tests. ## -## If you submit a pull request containing new view or controller tests, it will not be +## If you submit a pull request containing new view or controller tests, it will not be ## merged. diff --git a/spec/views/devise/mailer/confirmation_instructions_spec.rb b/spec/views/devise/mailer/confirmation_instructions_spec.rb index 6f60268e4..0ed226dc2 100644 --- a/spec/views/devise/mailer/confirmation_instructions_spec.rb +++ b/spec/views/devise/mailer/confirmation_instructions_spec.rb @@ -1,13 +1,13 @@ ## DEPRECATION NOTICE: Do not add new tests to this file! ## -## View and controller tests are deprecated in the Growstuff project. -## We no longer write new view and controller tests, but instead write -## feature tests (in spec/features) using Capybara (https://github.com/jnicklas/capybara). -## These test the full stack, behaving as a browser, and require less complicated setup -## to run. Please feel free to delete old view/controller tests as they are reimplemented -## in feature tests. +## View and controller tests are deprecated in the Growstuff project +## We no longer write new view and controller tests, but instead write +## feature tests (in spec/features) using Capybara (https://github.com/jnicklas/capybara). +## These test the full stack, behaving as a browser, and require less complicated setup +## to run. Please feel free to delete old view/controller tests as they are reimplemented +## in feature tests. ## -## If you submit a pull request containing new view or controller tests, it will not be +## If you submit a pull request containing new view or controller tests, it will not be ## merged. diff --git a/spec/views/devise/mailer/reset_password_instructions_spec.rb b/spec/views/devise/mailer/reset_password_instructions_spec.rb index 91c46a696..332f9a106 100644 --- a/spec/views/devise/mailer/reset_password_instructions_spec.rb +++ b/spec/views/devise/mailer/reset_password_instructions_spec.rb @@ -1,13 +1,13 @@ ## DEPRECATION NOTICE: Do not add new tests to this file! ## -## View and controller tests are deprecated in the Growstuff project. -## We no longer write new view and controller tests, but instead write -## feature tests (in spec/features) using Capybara (https://github.com/jnicklas/capybara). -## These test the full stack, behaving as a browser, and require less complicated setup -## to run. Please feel free to delete old view/controller tests as they are reimplemented -## in feature tests. +## View and controller tests are deprecated in the Growstuff project +## We no longer write new view and controller tests, but instead write +## feature tests (in spec/features) using Capybara (https://github.com/jnicklas/capybara). +## These test the full stack, behaving as a browser, and require less complicated setup +## to run. Please feel free to delete old view/controller tests as they are reimplemented +## in feature tests. ## -## If you submit a pull request containing new view or controller tests, it will not be +## If you submit a pull request containing new view or controller tests, it will not be ## merged. diff --git a/spec/views/devise/mailer/unlock_instructions_spec.rb b/spec/views/devise/mailer/unlock_instructions_spec.rb index 5c90260c5..ce4cd10a8 100644 --- a/spec/views/devise/mailer/unlock_instructions_spec.rb +++ b/spec/views/devise/mailer/unlock_instructions_spec.rb @@ -1,13 +1,13 @@ ## DEPRECATION NOTICE: Do not add new tests to this file! ## -## View and controller tests are deprecated in the Growstuff project. -## We no longer write new view and controller tests, but instead write -## feature tests (in spec/features) using Capybara (https://github.com/jnicklas/capybara). -## These test the full stack, behaving as a browser, and require less complicated setup -## to run. Please feel free to delete old view/controller tests as they are reimplemented -## in feature tests. +## View and controller tests are deprecated in the Growstuff project +## We no longer write new view and controller tests, but instead write +## feature tests (in spec/features) using Capybara (https://github.com/jnicklas/capybara). +## These test the full stack, behaving as a browser, and require less complicated setup +## to run. Please feel free to delete old view/controller tests as they are reimplemented +## in feature tests. ## -## If you submit a pull request containing new view or controller tests, it will not be +## If you submit a pull request containing new view or controller tests, it will not be ## merged. diff --git a/spec/views/devise/registrations/edit_spec.rb b/spec/views/devise/registrations/edit_spec.rb index 8fb096255..311b6bb15 100644 --- a/spec/views/devise/registrations/edit_spec.rb +++ b/spec/views/devise/registrations/edit_spec.rb @@ -1,13 +1,13 @@ ## DEPRECATION NOTICE: Do not add new tests to this file! ## -## View and controller tests are deprecated in the Growstuff project. -## We no longer write new view and controller tests, but instead write -## feature tests (in spec/features) using Capybara (https://github.com/jnicklas/capybara). -## These test the full stack, behaving as a browser, and require less complicated setup -## to run. Please feel free to delete old view/controller tests as they are reimplemented -## in feature tests. +## View and controller tests are deprecated in the Growstuff project +## We no longer write new view and controller tests, but instead write +## feature tests (in spec/features) using Capybara (https://github.com/jnicklas/capybara). +## These test the full stack, behaving as a browser, and require less complicated setup +## to run. Please feel free to delete old view/controller tests as they are reimplemented +## in feature tests. ## -## If you submit a pull request containing new view or controller tests, it will not be +## If you submit a pull request containing new view or controller tests, it will not be ## merged. diff --git a/spec/views/devise/registrations/new_spec.rb b/spec/views/devise/registrations/new_spec.rb index 5d6d8ac5a..994a702d1 100644 --- a/spec/views/devise/registrations/new_spec.rb +++ b/spec/views/devise/registrations/new_spec.rb @@ -1,13 +1,13 @@ ## DEPRECATION NOTICE: Do not add new tests to this file! ## -## View and controller tests are deprecated in the Growstuff project. -## We no longer write new view and controller tests, but instead write -## feature tests (in spec/features) using Capybara (https://github.com/jnicklas/capybara). -## These test the full stack, behaving as a browser, and require less complicated setup -## to run. Please feel free to delete old view/controller tests as they are reimplemented -## in feature tests. +## View and controller tests are deprecated in the Growstuff project +## We no longer write new view and controller tests, but instead write +## feature tests (in spec/features) using Capybara (https://github.com/jnicklas/capybara). +## These test the full stack, behaving as a browser, and require less complicated setup +## to run. Please feel free to delete old view/controller tests as they are reimplemented +## in feature tests. ## -## If you submit a pull request containing new view or controller tests, it will not be +## If you submit a pull request containing new view or controller tests, it will not be ## merged. diff --git a/spec/views/devise/sessions/new_spec.rb b/spec/views/devise/sessions/new_spec.rb index 674e92978..3685b21a9 100644 --- a/spec/views/devise/sessions/new_spec.rb +++ b/spec/views/devise/sessions/new_spec.rb @@ -1,13 +1,13 @@ ## DEPRECATION NOTICE: Do not add new tests to this file! ## -## View and controller tests are deprecated in the Growstuff project. -## We no longer write new view and controller tests, but instead write -## feature tests (in spec/features) using Capybara (https://github.com/jnicklas/capybara). -## These test the full stack, behaving as a browser, and require less complicated setup -## to run. Please feel free to delete old view/controller tests as they are reimplemented -## in feature tests. +## View and controller tests are deprecated in the Growstuff project +## We no longer write new view and controller tests, but instead write +## feature tests (in spec/features) using Capybara (https://github.com/jnicklas/capybara). +## These test the full stack, behaving as a browser, and require less complicated setup +## to run. Please feel free to delete old view/controller tests as they are reimplemented +## in feature tests. ## -## If you submit a pull request containing new view or controller tests, it will not be +## If you submit a pull request containing new view or controller tests, it will not be ## merged. diff --git a/spec/views/devise/unlocks/new_spec.rb b/spec/views/devise/unlocks/new_spec.rb index e145900e4..01140c9bb 100644 --- a/spec/views/devise/unlocks/new_spec.rb +++ b/spec/views/devise/unlocks/new_spec.rb @@ -1,13 +1,13 @@ ## DEPRECATION NOTICE: Do not add new tests to this file! ## -## View and controller tests are deprecated in the Growstuff project. -## We no longer write new view and controller tests, but instead write -## feature tests (in spec/features) using Capybara (https://github.com/jnicklas/capybara). -## These test the full stack, behaving as a browser, and require less complicated setup -## to run. Please feel free to delete old view/controller tests as they are reimplemented -## in feature tests. +## View and controller tests are deprecated in the Growstuff project +## We no longer write new view and controller tests, but instead write +## feature tests (in spec/features) using Capybara (https://github.com/jnicklas/capybara). +## These test the full stack, behaving as a browser, and require less complicated setup +## to run. Please feel free to delete old view/controller tests as they are reimplemented +## in feature tests. ## -## If you submit a pull request containing new view or controller tests, it will not be +## If you submit a pull request containing new view or controller tests, it will not be ## merged. diff --git a/spec/views/forums/edit.html.haml_spec.rb b/spec/views/forums/edit.html.haml_spec.rb index e3c874519..c068ef295 100644 --- a/spec/views/forums/edit.html.haml_spec.rb +++ b/spec/views/forums/edit.html.haml_spec.rb @@ -1,13 +1,13 @@ ## DEPRECATION NOTICE: Do not add new tests to this file! ## -## View and controller tests are deprecated in the Growstuff project. -## We no longer write new view and controller tests, but instead write -## feature tests (in spec/features) using Capybara (https://github.com/jnicklas/capybara). -## These test the full stack, behaving as a browser, and require less complicated setup -## to run. Please feel free to delete old view/controller tests as they are reimplemented -## in feature tests. +## View and controller tests are deprecated in the Growstuff project +## We no longer write new view and controller tests, but instead write +## feature tests (in spec/features) using Capybara (https://github.com/jnicklas/capybara). +## These test the full stack, behaving as a browser, and require less complicated setup +## to run. Please feel free to delete old view/controller tests as they are reimplemented +## in feature tests. ## -## If you submit a pull request containing new view or controller tests, it will not be +## If you submit a pull request containing new view or controller tests, it will not be ## merged. diff --git a/spec/views/forums/index.html.haml_spec.rb b/spec/views/forums/index.html.haml_spec.rb index dc1bdba58..470781a4f 100644 --- a/spec/views/forums/index.html.haml_spec.rb +++ b/spec/views/forums/index.html.haml_spec.rb @@ -1,13 +1,13 @@ ## DEPRECATION NOTICE: Do not add new tests to this file! ## -## View and controller tests are deprecated in the Growstuff project. -## We no longer write new view and controller tests, but instead write -## feature tests (in spec/features) using Capybara (https://github.com/jnicklas/capybara). -## These test the full stack, behaving as a browser, and require less complicated setup -## to run. Please feel free to delete old view/controller tests as they are reimplemented -## in feature tests. +## View and controller tests are deprecated in the Growstuff project +## We no longer write new view and controller tests, but instead write +## feature tests (in spec/features) using Capybara (https://github.com/jnicklas/capybara). +## These test the full stack, behaving as a browser, and require less complicated setup +## to run. Please feel free to delete old view/controller tests as they are reimplemented +## in feature tests. ## -## If you submit a pull request containing new view or controller tests, it will not be +## If you submit a pull request containing new view or controller tests, it will not be ## merged. diff --git a/spec/views/forums/new.html.haml_spec.rb b/spec/views/forums/new.html.haml_spec.rb index 59988ae90..b9a8abcb2 100644 --- a/spec/views/forums/new.html.haml_spec.rb +++ b/spec/views/forums/new.html.haml_spec.rb @@ -1,13 +1,13 @@ ## DEPRECATION NOTICE: Do not add new tests to this file! ## -## View and controller tests are deprecated in the Growstuff project. -## We no longer write new view and controller tests, but instead write -## feature tests (in spec/features) using Capybara (https://github.com/jnicklas/capybara). -## These test the full stack, behaving as a browser, and require less complicated setup -## to run. Please feel free to delete old view/controller tests as they are reimplemented -## in feature tests. +## View and controller tests are deprecated in the Growstuff project +## We no longer write new view and controller tests, but instead write +## feature tests (in spec/features) using Capybara (https://github.com/jnicklas/capybara). +## These test the full stack, behaving as a browser, and require less complicated setup +## to run. Please feel free to delete old view/controller tests as they are reimplemented +## in feature tests. ## -## If you submit a pull request containing new view or controller tests, it will not be +## If you submit a pull request containing new view or controller tests, it will not be ## merged. diff --git a/spec/views/forums/show.html.haml_spec.rb b/spec/views/forums/show.html.haml_spec.rb index 77ed26382..3b2d41783 100644 --- a/spec/views/forums/show.html.haml_spec.rb +++ b/spec/views/forums/show.html.haml_spec.rb @@ -1,13 +1,13 @@ ## DEPRECATION NOTICE: Do not add new tests to this file! ## -## View and controller tests are deprecated in the Growstuff project. -## We no longer write new view and controller tests, but instead write -## feature tests (in spec/features) using Capybara (https://github.com/jnicklas/capybara). -## These test the full stack, behaving as a browser, and require less complicated setup -## to run. Please feel free to delete old view/controller tests as they are reimplemented -## in feature tests. +## View and controller tests are deprecated in the Growstuff project +## We no longer write new view and controller tests, but instead write +## feature tests (in spec/features) using Capybara (https://github.com/jnicklas/capybara). +## These test the full stack, behaving as a browser, and require less complicated setup +## to run. Please feel free to delete old view/controller tests as they are reimplemented +## in feature tests. ## -## If you submit a pull request containing new view or controller tests, it will not be +## If you submit a pull request containing new view or controller tests, it will not be ## merged. diff --git a/spec/views/gardens/edit.html.haml_spec.rb b/spec/views/gardens/edit.html.haml_spec.rb index 959600d77..340feaeef 100644 --- a/spec/views/gardens/edit.html.haml_spec.rb +++ b/spec/views/gardens/edit.html.haml_spec.rb @@ -1,13 +1,13 @@ ## DEPRECATION NOTICE: Do not add new tests to this file! ## -## View and controller tests are deprecated in the Growstuff project. -## We no longer write new view and controller tests, but instead write -## feature tests (in spec/features) using Capybara (https://github.com/jnicklas/capybara). -## These test the full stack, behaving as a browser, and require less complicated setup -## to run. Please feel free to delete old view/controller tests as they are reimplemented -## in feature tests. +## View and controller tests are deprecated in the Growstuff project +## We no longer write new view and controller tests, but instead write +## feature tests (in spec/features) using Capybara (https://github.com/jnicklas/capybara). +## These test the full stack, behaving as a browser, and require less complicated setup +## to run. Please feel free to delete old view/controller tests as they are reimplemented +## in feature tests. ## -## If you submit a pull request containing new view or controller tests, it will not be +## If you submit a pull request containing new view or controller tests, it will not be ## merged. diff --git a/spec/views/gardens/new.html.haml_spec.rb b/spec/views/gardens/new.html.haml_spec.rb index 84b689eb0..58bd6a335 100644 --- a/spec/views/gardens/new.html.haml_spec.rb +++ b/spec/views/gardens/new.html.haml_spec.rb @@ -1,13 +1,13 @@ ## DEPRECATION NOTICE: Do not add new tests to this file! ## -## View and controller tests are deprecated in the Growstuff project. -## We no longer write new view and controller tests, but instead write -## feature tests (in spec/features) using Capybara (https://github.com/jnicklas/capybara). -## These test the full stack, behaving as a browser, and require less complicated setup -## to run. Please feel free to delete old view/controller tests as they are reimplemented -## in feature tests. +## View and controller tests are deprecated in the Growstuff project +## We no longer write new view and controller tests, but instead write +## feature tests (in spec/features) using Capybara (https://github.com/jnicklas/capybara). +## These test the full stack, behaving as a browser, and require less complicated setup +## to run. Please feel free to delete old view/controller tests as they are reimplemented +## in feature tests. ## -## If you submit a pull request containing new view or controller tests, it will not be +## If you submit a pull request containing new view or controller tests, it will not be ## merged. diff --git a/spec/views/gardens/show.html.haml_spec.rb b/spec/views/gardens/show.html.haml_spec.rb index dff7ebefa..b122abfd4 100644 --- a/spec/views/gardens/show.html.haml_spec.rb +++ b/spec/views/gardens/show.html.haml_spec.rb @@ -1,13 +1,13 @@ ## DEPRECATION NOTICE: Do not add new tests to this file! ## -## View and controller tests are deprecated in the Growstuff project. -## We no longer write new view and controller tests, but instead write -## feature tests (in spec/features) using Capybara (https://github.com/jnicklas/capybara). -## These test the full stack, behaving as a browser, and require less complicated setup -## to run. Please feel free to delete old view/controller tests as they are reimplemented -## in feature tests. +## View and controller tests are deprecated in the Growstuff project +## We no longer write new view and controller tests, but instead write +## feature tests (in spec/features) using Capybara (https://github.com/jnicklas/capybara). +## These test the full stack, behaving as a browser, and require less complicated setup +## to run. Please feel free to delete old view/controller tests as they are reimplemented +## in feature tests. ## -## If you submit a pull request containing new view or controller tests, it will not be +## If you submit a pull request containing new view or controller tests, it will not be ## merged. diff --git a/spec/views/harvests/edit.html.haml_spec.rb b/spec/views/harvests/edit.html.haml_spec.rb index f318e3a79..265925dd1 100644 --- a/spec/views/harvests/edit.html.haml_spec.rb +++ b/spec/views/harvests/edit.html.haml_spec.rb @@ -1,13 +1,13 @@ ## DEPRECATION NOTICE: Do not add new tests to this file! ## -## View and controller tests are deprecated in the Growstuff project. -## We no longer write new view and controller tests, but instead write -## feature tests (in spec/features) using Capybara (https://github.com/jnicklas/capybara). -## These test the full stack, behaving as a browser, and require less complicated setup -## to run. Please feel free to delete old view/controller tests as they are reimplemented -## in feature tests. +## View and controller tests are deprecated in the Growstuff project +## We no longer write new view and controller tests, but instead write +## feature tests (in spec/features) using Capybara (https://github.com/jnicklas/capybara). +## These test the full stack, behaving as a browser, and require less complicated setup +## to run. Please feel free to delete old view/controller tests as they are reimplemented +## in feature tests. ## -## If you submit a pull request containing new view or controller tests, it will not be +## If you submit a pull request containing new view or controller tests, it will not be ## merged. diff --git a/spec/views/harvests/index.html.haml_spec.rb b/spec/views/harvests/index.html.haml_spec.rb index 923b3fb39..0e86f9782 100644 --- a/spec/views/harvests/index.html.haml_spec.rb +++ b/spec/views/harvests/index.html.haml_spec.rb @@ -1,13 +1,13 @@ ## DEPRECATION NOTICE: Do not add new tests to this file! ## -## View and controller tests are deprecated in the Growstuff project. -## We no longer write new view and controller tests, but instead write -## feature tests (in spec/features) using Capybara (https://github.com/jnicklas/capybara). -## These test the full stack, behaving as a browser, and require less complicated setup -## to run. Please feel free to delete old view/controller tests as they are reimplemented -## in feature tests. +## View and controller tests are deprecated in the Growstuff project +## We no longer write new view and controller tests, but instead write +## feature tests (in spec/features) using Capybara (https://github.com/jnicklas/capybara). +## These test the full stack, behaving as a browser, and require less complicated setup +## to run. Please feel free to delete old view/controller tests as they are reimplemented +## in feature tests. ## -## If you submit a pull request containing new view or controller tests, it will not be +## If you submit a pull request containing new view or controller tests, it will not be ## merged. diff --git a/spec/views/harvests/new.html.haml_spec.rb b/spec/views/harvests/new.html.haml_spec.rb index 20a908310..0d372d6ee 100644 --- a/spec/views/harvests/new.html.haml_spec.rb +++ b/spec/views/harvests/new.html.haml_spec.rb @@ -1,13 +1,13 @@ ## DEPRECATION NOTICE: Do not add new tests to this file! ## -## View and controller tests are deprecated in the Growstuff project. -## We no longer write new view and controller tests, but instead write -## feature tests (in spec/features) using Capybara (https://github.com/jnicklas/capybara). -## These test the full stack, behaving as a browser, and require less complicated setup -## to run. Please feel free to delete old view/controller tests as they are reimplemented -## in feature tests. +## View and controller tests are deprecated in the Growstuff project +## We no longer write new view and controller tests, but instead write +## feature tests (in spec/features) using Capybara (https://github.com/jnicklas/capybara). +## These test the full stack, behaving as a browser, and require less complicated setup +## to run. Please feel free to delete old view/controller tests as they are reimplemented +## in feature tests. ## -## If you submit a pull request containing new view or controller tests, it will not be +## If you submit a pull request containing new view or controller tests, it will not be ## merged. diff --git a/spec/views/harvests/show.html.haml_spec.rb b/spec/views/harvests/show.html.haml_spec.rb index 91014941b..6ae30919b 100644 --- a/spec/views/harvests/show.html.haml_spec.rb +++ b/spec/views/harvests/show.html.haml_spec.rb @@ -1,13 +1,13 @@ ## DEPRECATION NOTICE: Do not add new tests to this file! ## -## View and controller tests are deprecated in the Growstuff project. -## We no longer write new view and controller tests, but instead write -## feature tests (in spec/features) using Capybara (https://github.com/jnicklas/capybara). -## These test the full stack, behaving as a browser, and require less complicated setup -## to run. Please feel free to delete old view/controller tests as they are reimplemented -## in feature tests. +## View and controller tests are deprecated in the Growstuff project +## We no longer write new view and controller tests, but instead write +## feature tests (in spec/features) using Capybara (https://github.com/jnicklas/capybara). +## These test the full stack, behaving as a browser, and require less complicated setup +## to run. Please feel free to delete old view/controller tests as they are reimplemented +## in feature tests. ## -## If you submit a pull request containing new view or controller tests, it will not be +## If you submit a pull request containing new view or controller tests, it will not be ## merged. diff --git a/spec/views/home/_blurb.html.haml_spec.rb b/spec/views/home/_blurb.html.haml_spec.rb index 94e7550d1..75314118a 100644 --- a/spec/views/home/_blurb.html.haml_spec.rb +++ b/spec/views/home/_blurb.html.haml_spec.rb @@ -1,13 +1,13 @@ ## DEPRECATION NOTICE: Do not add new tests to this file! ## -## View and controller tests are deprecated in the Growstuff project. -## We no longer write new view and controller tests, but instead write -## feature tests (in spec/features) using Capybara (https://github.com/jnicklas/capybara). -## These test the full stack, behaving as a browser, and require less complicated setup -## to run. Please feel free to delete old view/controller tests as they are reimplemented -## in feature tests. +## View and controller tests are deprecated in the Growstuff project +## We no longer write new view and controller tests, but instead write +## feature tests (in spec/features) using Capybara (https://github.com/jnicklas/capybara). +## These test the full stack, behaving as a browser, and require less complicated setup +## to run. Please feel free to delete old view/controller tests as they are reimplemented +## in feature tests. ## -## If you submit a pull request containing new view or controller tests, it will not be +## If you submit a pull request containing new view or controller tests, it will not be ## merged. diff --git a/spec/views/home/_crops.html.haml_spec.rb b/spec/views/home/_crops.html.haml_spec.rb index 3009a7cc4..5a0c06325 100644 --- a/spec/views/home/_crops.html.haml_spec.rb +++ b/spec/views/home/_crops.html.haml_spec.rb @@ -1,13 +1,13 @@ ## DEPRECATION NOTICE: Do not add new tests to this file! ## -## View and controller tests are deprecated in the Growstuff project. -## We no longer write new view and controller tests, but instead write -## feature tests (in spec/features) using Capybara (https://github.com/jnicklas/capybara). -## These test the full stack, behaving as a browser, and require less complicated setup -## to run. Please feel free to delete old view/controller tests as they are reimplemented -## in feature tests. +## View and controller tests are deprecated in the Growstuff project +## We no longer write new view and controller tests, but instead write +## feature tests (in spec/features) using Capybara (https://github.com/jnicklas/capybara). +## These test the full stack, behaving as a browser, and require less complicated setup +## to run. Please feel free to delete old view/controller tests as they are reimplemented +## in feature tests. ## -## If you submit a pull request containing new view or controller tests, it will not be +## If you submit a pull request containing new view or controller tests, it will not be ## merged. diff --git a/spec/views/home/_members.html.haml_spec.rb b/spec/views/home/_members.html.haml_spec.rb index f208c1bde..6cf6c0099 100644 --- a/spec/views/home/_members.html.haml_spec.rb +++ b/spec/views/home/_members.html.haml_spec.rb @@ -1,13 +1,13 @@ ## DEPRECATION NOTICE: Do not add new tests to this file! ## -## View and controller tests are deprecated in the Growstuff project. -## We no longer write new view and controller tests, but instead write -## feature tests (in spec/features) using Capybara (https://github.com/jnicklas/capybara). -## These test the full stack, behaving as a browser, and require less complicated setup -## to run. Please feel free to delete old view/controller tests as they are reimplemented -## in feature tests. +## View and controller tests are deprecated in the Growstuff project +## We no longer write new view and controller tests, but instead write +## feature tests (in spec/features) using Capybara (https://github.com/jnicklas/capybara). +## These test the full stack, behaving as a browser, and require less complicated setup +## to run. Please feel free to delete old view/controller tests as they are reimplemented +## in feature tests. ## -## If you submit a pull request containing new view or controller tests, it will not be +## If you submit a pull request containing new view or controller tests, it will not be ## merged. diff --git a/spec/views/home/_seeds.html.haml_spec.rb b/spec/views/home/_seeds.html.haml_spec.rb index 6cbd276f7..ac47b1c1a 100644 --- a/spec/views/home/_seeds.html.haml_spec.rb +++ b/spec/views/home/_seeds.html.haml_spec.rb @@ -1,13 +1,13 @@ ## DEPRECATION NOTICE: Do not add new tests to this file! ## -## View and controller tests are deprecated in the Growstuff project. -## We no longer write new view and controller tests, but instead write -## feature tests (in spec/features) using Capybara (https://github.com/jnicklas/capybara). -## These test the full stack, behaving as a browser, and require less complicated setup -## to run. Please feel free to delete old view/controller tests as they are reimplemented -## in feature tests. +## View and controller tests are deprecated in the Growstuff project +## We no longer write new view and controller tests, but instead write +## feature tests (in spec/features) using Capybara (https://github.com/jnicklas/capybara). +## These test the full stack, behaving as a browser, and require less complicated setup +## to run. Please feel free to delete old view/controller tests as they are reimplemented +## in feature tests. ## -## If you submit a pull request containing new view or controller tests, it will not be +## If you submit a pull request containing new view or controller tests, it will not be ## merged. diff --git a/spec/views/home/_stats.html.haml_spec.rb b/spec/views/home/_stats.html.haml_spec.rb index 0eeaf66f8..2bee43768 100644 --- a/spec/views/home/_stats.html.haml_spec.rb +++ b/spec/views/home/_stats.html.haml_spec.rb @@ -1,13 +1,13 @@ ## DEPRECATION NOTICE: Do not add new tests to this file! ## -## View and controller tests are deprecated in the Growstuff project. -## We no longer write new view and controller tests, but instead write -## feature tests (in spec/features) using Capybara (https://github.com/jnicklas/capybara). -## These test the full stack, behaving as a browser, and require less complicated setup -## to run. Please feel free to delete old view/controller tests as they are reimplemented -## in feature tests. +## View and controller tests are deprecated in the Growstuff project +## We no longer write new view and controller tests, but instead write +## feature tests (in spec/features) using Capybara (https://github.com/jnicklas/capybara). +## These test the full stack, behaving as a browser, and require less complicated setup +## to run. Please feel free to delete old view/controller tests as they are reimplemented +## in feature tests. ## -## If you submit a pull request containing new view or controller tests, it will not be +## If you submit a pull request containing new view or controller tests, it will not be ## merged. diff --git a/spec/views/home/index_spec.rb b/spec/views/home/index_spec.rb index 84dd65bde..c7f6f0927 100644 --- a/spec/views/home/index_spec.rb +++ b/spec/views/home/index_spec.rb @@ -1,13 +1,13 @@ ## DEPRECATION NOTICE: Do not add new tests to this file! ## -## View and controller tests are deprecated in the Growstuff project. -## We no longer write new view and controller tests, but instead write -## feature tests (in spec/features) using Capybara (https://github.com/jnicklas/capybara). -## These test the full stack, behaving as a browser, and require less complicated setup -## to run. Please feel free to delete old view/controller tests as they are reimplemented -## in feature tests. +## View and controller tests are deprecated in the Growstuff project +## We no longer write new view and controller tests, but instead write +## feature tests (in spec/features) using Capybara (https://github.com/jnicklas/capybara). +## These test the full stack, behaving as a browser, and require less complicated setup +## to run. Please feel free to delete old view/controller tests as they are reimplemented +## in feature tests. ## -## If you submit a pull request containing new view or controller tests, it will not be +## If you submit a pull request containing new view or controller tests, it will not be ## merged. diff --git a/spec/views/layouts/_meta_spec.rb b/spec/views/layouts/_meta_spec.rb index 716429e37..bd58962a3 100644 --- a/spec/views/layouts/_meta_spec.rb +++ b/spec/views/layouts/_meta_spec.rb @@ -1,13 +1,13 @@ ## DEPRECATION NOTICE: Do not add new tests to this file! ## -## View and controller tests are deprecated in the Growstuff project. -## We no longer write new view and controller tests, but instead write -## feature tests (in spec/features) using Capybara (https://github.com/jnicklas/capybara). -## These test the full stack, behaving as a browser, and require less complicated setup -## to run. Please feel free to delete old view/controller tests as they are reimplemented -## in feature tests. +## View and controller tests are deprecated in the Growstuff project +## We no longer write new view and controller tests, but instead write +## feature tests (in spec/features) using Capybara (https://github.com/jnicklas/capybara). +## These test the full stack, behaving as a browser, and require less complicated setup +## to run. Please feel free to delete old view/controller tests as they are reimplemented +## in feature tests. ## -## If you submit a pull request containing new view or controller tests, it will not be +## If you submit a pull request containing new view or controller tests, it will not be ## merged. diff --git a/spec/views/layouts/application_spec.rb b/spec/views/layouts/application_spec.rb index af710ce6f..a2a0c74f6 100644 --- a/spec/views/layouts/application_spec.rb +++ b/spec/views/layouts/application_spec.rb @@ -1,13 +1,13 @@ ## DEPRECATION NOTICE: Do not add new tests to this file! ## -## View and controller tests are deprecated in the Growstuff project. -## We no longer write new view and controller tests, but instead write -## feature tests (in spec/features) using Capybara (https://github.com/jnicklas/capybara). -## These test the full stack, behaving as a browser, and require less complicated setup -## to run. Please feel free to delete old view/controller tests as they are reimplemented -## in feature tests. +## View and controller tests are deprecated in the Growstuff project +## We no longer write new view and controller tests, but instead write +## feature tests (in spec/features) using Capybara (https://github.com/jnicklas/capybara). +## These test the full stack, behaving as a browser, and require less complicated setup +## to run. Please feel free to delete old view/controller tests as they are reimplemented +## in feature tests. ## -## If you submit a pull request containing new view or controller tests, it will not be +## If you submit a pull request containing new view or controller tests, it will not be ## merged. diff --git a/spec/views/members/_location.html.haml_spec.rb b/spec/views/members/_location.html.haml_spec.rb index 43fb66285..4a247d9eb 100644 --- a/spec/views/members/_location.html.haml_spec.rb +++ b/spec/views/members/_location.html.haml_spec.rb @@ -1,13 +1,13 @@ ## DEPRECATION NOTICE: Do not add new tests to this file! ## -## View and controller tests are deprecated in the Growstuff project. -## We no longer write new view and controller tests, but instead write -## feature tests (in spec/features) using Capybara (https://github.com/jnicklas/capybara). -## These test the full stack, behaving as a browser, and require less complicated setup -## to run. Please feel free to delete old view/controller tests as they are reimplemented -## in feature tests. +## View and controller tests are deprecated in the Growstuff project +## We no longer write new view and controller tests, but instead write +## feature tests (in spec/features) using Capybara (https://github.com/jnicklas/capybara). +## These test the full stack, behaving as a browser, and require less complicated setup +## to run. Please feel free to delete old view/controller tests as they are reimplemented +## in feature tests. ## -## If you submit a pull request containing new view or controller tests, it will not be +## If you submit a pull request containing new view or controller tests, it will not be ## merged. diff --git a/spec/views/members/show.rss.haml_spec.rb b/spec/views/members/show.rss.haml_spec.rb index dcfa0b7b6..c54253bf9 100644 --- a/spec/views/members/show.rss.haml_spec.rb +++ b/spec/views/members/show.rss.haml_spec.rb @@ -1,13 +1,13 @@ ## DEPRECATION NOTICE: Do not add new tests to this file! ## -## View and controller tests are deprecated in the Growstuff project. -## We no longer write new view and controller tests, but instead write -## feature tests (in spec/features) using Capybara (https://github.com/jnicklas/capybara). -## These test the full stack, behaving as a browser, and require less complicated setup -## to run. Please feel free to delete old view/controller tests as they are reimplemented -## in feature tests. +## View and controller tests are deprecated in the Growstuff project. +## We no longer write new view and controller tests, but instead write +## feature tests (in spec/features) using Capybara (https://github.com/jnicklas/capybara). +## These test the full stack, behaving as a browser, and require less complicated setup +## to run. Please feel free to delete old view/controller tests as they are reimplemented +## in feature tests. ## -## If you submit a pull request containing new view or controller tests, it will not be +## If you submit a pull request containing new view or controller tests, it will not be ## merged. diff --git a/spec/views/notifications/index.html.haml_spec.rb b/spec/views/notifications/index.html.haml_spec.rb index a7ec6a696..55937df04 100644 --- a/spec/views/notifications/index.html.haml_spec.rb +++ b/spec/views/notifications/index.html.haml_spec.rb @@ -1,13 +1,13 @@ ## DEPRECATION NOTICE: Do not add new tests to this file! ## -## View and controller tests are deprecated in the Growstuff project. -## We no longer write new view and controller tests, but instead write -## feature tests (in spec/features) using Capybara (https://github.com/jnicklas/capybara). -## These test the full stack, behaving as a browser, and require less complicated setup -## to run. Please feel free to delete old view/controller tests as they are reimplemented -## in feature tests. +## View and controller tests are deprecated in the Growstuff project. +## We no longer write new view and controller tests, but instead write +## feature tests (in spec/features) using Capybara (https://github.com/jnicklas/capybara). +## These test the full stack, behaving as a browser, and require less complicated setup +## to run. Please feel free to delete old view/controller tests as they are reimplemented +## in feature tests. ## -## If you submit a pull request containing new view or controller tests, it will not be +## If you submit a pull request containing new view or controller tests, it will not be ## merged. diff --git a/spec/views/notifications/new.html.haml_spec.rb b/spec/views/notifications/new.html.haml_spec.rb index b2e6cd125..92829806d 100644 --- a/spec/views/notifications/new.html.haml_spec.rb +++ b/spec/views/notifications/new.html.haml_spec.rb @@ -1,13 +1,13 @@ ## DEPRECATION NOTICE: Do not add new tests to this file! ## -## View and controller tests are deprecated in the Growstuff project. -## We no longer write new view and controller tests, but instead write -## feature tests (in spec/features) using Capybara (https://github.com/jnicklas/capybara). -## These test the full stack, behaving as a browser, and require less complicated setup -## to run. Please feel free to delete old view/controller tests as they are reimplemented -## in feature tests. +## View and controller tests are deprecated in the Growstuff project. +## We no longer write new view and controller tests, but instead write +## feature tests (in spec/features) using Capybara (https://github.com/jnicklas/capybara). +## These test the full stack, behaving as a browser, and require less complicated setup +## to run. Please feel free to delete old view/controller tests as they are reimplemented +## in feature tests. ## -## If you submit a pull request containing new view or controller tests, it will not be +## If you submit a pull request containing new view or controller tests, it will not be ## merged. diff --git a/spec/views/notifications/show.html.haml_spec.rb b/spec/views/notifications/show.html.haml_spec.rb index a0ca5ec8f..9e10d0a85 100644 --- a/spec/views/notifications/show.html.haml_spec.rb +++ b/spec/views/notifications/show.html.haml_spec.rb @@ -1,13 +1,13 @@ ## DEPRECATION NOTICE: Do not add new tests to this file! ## -## View and controller tests are deprecated in the Growstuff project. -## We no longer write new view and controller tests, but instead write -## feature tests (in spec/features) using Capybara (https://github.com/jnicklas/capybara). -## These test the full stack, behaving as a browser, and require less complicated setup -## to run. Please feel free to delete old view/controller tests as they are reimplemented -## in feature tests. +## View and controller tests are deprecated in the Growstuff project. +## We no longer write new view and controller tests, but instead write +## feature tests (in spec/features) using Capybara (https://github.com/jnicklas/capybara). +## These test the full stack, behaving as a browser, and require less complicated setup +## to run. Please feel free to delete old view/controller tests as they are reimplemented +## in feature tests. ## -## If you submit a pull request containing new view or controller tests, it will not be +## If you submit a pull request containing new view or controller tests, it will not be ## merged. diff --git a/spec/views/notifier/notify.html.haml_spec.rb b/spec/views/notifier/notify.html.haml_spec.rb index 5a6c96116..c0913d8e7 100644 --- a/spec/views/notifier/notify.html.haml_spec.rb +++ b/spec/views/notifier/notify.html.haml_spec.rb @@ -1,13 +1,13 @@ ## DEPRECATION NOTICE: Do not add new tests to this file! ## -## View and controller tests are deprecated in the Growstuff project. -## We no longer write new view and controller tests, but instead write -## feature tests (in spec/features) using Capybara (https://github.com/jnicklas/capybara). -## These test the full stack, behaving as a browser, and require less complicated setup -## to run. Please feel free to delete old view/controller tests as they are reimplemented -## in feature tests. +## View and controller tests are deprecated in the Growstuff project. +## We no longer write new view and controller tests, but instead write +## feature tests (in spec/features) using Capybara (https://github.com/jnicklas/capybara). +## These test the full stack, behaving as a browser, and require less complicated setup +## to run. Please feel free to delete old view/controller tests as they are reimplemented +## in feature tests. ## -## If you submit a pull request containing new view or controller tests, it will not be +## If you submit a pull request containing new view or controller tests, it will not be ## merged. diff --git a/spec/views/orders/index.html.haml_spec.rb b/spec/views/orders/index.html.haml_spec.rb index 297ac9ad4..8b39c7fbe 100644 --- a/spec/views/orders/index.html.haml_spec.rb +++ b/spec/views/orders/index.html.haml_spec.rb @@ -1,13 +1,13 @@ ## DEPRECATION NOTICE: Do not add new tests to this file! ## -## View and controller tests are deprecated in the Growstuff project. -## We no longer write new view and controller tests, but instead write -## feature tests (in spec/features) using Capybara (https://github.com/jnicklas/capybara). -## These test the full stack, behaving as a browser, and require less complicated setup -## to run. Please feel free to delete old view/controller tests as they are reimplemented -## in feature tests. +## View and controller tests are deprecated in the Growstuff project. +## We no longer write new view and controller tests, but instead write +## feature tests (in spec/features) using Capybara (https://github.com/jnicklas/capybara). +## These test the full stack, behaving as a browser, and require less complicated setup +## to run. Please feel free to delete old view/controller tests as they are reimplemented +## in feature tests. ## -## If you submit a pull request containing new view or controller tests, it will not be +## If you submit a pull request containing new view or controller tests, it will not be ## merged. diff --git a/spec/views/orders/show.html.haml_spec.rb b/spec/views/orders/show.html.haml_spec.rb index 10fd2f5d7..8d8d9f5c4 100644 --- a/spec/views/orders/show.html.haml_spec.rb +++ b/spec/views/orders/show.html.haml_spec.rb @@ -1,13 +1,13 @@ ## DEPRECATION NOTICE: Do not add new tests to this file! ## -## View and controller tests are deprecated in the Growstuff project. -## We no longer write new view and controller tests, but instead write -## feature tests (in spec/features) using Capybara (https://github.com/jnicklas/capybara). -## These test the full stack, behaving as a browser, and require less complicated setup -## to run. Please feel free to delete old view/controller tests as they are reimplemented -## in feature tests. +## View and controller tests are deprecated in the Growstuff project. +## We no longer write new view and controller tests, but instead write +## feature tests (in spec/features) using Capybara (https://github.com/jnicklas/capybara). +## These test the full stack, behaving as a browser, and require less complicated setup +## to run. Please feel free to delete old view/controller tests as they are reimplemented +## in feature tests. ## -## If you submit a pull request containing new view or controller tests, it will not be +## If you submit a pull request containing new view or controller tests, it will not be ## merged. diff --git a/spec/views/photos/edit.html.haml_spec.rb b/spec/views/photos/edit.html.haml_spec.rb index 6df82b418..c9b440a66 100644 --- a/spec/views/photos/edit.html.haml_spec.rb +++ b/spec/views/photos/edit.html.haml_spec.rb @@ -1,13 +1,13 @@ ## DEPRECATION NOTICE: Do not add new tests to this file! ## -## View and controller tests are deprecated in the Growstuff project. -## We no longer write new view and controller tests, but instead write -## feature tests (in spec/features) using Capybara (https://github.com/jnicklas/capybara). -## These test the full stack, behaving as a browser, and require less complicated setup -## to run. Please feel free to delete old view/controller tests as they are reimplemented -## in feature tests. +## View and controller tests are deprecated in the Growstuff project. +## We no longer write new view and controller tests, but instead write +## feature tests (in spec/features) using Capybara (https://github.com/jnicklas/capybara). +## These test the full stack, behaving as a browser, and require less complicated setup +## to run. Please feel free to delete old view/controller tests as they are reimplemented +## in feature tests. ## -## If you submit a pull request containing new view or controller tests, it will not be +## If you submit a pull request containing new view or controller tests, it will not be ## merged. diff --git a/spec/views/photos/index.html.haml_spec.rb b/spec/views/photos/index.html.haml_spec.rb index 1741d9aa3..7b7479c97 100644 --- a/spec/views/photos/index.html.haml_spec.rb +++ b/spec/views/photos/index.html.haml_spec.rb @@ -1,13 +1,13 @@ ## DEPRECATION NOTICE: Do not add new tests to this file! ## -## View and controller tests are deprecated in the Growstuff project. -## We no longer write new view and controller tests, but instead write -## feature tests (in spec/features) using Capybara (https://github.com/jnicklas/capybara). -## These test the full stack, behaving as a browser, and require less complicated setup -## to run. Please feel free to delete old view/controller tests as they are reimplemented -## in feature tests. +## View and controller tests are deprecated in the Growstuff project. +## We no longer write new view and controller tests, but instead write +## feature tests (in spec/features) using Capybara (https://github.com/jnicklas/capybara). +## These test the full stack, behaving as a browser, and require less complicated setup +## to run. Please feel free to delete old view/controller tests as they are reimplemented +## in feature tests. ## -## If you submit a pull request containing new view or controller tests, it will not be +## If you submit a pull request containing new view or controller tests, it will not be ## merged. diff --git a/spec/views/photos/new.html.haml_spec.rb b/spec/views/photos/new.html.haml_spec.rb index 47df538b4..b22240e4e 100644 --- a/spec/views/photos/new.html.haml_spec.rb +++ b/spec/views/photos/new.html.haml_spec.rb @@ -1,13 +1,13 @@ ## DEPRECATION NOTICE: Do not add new tests to this file! ## -## View and controller tests are deprecated in the Growstuff project. -## We no longer write new view and controller tests, but instead write -## feature tests (in spec/features) using Capybara (https://github.com/jnicklas/capybara). -## These test the full stack, behaving as a browser, and require less complicated setup -## to run. Please feel free to delete old view/controller tests as they are reimplemented -## in feature tests. +## View and controller tests are deprecated in the Growstuff project. +## We no longer write new view and controller tests, but instead write +## feature tests (in spec/features) using Capybara (https://github.com/jnicklas/capybara). +## These test the full stack, behaving as a browser, and require less complicated setup +## to run. Please feel free to delete old view/controller tests as they are reimplemented +## in feature tests. ## -## If you submit a pull request containing new view or controller tests, it will not be +## If you submit a pull request containing new view or controller tests, it will not be ## merged. diff --git a/spec/views/photos/show.html.haml_spec.rb b/spec/views/photos/show.html.haml_spec.rb index 055032f76..2f995fd31 100644 --- a/spec/views/photos/show.html.haml_spec.rb +++ b/spec/views/photos/show.html.haml_spec.rb @@ -1,13 +1,13 @@ ## DEPRECATION NOTICE: Do not add new tests to this file! ## -## View and controller tests are deprecated in the Growstuff project. -## We no longer write new view and controller tests, but instead write -## feature tests (in spec/features) using Capybara (https://github.com/jnicklas/capybara). -## These test the full stack, behaving as a browser, and require less complicated setup -## to run. Please feel free to delete old view/controller tests as they are reimplemented -## in feature tests. +## View and controller tests are deprecated in the Growstuff project. +## We no longer write new view and controller tests, but instead write +## feature tests (in spec/features) using Capybara (https://github.com/jnicklas/capybara). +## These test the full stack, behaving as a browser, and require less complicated setup +## to run. Please feel free to delete old view/controller tests as they are reimplemented +## in feature tests. ## -## If you submit a pull request containing new view or controller tests, it will not be +## If you submit a pull request containing new view or controller tests, it will not be ## merged. diff --git a/spec/views/places/_map_attribution.html.haml_spec.rb b/spec/views/places/_map_attribution.html.haml_spec.rb index cbb305ed6..009c45290 100644 --- a/spec/views/places/_map_attribution.html.haml_spec.rb +++ b/spec/views/places/_map_attribution.html.haml_spec.rb @@ -1,13 +1,13 @@ ## DEPRECATION NOTICE: Do not add new tests to this file! ## -## View and controller tests are deprecated in the Growstuff project. -## We no longer write new view and controller tests, but instead write -## feature tests (in spec/features) using Capybara (https://github.com/jnicklas/capybara). -## These test the full stack, behaving as a browser, and require less complicated setup -## to run. Please feel free to delete old view/controller tests as they are reimplemented -## in feature tests. +## View and controller tests are deprecated in the Growstuff project. +## We no longer write new view and controller tests, but instead write +## feature tests (in spec/features) using Capybara (https://github.com/jnicklas/capybara). +## These test the full stack, behaving as a browser, and require less complicated setup +## to run. Please feel free to delete old view/controller tests as they are reimplemented +## in feature tests. ## -## If you submit a pull request containing new view or controller tests, it will not be +## If you submit a pull request containing new view or controller tests, it will not be ## merged. diff --git a/spec/views/places/index.html.haml_spec.rb b/spec/views/places/index.html.haml_spec.rb index 10c5caca6..8efcca42e 100644 --- a/spec/views/places/index.html.haml_spec.rb +++ b/spec/views/places/index.html.haml_spec.rb @@ -1,13 +1,13 @@ ## DEPRECATION NOTICE: Do not add new tests to this file! ## -## View and controller tests are deprecated in the Growstuff project. -## We no longer write new view and controller tests, but instead write -## feature tests (in spec/features) using Capybara (https://github.com/jnicklas/capybara). -## These test the full stack, behaving as a browser, and require less complicated setup -## to run. Please feel free to delete old view/controller tests as they are reimplemented -## in feature tests. +## View and controller tests are deprecated in the Growstuff project. +## We no longer write new view and controller tests, but instead write +## feature tests (in spec/features) using Capybara (https://github.com/jnicklas/capybara). +## These test the full stack, behaving as a browser, and require less complicated setup +## to run. Please feel free to delete old view/controller tests as they are reimplemented +## in feature tests. ## -## If you submit a pull request containing new view or controller tests, it will not be +## If you submit a pull request containing new view or controller tests, it will not be ## merged. diff --git a/spec/views/places/show.html.haml_spec.rb b/spec/views/places/show.html.haml_spec.rb index 7cfa2c16c..5a312f360 100644 --- a/spec/views/places/show.html.haml_spec.rb +++ b/spec/views/places/show.html.haml_spec.rb @@ -1,13 +1,13 @@ ## DEPRECATION NOTICE: Do not add new tests to this file! ## -## View and controller tests are deprecated in the Growstuff project. -## We no longer write new view and controller tests, but instead write -## feature tests (in spec/features) using Capybara (https://github.com/jnicklas/capybara). -## These test the full stack, behaving as a browser, and require less complicated setup -## to run. Please feel free to delete old view/controller tests as they are reimplemented -## in feature tests. +## View and controller tests are deprecated in the Growstuff project. +## We no longer write new view and controller tests, but instead write +## feature tests (in spec/features) using Capybara (https://github.com/jnicklas/capybara). +## These test the full stack, behaving as a browser, and require less complicated setup +## to run. Please feel free to delete old view/controller tests as they are reimplemented +## in feature tests. ## -## If you submit a pull request containing new view or controller tests, it will not be +## If you submit a pull request containing new view or controller tests, it will not be ## merged. diff --git a/spec/views/plant_parts/edit.html.haml_spec.rb b/spec/views/plant_parts/edit.html.haml_spec.rb index 1f92923d8..c9a1533fa 100644 --- a/spec/views/plant_parts/edit.html.haml_spec.rb +++ b/spec/views/plant_parts/edit.html.haml_spec.rb @@ -1,13 +1,13 @@ ## DEPRECATION NOTICE: Do not add new tests to this file! ## -## View and controller tests are deprecated in the Growstuff project. -## We no longer write new view and controller tests, but instead write -## feature tests (in spec/features) using Capybara (https://github.com/jnicklas/capybara). -## These test the full stack, behaving as a browser, and require less complicated setup -## to run. Please feel free to delete old view/controller tests as they are reimplemented -## in feature tests. +## View and controller tests are deprecated in the Growstuff project. +## We no longer write new view and controller tests, but instead write +## feature tests (in spec/features) using Capybara (https://github.com/jnicklas/capybara). +## These test the full stack, behaving as a browser, and require less complicated setup +## to run. Please feel free to delete old view/controller tests as they are reimplemented +## in feature tests. ## -## If you submit a pull request containing new view or controller tests, it will not be +## If you submit a pull request containing new view or controller tests, it will not be ## merged. diff --git a/spec/views/plant_parts/index.html.haml_spec.rb b/spec/views/plant_parts/index.html.haml_spec.rb index 1fe26abba..8b16b48ff 100644 --- a/spec/views/plant_parts/index.html.haml_spec.rb +++ b/spec/views/plant_parts/index.html.haml_spec.rb @@ -1,13 +1,13 @@ ## DEPRECATION NOTICE: Do not add new tests to this file! ## -## View and controller tests are deprecated in the Growstuff project. -## We no longer write new view and controller tests, but instead write -## feature tests (in spec/features) using Capybara (https://github.com/jnicklas/capybara). -## These test the full stack, behaving as a browser, and require less complicated setup -## to run. Please feel free to delete old view/controller tests as they are reimplemented -## in feature tests. +## View and controller tests are deprecated in the Growstuff project. +## We no longer write new view and controller tests, but instead write +## feature tests (in spec/features) using Capybara (https://github.com/jnicklas/capybara). +## These test the full stack, behaving as a browser, and require less complicated setup +## to run. Please feel free to delete old view/controller tests as they are reimplemented +## in feature tests. ## -## If you submit a pull request containing new view or controller tests, it will not be +## If you submit a pull request containing new view or controller tests, it will not be ## merged. diff --git a/spec/views/plant_parts/new.html.haml_spec.rb b/spec/views/plant_parts/new.html.haml_spec.rb index 213eee57a..9e977bd42 100644 --- a/spec/views/plant_parts/new.html.haml_spec.rb +++ b/spec/views/plant_parts/new.html.haml_spec.rb @@ -1,13 +1,13 @@ ## DEPRECATION NOTICE: Do not add new tests to this file! ## -## View and controller tests are deprecated in the Growstuff project. -## We no longer write new view and controller tests, but instead write -## feature tests (in spec/features) using Capybara (https://github.com/jnicklas/capybara). -## These test the full stack, behaving as a browser, and require less complicated setup -## to run. Please feel free to delete old view/controller tests as they are reimplemented -## in feature tests. +## View and controller tests are deprecated in the Growstuff project. +## We no longer write new view and controller tests, but instead write +## feature tests (in spec/features) using Capybara (https://github.com/jnicklas/capybara). +## These test the full stack, behaving as a browser, and require less complicated setup +## to run. Please feel free to delete old view/controller tests as they are reimplemented +## in feature tests. ## -## If you submit a pull request containing new view or controller tests, it will not be +## If you submit a pull request containing new view or controller tests, it will not be ## merged. diff --git a/spec/views/plant_parts/show.html.haml_spec.rb b/spec/views/plant_parts/show.html.haml_spec.rb index 7c23b9bb9..f64171f5c 100644 --- a/spec/views/plant_parts/show.html.haml_spec.rb +++ b/spec/views/plant_parts/show.html.haml_spec.rb @@ -1,13 +1,13 @@ ## DEPRECATION NOTICE: Do not add new tests to this file! ## -## View and controller tests are deprecated in the Growstuff project. -## We no longer write new view and controller tests, but instead write -## feature tests (in spec/features) using Capybara (https://github.com/jnicklas/capybara). -## These test the full stack, behaving as a browser, and require less complicated setup -## to run. Please feel free to delete old view/controller tests as they are reimplemented -## in feature tests. +## View and controller tests are deprecated in the Growstuff project. +## We no longer write new view and controller tests, but instead write +## feature tests (in spec/features) using Capybara (https://github.com/jnicklas/capybara). +## These test the full stack, behaving as a browser, and require less complicated setup +## to run. Please feel free to delete old view/controller tests as they are reimplemented +## in feature tests. ## -## If you submit a pull request containing new view or controller tests, it will not be +## If you submit a pull request containing new view or controller tests, it will not be ## merged. diff --git a/spec/views/plantings/_form.html.haml_spec.rb b/spec/views/plantings/_form.html.haml_spec.rb index 0d813b678..0cb0ee09f 100644 --- a/spec/views/plantings/_form.html.haml_spec.rb +++ b/spec/views/plantings/_form.html.haml_spec.rb @@ -1,13 +1,13 @@ ## DEPRECATION NOTICE: Do not add new tests to this file! ## -## View and controller tests are deprecated in the Growstuff project. -## We no longer write new view and controller tests, but instead write -## feature tests (in spec/features) using Capybara (https://github.com/jnicklas/capybara). -## These test the full stack, behaving as a browser, and require less complicated setup -## to run. Please feel free to delete old view/controller tests as they are reimplemented -## in feature tests. +## View and controller tests are deprecated in the Growstuff project. +## We no longer write new view and controller tests, but instead write +## feature tests (in spec/features) using Capybara (https://github.com/jnicklas/capybara). +## These test the full stack, behaving as a browser, and require less complicated setup +## to run. Please feel free to delete old view/controller tests as they are reimplemented +## in feature tests. ## -## If you submit a pull request containing new view or controller tests, it will not be +## If you submit a pull request containing new view or controller tests, it will not be ## merged. diff --git a/spec/views/plantings/edit.html.haml_spec.rb b/spec/views/plantings/edit.html.haml_spec.rb index 24b0b81ce..234d83646 100644 --- a/spec/views/plantings/edit.html.haml_spec.rb +++ b/spec/views/plantings/edit.html.haml_spec.rb @@ -1,13 +1,13 @@ ## DEPRECATION NOTICE: Do not add new tests to this file! ## -## View and controller tests are deprecated in the Growstuff project. -## We no longer write new view and controller tests, but instead write -## feature tests (in spec/features) using Capybara (https://github.com/jnicklas/capybara). -## These test the full stack, behaving as a browser, and require less complicated setup -## to run. Please feel free to delete old view/controller tests as they are reimplemented -## in feature tests. +## View and controller tests are deprecated in the Growstuff project. +## We no longer write new view and controller tests, but instead write +## feature tests (in spec/features) using Capybara (https://github.com/jnicklas/capybara). +## These test the full stack, behaving as a browser, and require less complicated setup +## to run. Please feel free to delete old view/controller tests as they are reimplemented +## in feature tests. ## -## If you submit a pull request containing new view or controller tests, it will not be +## If you submit a pull request containing new view or controller tests, it will not be ## merged. diff --git a/spec/views/plantings/index.html.haml_spec.rb b/spec/views/plantings/index.html.haml_spec.rb index 928735dde..0b584562f 100644 --- a/spec/views/plantings/index.html.haml_spec.rb +++ b/spec/views/plantings/index.html.haml_spec.rb @@ -1,13 +1,13 @@ ## DEPRECATION NOTICE: Do not add new tests to this file! ## -## View and controller tests are deprecated in the Growstuff project. -## We no longer write new view and controller tests, but instead write -## feature tests (in spec/features) using Capybara (https://github.com/jnicklas/capybara). -## These test the full stack, behaving as a browser, and require less complicated setup -## to run. Please feel free to delete old view/controller tests as they are reimplemented -## in feature tests. +## View and controller tests are deprecated in the Growstuff project. +## We no longer write new view and controller tests, but instead write +## feature tests (in spec/features) using Capybara (https://github.com/jnicklas/capybara). +## These test the full stack, behaving as a browser, and require less complicated setup +## to run. Please feel free to delete old view/controller tests as they are reimplemented +## in feature tests. ## -## If you submit a pull request containing new view or controller tests, it will not be +## If you submit a pull request containing new view or controller tests, it will not be ## merged. diff --git a/spec/views/plantings/index.rss.haml_spec.rb b/spec/views/plantings/index.rss.haml_spec.rb index 9f3d7ccc1..eefb49c6a 100644 --- a/spec/views/plantings/index.rss.haml_spec.rb +++ b/spec/views/plantings/index.rss.haml_spec.rb @@ -1,13 +1,13 @@ ## DEPRECATION NOTICE: Do not add new tests to this file! ## -## View and controller tests are deprecated in the Growstuff project. -## We no longer write new view and controller tests, but instead write -## feature tests (in spec/features) using Capybara (https://github.com/jnicklas/capybara). -## These test the full stack, behaving as a browser, and require less complicated setup -## to run. Please feel free to delete old view/controller tests as they are reimplemented -## in feature tests. +## View and controller tests are deprecated in the Growstuff project. +## We no longer write new view and controller tests, but instead write +## feature tests (in spec/features) using Capybara (https://github.com/jnicklas/capybara). +## These test the full stack, behaving as a browser, and require less complicated setup +## to run. Please feel free to delete old view/controller tests as they are reimplemented +## in feature tests. ## -## If you submit a pull request containing new view or controller tests, it will not be +## If you submit a pull request containing new view or controller tests, it will not be ## merged. diff --git a/spec/views/plantings/new.html.haml_spec.rb b/spec/views/plantings/new.html.haml_spec.rb index 825d64c5b..3521d34f6 100644 --- a/spec/views/plantings/new.html.haml_spec.rb +++ b/spec/views/plantings/new.html.haml_spec.rb @@ -1,13 +1,13 @@ ## DEPRECATION NOTICE: Do not add new tests to this file! ## -## View and controller tests are deprecated in the Growstuff project. -## We no longer write new view and controller tests, but instead write -## feature tests (in spec/features) using Capybara (https://github.com/jnicklas/capybara). -## These test the full stack, behaving as a browser, and require less complicated setup -## to run. Please feel free to delete old view/controller tests as they are reimplemented -## in feature tests. +## View and controller tests are deprecated in the Growstuff project. +## We no longer write new view and controller tests, but instead write +## feature tests (in spec/features) using Capybara (https://github.com/jnicklas/capybara). +## These test the full stack, behaving as a browser, and require less complicated setup +## to run. Please feel free to delete old view/controller tests as they are reimplemented +## in feature tests. ## -## If you submit a pull request containing new view or controller tests, it will not be +## If you submit a pull request containing new view or controller tests, it will not be ## merged. diff --git a/spec/views/plantings/show.html.haml_spec.rb b/spec/views/plantings/show.html.haml_spec.rb index f04604722..48064e2fe 100644 --- a/spec/views/plantings/show.html.haml_spec.rb +++ b/spec/views/plantings/show.html.haml_spec.rb @@ -1,13 +1,13 @@ ## DEPRECATION NOTICE: Do not add new tests to this file! ## -## View and controller tests are deprecated in the Growstuff project. -## We no longer write new view and controller tests, but instead write -## feature tests (in spec/features) using Capybara (https://github.com/jnicklas/capybara). -## These test the full stack, behaving as a browser, and require less complicated setup -## to run. Please feel free to delete old view/controller tests as they are reimplemented -## in feature tests. +## View and controller tests are deprecated in the Growstuff project. +## We no longer write new view and controller tests, but instead write +## feature tests (in spec/features) using Capybara (https://github.com/jnicklas/capybara). +## These test the full stack, behaving as a browser, and require less complicated setup +## to run. Please feel free to delete old view/controller tests as they are reimplemented +## in feature tests. ## -## If you submit a pull request containing new view or controller tests, it will not be +## If you submit a pull request containing new view or controller tests, it will not be ## merged. diff --git a/spec/views/posts/_single.html.haml_spec.rb b/spec/views/posts/_single.html.haml_spec.rb index eabef90fe..8c2c4863b 100644 --- a/spec/views/posts/_single.html.haml_spec.rb +++ b/spec/views/posts/_single.html.haml_spec.rb @@ -1,13 +1,13 @@ ## DEPRECATION NOTICE: Do not add new tests to this file! ## -## View and controller tests are deprecated in the Growstuff project. -## We no longer write new view and controller tests, but instead write -## feature tests (in spec/features) using Capybara (https://github.com/jnicklas/capybara). -## These test the full stack, behaving as a browser, and require less complicated setup -## to run. Please feel free to delete old view/controller tests as they are reimplemented -## in feature tests. +## View and controller tests are deprecated in the Growstuff project. +## We no longer write new view and controller tests, but instead write +## feature tests (in spec/features) using Capybara (https://github.com/jnicklas/capybara). +## These test the full stack, behaving as a browser, and require less complicated setup +## to run. Please feel free to delete old view/controller tests as they are reimplemented +## in feature tests. ## -## If you submit a pull request containing new view or controller tests, it will not be +## If you submit a pull request containing new view or controller tests, it will not be ## merged. diff --git a/spec/views/posts/edit.html.haml_spec.rb b/spec/views/posts/edit.html.haml_spec.rb index bf48f9d88..9b4a14146 100644 --- a/spec/views/posts/edit.html.haml_spec.rb +++ b/spec/views/posts/edit.html.haml_spec.rb @@ -1,13 +1,13 @@ ## DEPRECATION NOTICE: Do not add new tests to this file! ## -## View and controller tests are deprecated in the Growstuff project. -## We no longer write new view and controller tests, but instead write -## feature tests (in spec/features) using Capybara (https://github.com/jnicklas/capybara). -## These test the full stack, behaving as a browser, and require less complicated setup -## to run. Please feel free to delete old view/controller tests as they are reimplemented -## in feature tests. +## View and controller tests are deprecated in the Growstuff project. +## We no longer write new view and controller tests, but instead write +## feature tests (in spec/features) using Capybara (https://github.com/jnicklas/capybara). +## These test the full stack, behaving as a browser, and require less complicated setup +## to run. Please feel free to delete old view/controller tests as they are reimplemented +## in feature tests. ## -## If you submit a pull request containing new view or controller tests, it will not be +## If you submit a pull request containing new view or controller tests, it will not be ## merged. diff --git a/spec/views/posts/index.html.haml_spec.rb b/spec/views/posts/index.html.haml_spec.rb index 1290cc2c7..3d0f094d6 100644 --- a/spec/views/posts/index.html.haml_spec.rb +++ b/spec/views/posts/index.html.haml_spec.rb @@ -1,13 +1,13 @@ ## DEPRECATION NOTICE: Do not add new tests to this file! ## -## View and controller tests are deprecated in the Growstuff project. -## We no longer write new view and controller tests, but instead write -## feature tests (in spec/features) using Capybara (https://github.com/jnicklas/capybara). -## These test the full stack, behaving as a browser, and require less complicated setup -## to run. Please feel free to delete old view/controller tests as they are reimplemented -## in feature tests. +## View and controller tests are deprecated in the Growstuff project. +## We no longer write new view and controller tests, but instead write +## feature tests (in spec/features) using Capybara (https://github.com/jnicklas/capybara). +## These test the full stack, behaving as a browser, and require less complicated setup +## to run. Please feel free to delete old view/controller tests as they are reimplemented +## in feature tests. ## -## If you submit a pull request containing new view or controller tests, it will not be +## If you submit a pull request containing new view or controller tests, it will not be ## merged. diff --git a/spec/views/posts/index.rss.haml_spec.rb b/spec/views/posts/index.rss.haml_spec.rb index 496311efc..8a2b78329 100644 --- a/spec/views/posts/index.rss.haml_spec.rb +++ b/spec/views/posts/index.rss.haml_spec.rb @@ -1,13 +1,13 @@ ## DEPRECATION NOTICE: Do not add new tests to this file! ## -## View and controller tests are deprecated in the Growstuff project. -## We no longer write new view and controller tests, but instead write -## feature tests (in spec/features) using Capybara (https://github.com/jnicklas/capybara). -## These test the full stack, behaving as a browser, and require less complicated setup -## to run. Please feel free to delete old view/controller tests as they are reimplemented -## in feature tests. +## View and controller tests are deprecated in the Growstuff project. +## We no longer write new view and controller tests, but instead write +## feature tests (in spec/features) using Capybara (https://github.com/jnicklas/capybara). +## These test the full stack, behaving as a browser, and require less complicated setup +## to run. Please feel free to delete old view/controller tests as they are reimplemented +## in feature tests. ## -## If you submit a pull request containing new view or controller tests, it will not be +## If you submit a pull request containing new view or controller tests, it will not be ## merged. diff --git a/spec/views/posts/new.html.haml_spec.rb b/spec/views/posts/new.html.haml_spec.rb index 6352ffabb..e4a23d704 100644 --- a/spec/views/posts/new.html.haml_spec.rb +++ b/spec/views/posts/new.html.haml_spec.rb @@ -1,13 +1,13 @@ ## DEPRECATION NOTICE: Do not add new tests to this file! ## -## View and controller tests are deprecated in the Growstuff project. -## We no longer write new view and controller tests, but instead write -## feature tests (in spec/features) using Capybara (https://github.com/jnicklas/capybara). -## These test the full stack, behaving as a browser, and require less complicated setup -## to run. Please feel free to delete old view/controller tests as they are reimplemented -## in feature tests. +## View and controller tests are deprecated in the Growstuff project. +## We no longer write new view and controller tests, but instead write +## feature tests (in spec/features) using Capybara (https://github.com/jnicklas/capybara). +## These test the full stack, behaving as a browser, and require less complicated setup +## to run. Please feel free to delete old view/controller tests as they are reimplemented +## in feature tests. ## -## If you submit a pull request containing new view or controller tests, it will not be +## If you submit a pull request containing new view or controller tests, it will not be ## merged. diff --git a/spec/views/posts/show.html.haml_spec.rb b/spec/views/posts/show.html.haml_spec.rb index b50812078..432879296 100644 --- a/spec/views/posts/show.html.haml_spec.rb +++ b/spec/views/posts/show.html.haml_spec.rb @@ -1,13 +1,13 @@ ## DEPRECATION NOTICE: Do not add new tests to this file! ## -## View and controller tests are deprecated in the Growstuff project. -## We no longer write new view and controller tests, but instead write -## feature tests (in spec/features) using Capybara (https://github.com/jnicklas/capybara). -## These test the full stack, behaving as a browser, and require less complicated setup -## to run. Please feel free to delete old view/controller tests as they are reimplemented -## in feature tests. +## View and controller tests are deprecated in the Growstuff project. +## We no longer write new view and controller tests, but instead write +## feature tests (in spec/features) using Capybara (https://github.com/jnicklas/capybara). +## These test the full stack, behaving as a browser, and require less complicated setup +## to run. Please feel free to delete old view/controller tests as they are reimplemented +## in feature tests. ## -## If you submit a pull request containing new view or controller tests, it will not be +## If you submit a pull request containing new view or controller tests, it will not be ## merged. @@ -107,7 +107,7 @@ describe "posts/show" do rendered.should have_content "in #{@post.forum.name}" end end - + context "signed in" do before(:each) do sign_in @author @@ -119,7 +119,7 @@ describe "posts/show" do it 'shows a comment button' do assert_select "a", {href: new_comment_path(post_id: @post.id)}, "Comment" - end + end end diff --git a/spec/views/posts/show.rss.haml_spec.rb b/spec/views/posts/show.rss.haml_spec.rb index abe9b81f4..b1f2977d2 100644 --- a/spec/views/posts/show.rss.haml_spec.rb +++ b/spec/views/posts/show.rss.haml_spec.rb @@ -1,13 +1,13 @@ ## DEPRECATION NOTICE: Do not add new tests to this file! ## -## View and controller tests are deprecated in the Growstuff project. -## We no longer write new view and controller tests, but instead write -## feature tests (in spec/features) using Capybara (https://github.com/jnicklas/capybara). -## These test the full stack, behaving as a browser, and require less complicated setup -## to run. Please feel free to delete old view/controller tests as they are reimplemented -## in feature tests. +## View and controller tests are deprecated in the Growstuff project. +## We no longer write new view and controller tests, but instead write +## feature tests (in spec/features) using Capybara (https://github.com/jnicklas/capybara). +## These test the full stack, behaving as a browser, and require less complicated setup +## to run. Please feel free to delete old view/controller tests as they are reimplemented +## in feature tests. ## -## If you submit a pull request containing new view or controller tests, it will not be +## If you submit a pull request containing new view or controller tests, it will not be ## merged. diff --git a/spec/views/products/edit.html.haml_spec.rb b/spec/views/products/edit.html.haml_spec.rb index 107a32284..7822d1289 100644 --- a/spec/views/products/edit.html.haml_spec.rb +++ b/spec/views/products/edit.html.haml_spec.rb @@ -1,13 +1,13 @@ ## DEPRECATION NOTICE: Do not add new tests to this file! ## -## View and controller tests are deprecated in the Growstuff project. -## We no longer write new view and controller tests, but instead write -## feature tests (in spec/features) using Capybara (https://github.com/jnicklas/capybara). -## These test the full stack, behaving as a browser, and require less complicated setup -## to run. Please feel free to delete old view/controller tests as they are reimplemented -## in feature tests. +## View and controller tests are deprecated in the Growstuff project. +## We no longer write new view and controller tests, but instead write +## feature tests (in spec/features) using Capybara (https://github.com/jnicklas/capybara). +## These test the full stack, behaving as a browser, and require less complicated setup +## to run. Please feel free to delete old view/controller tests as they are reimplemented +## in feature tests. ## -## If you submit a pull request containing new view or controller tests, it will not be +## If you submit a pull request containing new view or controller tests, it will not be ## merged. diff --git a/spec/views/products/index.html.haml_spec.rb b/spec/views/products/index.html.haml_spec.rb index 576e6d3ec..848bbab5b 100644 --- a/spec/views/products/index.html.haml_spec.rb +++ b/spec/views/products/index.html.haml_spec.rb @@ -1,13 +1,13 @@ ## DEPRECATION NOTICE: Do not add new tests to this file! ## -## View and controller tests are deprecated in the Growstuff project. -## We no longer write new view and controller tests, but instead write -## feature tests (in spec/features) using Capybara (https://github.com/jnicklas/capybara). -## These test the full stack, behaving as a browser, and require less complicated setup -## to run. Please feel free to delete old view/controller tests as they are reimplemented -## in feature tests. +## View and controller tests are deprecated in the Growstuff project. +## We no longer write new view and controller tests, but instead write +## feature tests (in spec/features) using Capybara (https://github.com/jnicklas/capybara). +## These test the full stack, behaving as a browser, and require less complicated setup +## to run. Please feel free to delete old view/controller tests as they are reimplemented +## in feature tests. ## -## If you submit a pull request containing new view or controller tests, it will not be +## If you submit a pull request containing new view or controller tests, it will not be ## merged. diff --git a/spec/views/products/new.html.haml_spec.rb b/spec/views/products/new.html.haml_spec.rb index db20a5c95..a2f9d9dac 100644 --- a/spec/views/products/new.html.haml_spec.rb +++ b/spec/views/products/new.html.haml_spec.rb @@ -1,13 +1,13 @@ ## DEPRECATION NOTICE: Do not add new tests to this file! ## -## View and controller tests are deprecated in the Growstuff project. -## We no longer write new view and controller tests, but instead write -## feature tests (in spec/features) using Capybara (https://github.com/jnicklas/capybara). -## These test the full stack, behaving as a browser, and require less complicated setup -## to run. Please feel free to delete old view/controller tests as they are reimplemented -## in feature tests. +## View and controller tests are deprecated in the Growstuff project. +## We no longer write new view and controller tests, but instead write +## feature tests (in spec/features) using Capybara (https://github.com/jnicklas/capybara). +## These test the full stack, behaving as a browser, and require less complicated setup +## to run. Please feel free to delete old view/controller tests as they are reimplemented +## in feature tests. ## -## If you submit a pull request containing new view or controller tests, it will not be +## If you submit a pull request containing new view or controller tests, it will not be ## merged. diff --git a/spec/views/products/show.html.haml_spec.rb b/spec/views/products/show.html.haml_spec.rb index 6fcb35654..83d517750 100644 --- a/spec/views/products/show.html.haml_spec.rb +++ b/spec/views/products/show.html.haml_spec.rb @@ -1,13 +1,13 @@ ## DEPRECATION NOTICE: Do not add new tests to this file! ## -## View and controller tests are deprecated in the Growstuff project. -## We no longer write new view and controller tests, but instead write -## feature tests (in spec/features) using Capybara (https://github.com/jnicklas/capybara). -## These test the full stack, behaving as a browser, and require less complicated setup -## to run. Please feel free to delete old view/controller tests as they are reimplemented -## in feature tests. +## View and controller tests are deprecated in the Growstuff project. +## We no longer write new view and controller tests, but instead write +## feature tests (in spec/features) using Capybara (https://github.com/jnicklas/capybara). +## These test the full stack, behaving as a browser, and require less complicated setup +## to run. Please feel free to delete old view/controller tests as they are reimplemented +## in feature tests. ## -## If you submit a pull request containing new view or controller tests, it will not be +## If you submit a pull request containing new view or controller tests, it will not be ## merged. diff --git a/spec/views/roles/edit.html.haml_spec.rb b/spec/views/roles/edit.html.haml_spec.rb index a4026f63e..72584b4b0 100644 --- a/spec/views/roles/edit.html.haml_spec.rb +++ b/spec/views/roles/edit.html.haml_spec.rb @@ -1,13 +1,13 @@ ## DEPRECATION NOTICE: Do not add new tests to this file! ## -## View and controller tests are deprecated in the Growstuff project. -## We no longer write new view and controller tests, but instead write -## feature tests (in spec/features) using Capybara (https://github.com/jnicklas/capybara). -## These test the full stack, behaving as a browser, and require less complicated setup -## to run. Please feel free to delete old view/controller tests as they are reimplemented -## in feature tests. +## View and controller tests are deprecated in the Growstuff project. +## We no longer write new view and controller tests, but instead write +## feature tests (in spec/features) using Capybara (https://github.com/jnicklas/capybara). +## These test the full stack, behaving as a browser, and require less complicated setup +## to run. Please feel free to delete old view/controller tests as they are reimplemented +## in feature tests. ## -## If you submit a pull request containing new view or controller tests, it will not be +## If you submit a pull request containing new view or controller tests, it will not be ## merged. diff --git a/spec/views/roles/index.html.haml_spec.rb b/spec/views/roles/index.html.haml_spec.rb index fe8e40333..be7fd4795 100644 --- a/spec/views/roles/index.html.haml_spec.rb +++ b/spec/views/roles/index.html.haml_spec.rb @@ -1,13 +1,13 @@ ## DEPRECATION NOTICE: Do not add new tests to this file! ## -## View and controller tests are deprecated in the Growstuff project. -## We no longer write new view and controller tests, but instead write -## feature tests (in spec/features) using Capybara (https://github.com/jnicklas/capybara). -## These test the full stack, behaving as a browser, and require less complicated setup -## to run. Please feel free to delete old view/controller tests as they are reimplemented -## in feature tests. +## View and controller tests are deprecated in the Growstuff project. +## We no longer write new view and controller tests, but instead write +## feature tests (in spec/features) using Capybara (https://github.com/jnicklas/capybara). +## These test the full stack, behaving as a browser, and require less complicated setup +## to run. Please feel free to delete old view/controller tests as they are reimplemented +## in feature tests. ## -## If you submit a pull request containing new view or controller tests, it will not be +## If you submit a pull request containing new view or controller tests, it will not be ## merged. diff --git a/spec/views/roles/new.html.haml_spec.rb b/spec/views/roles/new.html.haml_spec.rb index 01dcd4c60..341bd91f8 100644 --- a/spec/views/roles/new.html.haml_spec.rb +++ b/spec/views/roles/new.html.haml_spec.rb @@ -1,13 +1,13 @@ ## DEPRECATION NOTICE: Do not add new tests to this file! ## -## View and controller tests are deprecated in the Growstuff project. -## We no longer write new view and controller tests, but instead write -## feature tests (in spec/features) using Capybara (https://github.com/jnicklas/capybara). -## These test the full stack, behaving as a browser, and require less complicated setup -## to run. Please feel free to delete old view/controller tests as they are reimplemented -## in feature tests. +## View and controller tests are deprecated in the Growstuff project. +## We no longer write new view and controller tests, but instead write +## feature tests (in spec/features) using Capybara (https://github.com/jnicklas/capybara). +## These test the full stack, behaving as a browser, and require less complicated setup +## to run. Please feel free to delete old view/controller tests as they are reimplemented +## in feature tests. ## -## If you submit a pull request containing new view or controller tests, it will not be +## If you submit a pull request containing new view or controller tests, it will not be ## merged. diff --git a/spec/views/roles/show.html.haml_spec.rb b/spec/views/roles/show.html.haml_spec.rb index cc0eb506e..ec2934088 100644 --- a/spec/views/roles/show.html.haml_spec.rb +++ b/spec/views/roles/show.html.haml_spec.rb @@ -1,13 +1,13 @@ ## DEPRECATION NOTICE: Do not add new tests to this file! ## -## View and controller tests are deprecated in the Growstuff project. -## We no longer write new view and controller tests, but instead write -## feature tests (in spec/features) using Capybara (https://github.com/jnicklas/capybara). -## These test the full stack, behaving as a browser, and require less complicated setup -## to run. Please feel free to delete old view/controller tests as they are reimplemented -## in feature tests. +## View and controller tests are deprecated in the Growstuff project. +## We no longer write new view and controller tests, but instead write +## feature tests (in spec/features) using Capybara (https://github.com/jnicklas/capybara). +## These test the full stack, behaving as a browser, and require less complicated setup +## to run. Please feel free to delete old view/controller tests as they are reimplemented +## in feature tests. ## -## If you submit a pull request containing new view or controller tests, it will not be +## If you submit a pull request containing new view or controller tests, it will not be ## merged. diff --git a/spec/views/scientific_names/edit.html.haml_spec.rb b/spec/views/scientific_names/edit.html.haml_spec.rb index 09ff5125b..8d63f80d7 100644 --- a/spec/views/scientific_names/edit.html.haml_spec.rb +++ b/spec/views/scientific_names/edit.html.haml_spec.rb @@ -1,13 +1,13 @@ ## DEPRECATION NOTICE: Do not add new tests to this file! ## -## View and controller tests are deprecated in the Growstuff project. -## We no longer write new view and controller tests, but instead write -## feature tests (in spec/features) using Capybara (https://github.com/jnicklas/capybara). -## These test the full stack, behaving as a browser, and require less complicated setup -## to run. Please feel free to delete old view/controller tests as they are reimplemented -## in feature tests. +## View and controller tests are deprecated in the Growstuff project. +## We no longer write new view and controller tests, but instead write +## feature tests (in spec/features) using Capybara (https://github.com/jnicklas/capybara). +## These test the full stack, behaving as a browser, and require less complicated setup +## to run. Please feel free to delete old view/controller tests as they are reimplemented +## in feature tests. ## -## If you submit a pull request containing new view or controller tests, it will not be +## If you submit a pull request containing new view or controller tests, it will not be ## merged. diff --git a/spec/views/scientific_names/index.html.haml_spec.rb b/spec/views/scientific_names/index.html.haml_spec.rb index ea89ae101..64d5cb521 100644 --- a/spec/views/scientific_names/index.html.haml_spec.rb +++ b/spec/views/scientific_names/index.html.haml_spec.rb @@ -1,13 +1,13 @@ ## DEPRECATION NOTICE: Do not add new tests to this file! ## -## View and controller tests are deprecated in the Growstuff project. -## We no longer write new view and controller tests, but instead write -## feature tests (in spec/features) using Capybara (https://github.com/jnicklas/capybara). -## These test the full stack, behaving as a browser, and require less complicated setup -## to run. Please feel free to delete old view/controller tests as they are reimplemented -## in feature tests. +## View and controller tests are deprecated in the Growstuff project. +## We no longer write new view and controller tests, but instead write +## feature tests (in spec/features) using Capybara (https://github.com/jnicklas/capybara). +## These test the full stack, behaving as a browser, and require less complicated setup +## to run. Please feel free to delete old view/controller tests as they are reimplemented +## in feature tests. ## -## If you submit a pull request containing new view or controller tests, it will not be +## If you submit a pull request containing new view or controller tests, it will not be ## merged. diff --git a/spec/views/scientific_names/new.html.haml_spec.rb b/spec/views/scientific_names/new.html.haml_spec.rb index a8ad3f615..4fbf196e0 100644 --- a/spec/views/scientific_names/new.html.haml_spec.rb +++ b/spec/views/scientific_names/new.html.haml_spec.rb @@ -1,13 +1,13 @@ ## DEPRECATION NOTICE: Do not add new tests to this file! ## -## View and controller tests are deprecated in the Growstuff project. -## We no longer write new view and controller tests, but instead write -## feature tests (in spec/features) using Capybara (https://github.com/jnicklas/capybara). -## These test the full stack, behaving as a browser, and require less complicated setup -## to run. Please feel free to delete old view/controller tests as they are reimplemented -## in feature tests. +## View and controller tests are deprecated in the Growstuff project. +## We no longer write new view and controller tests, but instead write +## feature tests (in spec/features) using Capybara (https://github.com/jnicklas/capybara). +## These test the full stack, behaving as a browser, and require less complicated setup +## to run. Please feel free to delete old view/controller tests as they are reimplemented +## in feature tests. ## -## If you submit a pull request containing new view or controller tests, it will not be +## If you submit a pull request containing new view or controller tests, it will not be ## merged. diff --git a/spec/views/scientific_names/show.html.haml_spec.rb b/spec/views/scientific_names/show.html.haml_spec.rb index a36646658..2f0228a3e 100644 --- a/spec/views/scientific_names/show.html.haml_spec.rb +++ b/spec/views/scientific_names/show.html.haml_spec.rb @@ -1,13 +1,13 @@ ## DEPRECATION NOTICE: Do not add new tests to this file! ## -## View and controller tests are deprecated in the Growstuff project. -## We no longer write new view and controller tests, but instead write -## feature tests (in spec/features) using Capybara (https://github.com/jnicklas/capybara). -## These test the full stack, behaving as a browser, and require less complicated setup -## to run. Please feel free to delete old view/controller tests as they are reimplemented -## in feature tests. +## View and controller tests are deprecated in the Growstuff project. +## We no longer write new view and controller tests, but instead write +## feature tests (in spec/features) using Capybara (https://github.com/jnicklas/capybara). +## These test the full stack, behaving as a browser, and require less complicated setup +## to run. Please feel free to delete old view/controller tests as they are reimplemented +## in feature tests. ## -## If you submit a pull request containing new view or controller tests, it will not be +## If you submit a pull request containing new view or controller tests, it will not be ## merged. diff --git a/spec/views/seeds/edit.html.haml_spec.rb b/spec/views/seeds/edit.html.haml_spec.rb index 1c9911afa..995060c45 100644 --- a/spec/views/seeds/edit.html.haml_spec.rb +++ b/spec/views/seeds/edit.html.haml_spec.rb @@ -1,13 +1,13 @@ ## DEPRECATION NOTICE: Do not add new tests to this file! ## -## View and controller tests are deprecated in the Growstuff project. -## We no longer write new view and controller tests, but instead write -## feature tests (in spec/features) using Capybara (https://github.com/jnicklas/capybara). -## These test the full stack, behaving as a browser, and require less complicated setup -## to run. Please feel free to delete old view/controller tests as they are reimplemented -## in feature tests. +## View and controller tests are deprecated in the Growstuff project. +## We no longer write new view and controller tests, but instead write +## feature tests (in spec/features) using Capybara (https://github.com/jnicklas/capybara). +## These test the full stack, behaving as a browser, and require less complicated setup +## to run. Please feel free to delete old view/controller tests as they are reimplemented +## in feature tests. ## -## If you submit a pull request containing new view or controller tests, it will not be +## If you submit a pull request containing new view or controller tests, it will not be ## merged. diff --git a/spec/views/seeds/index.rss.haml_spec.rb b/spec/views/seeds/index.rss.haml_spec.rb index 5e88fc014..5e1ceb62f 100644 --- a/spec/views/seeds/index.rss.haml_spec.rb +++ b/spec/views/seeds/index.rss.haml_spec.rb @@ -1,13 +1,13 @@ ## DEPRECATION NOTICE: Do not add new tests to this file! ## -## View and controller tests are deprecated in the Growstuff project. -## We no longer write new view and controller tests, but instead write -## feature tests (in spec/features) using Capybara (https://github.com/jnicklas/capybara). -## These test the full stack, behaving as a browser, and require less complicated setup -## to run. Please feel free to delete old view/controller tests as they are reimplemented -## in feature tests. +## View and controller tests are deprecated in the Growstuff project. +## We no longer write new view and controller tests, but instead write +## feature tests (in spec/features) using Capybara (https://github.com/jnicklas/capybara). +## These test the full stack, behaving as a browser, and require less complicated setup +## to run. Please feel free to delete old view/controller tests as they are reimplemented +## in feature tests. ## -## If you submit a pull request containing new view or controller tests, it will not be +## If you submit a pull request containing new view or controller tests, it will not be ## merged. diff --git a/spec/views/seeds/new.html.haml_spec.rb b/spec/views/seeds/new.html.haml_spec.rb index 2f20412fa..2d90ede1f 100644 --- a/spec/views/seeds/new.html.haml_spec.rb +++ b/spec/views/seeds/new.html.haml_spec.rb @@ -1,13 +1,13 @@ ## DEPRECATION NOTICE: Do not add new tests to this file! ## -## View and controller tests are deprecated in the Growstuff project. -## We no longer write new view and controller tests, but instead write -## feature tests (in spec/features) using Capybara (https://github.com/jnicklas/capybara). -## These test the full stack, behaving as a browser, and require less complicated setup -## to run. Please feel free to delete old view/controller tests as they are reimplemented -## in feature tests. +## View and controller tests are deprecated in the Growstuff project. +## We no longer write new view and controller tests, but instead write +## feature tests (in spec/features) using Capybara (https://github.com/jnicklas/capybara). +## These test the full stack, behaving as a browser, and require less complicated setup +## to run. Please feel free to delete old view/controller tests as they are reimplemented +## in feature tests. ## -## If you submit a pull request containing new view or controller tests, it will not be +## If you submit a pull request containing new view or controller tests, it will not be ## merged. diff --git a/spec/views/seeds/show.html.haml_spec.rb b/spec/views/seeds/show.html.haml_spec.rb index 88f4f32d5..553a92fa2 100644 --- a/spec/views/seeds/show.html.haml_spec.rb +++ b/spec/views/seeds/show.html.haml_spec.rb @@ -1,13 +1,13 @@ ## DEPRECATION NOTICE: Do not add new tests to this file! ## -## View and controller tests are deprecated in the Growstuff project. -## We no longer write new view and controller tests, but instead write -## feature tests (in spec/features) using Capybara (https://github.com/jnicklas/capybara). -## These test the full stack, behaving as a browser, and require less complicated setup -## to run. Please feel free to delete old view/controller tests as they are reimplemented -## in feature tests. +## View and controller tests are deprecated in the Growstuff project. +## We no longer write new view and controller tests, but instead write +## feature tests (in spec/features) using Capybara (https://github.com/jnicklas/capybara). +## These test the full stack, behaving as a browser, and require less complicated setup +## to run. Please feel free to delete old view/controller tests as they are reimplemented +## in feature tests. ## -## If you submit a pull request containing new view or controller tests, it will not be +## If you submit a pull request containing new view or controller tests, it will not be ## merged. diff --git a/spec/views/shop/index_spec.rb b/spec/views/shop/index_spec.rb index c574f2ac4..5c1f9caef 100644 --- a/spec/views/shop/index_spec.rb +++ b/spec/views/shop/index_spec.rb @@ -1,13 +1,13 @@ ## DEPRECATION NOTICE: Do not add new tests to this file! ## -## View and controller tests are deprecated in the Growstuff project. -## We no longer write new view and controller tests, but instead write -## feature tests (in spec/features) using Capybara (https://github.com/jnicklas/capybara). -## These test the full stack, behaving as a browser, and require less complicated setup -## to run. Please feel free to delete old view/controller tests as they are reimplemented -## in feature tests. +## View and controller tests are deprecated in the Growstuff project. +## We no longer write new view and controller tests, but instead write +## feature tests (in spec/features) using Capybara (https://github.com/jnicklas/capybara). +## These test the full stack, behaving as a browser, and require less complicated setup +## to run. Please feel free to delete old view/controller tests as they are reimplemented +## in feature tests. ## -## If you submit a pull request containing new view or controller tests, it will not be +## If you submit a pull request containing new view or controller tests, it will not be ## merged. From 510c31f669a80e5370763f627c269e9412c6808d Mon Sep 17 00:00:00 2001 From: Brenda Wallace Date: Mon, 14 Nov 2016 15:10:13 +1300 Subject: [PATCH 113/268] Removed 3 blank lines that codeclimate didn't like --- app/controllers/harvests_controller.rb | 1 - app/controllers/notifications_controller.rb | 1 - app/helpers/seeds_helper.rb | 1 - 3 files changed, 3 deletions(-) diff --git a/app/controllers/harvests_controller.rb b/app/controllers/harvests_controller.rb index 739eed8fe..d7f153016 100644 --- a/app/controllers/harvests_controller.rb +++ b/app/controllers/harvests_controller.rb @@ -2,7 +2,6 @@ class HarvestsController < ApplicationController before_filter :authenticate_member!, except: [:index, :show] load_and_authorize_resource - # GET /harvests # GET /harvests.json def index diff --git a/app/controllers/notifications_controller.rb b/app/controllers/notifications_controller.rb index 06346f9d7..b6e0acbec 100644 --- a/app/controllers/notifications_controller.rb +++ b/app/controllers/notifications_controller.rb @@ -47,7 +47,6 @@ class NotificationsController < ApplicationController @sender_notification.subject : "Re: " + @sender_notification.subject - respond_to do |format| format.html # reply.html.haml end diff --git a/app/helpers/seeds_helper.rb b/app/helpers/seeds_helper.rb index 5a086953a..2d444c0f1 100644 --- a/app/helpers/seeds_helper.rb +++ b/app/helpers/seeds_helper.rb @@ -7,5 +7,4 @@ module SeedsHelper truncate(seed.description, length: 130, separator: ' ', omission: '... ') { link_to "Read more", seed_path(seed) } end end - end \ No newline at end of file From 1cac58dadc24ae9d8b66249674efc31c3fc5a953 Mon Sep 17 00:00:00 2001 From: Brenda Wallace Date: Mon, 14 Nov 2016 16:49:26 +1300 Subject: [PATCH 114/268] Allow both " and ' quote styles --- .rubocop.yml | 3 + .rubocop_todo.yml | 327 ---------------------------------------------- 2 files changed, 3 insertions(+), 327 deletions(-) diff --git a/.rubocop.yml b/.rubocop.yml index d39e7933e..a61e805f1 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -7,3 +7,6 @@ AllCops: Exclude: - 'db/schema.rb' - 'vendor/**/*' + +Style/StringLiterals: + Enabled: false diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml index 9abe56d2e..e6a71276b 100644 --- a/.rubocop_todo.yml +++ b/.rubocop_todo.yml @@ -156,11 +156,6 @@ Metrics/CyclomaticComplexity: Metrics/LineLength: Max: 223 -# Offense count: 68 -# Configuration parameters: CountComments. -Metrics/MethodLength: - Max: 104 - # Offense count: 8 Metrics/PerceivedComplexity: Max: 12 @@ -2440,328 +2435,6 @@ Style/SpaceInsideStringInterpolation: Style/SpecialGlobalVars: EnforcedStyle: use_perl_names -# Offense count: 3216 -# Cop supports --auto-correct. -# Configuration parameters: EnforcedStyle, SupportedStyles, ConsistentQuotesInMultiline. -# SupportedStyles: single_quotes, double_quotes -Style/StringLiterals: - Exclude: - - 'app/controllers/account_types_controller.rb' - - 'app/controllers/accounts_controller.rb' - - 'app/controllers/alternate_names_controller.rb' - - 'app/controllers/application_controller.rb' - - 'app/controllers/authentications_controller.rb' - - 'app/controllers/comments_controller.rb' - - 'app/controllers/crops_controller.rb' - - 'app/controllers/follows_controller.rb' - - 'app/controllers/forums_controller.rb' - - 'app/controllers/gardens_controller.rb' - - 'app/controllers/harvests_controller.rb' - - 'app/controllers/members_controller.rb' - - 'app/controllers/notifications_controller.rb' - - 'app/controllers/omniauth_callbacks_controller.rb' - - 'app/controllers/order_items_controller.rb' - - 'app/controllers/orders_controller.rb' - - 'app/controllers/pages_controller.rb' - - 'app/controllers/photos_controller.rb' - - 'app/controllers/plant_parts_controller.rb' - - 'app/controllers/plantings_controller.rb' - - 'app/controllers/posts_controller.rb' - - 'app/controllers/products_controller.rb' - - 'app/controllers/registrations_controller.rb' - - 'app/controllers/roles_controller.rb' - - 'app/controllers/scientific_names_controller.rb' - - 'app/controllers/seeds_controller.rb' - - 'app/controllers/sessions_controller.rb' - - 'app/helpers/application_helper.rb' - - 'app/helpers/crops_helper.rb' - - 'app/helpers/gardens_helper.rb' - - 'app/helpers/harvests_helper.rb' - - 'app/helpers/plantings_helper.rb' - - 'app/helpers/seeds_helper.rb' - - 'app/mailers/notifier.rb' - - 'app/models/ability.rb' - - 'app/models/account.rb' - - 'app/models/alternate_name.rb' - - 'app/models/comment.rb' - - 'app/models/crop.rb' - - 'app/models/follow.rb' - - 'app/models/forum.rb' - - 'app/models/garden.rb' - - 'app/models/harvest.rb' - - 'app/models/member.rb' - - 'app/models/notification.rb' - - 'app/models/order.rb' - - 'app/models/order_item.rb' - - 'app/models/photo.rb' - - 'app/models/planting.rb' - - 'app/models/post.rb' - - 'app/models/scientific_name.rb' - - 'app/models/seed.rb' - - 'config.rb' - - 'config/application.rb' - - 'config/environments/test.rb' - - 'config/initializers/devise.rb' - - 'config/initializers/geocoder.rb' - - 'config/initializers/time_formats.rb' - - 'config/routes.rb' - - 'config/setup_load_paths.rb' - - 'db/migrate/20120903092956_devise_create_users.rb' - - 'db/migrate/20150201053200_add_approval_status_to_crops.rb' - - 'db/seeds.rb' - - 'lib/actions/oauth_signup_action.rb' - - 'lib/haml/filters/growstuff_markdown.rb' - - 'lib/tasks/growstuff.rake' - - 'lib/tasks/hooks.rake' - - 'script/gemfile_check' - - 'script/heroku_maintenance.rb' - - 'spec/controllers/account_types_controller_spec.rb' - - 'spec/controllers/accounts_controller_spec.rb' - - 'spec/controllers/admin/orders_controller_spec.rb' - - 'spec/controllers/admin_controller_spec.rb' - - 'spec/controllers/comments_controller_spec.rb' - - 'spec/controllers/crops_controller_spec.rb' - - 'spec/controllers/forums_controller_spec.rb' - - 'spec/controllers/harvests_controller_spec.rb' - - 'spec/controllers/home_controller_spec.rb' - - 'spec/controllers/member_controller_spec.rb' - - 'spec/controllers/notifications_controller_spec.rb' - - 'spec/controllers/order_items_controller_spec.rb' - - 'spec/controllers/orders_controller_spec.rb' - - 'spec/controllers/photos_controller_spec.rb' - - 'spec/controllers/places_controller_spec.rb' - - 'spec/controllers/plantings_controller_spec.rb' - - 'spec/controllers/posts_controller_spec.rb' - - 'spec/controllers/products_controller_spec.rb' - - 'spec/controllers/registrations_controller_spec.rb' - - 'spec/controllers/roles_controller_spec.rb' - - 'spec/controllers/scientific_names_controller_spec.rb' - - 'spec/controllers/seeds_controller_spec.rb' - - 'spec/controllers/shop_controller_spec.rb' - - 'spec/factories/account_types.rb' - - 'spec/factories/alternate_names.rb' - - 'spec/factories/crop.rb' - - 'spec/factories/forums.rb' - - 'spec/factories/garden.rb' - - 'spec/factories/harvests.rb' - - 'spec/factories/member.rb' - - 'spec/factories/notifications.rb' - - 'spec/factories/order_items.rb' - - 'spec/factories/photos.rb' - - 'spec/factories/plant_parts.rb' - - 'spec/factories/planting.rb' - - 'spec/factories/post.rb' - - 'spec/factories/products.rb' - - 'spec/factories/roles.rb' - - 'spec/factories/scientific_name.rb' - - 'spec/factories/seeds.rb' - - 'spec/features/admin/account_types_spec.rb' - - 'spec/features/admin/forums_spec.rb' - - 'spec/features/admin/products_spec.rb' - - 'spec/features/cms_spec.rb' - - 'spec/features/comments/commenting_a_comment_spec.rb' - - 'spec/features/crops/alternate_name_spec.rb' - - 'spec/features/crops/browse_crops_spec.rb' - - 'spec/features/crops/creating_a_crop_spec.rb' - - 'spec/features/crops/crop_detail_page_spec.rb' - - 'spec/features/crops/crop_search_spec.rb' - - 'spec/features/crops/crop_wranglers_spec.rb' - - 'spec/features/crops/crop_wrangling_button_spec.rb' - - 'spec/features/crops/inflections_spec.rb' - - 'spec/features/crops/request_new_crop_spec.rb' - - 'spec/features/following_spec.rb' - - 'spec/features/footer_spec.rb' - - 'spec/features/gardens/adding_gardens_spec.rb' - - 'spec/features/gardens_spec.rb' - - 'spec/features/harvests/browse_harvests_spec.rb' - - 'spec/features/harvests/harvesting_a_crop_spec.rb' - - 'spec/features/locale_spec.rb' - - 'spec/features/member_profile_spec.rb' - - 'spec/features/members_list_spec.rb' - - 'spec/features/notifications_spec.rb' - - 'spec/features/photos/show_photo_spec.rb' - - 'spec/features/places/searching_a_place_spec.rb' - - 'spec/features/planting_reminder_spec.rb' - - 'spec/features/plantings/planting_a_crop_spec.rb' - - 'spec/features/posts/posting_a_post_spec.rb' - - 'spec/features/scientific_name_spec.rb' - - 'spec/features/seeds/adding_seeds_spec.rb' - - 'spec/features/seeds/misc_seeds_spec.rb' - - 'spec/features/shared_examples/append_date.rb' - - 'spec/features/shared_examples/crop_suggest.rb' - - 'spec/features/signin_spec.rb' - - 'spec/features/signout_spec.rb' - - 'spec/features/signup_spec.rb' - - 'spec/features/unsubscribing_spec.rb' - - 'spec/helpers/application_helper_spec.rb' - - 'spec/helpers/crops_helper_spec.rb' - - 'spec/helpers/gardens_helper_spec.rb' - - 'spec/helpers/harvests_helper_spec.rb' - - 'spec/helpers/notifications_helper_spec.rb' - - 'spec/helpers/plantings_helper_spec.rb' - - 'spec/helpers/seeds_helper_spec.rb' - - 'spec/lib/actions/oauth_signup_action_spec.rb' - - 'spec/lib/haml/filters/escaped_markdown_spec.rb' - - 'spec/lib/haml/filters/growstuff_markdown_spec.rb' - - 'spec/mailers/notifier_spec.rb' - - 'spec/models/ability_spec.rb' - - 'spec/models/account_spec.rb' - - 'spec/models/alternate_name_spec.rb' - - 'spec/models/comment_spec.rb' - - 'spec/models/crop_spec.rb' - - 'spec/models/follow_spec.rb' - - 'spec/models/forum_spec.rb' - - 'spec/models/garden_spec.rb' - - 'spec/models/harvest_spec.rb' - - 'spec/models/member_spec.rb' - - 'spec/models/notification_spec.rb' - - 'spec/models/order_item_spec.rb' - - 'spec/models/order_spec.rb' - - 'spec/models/photo_spec.rb' - - 'spec/models/planting_spec.rb' - - 'spec/models/post_spec.rb' - - 'spec/models/product_spec.rb' - - 'spec/models/seed_spec.rb' - - 'spec/rails_helper.rb' - - 'spec/requests/authentications_spec.rb' - - 'spec/requests/comments_spec.rb' - - 'spec/requests/forums_spec.rb' - - 'spec/requests/gardens_spec.rb' - - 'spec/requests/harvests_spec.rb' - - 'spec/requests/notifications_spec.rb' - - 'spec/requests/photos_spec.rb' - - 'spec/requests/plant_parts_spec.rb' - - 'spec/requests/plantings_spec.rb' - - 'spec/requests/post_spec.rb' - - 'spec/requests/scientific_names_spec.rb' - - 'spec/requests/seeds_spec.rb' - - 'spec/routing/account_types_routing_spec.rb' - - 'spec/routing/authentications_routing_spec.rb' - - 'spec/routing/comments_routing_spec.rb' - - 'spec/routing/crops_routing_spec.rb' - - 'spec/routing/follows_routing_spec.rb' - - 'spec/routing/forums_routing_spec.rb' - - 'spec/routing/gardens_routing_spec.rb' - - 'spec/routing/harvests_routing_spec.rb' - - 'spec/routing/notifications_routing_spec.rb' - - 'spec/routing/order_items_routing_spec.rb' - - 'spec/routing/orders_routing_spec.rb' - - 'spec/routing/photos_routing_spec.rb' - - 'spec/routing/plant_parts_routing_spec.rb' - - 'spec/routing/plantings_routing_spec.rb' - - 'spec/routing/products_routing_spec.rb' - - 'spec/routing/roles_routing_spec.rb' - - 'spec/routing/scientific_names_routing_spec.rb' - - 'spec/routing/seeds_routing_spec.rb' - - 'spec/routing/updates_routing_spec.rb' - - 'spec/spec_helper.rb' - - 'spec/support/controller_macros.rb' - - 'spec/support/elasticsearch_helpers.rb' - - 'spec/views/account_types/edit.html.haml_spec.rb' - - 'spec/views/account_types/index.html.haml_spec.rb' - - 'spec/views/account_types/new.html.haml_spec.rb' - - 'spec/views/account_types/show.html.haml_spec.rb' - - 'spec/views/accounts/edit.html.haml_spec.rb' - - 'spec/views/accounts/index.html.haml_spec.rb' - - 'spec/views/accounts/new.html.haml_spec.rb' - - 'spec/views/accounts/show.html.haml_spec.rb' - - 'spec/views/admin/index_spec.rb' - - 'spec/views/admin/newsletter_spec.rb' - - 'spec/views/admin/orders/index_spec.rb' - - 'spec/views/comments/edit.html.haml_spec.rb' - - 'spec/views/comments/index.html.haml_spec.rb' - - 'spec/views/comments/index.rss.haml_spec.rb' - - 'spec/views/comments/new.html.haml_spec.rb' - - 'spec/views/comments/show.html.haml_spec.rb' - - 'spec/views/crops/_grown_for.html.haml_spec.rb' - - 'spec/views/crops/_planting_advice.html.haml_spec.rb' - - 'spec/views/crops/_popover.html.haml_spec.rb' - - 'spec/views/crops/edit.html.haml_spec.rb' - - 'spec/views/crops/hierarchy.html.haml_spec.rb' - - 'spec/views/crops/index.html.haml_spec.rb' - - 'spec/views/crops/index.rss.haml_spec.rb' - - 'spec/views/crops/new.html.haml_spec.rb' - - 'spec/views/crops/wrangle.html.haml_spec.rb' - - 'spec/views/devise/confirmations/new_spec.rb' - - 'spec/views/devise/mailer/confirmation_instructions_spec.rb' - - 'spec/views/devise/mailer/reset_password_instructions_spec.rb' - - 'spec/views/devise/mailer/unlock_instructions_spec.rb' - - 'spec/views/devise/registrations/edit_spec.rb' - - 'spec/views/devise/registrations/new_spec.rb' - - 'spec/views/devise/sessions/new_spec.rb' - - 'spec/views/devise/shared/_links_spec.rb' - - 'spec/views/devise/unlocks/new_spec.rb' - - 'spec/views/forums/edit.html.haml_spec.rb' - - 'spec/views/forums/index.html.haml_spec.rb' - - 'spec/views/forums/new.html.haml_spec.rb' - - 'spec/views/forums/show.html.haml_spec.rb' - - 'spec/views/gardens/edit.html.haml_spec.rb' - - 'spec/views/gardens/new.html.haml_spec.rb' - - 'spec/views/gardens/show.html.haml_spec.rb' - - 'spec/views/harvests/edit.html.haml_spec.rb' - - 'spec/views/harvests/index.html.haml_spec.rb' - - 'spec/views/harvests/new.html.haml_spec.rb' - - 'spec/views/harvests/show.html.haml_spec.rb' - - 'spec/views/home/_blurb.html.haml_spec.rb' - - 'spec/views/home/_crops.html.haml_spec.rb' - - 'spec/views/home/_members.html.haml_spec.rb' - - 'spec/views/home/_seeds.html.haml_spec.rb' - - 'spec/views/home/_stats.html.haml_spec.rb' - - 'spec/views/home/index_spec.rb' - - 'spec/views/layouts/_header_spec.rb' - - 'spec/views/layouts/_meta_spec.rb' - - 'spec/views/layouts/application_spec.rb' - - 'spec/views/members/_location.html.haml_spec.rb' - - 'spec/views/members/index.html.haml_spec.rb' - - 'spec/views/members/show.rss.haml_spec.rb' - - 'spec/views/notifications/index.html.haml_spec.rb' - - 'spec/views/notifications/new.html.haml_spec.rb' - - 'spec/views/notifications/show.html.haml_spec.rb' - - 'spec/views/notifier/notify.html.haml_spec.rb' - - 'spec/views/orders/index.html.haml_spec.rb' - - 'spec/views/orders/show.html.haml_spec.rb' - - 'spec/views/photos/edit.html.haml_spec.rb' - - 'spec/views/photos/index.html.haml_spec.rb' - - 'spec/views/photos/new.html.haml_spec.rb' - - 'spec/views/photos/show.html.haml_spec.rb' - - 'spec/views/places/_map_attribution.html.haml_spec.rb' - - 'spec/views/places/index.html.haml_spec.rb' - - 'spec/views/places/show.html.haml_spec.rb' - - 'spec/views/plant_parts/edit.html.haml_spec.rb' - - 'spec/views/plant_parts/index.html.haml_spec.rb' - - 'spec/views/plant_parts/new.html.haml_spec.rb' - - 'spec/views/plant_parts/show.html.haml_spec.rb' - - 'spec/views/plantings/_form.html.haml_spec.rb' - - 'spec/views/plantings/edit.html.haml_spec.rb' - - 'spec/views/plantings/index.html.haml_spec.rb' - - 'spec/views/plantings/index.rss.haml_spec.rb' - - 'spec/views/plantings/new.html.haml_spec.rb' - - 'spec/views/plantings/show.html.haml_spec.rb' - - 'spec/views/posts/_single.html.haml_spec.rb' - - 'spec/views/posts/edit.html.haml_spec.rb' - - 'spec/views/posts/index.html.haml_spec.rb' - - 'spec/views/posts/index.rss.haml_spec.rb' - - 'spec/views/posts/new.html.haml_spec.rb' - - 'spec/views/posts/show.html.haml_spec.rb' - - 'spec/views/posts/show.rss.haml_spec.rb' - - 'spec/views/products/edit.html.haml_spec.rb' - - 'spec/views/products/index.html.haml_spec.rb' - - 'spec/views/products/new.html.haml_spec.rb' - - 'spec/views/products/show.html.haml_spec.rb' - - 'spec/views/roles/edit.html.haml_spec.rb' - - 'spec/views/roles/index.html.haml_spec.rb' - - 'spec/views/roles/new.html.haml_spec.rb' - - 'spec/views/roles/show.html.haml_spec.rb' - - 'spec/views/scientific_names/edit.html.haml_spec.rb' - - 'spec/views/scientific_names/index.html.haml_spec.rb' - - 'spec/views/scientific_names/new.html.haml_spec.rb' - - 'spec/views/scientific_names/show.html.haml_spec.rb' - - 'spec/views/seeds/edit.html.haml_spec.rb' - - 'spec/views/seeds/index.rss.haml_spec.rb' - - 'spec/views/seeds/new.html.haml_spec.rb' - - 'spec/views/seeds/show.html.haml_spec.rb' - - 'spec/views/shop/index_spec.rb' - # Offense count: 2 # Cop supports --auto-correct. # Configuration parameters: EnforcedStyle, SupportedStyles. From a91c785543b241f3fc3707151abbc13b3e23703b Mon Sep 17 00:00:00 2001 From: Brenda Wallace Date: Mon, 14 Nov 2016 16:51:17 +1300 Subject: [PATCH 115/268] Moved metrics placeholders to main rubocop.yml file --- .rubocop.yml | 36 ++++++++++++++++++++++++++++++++++++ .rubocop_todo.yml | 28 ---------------------------- 2 files changed, 36 insertions(+), 28 deletions(-) diff --git a/.rubocop.yml b/.rubocop.yml index a61e805f1..e525bb5d6 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -10,3 +10,39 @@ AllCops: Style/StringLiterals: Enabled: false + +Metrics/MethodLength: + Description: 'Avoid methods longer than 30 lines of code.' + StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#short-methods' + # Set to 30 once all methods are fixed. + # Max: 30 + Max: 104 + +# Remove the following once the code style matches +# Offense count: 59 +Metrics/AbcSize: + Max: 115 + +# Offense count: 5 +# Configuration parameters: CountComments. +Metrics/BlockLength: + Max: 62 + +# Offense count: 6 +# Configuration parameters: CountComments. +Metrics/ClassLength: + Max: 275 + +# Offense count: 6 +Metrics/CyclomaticComplexity: + Max: 11 + +# Offense count: 1108 +# Configuration parameters: AllowHeredoc, AllowURI, URISchemes, IgnoreCopDirectives. +# URISchemes: http, https +Metrics/LineLength: + Max: 223 + +# Offense count: 8 +Metrics/PerceivedComplexity: + Max: 12 \ No newline at end of file diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml index e6a71276b..c49f33a60 100644 --- a/.rubocop_todo.yml +++ b/.rubocop_todo.yml @@ -132,34 +132,6 @@ Lint/Void: - 'spec/models/garden_spec.rb' - 'spec/models/post_spec.rb' -# Offense count: 59 -Metrics/AbcSize: - Max: 115 - -# Offense count: 5 -# Configuration parameters: CountComments. -Metrics/BlockLength: - Max: 62 - -# Offense count: 6 -# Configuration parameters: CountComments. -Metrics/ClassLength: - Max: 275 - -# Offense count: 6 -Metrics/CyclomaticComplexity: - Max: 11 - -# Offense count: 1108 -# Configuration parameters: AllowHeredoc, AllowURI, URISchemes, IgnoreCopDirectives. -# URISchemes: http, https -Metrics/LineLength: - Max: 223 - -# Offense count: 8 -Metrics/PerceivedComplexity: - Max: 12 - # Offense count: 5 # Cop supports --auto-correct. Performance/StringReplacement: From 0475954acf0279862a622f784bd636cde70c238d Mon Sep 17 00:00:00 2001 From: Brenda Wallace Date: Wed, 16 Nov 2016 12:50:14 +1300 Subject: [PATCH 116/268] Removed extra blank lines --- db/migrate/20150201052245_create_cms.rb | 2 -- spec/models/member_spec.rb | 2 -- spec/support/controller_macros.rb | 1 - 3 files changed, 5 deletions(-) diff --git a/db/migrate/20150201052245_create_cms.rb b/db/migrate/20150201052245_create_cms.rb index 585e52396..1a3ed751f 100644 --- a/db/migrate/20150201052245_create_cms.rb +++ b/db/migrate/20150201052245_create_cms.rb @@ -1,7 +1,5 @@ class CreateCms < ActiveRecord::Migration - def self.up - text_limit = case ActiveRecord::Base.connection.adapter_name when 'PostgreSQL' { } diff --git a/spec/models/member_spec.rb b/spec/models/member_spec.rb index 8689b4f0e..474819018 100644 --- a/spec/models/member_spec.rb +++ b/spec/models/member_spec.rb @@ -380,8 +380,6 @@ describe 'member' do end context 'member who followed another member' do - - let(:member1) { FactoryGirl.create(:member) } let(:member2) { FactoryGirl.create(:member) } let(:member3) { FactoryGirl.create(:member) } diff --git a/spec/support/controller_macros.rb b/spec/support/controller_macros.rb index 6860e8ac7..e5781444e 100644 --- a/spec/support/controller_macros.rb +++ b/spec/support/controller_macros.rb @@ -1,7 +1,6 @@ # Taken unashamedly from https://github.com/plataformatec/devise/wiki/How-To%3a-Controllers-and-Views-tests-with-Rails-3-%28and-rspec%29 module ControllerMacros def login_member(member_factory=:member) - let(:member) { member = FactoryGirl.create(member_factory || :member) } before(:each) do From 6bd9bd98d9d0537d7460ba656b0b57f55427862b Mon Sep 17 00:00:00 2001 From: Brenda Wallace Date: Wed, 16 Nov 2016 12:52:48 +1300 Subject: [PATCH 117/268] Removed extra blank lines, & added a end of file --- .rubocop_todo.yml | 38 ------------------- .../omniauth_callbacks_controller.rb | 2 +- app/controllers/passwords_controller.rb | 2 +- app/helpers/application_helper.rb | 1 - app/helpers/seeds_helper.rb | 2 +- config.rb | 1 - config/application.rb | 2 +- config/environments/test.rb | 2 +- config/initializers/geocoder.rb | 2 +- config/initializers/sidekiq.rb | 2 +- .../20140928044231_add_crops_posts_table.rb | 2 +- db/migrate/20150201052245_create_cms.rb | 1 - lib/actions/oauth_signup_action.rb | 2 +- script/check_contributors_md | 1 - spec/features/cms_spec.rb | 2 +- .../comments/commenting_a_comment_spec.rb | 2 +- spec/features/crops/creating_a_crop_spec.rb | 2 +- spec/features/members_list_spec.rb | 2 +- spec/features/notifications_spec.rb | 2 +- spec/features/photos/show_photo_spec.rb | 1 - .../features/places/searching_a_place_spec.rb | 2 +- .../plantings/planting_a_crop_spec.rb | 1 - spec/features/shared_examples/append_date.rb | 2 +- spec/features/unsubscribing_spec.rb | 2 +- spec/helpers/plantings_helper_spec.rb | 2 +- spec/lib/actions/oauth_signup_action_spec.rb | 2 +- spec/models/follow_spec.rb | 2 +- spec/support/database_cleaner.rb | 2 +- spec/support/feature_helpers.rb | 2 +- .../devise/mailer/unlock_instructions_spec.rb | 1 - spec/views/plant_parts/show.html.haml_spec.rb | 1 - spec/views/plantings/_form.html.haml_spec.rb | 1 - 32 files changed, 22 insertions(+), 69 deletions(-) diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml index c49f33a60..cf8d99b02 100644 --- a/.rubocop_todo.yml +++ b/.rubocop_todo.yml @@ -2446,44 +2446,6 @@ Style/TernaryParentheses: Exclude: - 'app/helpers/plantings_helper.rb' -# Offense count: 31 -# Cop supports --auto-correct. -# Configuration parameters: EnforcedStyle, SupportedStyles. -# SupportedStyles: final_newline, final_blank_line -Style/TrailingBlankLines: - Exclude: - - 'app/controllers/omniauth_callbacks_controller.rb' - - 'app/controllers/passwords_controller.rb' - - 'app/helpers/application_helper.rb' - - 'app/helpers/seeds_helper.rb' - - 'config.rb' - - 'config/application.rb' - - 'config/environments/test.rb' - - 'config/initializers/geocoder.rb' - - 'config/initializers/sidekiq.rb' - - 'db/migrate/20140928044231_add_crops_posts_table.rb' - - 'db/migrate/20150201052245_create_cms.rb' - - 'lib/actions/oauth_signup_action.rb' - - 'script/check_contributors_md' - - 'spec/features/cms_spec.rb' - - 'spec/features/comments/commenting_a_comment_spec.rb' - - 'spec/features/crops/creating_a_crop_spec.rb' - - 'spec/features/members_list_spec.rb' - - 'spec/features/notifications_spec.rb' - - 'spec/features/photos/show_photo_spec.rb' - - 'spec/features/places/searching_a_place_spec.rb' - - 'spec/features/plantings/planting_a_crop_spec.rb' - - 'spec/features/shared_examples/append_date.rb' - - 'spec/features/unsubscribing_spec.rb' - - 'spec/helpers/plantings_helper_spec.rb' - - 'spec/lib/actions/oauth_signup_action_spec.rb' - - 'spec/models/follow_spec.rb' - - 'spec/support/database_cleaner.rb' - - 'spec/support/feature_helpers.rb' - - 'spec/views/devise/mailer/unlock_instructions_spec.rb' - - 'spec/views/plant_parts/show.html.haml_spec.rb' - - 'spec/views/plantings/_form.html.haml_spec.rb' - # Offense count: 5 # Cop supports --auto-correct. # Configuration parameters: EnforcedStyleForMultiline, SupportedStyles. diff --git a/app/controllers/omniauth_callbacks_controller.rb b/app/controllers/omniauth_callbacks_controller.rb index f6795bdef..bf479ccbc 100644 --- a/app/controllers/omniauth_callbacks_controller.rb +++ b/app/controllers/omniauth_callbacks_controller.rb @@ -48,4 +48,4 @@ class OmniauthCallbacksController < Devise::OmniauthCallbacksController finish_signup_path(resource) end end -end \ No newline at end of file +end diff --git a/app/controllers/passwords_controller.rb b/app/controllers/passwords_controller.rb index 7a31ffddd..1ec2486cc 100644 --- a/app/controllers/passwords_controller.rb +++ b/app/controllers/passwords_controller.rb @@ -4,4 +4,4 @@ protected def after_resetting_password_path_for(resource) root_path end -end \ No newline at end of file +end diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 3508c4d0d..89646d8b3 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -86,4 +86,3 @@ module ApplicationHelper "#{size} #{model_name}" end end - diff --git a/app/helpers/seeds_helper.rb b/app/helpers/seeds_helper.rb index 2d444c0f1..8606289f7 100644 --- a/app/helpers/seeds_helper.rb +++ b/app/helpers/seeds_helper.rb @@ -7,4 +7,4 @@ module SeedsHelper truncate(seed.description, length: 130, separator: ' ', omission: '... ') { link_to "Read more", seed_path(seed) } end end -end \ No newline at end of file +end diff --git a/config.rb b/config.rb index 5cd5b6cc6..609849e17 100644 --- a/config.rb +++ b/config.rb @@ -22,4 +22,3 @@ images_dir = "app/assets/images" preferred_syntax = :sass # and then run: # sass-convert -R --from scss --to sass sass scss && rm -rf sass && mv scss sass - diff --git a/config/application.rb b/config/application.rb index cbc72e4fa..2dff668c1 100644 --- a/config/application.rb +++ b/config/application.rb @@ -108,4 +108,4 @@ module Growstuff config.active_record.raise_in_transactional_callbacks = true end -end \ No newline at end of file +end diff --git a/config/environments/test.rb b/config/environments/test.rb index c2e0d8f96..f59962926 100644 --- a/config/environments/test.rb +++ b/config/environments/test.rb @@ -122,4 +122,4 @@ OmniAuth.config.mock_auth[:facebook] = OmniAuth::AuthHash.new({ token: "token", secret: "donttell" } -}) \ No newline at end of file +}) diff --git a/config/initializers/geocoder.rb b/config/initializers/geocoder.rb index 9c52ced91..67ce37799 100644 --- a/config/initializers/geocoder.rb +++ b/config/initializers/geocoder.rb @@ -13,4 +13,4 @@ Geocoder.configure( # Reported as https://github.com/alexreisner/geocoder/issues/509 if Geocoder.config.lookup != :test Geocoder.configure(lookup: :nominatim) -end \ No newline at end of file +end diff --git a/config/initializers/sidekiq.rb b/config/initializers/sidekiq.rb index 074c85f33..4dab98d12 100644 --- a/config/initializers/sidekiq.rb +++ b/config/initializers/sidekiq.rb @@ -6,4 +6,4 @@ end Sidekiq.configure_client do |config| config.redis = { url: 'redis://localhost:6379/0', namespace: "app3_sidekiq_#{Rails.env}" } -end \ No newline at end of file +end diff --git a/db/migrate/20140928044231_add_crops_posts_table.rb b/db/migrate/20140928044231_add_crops_posts_table.rb index 6f200c3d8..475a993f5 100644 --- a/db/migrate/20140928044231_add_crops_posts_table.rb +++ b/db/migrate/20140928044231_add_crops_posts_table.rb @@ -7,4 +7,4 @@ class AddCropsPostsTable < ActiveRecord::Migration add_index :crops_posts, [:crop_id, :post_id] add_index :crops_posts, :crop_id end -end \ No newline at end of file +end diff --git a/db/migrate/20150201052245_create_cms.rb b/db/migrate/20150201052245_create_cms.rb index 1a3ed751f..312bff94f 100644 --- a/db/migrate/20150201052245_create_cms.rb +++ b/db/migrate/20150201052245_create_cms.rb @@ -135,4 +135,3 @@ class CreateCms < ActiveRecord::Migration drop_table :comfy_cms_categorizations end end - diff --git a/lib/actions/oauth_signup_action.rb b/lib/actions/oauth_signup_action.rb index 626d4c6c3..5c8825495 100644 --- a/lib/actions/oauth_signup_action.rb +++ b/lib/actions/oauth_signup_action.rb @@ -73,4 +73,4 @@ class Growstuff::OauthSignupAction name end -end \ No newline at end of file +end diff --git a/script/check_contributors_md b/script/check_contributors_md index d108ca56c..2bf2e6a4e 100755 --- a/script/check_contributors_md +++ b/script/check_contributors_md @@ -35,4 +35,3 @@ Please add your name and GitHub handle to the file CONTRIBUTORS.md, commit it, and update your PR. } end - diff --git a/spec/features/cms_spec.rb b/spec/features/cms_spec.rb index ad10acd12..768806e59 100644 --- a/spec/features/cms_spec.rb +++ b/spec/features/cms_spec.rb @@ -23,4 +23,4 @@ feature "cms admin" do visit comfy_admin_cms_path expect(current_path).to match /#{comfy_admin_cms_path}/ # match any CMS admin page end -end \ No newline at end of file +end diff --git a/spec/features/comments/commenting_a_comment_spec.rb b/spec/features/comments/commenting_a_comment_spec.rb index 49183c274..4d7c956bd 100644 --- a/spec/features/comments/commenting_a_comment_spec.rb +++ b/spec/features/comments/commenting_a_comment_spec.rb @@ -30,4 +30,4 @@ feature 'Commenting on a post' do expect(page).to have_content "edited at" end end -end \ No newline at end of file +end diff --git a/spec/features/crops/creating_a_crop_spec.rb b/spec/features/crops/creating_a_crop_spec.rb index d234818b8..b97866fd8 100644 --- a/spec/features/crops/creating_a_crop_spec.rb +++ b/spec/features/crops/creating_a_crop_spec.rb @@ -31,4 +31,4 @@ feature "Crop - " do expect(page).to have_content "Jasminum sambac 2" expect(page).to have_content "Matsurika" end -end \ No newline at end of file +end diff --git a/spec/features/members_list_spec.rb b/spec/features/members_list_spec.rb index 99e15820a..01b6ee8bd 100644 --- a/spec/features/members_list_spec.rb +++ b/spec/features/members_list_spec.rb @@ -27,4 +27,4 @@ feature "members list" do expect(all_links.last).to have_text member1.login_name end end -end \ No newline at end of file +end diff --git a/spec/features/notifications_spec.rb b/spec/features/notifications_spec.rb index 9949a619d..05d02c764 100644 --- a/spec/features/notifications_spec.rb +++ b/spec/features/notifications_spec.rb @@ -49,4 +49,4 @@ feature "Notifications", :js do expect(page).to have_selector 'tr', count: 5 end end -end \ No newline at end of file +end diff --git a/spec/features/photos/show_photo_spec.rb b/spec/features/photos/show_photo_spec.rb index bf72f5fd6..ea3a20f14 100644 --- a/spec/features/photos/show_photo_spec.rb +++ b/spec/features/photos/show_photo_spec.rb @@ -39,4 +39,3 @@ feature "show photo page" do end end end - diff --git a/spec/features/places/searching_a_place_spec.rb b/spec/features/places/searching_a_place_spec.rb index e8562c244..10797d917 100644 --- a/spec/features/places/searching_a_place_spec.rb +++ b/spec/features/places/searching_a_place_spec.rb @@ -58,4 +58,4 @@ feature "User searches" do fill_in "new_place", with: search_string click_button "search_button" end -end \ No newline at end of file +end diff --git a/spec/features/plantings/planting_a_crop_spec.rb b/spec/features/plantings/planting_a_crop_spec.rb index 79e8a8599..2494e7e41 100644 --- a/spec/features/plantings/planting_a_crop_spec.rb +++ b/spec/features/plantings/planting_a_crop_spec.rb @@ -276,4 +276,3 @@ feature "Planting a crop", :js do it_behaves_like "append date" end end - diff --git a/spec/features/shared_examples/append_date.rb b/spec/features/shared_examples/append_date.rb index 310e39606..3457663e6 100644 --- a/spec/features/shared_examples/append_date.rb +++ b/spec/features/shared_examples/append_date.rb @@ -18,4 +18,4 @@ shared_examples "append date" do click_link "Confirm without date" expect(page).to have_content("Finished: Yes (no date specified) ") end -end \ No newline at end of file +end diff --git a/spec/features/unsubscribing_spec.rb b/spec/features/unsubscribing_spec.rb index 4b4981ad9..ba231d1d8 100644 --- a/spec/features/unsubscribing_spec.rb +++ b/spec/features/unsubscribing_spec.rb @@ -56,4 +56,4 @@ feature "unsubscribe" do expect(member.send_planting_reminder).to eq(true) expect(member.send_notification_email).to eq(true) end -end \ No newline at end of file +end diff --git a/spec/helpers/plantings_helper_spec.rb b/spec/helpers/plantings_helper_spec.rb index ae8c78c78..b7acfaaca 100644 --- a/spec/helpers/plantings_helper_spec.rb +++ b/spec/helpers/plantings_helper_spec.rb @@ -71,4 +71,4 @@ describe PlantingsHelper do end end -end \ No newline at end of file +end diff --git a/spec/lib/actions/oauth_signup_action_spec.rb b/spec/lib/actions/oauth_signup_action_spec.rb index 7ea84ceb3..da654e8e6 100644 --- a/spec/lib/actions/oauth_signup_action_spec.rb +++ b/spec/lib/actions/oauth_signup_action_spec.rb @@ -168,4 +168,4 @@ describe 'Growstuff::OauthSignupAction' do end end end -end \ No newline at end of file +end diff --git a/spec/models/follow_spec.rb b/spec/models/follow_spec.rb index d0b74b1e6..6005583f8 100644 --- a/spec/models/follow_spec.rb +++ b/spec/models/follow_spec.rb @@ -42,4 +42,4 @@ describe Follow do end end -end \ No newline at end of file +end diff --git a/spec/support/database_cleaner.rb b/spec/support/database_cleaner.rb index 051579ea7..36c994e6f 100644 --- a/spec/support/database_cleaner.rb +++ b/spec/support/database_cleaner.rb @@ -20,4 +20,4 @@ RSpec.configure do |config| DatabaseCleaner.clean end -end \ No newline at end of file +end diff --git a/spec/support/feature_helpers.rb b/spec/support/feature_helpers.rb index b4da3b755..bf23c2854 100644 --- a/spec/support/feature_helpers.rb +++ b/spec/support/feature_helpers.rb @@ -17,4 +17,4 @@ end RSpec.configure do |config| config.include FeatureHelpers, type: :feature -end \ No newline at end of file +end diff --git a/spec/views/devise/mailer/unlock_instructions_spec.rb b/spec/views/devise/mailer/unlock_instructions_spec.rb index ce4cd10a8..da74564c1 100644 --- a/spec/views/devise/mailer/unlock_instructions_spec.rb +++ b/spec/views/devise/mailer/unlock_instructions_spec.rb @@ -31,4 +31,3 @@ describe 'devise/mailer/unlock_instructions.html.haml', type: "view" do end end end - diff --git a/spec/views/plant_parts/show.html.haml_spec.rb b/spec/views/plant_parts/show.html.haml_spec.rb index f64171f5c..66a6ddbb7 100644 --- a/spec/views/plant_parts/show.html.haml_spec.rb +++ b/spec/views/plant_parts/show.html.haml_spec.rb @@ -32,4 +32,3 @@ describe "plant_parts/show" do end end end - diff --git a/spec/views/plantings/_form.html.haml_spec.rb b/spec/views/plantings/_form.html.haml_spec.rb index 0cb0ee09f..d2cdcf441 100644 --- a/spec/views/plantings/_form.html.haml_spec.rb +++ b/spec/views/plantings/_form.html.haml_spec.rb @@ -38,4 +38,3 @@ describe "plantings/_form" do end end - From e182247774b27368b9792b6a0f9a063767eb8b15 Mon Sep 17 00:00:00 2001 From: Brenda Wallace Date: Wed, 16 Nov 2016 13:09:04 +1300 Subject: [PATCH 118/268] Removed the ignores for trailing whitespace --- .rubocop_todo.yml | 180 ---------------------------------------------- 1 file changed, 180 deletions(-) diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml index cf8d99b02..37ffe01b0 100644 --- a/.rubocop_todo.yml +++ b/.rubocop_todo.yml @@ -2467,186 +2467,6 @@ Style/TrailingCommaInLiteral: - 'config/environments/test.rb' - 'spec/rails_helper.rb' -# Offense count: 977 -# Cop supports --auto-correct. -Style/TrailingWhitespace: - Exclude: - - 'app/controllers/account_types_controller.rb' - - 'app/controllers/accounts_controller.rb' - - 'app/controllers/comments_controller.rb' - - 'app/controllers/crops_controller.rb' - - 'app/controllers/harvests_controller.rb' - - 'app/controllers/members_controller.rb' - - 'app/controllers/notifications_controller.rb' - - 'app/controllers/photos_controller.rb' - - 'app/controllers/roles_controller.rb' - - 'app/helpers/seeds_helper.rb' - - 'app/mailers/notifier.rb' - - 'app/models/ability.rb' - - 'app/models/account.rb' - - 'app/models/harvest.rb' - - 'app/models/member.rb' - - 'app/models/order.rb' - - 'app/models/planting.rb' - - 'app/models/post.rb' - - 'config/environments/development.rb' - - 'config/environments/staging.rb' - - 'config/environments/test.rb' - - 'db/migrate/20130326092227_change_planted_at_to_date.rb' - - 'db/migrate/20150201052245_create_cms.rb' - - 'db/seeds.rb' - - 'lib/actions/oauth_signup_action.rb' - - 'lib/tasks/growstuff.rake' - - 'spec/controllers/account_types_controller_spec.rb' - - 'spec/controllers/accounts_controller_spec.rb' - - 'spec/controllers/admin/orders_controller_spec.rb' - - 'spec/controllers/admin_controller_spec.rb' - - 'spec/controllers/authentications_controller_spec.rb' - - 'spec/controllers/comments_controller_spec.rb' - - 'spec/controllers/crops_controller_spec.rb' - - 'spec/controllers/forums_controller_spec.rb' - - 'spec/controllers/gardens_controller_spec.rb' - - 'spec/controllers/harvests_controller_spec.rb' - - 'spec/controllers/home_controller_spec.rb' - - 'spec/controllers/member_controller_spec.rb' - - 'spec/controllers/notifications_controller_spec.rb' - - 'spec/controllers/order_items_controller_spec.rb' - - 'spec/controllers/orders_controller_spec.rb' - - 'spec/controllers/photos_controller_spec.rb' - - 'spec/controllers/places_controller_spec.rb' - - 'spec/controllers/plant_parts_controller_spec.rb' - - 'spec/controllers/plantings_controller_spec.rb' - - 'spec/controllers/posts_controller_spec.rb' - - 'spec/controllers/products_controller_spec.rb' - - 'spec/controllers/registrations_controller_spec.rb' - - 'spec/controllers/roles_controller_spec.rb' - - 'spec/controllers/scientific_names_controller_spec.rb' - - 'spec/controllers/seeds_controller_spec.rb' - - 'spec/controllers/shop_controller_spec.rb' - - 'spec/factories/crop.rb' - - 'spec/factories/follows.rb' - - 'spec/features/admin/forums_spec.rb' - - 'spec/features/admin/products_spec.rb' - - 'spec/features/crops/crop_detail_page_spec.rb' - - 'spec/features/planting_reminder_spec.rb' - - 'spec/features/plantings/planting_a_crop_spec.rb' - - 'spec/features/signin_spec.rb' - - 'spec/features/signup_spec.rb' - - 'spec/helpers/crops_helper_spec.rb' - - 'spec/helpers/notifications_helper_spec.rb' - - 'spec/lib/actions/oauth_signup_action_spec.rb' - - 'spec/models/ability_spec.rb' - - 'spec/models/comment_spec.rb' - - 'spec/models/crop_spec.rb' - - 'spec/models/follow_spec.rb' - - 'spec/models/garden_spec.rb' - - 'spec/models/harvest_spec.rb' - - 'spec/models/member_spec.rb' - - 'spec/models/order_spec.rb' - - 'spec/models/planting_spec.rb' - - 'spec/models/post_spec.rb' - - 'spec/support/controller_macros.rb' - - 'spec/views/account_types/edit.html.haml_spec.rb' - - 'spec/views/account_types/index.html.haml_spec.rb' - - 'spec/views/account_types/new.html.haml_spec.rb' - - 'spec/views/account_types/show.html.haml_spec.rb' - - 'spec/views/accounts/edit.html.haml_spec.rb' - - 'spec/views/accounts/index.html.haml_spec.rb' - - 'spec/views/accounts/new.html.haml_spec.rb' - - 'spec/views/accounts/show.html.haml_spec.rb' - - 'spec/views/admin/index_spec.rb' - - 'spec/views/admin/newsletter_spec.rb' - - 'spec/views/admin/orders/index_spec.rb' - - 'spec/views/comments/edit.html.haml_spec.rb' - - 'spec/views/comments/index.html.haml_spec.rb' - - 'spec/views/comments/index.rss.haml_spec.rb' - - 'spec/views/comments/new.html.haml_spec.rb' - - 'spec/views/comments/show.html.haml_spec.rb' - - 'spec/views/crops/_grown_for.html.haml_spec.rb' - - 'spec/views/crops/_planting_advice.html.haml_spec.rb' - - 'spec/views/crops/_popover.html.haml_spec.rb' - - 'spec/views/crops/edit.html.haml_spec.rb' - - 'spec/views/crops/hierarchy.html.haml_spec.rb' - - 'spec/views/crops/index.html.haml_spec.rb' - - 'spec/views/crops/index.rss.haml_spec.rb' - - 'spec/views/crops/new.html.haml_spec.rb' - - 'spec/views/crops/wrangle.html.haml_spec.rb' - - 'spec/views/devise/mailer/confirmation_instructions_spec.rb' - - 'spec/views/devise/mailer/reset_password_instructions_spec.rb' - - 'spec/views/devise/mailer/unlock_instructions_spec.rb' - - 'spec/views/devise/registrations/edit_spec.rb' - - 'spec/views/devise/registrations/new_spec.rb' - - 'spec/views/devise/sessions/new_spec.rb' - - 'spec/views/devise/unlocks/new_spec.rb' - - 'spec/views/forums/edit.html.haml_spec.rb' - - 'spec/views/forums/index.html.haml_spec.rb' - - 'spec/views/forums/new.html.haml_spec.rb' - - 'spec/views/forums/show.html.haml_spec.rb' - - 'spec/views/gardens/edit.html.haml_spec.rb' - - 'spec/views/gardens/new.html.haml_spec.rb' - - 'spec/views/gardens/show.html.haml_spec.rb' - - 'spec/views/harvests/edit.html.haml_spec.rb' - - 'spec/views/harvests/index.html.haml_spec.rb' - - 'spec/views/harvests/new.html.haml_spec.rb' - - 'spec/views/harvests/show.html.haml_spec.rb' - - 'spec/views/home/_blurb.html.haml_spec.rb' - - 'spec/views/home/_crops.html.haml_spec.rb' - - 'spec/views/home/_members.html.haml_spec.rb' - - 'spec/views/home/_seeds.html.haml_spec.rb' - - 'spec/views/home/_stats.html.haml_spec.rb' - - 'spec/views/home/index_spec.rb' - - 'spec/views/layouts/_meta_spec.rb' - - 'spec/views/layouts/application_spec.rb' - - 'spec/views/members/_location.html.haml_spec.rb' - - 'spec/views/members/show.rss.haml_spec.rb' - - 'spec/views/notifications/index.html.haml_spec.rb' - - 'spec/views/notifications/new.html.haml_spec.rb' - - 'spec/views/notifications/show.html.haml_spec.rb' - - 'spec/views/notifier/notify.html.haml_spec.rb' - - 'spec/views/orders/index.html.haml_spec.rb' - - 'spec/views/orders/show.html.haml_spec.rb' - - 'spec/views/photos/edit.html.haml_spec.rb' - - 'spec/views/photos/index.html.haml_spec.rb' - - 'spec/views/photos/new.html.haml_spec.rb' - - 'spec/views/photos/show.html.haml_spec.rb' - - 'spec/views/places/_map_attribution.html.haml_spec.rb' - - 'spec/views/places/index.html.haml_spec.rb' - - 'spec/views/places/show.html.haml_spec.rb' - - 'spec/views/plant_parts/edit.html.haml_spec.rb' - - 'spec/views/plant_parts/index.html.haml_spec.rb' - - 'spec/views/plant_parts/new.html.haml_spec.rb' - - 'spec/views/plant_parts/show.html.haml_spec.rb' - - 'spec/views/plantings/_form.html.haml_spec.rb' - - 'spec/views/plantings/edit.html.haml_spec.rb' - - 'spec/views/plantings/index.html.haml_spec.rb' - - 'spec/views/plantings/index.rss.haml_spec.rb' - - 'spec/views/plantings/new.html.haml_spec.rb' - - 'spec/views/plantings/show.html.haml_spec.rb' - - 'spec/views/posts/_single.html.haml_spec.rb' - - 'spec/views/posts/edit.html.haml_spec.rb' - - 'spec/views/posts/index.html.haml_spec.rb' - - 'spec/views/posts/index.rss.haml_spec.rb' - - 'spec/views/posts/new.html.haml_spec.rb' - - 'spec/views/posts/show.html.haml_spec.rb' - - 'spec/views/posts/show.rss.haml_spec.rb' - - 'spec/views/products/edit.html.haml_spec.rb' - - 'spec/views/products/index.html.haml_spec.rb' - - 'spec/views/products/new.html.haml_spec.rb' - - 'spec/views/products/show.html.haml_spec.rb' - - 'spec/views/roles/edit.html.haml_spec.rb' - - 'spec/views/roles/index.html.haml_spec.rb' - - 'spec/views/roles/new.html.haml_spec.rb' - - 'spec/views/roles/show.html.haml_spec.rb' - - 'spec/views/scientific_names/edit.html.haml_spec.rb' - - 'spec/views/scientific_names/index.html.haml_spec.rb' - - 'spec/views/scientific_names/new.html.haml_spec.rb' - - 'spec/views/scientific_names/show.html.haml_spec.rb' - - 'spec/views/seeds/edit.html.haml_spec.rb' - - 'spec/views/seeds/index.rss.haml_spec.rb' - - 'spec/views/seeds/new.html.haml_spec.rb' - - 'spec/views/seeds/show.html.haml_spec.rb' - - 'spec/views/shop/index_spec.rb' - # Offense count: 1 # Cop supports --auto-correct. Style/UnlessElse: From 5ec2877577039a1f1c79f95e9ba77b48d1963788 Mon Sep 17 00:00:00 2001 From: Brenda Wallace Date: Wed, 16 Nov 2016 13:18:26 +1300 Subject: [PATCH 119/268] Covert all tabs to spaces --- .rubocop_todo.yml | 8 -------- app/helpers/seeds_helper.rb | 8 +++----- ...41119130555_change_follows_member_id_to_follower_id.rb | 2 +- spec/support/controller_macros.rb | 3 +-- 4 files changed, 5 insertions(+), 16 deletions(-) diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml index c49f33a60..b18c8eb42 100644 --- a/.rubocop_todo.yml +++ b/.rubocop_todo.yml @@ -2430,14 +2430,6 @@ Style/SymbolProc: - 'app/models/post.rb' - 'lib/tasks/growstuff.rake' -# Offense count: 5 -# Cop supports --auto-correct. -Style/Tab: - Exclude: - - 'app/helpers/seeds_helper.rb' - - 'db/migrate/20141119130555_change_follows_member_id_to_follower_id.rb' - - 'spec/support/controller_macros.rb' - # Offense count: 1 # Cop supports --auto-correct. # Configuration parameters: EnforcedStyle, SupportedStyles, AllowSafeAssignment. diff --git a/app/helpers/seeds_helper.rb b/app/helpers/seeds_helper.rb index 2d4f5a299..a4647548c 100644 --- a/app/helpers/seeds_helper.rb +++ b/app/helpers/seeds_helper.rb @@ -1,11 +1,9 @@ module SeedsHelper - def display_seed_description(seed) - if seed.description.nil? - "no description provided." + if seed.description.nil? + "no description provided." else - truncate(seed.description, length: 130, separator: ' ', omission: '... ') { link_to "Read more", seed_path(seed) } + truncate(seed.description, length: 130, separator: ' ', omission: '... ') { link_to "Read more", seed_path(seed) } end end - end \ No newline at end of file diff --git a/db/migrate/20141119130555_change_follows_member_id_to_follower_id.rb b/db/migrate/20141119130555_change_follows_member_id_to_follower_id.rb index 1ac6af7f2..cb9e58d3a 100644 --- a/db/migrate/20141119130555_change_follows_member_id_to_follower_id.rb +++ b/db/migrate/20141119130555_change_follows_member_id_to_follower_id.rb @@ -1,5 +1,5 @@ class ChangeFollowsMemberIdToFollowerId < ActiveRecord::Migration def change - rename_column :follows, :member_id, :follower_id + rename_column :follows, :member_id, :follower_id end end diff --git a/spec/support/controller_macros.rb b/spec/support/controller_macros.rb index 2e8162705..e1edc890c 100644 --- a/spec/support/controller_macros.rb +++ b/spec/support/controller_macros.rb @@ -1,8 +1,7 @@ # Taken unashamedly from https://github.com/plataformatec/devise/wiki/How-To%3a-Controllers-and-Views-tests-with-Rails-3-%28and-rspec%29 module ControllerMacros def login_member(member_factory=:member) - - let(:member) { member = FactoryGirl.create(member_factory || :member) } + let(:member) { member = FactoryGirl.create(member_factory || :member) } before(:each) do @request.env["devise.mapping"] = Devise.mappings[:member] From fd29a94d6e8d701fba6bdf7e3aa3b40bd62fa415 Mon Sep 17 00:00:00 2001 From: Brenda Wallace Date: Thu, 17 Nov 2016 21:48:45 +1300 Subject: [PATCH 120/268] Whitespace fixes in Gemfile --- .rubocop.yml | 5 +++++ Gemfile | 9 +++++---- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/.rubocop.yml b/.rubocop.yml index e525bb5d6..85b644c3e 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -8,6 +8,11 @@ AllCops: - 'db/schema.rb' - 'vendor/**/*' +Style/FileName: + Exclude: + - 'Gemfile' + - 'Gemfile.lock' + Style/StringLiterals: Enabled: false diff --git a/Gemfile b/Gemfile index 1a129416f..0a445dc62 100644 --- a/Gemfile +++ b/Gemfile @@ -1,3 +1,4 @@ +# frozen_string_literal: true source 'https://rubygems.org' ruby '2.3.1' @@ -14,11 +15,11 @@ gem 'haml' gem 'bootstrap-sass', '~> 3.3.6' gem 'font-awesome-sass' -gem 'uglifier', '~> 2.7.2' # JavaScript compressor +gem 'uglifier', '~> 2.7.2' # JavaScript compressor gem 'jquery-rails' gem 'jquery-ui-rails', '~> 5.0.2' -gem 'js-routes' # provides access to Rails routes in Javascript +gem 'js-routes' # provides access to Rails routes in Javascript gem 'flickraw' gem 'leaflet-rails' @@ -68,7 +69,7 @@ gem 'omniauth-flickr', '>= 0.0.15' gem 'omniauth-facebook' # client for Elasticsearch. Elasticsearch is a flexible -# and powerful, distributed, real-time search and analytics engine. +# and powerful, distributed, real-time search and analytics engine. # An example of the use in the project is fuzzy crop search. gem "elasticsearch-model" gem "elasticsearch-rails" @@ -80,7 +81,7 @@ group :production, :staging do gem 'dalli' gem 'memcachier' gem 'rails_12factor' # supresses heroku plugin injection - gem 'bonsai-elasticsearch-rails' # Integration with Bonsa-Elasticsearch on heroku + gem 'bonsai-elasticsearch-rails' # Integration with Bonsa-Elasticsearch on heroku gem 'sparkpost_rails' end From 2872a1c29dcb3b30820253470f857845c07bf3c2 Mon Sep 17 00:00:00 2001 From: Brenda Wallace Date: Thu, 17 Nov 2016 22:02:18 +1300 Subject: [PATCH 121/268] Wrapped all long lines. reduced rubocop's line length limit to 120 --- .rubocop.yml | 2 +- app/controllers/crops_controller.rb | 11 +++++++++- app/controllers/gardens_controller.rb | 4 +++- app/controllers/members_controller.rb | 12 +++++++++-- app/controllers/places_controller.rb | 12 +++++++++-- app/controllers/plantings_controller.rb | 6 ++++-- app/helpers/auto_suggest_helper.rb | 11 +++++++--- app/helpers/gardens_helper.rb | 4 +++- app/mailers/notifier.rb | 5 ++++- app/models/crop.rb | 19 ++++++++++++----- app/models/harvest.rb | 3 ++- config/database.yml | 6 ------ config/initializers/devise.rb | 1 + config/routes.rb | 9 ++++++-- lib/tasks/growstuff.rake | 22 +++++++++++++++----- script/rails | 3 ++- spec/features/admin/products_spec.rb | 3 ++- spec/features/crops/crop_detail_page_spec.rb | 6 ++++-- spec/features/rss/plantings_spec.rb | 3 ++- spec/features/rss/posts_spec.rb | 3 ++- spec/features/rss/seeds_spec.rb | 3 ++- spec/helpers/crops_helper_spec.rb | 4 +++- spec/models/crop_spec.rb | 13 ++++++++++-- spec/models/seed_spec.rb | 5 ++++- 24 files changed, 126 insertions(+), 44 deletions(-) diff --git a/.rubocop.yml b/.rubocop.yml index 85b644c3e..426914184 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -46,7 +46,7 @@ Metrics/CyclomaticComplexity: # Configuration parameters: AllowHeredoc, AllowURI, URISchemes, IgnoreCopDirectives. # URISchemes: http, https Metrics/LineLength: - Max: 223 + Max: 120 # Offense count: 8 Metrics/PerceivedComplexity: diff --git a/app/controllers/crops_controller.rb b/app/controllers/crops_controller.rb index f6af048e6..abf2102ae 100644 --- a/app/controllers/crops_controller.rb +++ b/app/controllers/crops_controller.rb @@ -215,6 +215,15 @@ class CropsController < ApplicationController private def crop_params - params.require(:crop).permit(:en_wikipedia_url, :name, :parent_id, :creator_id, :approval_status, :request_notes, :reason_for_rejection, :rejection_notes, scientific_names_attributes: [:scientific_name, :_destroy, :id]) + params.require(:crop).permit(:en_wikipedia_url, + :name, + :parent_id, + :creator_id, + :approval_status, + :request_notes, + :reason_for_rejection, + :rejection_notes, scientific_names_attributes: [:scientific_name, + :_destroy, + :id]) end end diff --git a/app/controllers/gardens_controller.rb b/app/controllers/gardens_controller.rb index 68bb919c4..6fe5347be 100644 --- a/app/controllers/gardens_controller.rb +++ b/app/controllers/gardens_controller.rb @@ -87,7 +87,9 @@ class GardensController < ApplicationController expire_fragment("homepage_stats") respond_to do |format| - format.html { redirect_to gardens_by_owner_path(owner: @garden.owner), notice: 'Garden was successfully deleted.' } + format.html do + redirect_to gardens_by_owner_path(owner: @garden.owner), notice: 'Garden was successfully deleted.' + end format.json { head :no_content } end end diff --git a/app/controllers/members_controller.rb b/app/controllers/members_controller.rb index e3c48785e..027b40f21 100644 --- a/app/controllers/members_controller.rb +++ b/app/controllers/members_controller.rb @@ -15,7 +15,11 @@ class MembersController < ApplicationController respond_to do |format| format.html # index.html.haml - format.json { render json: @members.to_json(only: [:id, :login_name, :slug, :bio, :created_at, :location, :latitude, :longitude]) } + format.json { + render json: @members.to_json(only: [ + :id, :login_name, :slug, :bio, :created_at, :location, :latitude, :longitude + ]) + } end end @@ -32,7 +36,11 @@ class MembersController < ApplicationController respond_to do |format| format.html # show.html.haml - format.json { render json: @member.to_json(only: [:id, :login_name, :bio, :created_at, :slug, :location, :latitude, :longitude]) } + format.json { + render json: @member.to_json(only: [ + :id, :login_name, :bio, :created_at, :slug, :location, :latitude, :longitude + ]) + } format.rss { render( layout: false, locals: { member: @member } diff --git a/app/controllers/places_controller.rb b/app/controllers/places_controller.rb index 13c0bd05c..2f7331b3a 100644 --- a/app/controllers/places_controller.rb +++ b/app/controllers/places_controller.rb @@ -5,7 +5,11 @@ class PlacesController < ApplicationController respond_to do |format| format.html # json response is whatever we want to map here - format.json { render json: Member.located.to_json(only: [:id, :login_name, :slug, :location, :latitude, :longitude]) } + format.json do + render json: Member.located.to_json(only: [ + :id, :login_name, :slug, :location, :latitude, :longitude + ]) + end end end @@ -16,7 +20,11 @@ class PlacesController < ApplicationController @nearby_members = Member.nearest_to(params[:place]) respond_to do |format| format.html # show.html.haml - format.json { render json: @nearby_members.to_json(only: [:id, :login_name, :slug, :location, :latitude, :longitude]) } + format.json do + render json: @nearby_members.to_json(only: [ + :id, :login_name, :slug, :location, :latitude, :longitude + ]) + end end end diff --git a/app/controllers/plantings_controller.rb b/app/controllers/plantings_controller.rb index 276024309..ca9de8ef0 100644 --- a/app/controllers/plantings_controller.rb +++ b/app/controllers/plantings_controller.rb @@ -71,7 +71,8 @@ class PlantingsController < ApplicationController respond_to do |format| if @planting.save - @planting.update_attribute(:days_before_maturity, update_days_before_maturity(@planting, planting_params[:crop_id])) + @planting.update_attribute(:days_before_maturity, + update_days_before_maturity(@planting, planting_params[:crop_id])) format.html { redirect_to @planting, notice: 'Planting was successfully created.' } format.json { render json: @planting, status: :created, location: @planting } expire_fragment("homepage_stats") @@ -90,7 +91,8 @@ class PlantingsController < ApplicationController respond_to do |format| if @planting.update(planting_params) - @planting.update_attribute(:days_before_maturity, update_days_before_maturity(@planting, planting_params[:crop_id])) + @planting.update_attribute(:days_before_maturity, + update_days_before_maturity(@planting, planting_params[:crop_id])) format.html { redirect_to @planting, notice: 'Planting was successfully updated.' } format.json { head :no_content } else diff --git a/app/helpers/auto_suggest_helper.rb b/app/helpers/auto_suggest_helper.rb index f7722c59c..9750b342b 100644 --- a/app/helpers/auto_suggest_helper.rb +++ b/app/helpers/auto_suggest_helper.rb @@ -13,9 +13,14 @@ module AutoSuggestHelper source_path = Rails.application.routes.url_helpers.send("#{source}s_search_path") %Q{ - - - + + + }.html_safe end diff --git a/app/helpers/gardens_helper.rb b/app/helpers/gardens_helper.rb index 57f0c7bc6..fc2beae4f 100644 --- a/app/helpers/gardens_helper.rb +++ b/app/helpers/gardens_helper.rb @@ -4,7 +4,9 @@ module GardensHelper if garden.description.nil? "no description provided." else - truncate(garden.description, length: 130, separator: ' ', omission: '... ') { link_to "Read more", garden_path(garden) } + truncate(garden.description, length: 130, separator: ' ', omission: '... ') do + link_to "Read more", garden_path(garden) + end end end diff --git a/app/mailers/notifier.rb b/app/mailers/notifier.rb index e81605912..57974620c 100644 --- a/app/mailers/notifier.rb +++ b/app/mailers/notifier.rb @@ -3,7 +3,10 @@ class Notifier < ActionMailer::Base default from: "Growstuff " def verifier - raise "RAILS_SECRET_TOKEN environment variable not set - have you created config/application.yml?" unless ENV['RAILS_SECRET_TOKEN'] + unless ENV['RAILS_SECRET_TOKEN'] + raise "RAILS_SECRET_TOKEN environment variable"\ + "not set - have you created config/application.yml?" + end return ActiveSupport::MessageVerifier.new(ENV['RAILS_SECRET_TOKEN']) end diff --git a/app/models/crop.rb b/app/models/crop.rb index 02acbdcf7..7de010b1e 100644 --- a/app/models/crop.rb +++ b/app/models/crop.rb @@ -1,4 +1,4 @@ -class Crop < ActiveRecord::Base +class Crop < ActiveRecord::Base # rubocop:disable Metrics/ClassLength extend FriendlyId friendly_id :name, use: [:slugged, :finders] @@ -22,10 +22,19 @@ class Crop < ActiveRecord::Base before_destroy {|crop| crop.posts.clear} default_scope { order("lower(name) asc") } - scope :recent, -> { where(approval_status: "approved").reorder("created_at desc") } - scope :toplevel, -> { where(approval_status: "approved", parent_id: nil) } - scope :popular, -> { where(approval_status: "approved").reorder("plantings_count desc, lower(name) asc") } - scope :randomized, -> { where(approval_status: "approved").reorder('random()') } # ok on sqlite and psql, but not on mysql + scope :recent, lambda { + where(approval_status: "approved").reorder("created_at desc") + } + scope :toplevel, lambda { + where(approval_status: "approved", parent_id: nil) + } + scope :popular, lambda { + where(approval_status: "approved").reorder("plantings_count desc, lower(name) asc") + } + scope :randomized, lambda { + # ok on sqlite and psql, but not on mysql + where(approval_status: "approved").reorder('random()') + } scope :pending_approval, -> { where(approval_status: "pending") } scope :approved, -> { where(approval_status: "approved") } scope :rejected, -> { where(approval_status: "rejected") } diff --git a/app/models/harvest.rb b/app/models/harvest.rb index 3370d62a1..176562d9d 100644 --- a/app/models/harvest.rb +++ b/app/models/harvest.rb @@ -125,7 +125,8 @@ class Harvest < ActiveRecord::Base end if self.weight_quantity - string += " weighing #{number_to_human(self.weight_quantity, strip_insignificant_zeros: true)} #{self.weight_unit}" + string += " weighing #{number_to_human(self.weight_quantity, strip_insignificant_zeros: true)}"\ + " #{self.weight_unit}" end return string diff --git a/config/database.yml b/config/database.yml index eb75b3791..72f6533ae 100644 --- a/config/database.yml +++ b/config/database.yml @@ -1,16 +1,10 @@ development: adapter: postgresql database: growstuff_dev - host: localhost - user: postgres - password: postgres test: adapter: postgresql database: growstuff_test - host: localhost - user: postgres - password: postgres production: adapter: postgresql diff --git a/config/initializers/devise.rb b/config/initializers/devise.rb index d37c92188..3a7e49d44 100644 --- a/config/initializers/devise.rb +++ b/config/initializers/devise.rb @@ -1,3 +1,4 @@ +# rubocop:disable Metrics/LineLength # Use this hook to configure devise mailer, warden hooks and so forth. # Many of these configuration options can be set straight in your model. Devise.setup do |config| diff --git a/config/routes.rb b/config/routes.rb index 8d373feff..4f0438a11 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -1,10 +1,15 @@ -Growstuff::Application.routes.draw do +Growstuff::Application.routes.draw do # rubocop:disable Metrics/BlockLength get '/robots.txt' => 'robots#robots' resources :plant_parts - devise_for :members, controllers: { registrations: "registrations", passwords: "passwords", sessions: "sessions", omniauth_callbacks: "omniauth_callbacks" } + devise_for :members, controllers: { + registrations: "registrations", + passwords: "passwords", + sessions: "sessions", + omniauth_callbacks: "omniauth_callbacks" + } devise_scope :member do get '/members/unsubscribe/:message' => 'members#unsubscribe', :as => 'unsubscribe_member' end diff --git a/lib/tasks/growstuff.rake b/lib/tasks/growstuff.rake index 1e3a8188e..a46a0ca34 100644 --- a/lib/tasks/growstuff.rake +++ b/lib/tasks/growstuff.rake @@ -4,8 +4,12 @@ namespace :growstuff do # usage: rake growstuff:admin_user name=skud task admin_user: :environment do - member = Member.find_by_login_name(ENV['name']) or raise "Usage: rake growstuff:admin_user name=whoever (login name is case-sensitive)" - admin = Role.find('admin') + member = Member.find_by_login_name(ENV['name']) + unless member.present? + raise "Usage: rake growstuff:admin_user "\ + "name=whoever (login name is case-sensitive)" + end + admin = Role.find('admin') member.roles << admin end @@ -13,7 +17,11 @@ namespace :growstuff do # usage: rake growstuff:cropwrangler_user name=skud task cropwrangler_user: :environment do - member = Member.find_by_login_name(ENV['name']) or raise "Usage: rake growstuff:cropwrangler_user name=whoever (login name is case-sensitive)" + member = Member.find_by_login_name(ENV['name']) + unless member.present? + raise "Usage: rake growstuff:cropwrangler_user "\ + "name=whoever (login name is case-sensitive)" + end cw = Role.find('crop-wrangler') member.roles << cw end @@ -122,14 +130,18 @@ namespace :growstuff do puts "Adding products..." Product.find_or_create_by( name: "Annual subscription", - description: "An annual subscription gives you access to paid account features for one year. Does not auto-renew.", + description: "An annual subscription gives you access "\ + "to paid account features for one year. Does not auto-renew.", min_price: 3000, account_type_id: @paid_account.id, paid_months: 12 ) Product.find_or_create_by( name: "Seed account", - description: "A seed account helps Growstuff grow in its early days. It gives you all the features of a paid account, in perpetuity. This account type never expires.", + description: "A seed account helps Growstuff grow in its "\ + "early days. It gives you all the features of "\ + "a paid account, in perpetuity. This account "\ + "type never expires.", min_price: 15000, account_type_id: @seed_account.id, ) diff --git a/script/rails b/script/rails index f8da2cffd..8c7d72b27 100755 --- a/script/rails +++ b/script/rails @@ -1,5 +1,6 @@ #!/usr/bin/env ruby -# This command will automatically be run when you run "rails" with Rails 3 gems installed from the root of your application. +# This command will automatically be run when you run "rails" +# with Rails 3 gems installed from the root of your application. APP_PATH = File.expand_path('../../config/application', __FILE__) require File.expand_path('../../config/boot', __FILE__) diff --git a/spec/features/admin/products_spec.rb b/spec/features/admin/products_spec.rb index 849762ad8..ca24daf83 100644 --- a/spec/features/admin/products_spec.rb +++ b/spec/features/admin/products_spec.rb @@ -20,7 +20,8 @@ feature "products" do click_link "New Product" expect(current_path).to eq new_product_path fill_in 'Name', with: 'Special offer' - # note that failing to fill in a mandatory field has a messy error. This is not a priority defect but should be raised at some point. + # note that failing to fill in a mandatory field has a messy error. + # This is not a priority defect but should be raised at some point. fill_in 'Minimum price', with: '150' click_button 'Save' expect(current_path).to eq product_path(Product.last) diff --git a/spec/features/crops/crop_detail_page_spec.rb b/spec/features/crops/crop_detail_page_spec.rb index ef07fb99c..3e6a71cea 100644 --- a/spec/features/crops/crop_detail_page_spec.rb +++ b/spec/features/crops/crop_detail_page_spec.rb @@ -137,11 +137,13 @@ feature "crop detail page", js: true do end scenario "has a link to OpenFarm" do - expect(page).to have_link "OpenFarm - Growing guide", href: "https://openfarm.cc/en/crops/#{URI.escape crop.name}" + expect(page).to have_link "OpenFarm - Growing guide", + href: "https://openfarm.cc/en/crops/#{URI.escape crop.name}" end scenario "has a link to gardenate" do - expect(page).to have_link "Gardenate - Planting reminders", href: "http://www.gardenate.com/plant/#{URI.escape crop.name}" + expect(page).to have_link "Gardenate - Planting reminders", + href: "http://www.gardenate.com/plant/#{URI.escape crop.name}" end end end diff --git a/spec/features/rss/plantings_spec.rb b/spec/features/rss/plantings_spec.rb index effad2969..597d82c01 100644 --- a/spec/features/rss/plantings_spec.rb +++ b/spec/features/rss/plantings_spec.rb @@ -8,6 +8,7 @@ feature 'Plantings RSS feed' do scenario 'The index title is what we expect' do visit plantings_path(format: 'rss') - expect(page).to have_content "Recent plantings from #{ @owner ? @owner : 'all members' } (#{ENV['GROWSTUFF_SITE_NAME']})" + expect(page).to have_content "Recent plantings from "\ + "#{ @owner ? @owner : 'all members' } (#{ENV['GROWSTUFF_SITE_NAME']})" end end diff --git a/spec/features/rss/posts_spec.rb b/spec/features/rss/posts_spec.rb index 2d900ebe4..8c48ad5d2 100644 --- a/spec/features/rss/posts_spec.rb +++ b/spec/features/rss/posts_spec.rb @@ -8,6 +8,7 @@ feature 'Posts RSS feed' do scenario 'The index title is what we expect' do visit posts_path(format: 'rss') - expect(page).to have_content "Recent posts from #{ @author ? @author : 'all members' } (#{ENV['GROWSTUFF_SITE_NAME']})" + expect(page).to have_content "Recent posts from "\ + "#{ @author ? @author : 'all members' } (#{ENV['GROWSTUFF_SITE_NAME']})" end end diff --git a/spec/features/rss/seeds_spec.rb b/spec/features/rss/seeds_spec.rb index 7e5320655..0d3957f19 100644 --- a/spec/features/rss/seeds_spec.rb +++ b/spec/features/rss/seeds_spec.rb @@ -8,6 +8,7 @@ feature 'Seeds RSS feed' do scenario 'The index title is what we expect' do visit seeds_path(format: 'rss') - expect(page).to have_content "Recent seeds from #{ @owner ? @owner : 'all members' } (#{ENV['GROWSTUFF_SITE_NAME']})" + expect(page).to have_content "Recent seeds from "\ + "#{ @owner ? @owner : 'all members' } (#{ENV['GROWSTUFF_SITE_NAME']})" end end diff --git a/spec/helpers/crops_helper_spec.rb b/spec/helpers/crops_helper_spec.rb index 67714f4f0..49a570836 100644 --- a/spec/helpers/crops_helper_spec.rb +++ b/spec/helpers/crops_helper_spec.rb @@ -19,7 +19,9 @@ describe CropsHelper do end it 'should render' do - expect(helper.display_seed_availability(@member, @crop)).to eq "You have an unknown quantity of seeds of this crop." + expect( + helper.display_seed_availability(@member, @crop) + ).to eq "You have an unknown quantity of seeds of this crop." end end diff --git a/spec/models/crop_spec.rb b/spec/models/crop_spec.rb index 4d59bdc68..6ff1bd47b 100644 --- a/spec/models/crop_spec.rb +++ b/spec/models/crop_spec.rb @@ -597,8 +597,17 @@ describe Crop do end context "crop rejections" do - let!(:rejected_reason) { FactoryGirl.create(:crop, name: 'tomato', approval_status: 'rejected', reason_for_rejection: 'not edible') } - let!(:rejected_other) { FactoryGirl.create(:crop, name: 'tomato', approval_status: 'rejected', reason_for_rejection: 'other', rejection_notes: 'blah blah blah') } + let!(:rejected_reason) do + FactoryGirl.create(:crop, name: 'tomato', + approval_status: 'rejected', + reason_for_rejection: 'not edible') + end + let!(:rejected_other) do + FactoryGirl.create(:crop, name: 'tomato', + approval_status: 'rejected', + reason_for_rejection: 'other', + rejection_notes: 'blah blah blah') + end describe "rejecting a crop" do it "should give reason if a default option" do diff --git a/spec/models/seed_spec.rb b/spec/models/seed_spec.rb index 58ae5f906..aa2238d54 100644 --- a/spec/models/seed_spec.rb +++ b/spec/models/seed_spec.rb @@ -48,7 +48,10 @@ describe Seed do it 'should refuse invalid tradable_to values' do @seed = FactoryGirl.build(:seed, tradable_to: 'not valid') @seed.should_not be_valid - @seed.errors[:tradable_to].should include("You may only trade seed nowhere, locally, nationally, or internationally") + @seed.errors[:tradable_to].should include( + "You may only trade seed nowhere, locally, "\ + "nationally, or internationally" + ) end it 'should not allow nil or blank values' do From 951727e266d01bf47c569049da3da111d529bc1d Mon Sep 17 00:00:00 2001 From: Brenda Wallace Date: Sat, 19 Nov 2016 13:58:45 +1300 Subject: [PATCH 122/268] Removed offense count comment from rubocop.yml - has fixed --- .rubocop.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.rubocop.yml b/.rubocop.yml index 426914184..18428c5bc 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -42,9 +42,6 @@ Metrics/ClassLength: Metrics/CyclomaticComplexity: Max: 11 -# Offense count: 1108 -# Configuration parameters: AllowHeredoc, AllowURI, URISchemes, IgnoreCopDirectives. -# URISchemes: http, https Metrics/LineLength: Max: 120 From 9c4f011fbce8a0611f8ea9930f5bce72b238caee Mon Sep 17 00:00:00 2001 From: Brenda Wallace Date: Sat, 19 Nov 2016 22:28:38 +1300 Subject: [PATCH 123/268] Reduced percieved complexity in photos_controller.rb --- .rubocop.yml | 2 +- app/controllers/photos_controller.rb | 14 +++++++++----- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/.rubocop.yml b/.rubocop.yml index e525bb5d6..f26396137 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -45,4 +45,4 @@ Metrics/LineLength: # Offense count: 8 Metrics/PerceivedComplexity: - Max: 12 \ No newline at end of file + Max: 11 \ No newline at end of file diff --git a/app/controllers/photos_controller.rb b/app/controllers/photos_controller.rb index 2e2f44689..da3ebd659 100644 --- a/app/controllers/photos_controller.rb +++ b/app/controllers/photos_controller.rb @@ -47,11 +47,7 @@ class PhotosController < ApplicationController # POST /photos # POST /photos.json def create - @photo = Photo.find_by_flickr_photo_id(params[:photo][:flickr_photo_id]) || - Photo.new(photo_params) - @photo.owner_id = current_member.id - @photo.set_flickr_metadata - + @photo = find_or_create_from_flickr_photo params[:photo][:flickr_photo_id] collection = case params[:type] when 'garden' @@ -129,4 +125,12 @@ class PhotosController < ApplicationController params.require(:photo).permit(:flickr_photo_id, :owner_id, :title, :license_name, :license_url, :thumbnail_url, :fullsize_url, :link_url) end + + def find_or_create_from_flickr_photo(flickr_photo_id) + photo = Photo.find_by(flickr_photo_id: flickr_photo_id) + photo = Photo.new(photo_params) unless photo + photo.owner_id = current_member.id + photo.set_flickr_metadata + photo + end end From 0a54c2d98617ab4cc5f513ba35adb3dea9830621 Mon Sep 17 00:00:00 2001 From: Brenda Wallace Date: Sun, 20 Nov 2016 09:05:29 +1300 Subject: [PATCH 124/268] Moved to method: collection to use for photos --- app/controllers/photos_controller.rb | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/app/controllers/photos_controller.rb b/app/controllers/photos_controller.rb index da3ebd659..fe0ab9bf5 100644 --- a/app/controllers/photos_controller.rb +++ b/app/controllers/photos_controller.rb @@ -48,17 +48,7 @@ class PhotosController < ApplicationController # POST /photos.json def create @photo = find_or_create_from_flickr_photo params[:photo][:flickr_photo_id] - - collection = case params[:type] - when 'garden' - @photo.gardens - when 'planting' - @photo.plantings - when 'harvest' - @photo.harvests - else - nil - end + collection = which_collection? if collection && has_item_id item = params[:type].camelcase.constantize.find_by_id(params[:id]) @@ -133,4 +123,15 @@ class PhotosController < ApplicationController photo.set_flickr_metadata photo end + + def which_collection? + case params[:type] + when 'garden' + @photo.gardens + when 'planting' + @photo.plantings + when 'harvest' + @photo.harvests + end + end end From f4a26d0580ecb86dc75ca0f9397cd434b9f62a75 Mon Sep 17 00:00:00 2001 From: Brenda Wallace Date: Sun, 20 Nov 2016 09:06:04 +1300 Subject: [PATCH 125/268] has_item_id? renamed to item_id? --- app/controllers/photos_controller.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/controllers/photos_controller.rb b/app/controllers/photos_controller.rb index fe0ab9bf5..418f3c1cc 100644 --- a/app/controllers/photos_controller.rb +++ b/app/controllers/photos_controller.rb @@ -50,7 +50,7 @@ class PhotosController < ApplicationController @photo = find_or_create_from_flickr_photo params[:photo][:flickr_photo_id] collection = which_collection? - if collection && has_item_id + if collection && item_id? item = params[:type].camelcase.constantize.find_by_id(params[:id]) if item && member_owns_item(item) collection << item unless collection.include?(item) @@ -103,7 +103,7 @@ class PhotosController < ApplicationController private - def has_item_id + def item_id? params.key? :id end From 810fe14c692bdc22b9ad338d484206ef6279dd53 Mon Sep 17 00:00:00 2001 From: Brenda Wallace Date: Sun, 20 Nov 2016 09:17:42 +1300 Subject: [PATCH 126/268] Highest percieved complexity is now 10 --- .rubocop.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.rubocop.yml b/.rubocop.yml index f26396137..8665b83fa 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -45,4 +45,4 @@ Metrics/LineLength: # Offense count: 8 Metrics/PerceivedComplexity: - Max: 11 \ No newline at end of file + Max: 10 \ No newline at end of file From 2fa282e131c217f0605b8e62f600098ffb8631a8 Mon Sep 17 00:00:00 2001 From: Miles Gould Date: Wed, 8 Jun 2016 17:49:54 +0100 Subject: [PATCH 127/268] Install PhantomJS 2.1.1 on Travis-CI I've found it to be much more stable locally - hopefully it will help with our flaky CI issues (#901). Code mostly cargo-culted from https://github.com/mitchlloyd/ember-orbit/commit/9d3afe3d0434d9e3572e018d65ea96857fe5fa25 --- .travis.yml | 11 ++++++++++- Gemfile | 9 +++++---- 2 files changed, 15 insertions(+), 5 deletions(-) diff --git a/.travis.yml b/.travis.yml index de144b2ad..0fc8e1e54 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,6 +1,9 @@ sudo: false language: ruby -cache: bundler +cache: + bundler: true + directories: + - travis_phantomjs env: matrix: - GROWSTUFF_SITE_NAME="Growstuff (travis)" RAILS_SECRET_TOKEN='xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx' GROWSTUFF_ELASTICSEARCH='true' @@ -9,6 +12,12 @@ env: secure: "Z5TpM2jEX4UCvNePnk/LwltQX48U2u9BRc+Iypr1x9QW2o228QJhPIOH39a8RMUrepGnkQIq9q3ZRUn98RfrJz1yThtlNFL3NmzdQ57gKgjGwfpa0e4Dwj/ZJqV2D84tDGjvdVYLP7zzaYZxQcwk/cgNpzKf/jq97HLNP7CYuf4=" rvm: - 2.3.1 +before_install: + - export PATH=$PWD/travis_phantomjs/phantomjs-2.1.1-linux-x86_64/bin:$PATH + - if [ $(phantomjs --version) != '2.1.1' ]; then rm -rf $PWD/travis_phantomjs; mkdir -p $PWD/travis_phantomjs; fi + - if [ $(phantomjs --version) != '2.1.1' ]; then wget https://assets.membergetmember.co/software/phantomjs-2.1.1-linux-x86_64.tar.bz2 -O $PWD/travis_phantomjs/phantomjs-2.1.1-linux-x86_64.tar.bz2; fi + - if [ $(phantomjs --version) != '2.1.1' ]; then tar -xvf $PWD/travis_phantomjs/phantomjs-2.1.1-linux-x86_64.tar.bz2 -C $PWD/travis_phantomjs; fi + - phantomjs --version before_script: - psql -c 'create database growstuff_test;' -U postgres script: diff --git a/Gemfile b/Gemfile index 1a129416f..0a445dc62 100644 --- a/Gemfile +++ b/Gemfile @@ -1,3 +1,4 @@ +# frozen_string_literal: true source 'https://rubygems.org' ruby '2.3.1' @@ -14,11 +15,11 @@ gem 'haml' gem 'bootstrap-sass', '~> 3.3.6' gem 'font-awesome-sass' -gem 'uglifier', '~> 2.7.2' # JavaScript compressor +gem 'uglifier', '~> 2.7.2' # JavaScript compressor gem 'jquery-rails' gem 'jquery-ui-rails', '~> 5.0.2' -gem 'js-routes' # provides access to Rails routes in Javascript +gem 'js-routes' # provides access to Rails routes in Javascript gem 'flickraw' gem 'leaflet-rails' @@ -68,7 +69,7 @@ gem 'omniauth-flickr', '>= 0.0.15' gem 'omniauth-facebook' # client for Elasticsearch. Elasticsearch is a flexible -# and powerful, distributed, real-time search and analytics engine. +# and powerful, distributed, real-time search and analytics engine. # An example of the use in the project is fuzzy crop search. gem "elasticsearch-model" gem "elasticsearch-rails" @@ -80,7 +81,7 @@ group :production, :staging do gem 'dalli' gem 'memcachier' gem 'rails_12factor' # supresses heroku plugin injection - gem 'bonsai-elasticsearch-rails' # Integration with Bonsa-Elasticsearch on heroku + gem 'bonsai-elasticsearch-rails' # Integration with Bonsa-Elasticsearch on heroku gem 'sparkpost_rails' end From 5fc1ab9c60e88a6c1ff133d3b0dba06902cd7264 Mon Sep 17 00:00:00 2001 From: Brenda Wallace Date: Sun, 20 Nov 2016 19:35:17 +1300 Subject: [PATCH 128/268] Reduced code duplication in growstuff.rake --- lib/tasks/growstuff.rake | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/lib/tasks/growstuff.rake b/lib/tasks/growstuff.rake index 1e3a8188e..9ef918840 100644 --- a/lib/tasks/growstuff.rake +++ b/lib/tasks/growstuff.rake @@ -4,18 +4,20 @@ namespace :growstuff do # usage: rake growstuff:admin_user name=skud task admin_user: :environment do - member = Member.find_by_login_name(ENV['name']) or raise "Usage: rake growstuff:admin_user name=whoever (login name is case-sensitive)" - admin = Role.find('admin') - member.roles << admin + add_role_to_member! ENV['name'], 'admin' end desc "Add a crop wrangler user, by name" # usage: rake growstuff:cropwrangler_user name=skud task cropwrangler_user: :environment do - member = Member.find_by_login_name(ENV['name']) or raise "Usage: rake growstuff:cropwrangler_user name=whoever (login name is case-sensitive)" - cw = Role.find('crop-wrangler') - member.roles << cw + add_role_to_member! ENV['name'], 'crop-wrangler' + end + + def add_role_to_member!(login_name, role_name) + member = Member.find_by!(login_name: login_name) + role = Role.find_by!(name: role_name) + member.roles << role end desc "Upload crops from a CSV file" From cf70bfebe9fa911747d9e5ae54d37833114b2ec9 Mon Sep 17 00:00:00 2001 From: Brenda Wallace Date: Sun, 20 Nov 2016 20:13:51 +1300 Subject: [PATCH 129/268] Further simplified photos controller --- app/controllers/photos_controller.rb | 51 ++++++++++++++++------------ 1 file changed, 30 insertions(+), 21 deletions(-) diff --git a/app/controllers/photos_controller.rb b/app/controllers/photos_controller.rb index 418f3c1cc..928dab228 100644 --- a/app/controllers/photos_controller.rb +++ b/app/controllers/photos_controller.rb @@ -47,23 +47,12 @@ class PhotosController < ApplicationController # POST /photos # POST /photos.json def create - @photo = find_or_create_from_flickr_photo params[:photo][:flickr_photo_id] - collection = which_collection? - - if collection && item_id? - item = params[:type].camelcase.constantize.find_by_id(params[:id]) - if item && member_owns_item(item) - collection << item unless collection.include?(item) - else - flash[:alert] = "Could not find this item owned by you" - end - else - flash[:alert] = "Missing or invalid type or id parameter" - end + find_or_create_photo_from_flickr_photo + add_photo_to_collection respond_to do |format| - if @photo.save - format.html { redirect_to @photo, notice: 'Photo was successfully added.' } + if @photo.present? && @photo.save + format.html { redirect_to photo_path(@photo), notice: 'Photo was successfully added.' } format.json { render json: @photo, status: :created, location: @photo } else format.html { render action: "new" } @@ -111,17 +100,21 @@ class PhotosController < ApplicationController item.owner.id == current_member.id end + def flickr_photo_id_param + params[:photo][:flickr_photo_id] + end + def photo_params params.require(:photo).permit(:flickr_photo_id, :owner_id, :title, :license_name, :license_url, :thumbnail_url, :fullsize_url, :link_url) end - def find_or_create_from_flickr_photo(flickr_photo_id) - photo = Photo.find_by(flickr_photo_id: flickr_photo_id) - photo = Photo.new(photo_params) unless photo - photo.owner_id = current_member.id - photo.set_flickr_metadata - photo + def find_or_create_photo_from_flickr_photo + @photo = Photo.find_by(flickr_photo_id: flickr_photo_id_param) + @photo = Photo.new(photo_params) unless @photo + @photo.owner_id = current_member.id + @photo.set_flickr_metadata + @photo end def which_collection? @@ -134,4 +127,20 @@ class PhotosController < ApplicationController @photo.harvests end end + + def add_photo_to_collection + collection = which_collection? + + unless collection && item_id? + flash[:alert] = "Missing or invalid type or id parameter" + return + end + + item = params[:type].camelcase.constantize.find(params[:id]) + if item && member_owns_item(item) + collection << item unless collection.include?(item) + else + flash[:alert] = "Could not find this item owned by you" + end + end end From 138080c4d4c5878bb040fff0a8a47c3a29e36207 Mon Sep 17 00:00:00 2001 From: Brenda Wallace Date: Sun, 20 Nov 2016 20:18:20 +1300 Subject: [PATCH 130/268] Tabulation fix --- app/controllers/photos_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/photos_controller.rb b/app/controllers/photos_controller.rb index 928dab228..d63698f05 100644 --- a/app/controllers/photos_controller.rb +++ b/app/controllers/photos_controller.rb @@ -106,7 +106,7 @@ class PhotosController < ApplicationController def photo_params params.require(:photo).permit(:flickr_photo_id, :owner_id, :title, :license_name, - :license_url, :thumbnail_url, :fullsize_url, :link_url) + :license_url, :thumbnail_url, :fullsize_url, :link_url) end def find_or_create_photo_from_flickr_photo From 72f1d83af435b91704ca213398bd548b98b7b050 Mon Sep 17 00:00:00 2001 From: Brenda Wallace Date: Sun, 20 Nov 2016 20:19:14 +1300 Subject: [PATCH 131/268] Removed a bunch of blank lines --- spec/controllers/photos_controller_spec.rb | 6 ------ 1 file changed, 6 deletions(-) diff --git a/spec/controllers/photos_controller_spec.rb b/spec/controllers/photos_controller_spec.rb index 0b1c3699e..ee8e3286a 100644 --- a/spec/controllers/photos_controller_spec.rb +++ b/spec/controllers/photos_controller_spec.rb @@ -10,14 +10,9 @@ ## If you submit a pull request containing new view or controller tests, it will not be ## merged. - - - - require 'rails_helper' describe PhotosController do - login_member def valid_attributes @@ -74,7 +69,6 @@ describe PhotosController do get :new, { set: 'foo' } assigns(:current_set).should eq "foo" end - end describe "POST create" do From f6aac07c3dc25067951a12f8918a174a9dc1182b Mon Sep 17 00:00:00 2001 From: Brenda Wallace Date: Sun, 20 Nov 2016 20:27:59 +1300 Subject: [PATCH 132/268] Flatten params passed in photos controller spec --- spec/controllers/photos_controller_spec.rb | 48 +++++++--------------- 1 file changed, 14 insertions(+), 34 deletions(-) diff --git a/spec/controllers/photos_controller_spec.rb b/spec/controllers/photos_controller_spec.rb index ee8e3286a..8f3b9d973 100644 --- a/spec/controllers/photos_controller_spec.rb +++ b/spec/controllers/photos_controller_spec.rb @@ -48,25 +48,25 @@ describe PhotosController do end it "assigns a planting id" do - get :new, { type: "planting", id: 5 } + get :new, type: "planting", id: 5 assigns(:id).should eq "5" assigns(:type).should eq "planting" end it "assigns a harvest id" do - get :new, { type: "harvest", id: 5 } + get :new, type: "harvest", id: 5 assigns(:id).should eq "5" assigns(:type).should eq "harvest" end it "assigns a garden id" do - get :new, { type: "garden", id: 5 } + get :new, type: "garden", id: 5 assigns(:id).should eq "5" assigns(:type).should eq "garden" end it "assigns the current set as @current_set" do - get :new, { set: 'foo' } + get :new, set: 'foo' assigns(:current_set).should eq "foo" end end @@ -91,9 +91,7 @@ describe PhotosController do garden = FactoryGirl.create(:garden, owner: member) planting = FactoryGirl.create(:planting, garden: garden, owner: member) photo = FactoryGirl.create(:photo, owner: member) - post :create, {photo: { flickr_photo_id: photo.flickr_photo_id }, - type: "planting", - id: planting.id } + post :create, photo: { flickr_photo_id: photo.flickr_photo_id }, type: "planting", id: planting.id Photo.last.plantings.first.should eq planting end @@ -103,12 +101,8 @@ describe PhotosController do garden = FactoryGirl.create(:garden, owner: member) planting = FactoryGirl.create(:planting, garden: garden, owner: member) photo = FactoryGirl.create(:photo, owner: member) - post :create, {photo: { flickr_photo_id: photo.flickr_photo_id }, - type: "planting", - id: planting.id } - post :create, {photo: { flickr_photo_id: photo.flickr_photo_id }, - type: "planting", - id: planting.id } + post :create, photo: { flickr_photo_id: photo.flickr_photo_id }, type: "planting", id: planting.id + post :create, photo: { flickr_photo_id: photo.flickr_photo_id }, type: "planting", id: planting.id Photo.last.plantings.size.should eq 1 end @@ -117,9 +111,7 @@ describe PhotosController do controller.stub(:current_member) { member } harvest = FactoryGirl.create(:harvest, owner: member) photo = FactoryGirl.create(:photo, owner: member) - post :create, {photo: { flickr_photo_id: photo.flickr_photo_id }, - type: "harvest", - id: harvest.id } + post :create, photo: { flickr_photo_id: photo.flickr_photo_id }, type: "harvest", id: harvest.id Photo.last.harvests.first.should eq harvest end @@ -128,12 +120,8 @@ describe PhotosController do controller.stub(:current_member) { member } harvest = FactoryGirl.create(:harvest, owner: member) photo = FactoryGirl.create(:photo, owner: member) - post :create, {photo: { flickr_photo_id: photo.flickr_photo_id }, - type: "harvest", - id: harvest.id } - post :create, {photo: { flickr_photo_id: photo.flickr_photo_id }, - type: "harvest", - id: harvest.id } + post :create, photo: { flickr_photo_id: photo.flickr_photo_id }, type: "harvest", id: harvest.id + post :create, photo: { flickr_photo_id: photo.flickr_photo_id }, type: "harvest", id: harvest.id Photo.last.harvests.size.should eq 1 end end @@ -156,9 +144,7 @@ describe PhotosController do garden = FactoryGirl.create(:garden, owner: member) planting = FactoryGirl.create(:planting, garden: garden, owner: member) photo = FactoryGirl.create(:photo, owner: member) - post :create, {photo: { flickr_photo_id: photo.flickr_photo_id }, - type: "planting", - id: planting.id } + post :create, photo: { flickr_photo_id: photo.flickr_photo_id }, type: "planting", id: planting.id Photo.last.plantings.first.should eq planting end @@ -167,9 +153,7 @@ describe PhotosController do controller.stub(:current_member) { member } harvest = FactoryGirl.create(:harvest, owner: member) photo = FactoryGirl.create(:photo, owner: member) - post :create, {photo: { flickr_photo_id: photo.flickr_photo_id }, - type: "harvest", - id: harvest.id } + post :create, photo: { flickr_photo_id: photo.flickr_photo_id }, type: "harvest", id: harvest.id Photo.last.harvests.first.should eq harvest end end @@ -179,9 +163,7 @@ describe PhotosController do # members will be auto-created, and different planting = FactoryGirl.create(:planting) photo = FactoryGirl.create(:photo) - post :create, {photo: { flickr_photo_id: photo.flickr_photo_id }, - type: "planting", - id: planting.id } + post :create, photo: { flickr_photo_id: photo.flickr_photo_id }, type: "planting", id: planting.id Photo.last.plantings.first.should_not eq planting end @@ -189,9 +171,7 @@ describe PhotosController do # members will be auto-created, and different harvest = FactoryGirl.create(:harvest) photo = FactoryGirl.create(:photo) - post :create, {photo: { flickr_photo_id: photo.flickr_photo_id }, - type: "harvest", - id: harvest.id } + post :create, photo: { flickr_photo_id: photo.flickr_photo_id }, type: "harvest", id: harvest.id Photo.last.harvests.first.should_not eq harvest end end From a8bffd3bcec2eefc0898be6aaa40911930d592a0 Mon Sep 17 00:00:00 2001 From: Brenda Wallace Date: Sun, 20 Nov 2016 20:28:34 +1300 Subject: [PATCH 133/268] White space fix in spec --- spec/controllers/photos_controller_spec.rb | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/spec/controllers/photos_controller_spec.rb b/spec/controllers/photos_controller_spec.rb index 8f3b9d973..a46f4e419 100644 --- a/spec/controllers/photos_controller_spec.rb +++ b/spec/controllers/photos_controller_spec.rb @@ -73,18 +73,15 @@ describe PhotosController do describe "POST create" do before(:each) do - Photo.any_instance.stub(:flickr_metadata).and_return( { - title: "A Heartbreaking work of staggering genius", - license_name: "CC-BY", - license_url: "http://example.com/aybpl", - thumbnail_url: "http://example.com/thumb.jpg", - fullsize_url: "http://example.com/full.jpg", - link_url: "http://example.com" - }) + Photo.any_instance.stub(:flickr_metadata).and_return(title: "A Heartbreaking work of staggering genius", + license_name: "CC-BY", + license_url: "http://example.com/aybpl", + thumbnail_url: "http://example.com/thumb.jpg", + fullsize_url: "http://example.com/full.jpg", + link_url: "http://example.com") end describe "with valid params" do - it "attaches the photo to a planting" do member = FactoryGirl.create(:member) controller.stub(:current_member) { member } @@ -123,8 +120,8 @@ describe PhotosController do post :create, photo: { flickr_photo_id: photo.flickr_photo_id }, type: "harvest", id: harvest.id post :create, photo: { flickr_photo_id: photo.flickr_photo_id }, type: "harvest", id: harvest.id Photo.last.harvests.size.should eq 1 + end end - end describe "for the second time" do it "does not add a photo twice" do From d0a1a113b603ecce21018df21ee1e8fc1b02a5ac Mon Sep 17 00:00:00 2001 From: Brenda Wallace Date: Sun, 20 Nov 2016 20:29:01 +1300 Subject: [PATCH 134/268] Multi-line block changed from {} to do end --- spec/controllers/photos_controller_spec.rb | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/spec/controllers/photos_controller_spec.rb b/spec/controllers/photos_controller_spec.rb index a46f4e419..647a4aa87 100644 --- a/spec/controllers/photos_controller_spec.rb +++ b/spec/controllers/photos_controller_spec.rb @@ -125,12 +125,12 @@ describe PhotosController do describe "for the second time" do it "does not add a photo twice" do - expect { - post :create, {photo: { flickr_photo_id: 1 } } - }.to change(Photo, :count).by(1) - expect { - post :create, {photo: { flickr_photo_id: 1 } } - }.to change(Photo, :count).by(0) + expect do + post :create, photo: { flickr_photo_id: 1 } + end.to change(Photo, :count).by(1) + expect do + post :create, photo: { flickr_photo_id: 1 } + end.to change(Photo, :count).by(0) end end From 73a050df13e2cec053033a91683c69bfdd882278 Mon Sep 17 00:00:00 2001 From: Brenda Wallace Date: Sun, 20 Nov 2016 20:29:45 +1300 Subject: [PATCH 135/268] before_filter becomes before_action in photos controller --- app/controllers/photos_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/photos_controller.rb b/app/controllers/photos_controller.rb index d63698f05..6a6a29f07 100644 --- a/app/controllers/photos_controller.rb +++ b/app/controllers/photos_controller.rb @@ -1,5 +1,5 @@ class PhotosController < ApplicationController - before_filter :authenticate_member!, except: [:index, :show] + before_action :authenticate_member!, except: [:index, :show] load_and_authorize_resource # GET /photos From 8012d9f6a804658f07ae30c39243bc494fda78fb Mon Sep 17 00:00:00 2001 From: Brenda Wallace Date: Sun, 20 Nov 2016 21:02:43 +1300 Subject: [PATCH 136/268] Whitelist which items can have photos --- app/controllers/photos_controller.rb | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/app/controllers/photos_controller.rb b/app/controllers/photos_controller.rb index 6a6a29f07..1409ba748 100644 --- a/app/controllers/photos_controller.rb +++ b/app/controllers/photos_controller.rb @@ -136,11 +136,17 @@ class PhotosController < ApplicationController return end - item = params[:type].camelcase.constantize.find(params[:id]) + item = which_item? if item && member_owns_item(item) collection << item unless collection.include?(item) else flash[:alert] = "Could not find this item owned by you" end end + + def which_item? + allowed_types = %w(planting garden harvest) + item_type = params[:type] + item_type.camelcase.constantize.find(params[:id]) if allowed_types.include? item_type + end end From a7e88a55b3a052675b8c218c65ac6176e23c6685 Mon Sep 17 00:00:00 2001 From: Brenda Wallace Date: Sun, 20 Nov 2016 21:03:08 +1300 Subject: [PATCH 137/268] Spec for trying to attach photo when not allowed. --- spec/controllers/photos_controller_spec.rb | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/spec/controllers/photos_controller_spec.rb b/spec/controllers/photos_controller_spec.rb index 647a4aa87..dc09443fe 100644 --- a/spec/controllers/photos_controller_spec.rb +++ b/spec/controllers/photos_controller_spec.rb @@ -121,6 +121,15 @@ describe PhotosController do post :create, photo: { flickr_photo_id: photo.flickr_photo_id }, type: "harvest", id: harvest.id Photo.last.harvests.size.should eq 1 end + + it "doesn't attach photo to a comment" do + member = FactoryGirl.create(:member) + controller.stub(:current_member) { member } + comment = FactoryGirl.create(:comment) + photo = FactoryGirl.create(:photo, owner: member) + post :create, photo: { flickr_photo_id: photo.flickr_photo_id }, type: "comment", id: comment.id + expect(flash[:alert]).to be_present + end end describe "for the second time" do From 50a0668c1d61cebdda5ca4ec99d8c7f21d7d2865 Mon Sep 17 00:00:00 2001 From: Brenda Wallace Date: Sun, 20 Nov 2016 21:11:54 +1300 Subject: [PATCH 138/268] Check no alert message was generated --- spec/controllers/photos_controller_spec.rb | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/spec/controllers/photos_controller_spec.rb b/spec/controllers/photos_controller_spec.rb index dc09443fe..22712f2e0 100644 --- a/spec/controllers/photos_controller_spec.rb +++ b/spec/controllers/photos_controller_spec.rb @@ -51,23 +51,27 @@ describe PhotosController do get :new, type: "planting", id: 5 assigns(:id).should eq "5" assigns(:type).should eq "planting" + expect(flash[:alert]).not_to be_present end it "assigns a harvest id" do get :new, type: "harvest", id: 5 assigns(:id).should eq "5" assigns(:type).should eq "harvest" + expect(flash[:alert]).not_to be_present end it "assigns a garden id" do get :new, type: "garden", id: 5 assigns(:id).should eq "5" assigns(:type).should eq "garden" + expect(flash[:alert]).not_to be_present end it "assigns the current set as @current_set" do get :new, set: 'foo' assigns(:current_set).should eq "foo" + expect(flash[:alert]).not_to be_present end end @@ -89,6 +93,7 @@ describe PhotosController do planting = FactoryGirl.create(:planting, garden: garden, owner: member) photo = FactoryGirl.create(:photo, owner: member) post :create, photo: { flickr_photo_id: photo.flickr_photo_id }, type: "planting", id: planting.id + expect(flash[:alert]).not_to be_present Photo.last.plantings.first.should eq planting end @@ -100,6 +105,7 @@ describe PhotosController do photo = FactoryGirl.create(:photo, owner: member) post :create, photo: { flickr_photo_id: photo.flickr_photo_id }, type: "planting", id: planting.id post :create, photo: { flickr_photo_id: photo.flickr_photo_id }, type: "planting", id: planting.id + expect(flash[:alert]).not_to be_present Photo.last.plantings.size.should eq 1 end @@ -109,6 +115,7 @@ describe PhotosController do harvest = FactoryGirl.create(:harvest, owner: member) photo = FactoryGirl.create(:photo, owner: member) post :create, photo: { flickr_photo_id: photo.flickr_photo_id }, type: "harvest", id: harvest.id + expect(flash[:alert]).not_to be_present Photo.last.harvests.first.should eq harvest end @@ -119,6 +126,7 @@ describe PhotosController do photo = FactoryGirl.create(:photo, owner: member) post :create, photo: { flickr_photo_id: photo.flickr_photo_id }, type: "harvest", id: harvest.id post :create, photo: { flickr_photo_id: photo.flickr_photo_id }, type: "harvest", id: harvest.id + expect(flash[:alert]).not_to be_present Photo.last.harvests.size.should eq 1 end @@ -151,6 +159,7 @@ describe PhotosController do planting = FactoryGirl.create(:planting, garden: garden, owner: member) photo = FactoryGirl.create(:photo, owner: member) post :create, photo: { flickr_photo_id: photo.flickr_photo_id }, type: "planting", id: planting.id + expect(flash[:alert]).not_to be_present Photo.last.plantings.first.should eq planting end @@ -170,6 +179,7 @@ describe PhotosController do planting = FactoryGirl.create(:planting) photo = FactoryGirl.create(:photo) post :create, photo: { flickr_photo_id: photo.flickr_photo_id }, type: "planting", id: planting.id + expect(flash[:alert]).to be_present Photo.last.plantings.first.should_not eq planting end @@ -178,6 +188,7 @@ describe PhotosController do harvest = FactoryGirl.create(:harvest) photo = FactoryGirl.create(:photo) post :create, photo: { flickr_photo_id: photo.flickr_photo_id }, type: "harvest", id: harvest.id + expect(flash[:alert]).to be_present Photo.last.harvests.first.should_not eq harvest end end From 6a8f48693bd89aa1a699cec483df7f36b777dc08 Mon Sep 17 00:00:00 2001 From: Brenda Wallace Date: Sun, 20 Nov 2016 21:12:43 +1300 Subject: [PATCH 139/268] Reduce code duplication in photos cont spec --- spec/controllers/photos_controller_spec.rb | 28 ++++++---------------- 1 file changed, 7 insertions(+), 21 deletions(-) diff --git a/spec/controllers/photos_controller_spec.rb b/spec/controllers/photos_controller_spec.rb index 22712f2e0..2c507b611 100644 --- a/spec/controllers/photos_controller_spec.rb +++ b/spec/controllers/photos_controller_spec.rb @@ -86,23 +86,20 @@ describe PhotosController do end describe "with valid params" do + let(:member) { FactoryGirl.create(:member) } + let(:garden) { FactoryGirl.create(:garden, owner: member) } + let(:planting) { FactoryGirl.create(:planting, garden: garden, owner: member) } + let(:harvest) { FactoryGirl.create(:harvest, owner: member) } + let(:photo) { FactoryGirl.create(:photo, owner: member) } + + before { controller.stub(:current_member) { member } } it "attaches the photo to a planting" do - member = FactoryGirl.create(:member) - controller.stub(:current_member) { member } - garden = FactoryGirl.create(:garden, owner: member) - planting = FactoryGirl.create(:planting, garden: garden, owner: member) - photo = FactoryGirl.create(:photo, owner: member) post :create, photo: { flickr_photo_id: photo.flickr_photo_id }, type: "planting", id: planting.id expect(flash[:alert]).not_to be_present Photo.last.plantings.first.should eq planting end it "doesn't attach a photo to a planting twice" do - member = FactoryGirl.create(:member) - controller.stub(:current_member) { member } - garden = FactoryGirl.create(:garden, owner: member) - planting = FactoryGirl.create(:planting, garden: garden, owner: member) - photo = FactoryGirl.create(:photo, owner: member) post :create, photo: { flickr_photo_id: photo.flickr_photo_id }, type: "planting", id: planting.id post :create, photo: { flickr_photo_id: photo.flickr_photo_id }, type: "planting", id: planting.id expect(flash[:alert]).not_to be_present @@ -110,20 +107,12 @@ describe PhotosController do end it "attaches the photo to a harvest" do - member = FactoryGirl.create(:member) - controller.stub(:current_member) { member } - harvest = FactoryGirl.create(:harvest, owner: member) - photo = FactoryGirl.create(:photo, owner: member) post :create, photo: { flickr_photo_id: photo.flickr_photo_id }, type: "harvest", id: harvest.id expect(flash[:alert]).not_to be_present Photo.last.harvests.first.should eq harvest end it "doesn't attach a photo to a harvest twice" do - member = FactoryGirl.create(:member) - controller.stub(:current_member) { member } - harvest = FactoryGirl.create(:harvest, owner: member) - photo = FactoryGirl.create(:photo, owner: member) post :create, photo: { flickr_photo_id: photo.flickr_photo_id }, type: "harvest", id: harvest.id post :create, photo: { flickr_photo_id: photo.flickr_photo_id }, type: "harvest", id: harvest.id expect(flash[:alert]).not_to be_present @@ -131,10 +120,7 @@ describe PhotosController do end it "doesn't attach photo to a comment" do - member = FactoryGirl.create(:member) - controller.stub(:current_member) { member } comment = FactoryGirl.create(:comment) - photo = FactoryGirl.create(:photo, owner: member) post :create, photo: { flickr_photo_id: photo.flickr_photo_id }, type: "comment", id: comment.id expect(flash[:alert]).to be_present end From 12a9a0b97d6be7a578c819b57e1ca1779325abe1 Mon Sep 17 00:00:00 2001 From: Brenda Wallace Date: Sun, 20 Nov 2016 21:13:08 +1300 Subject: [PATCH 140/268] one more check no alert was generated --- spec/controllers/photos_controller_spec.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/spec/controllers/photos_controller_spec.rb b/spec/controllers/photos_controller_spec.rb index 2c507b611..085870968 100644 --- a/spec/controllers/photos_controller_spec.rb +++ b/spec/controllers/photos_controller_spec.rb @@ -155,6 +155,7 @@ describe PhotosController do harvest = FactoryGirl.create(:harvest, owner: member) photo = FactoryGirl.create(:photo, owner: member) post :create, photo: { flickr_photo_id: photo.flickr_photo_id }, type: "harvest", id: harvest.id + expect(flash[:alert]).not_to be_present Photo.last.harvests.first.should eq harvest end end From dddc7b020d626287cb38fdc17646f36f8d7015bf Mon Sep 17 00:00:00 2001 From: Brenda Wallace Date: Sun, 20 Nov 2016 21:13:33 +1300 Subject: [PATCH 141/268] Corrected description in spec --- spec/controllers/photos_controller_spec.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/spec/controllers/photos_controller_spec.rb b/spec/controllers/photos_controller_spec.rb index 085870968..3f9f07d98 100644 --- a/spec/controllers/photos_controller_spec.rb +++ b/spec/controllers/photos_controller_spec.rb @@ -161,7 +161,7 @@ describe PhotosController do end describe "with mismatched owners" do - it "creates the planting/photo link" do + it "does not create the planting/photo link" do # members will be auto-created, and different planting = FactoryGirl.create(:planting) photo = FactoryGirl.create(:photo) @@ -170,7 +170,7 @@ describe PhotosController do Photo.last.plantings.first.should_not eq planting end - it "creates the harvest/photo link" do + it "does not create the harvest/photo link" do # members will be auto-created, and different harvest = FactoryGirl.create(:harvest) photo = FactoryGirl.create(:photo) From f24e02fd11d94d850d3ff98829f5ca4808869d04 Mon Sep 17 00:00:00 2001 From: Brenda Wallace Date: Sun, 20 Nov 2016 21:13:57 +1300 Subject: [PATCH 142/268] reduced code duplication again in photos cont spec --- spec/controllers/photos_controller_spec.rb | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/spec/controllers/photos_controller_spec.rb b/spec/controllers/photos_controller_spec.rb index 3f9f07d98..82566501a 100644 --- a/spec/controllers/photos_controller_spec.rb +++ b/spec/controllers/photos_controller_spec.rb @@ -161,10 +161,10 @@ describe PhotosController do end describe "with mismatched owners" do + let(:photo) { FactoryGirl.create(:photo) } it "does not create the planting/photo link" do # members will be auto-created, and different planting = FactoryGirl.create(:planting) - photo = FactoryGirl.create(:photo) post :create, photo: { flickr_photo_id: photo.flickr_photo_id }, type: "planting", id: planting.id expect(flash[:alert]).to be_present Photo.last.plantings.first.should_not eq planting @@ -173,7 +173,6 @@ describe PhotosController do it "does not create the harvest/photo link" do # members will be auto-created, and different harvest = FactoryGirl.create(:harvest) - photo = FactoryGirl.create(:photo) post :create, photo: { flickr_photo_id: photo.flickr_photo_id }, type: "harvest", id: harvest.id expect(flash[:alert]).to be_present Photo.last.harvests.first.should_not eq harvest From dac2343b68620ae57e85ad7ec0ffa62696969da0 Mon Sep 17 00:00:00 2001 From: Brenda Wallace Date: Sun, 20 Nov 2016 21:18:07 +1300 Subject: [PATCH 143/268] Further code duplication reduction --- spec/controllers/photos_controller_spec.rb | 32 +++++++++------------- 1 file changed, 13 insertions(+), 19 deletions(-) diff --git a/spec/controllers/photos_controller_spec.rb b/spec/controllers/photos_controller_spec.rb index 82566501a..0197e2009 100644 --- a/spec/controllers/photos_controller_spec.rb +++ b/spec/controllers/photos_controller_spec.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true ## DEPRECATION NOTICE: Do not add new tests to this file! ## ## View and controller tests are deprecated in the Growstuff project. @@ -85,13 +86,12 @@ describe PhotosController do link_url: "http://example.com") end + let(:member) { FactoryGirl.create(:member) } + let(:garden) { FactoryGirl.create(:garden, owner: member) } + let(:planting) { FactoryGirl.create(:planting, garden: garden, owner: member) } + let(:harvest) { FactoryGirl.create(:harvest, owner: member) } + let(:photo) { FactoryGirl.create(:photo, owner: member) } describe "with valid params" do - let(:member) { FactoryGirl.create(:member) } - let(:garden) { FactoryGirl.create(:garden, owner: member) } - let(:planting) { FactoryGirl.create(:planting, garden: garden, owner: member) } - let(:harvest) { FactoryGirl.create(:harvest, owner: member) } - let(:photo) { FactoryGirl.create(:photo, owner: member) } - before { controller.stub(:current_member) { member } } it "attaches the photo to a planting" do post :create, photo: { flickr_photo_id: photo.flickr_photo_id }, type: "planting", id: planting.id @@ -138,10 +138,8 @@ describe PhotosController do end describe "with matching owners" do + before { controller.stub(:current_member) { member } } it "creates the planting/photo link" do - member = FactoryGirl.create(:member) - controller.stub(:current_member) { member } - garden = FactoryGirl.create(:garden, owner: member) planting = FactoryGirl.create(:planting, garden: garden, owner: member) photo = FactoryGirl.create(:photo, owner: member) post :create, photo: { flickr_photo_id: photo.flickr_photo_id }, type: "planting", id: planting.id @@ -150,10 +148,6 @@ describe PhotosController do end it "creates the harvest/photo link" do - member = FactoryGirl.create(:member) - controller.stub(:current_member) { member } - harvest = FactoryGirl.create(:harvest, owner: member) - photo = FactoryGirl.create(:photo, owner: member) post :create, photo: { flickr_photo_id: photo.flickr_photo_id }, type: "harvest", id: harvest.id expect(flash[:alert]).not_to be_present Photo.last.harvests.first.should eq harvest @@ -164,18 +158,18 @@ describe PhotosController do let(:photo) { FactoryGirl.create(:photo) } it "does not create the planting/photo link" do # members will be auto-created, and different - planting = FactoryGirl.create(:planting) - post :create, photo: { flickr_photo_id: photo.flickr_photo_id }, type: "planting", id: planting.id + another_planting = FactoryGirl.create(:planting) + post :create, photo: { flickr_photo_id: photo.flickr_photo_id }, type: "planting", id: another_planting.id expect(flash[:alert]).to be_present - Photo.last.plantings.first.should_not eq planting + Photo.last.plantings.first.should_not eq another_planting end it "does not create the harvest/photo link" do # members will be auto-created, and different - harvest = FactoryGirl.create(:harvest) - post :create, photo: { flickr_photo_id: photo.flickr_photo_id }, type: "harvest", id: harvest.id + another_harvest = FactoryGirl.create(:harvest) + post :create, photo: { flickr_photo_id: photo.flickr_photo_id }, type: "harvest", id: another_harvest.id expect(flash[:alert]).to be_present - Photo.last.harvests.first.should_not eq harvest + Photo.last.harvests.first.should_not eq another_harvest end end end From 0d6680f574ce9abf3da3a7e872513313b7453278 Mon Sep 17 00:00:00 2001 From: Brenda Wallace Date: Sun, 20 Nov 2016 21:37:10 +1300 Subject: [PATCH 144/268] Disabling rails-pos-args, and documentation in rubocop --- .rubocop.yml | 9 ++++++++- .rubocop_todo.yml | 21 --------------------- 2 files changed, 8 insertions(+), 22 deletions(-) diff --git a/.rubocop.yml b/.rubocop.yml index 8665b83fa..23f203825 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -45,4 +45,11 @@ Metrics/LineLength: # Offense count: 8 Metrics/PerceivedComplexity: - Max: 10 \ No newline at end of file + Max: 10 + +# See https://github.com/bbatsov/rubocop/issues/3629 +Rails/HttpPositionalArguments: + Enabled: false + +Style/Documentation: + Enabled: false diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml index 6a6829835..5bc6935ba 100644 --- a/.rubocop_todo.yml +++ b/.rubocop_todo.yml @@ -38,7 +38,6 @@ Lint/AssignmentInCondition: # SupportedStyles: either, start_of_block, start_of_line Lint/BlockAlignment: Exclude: - - 'spec/controllers/photos_controller_spec.rb' - 'spec/features/signin_spec.rb' - 'spec/models/seed_spec.rb' @@ -162,7 +161,6 @@ Rails/ActionFilter: - 'app/controllers/notifications_controller.rb' - 'app/controllers/order_items_controller.rb' - 'app/controllers/orders_controller.rb' - - 'app/controllers/photos_controller.rb' - 'app/controllers/plantings_controller.rb' - 'app/controllers/posts_controller.rb' - 'app/controllers/products_controller.rb' @@ -195,7 +193,6 @@ Rails/DynamicFindBy: - 'app/controllers/gardens_controller.rb' - 'app/controllers/harvests_controller.rb' - 'app/controllers/notifications_controller.rb' - - 'app/controllers/photos_controller.rb' - 'app/controllers/plantings_controller.rb' - 'app/controllers/posts_controller.rb' - 'app/controllers/scientific_names_controller.rb' @@ -247,7 +244,6 @@ Rails/HttpPositionalArguments: - 'spec/controllers/notifications_controller_spec.rb' - 'spec/controllers/order_items_controller_spec.rb' - 'spec/controllers/orders_controller_spec.rb' - - 'spec/controllers/photos_controller_spec.rb' - 'spec/controllers/places_controller_spec.rb' - 'spec/controllers/plantings_controller_spec.rb' - 'spec/controllers/posts_controller_spec.rb' @@ -335,7 +331,6 @@ Style/AlignHash: - 'app/models/planting.rb' - 'app/models/seed.rb' - 'db/migrate/20150201052245_create_cms.rb' - - 'spec/controllers/photos_controller_spec.rb' - 'spec/models/harvest_spec.rb' - 'spec/models/post_spec.rb' - 'spec/views/notifications/index.html.haml_spec.rb' @@ -354,7 +349,6 @@ Style/AlignParameters: - 'app/controllers/comments_controller.rb' - 'app/controllers/gardens_controller.rb' - 'app/controllers/harvests_controller.rb' - - 'app/controllers/photos_controller.rb' - 'app/controllers/plantings_controller.rb' - 'app/controllers/products_controller.rb' - 'app/helpers/application_helper.rb' @@ -451,7 +445,6 @@ Style/BlockDelimiters: - 'app/controllers/scientific_names_controller.rb' - 'spec/controllers/harvests_controller_spec.rb' - 'spec/controllers/order_items_controller_spec.rb' - - 'spec/controllers/photos_controller_spec.rb' - 'spec/features/notifications_spec.rb' - 'spec/models/ability_spec.rb' - 'spec/models/comment_spec.rb' @@ -492,7 +485,6 @@ Style/BracesAroundHashParameters: - 'spec/controllers/notifications_controller_spec.rb' - 'spec/controllers/order_items_controller_spec.rb' - 'spec/controllers/orders_controller_spec.rb' - - 'spec/controllers/photos_controller_spec.rb' - 'spec/controllers/places_controller_spec.rb' - 'spec/controllers/plantings_controller_spec.rb' - 'spec/controllers/posts_controller_spec.rb' @@ -508,7 +500,6 @@ Style/BracesAroundHashParameters: # SupportedStyles: case, end Style/CaseIndentation: Exclude: - - 'app/controllers/photos_controller.rb' - 'app/helpers/application_helper.rb' - 'app/models/order.rb' - 'db/migrate/20150201052245_create_cms.rb' @@ -834,7 +825,6 @@ Style/ElseAlignment: # SupportedStyles: empty, nil, both Style/EmptyElse: Exclude: - - 'app/controllers/photos_controller.rb' # Offense count: 2 # Cop supports --auto-correct. @@ -849,7 +839,6 @@ Style/EmptyLineBetweenDefs: Style/EmptyLines: Exclude: - 'app/controllers/gardens_controller.rb' - - 'app/controllers/photos_controller.rb' - 'app/models/follow.rb' - 'app/models/member.rb' - 'app/models/post.rb' @@ -874,7 +863,6 @@ Style/EmptyLines: - 'spec/controllers/notifications_controller_spec.rb' - 'spec/controllers/order_items_controller_spec.rb' - 'spec/controllers/orders_controller_spec.rb' - - 'spec/controllers/photos_controller_spec.rb' - 'spec/controllers/places_controller_spec.rb' - 'spec/controllers/plant_parts_controller_spec.rb' - 'spec/controllers/plantings_controller_spec.rb' @@ -1030,7 +1018,6 @@ Style/EmptyLinesAroundBlockBody: - 'spec/controllers/notifications_controller_spec.rb' - 'spec/controllers/order_items_controller_spec.rb' - 'spec/controllers/orders_controller_spec.rb' - - 'spec/controllers/photos_controller_spec.rb' - 'spec/controllers/places_controller_spec.rb' - 'spec/controllers/plant_parts_controller_spec.rb' - 'spec/controllers/plantings_controller_spec.rb' @@ -1305,7 +1292,6 @@ Style/FrozenStringLiteralComment: - 'app/controllers/orders_controller.rb' - 'app/controllers/pages_controller.rb' - 'app/controllers/passwords_controller.rb' - - 'app/controllers/photos_controller.rb' - 'app/controllers/places_controller.rb' - 'app/controllers/plant_parts_controller.rb' - 'app/controllers/plantings_controller.rb' @@ -1513,7 +1499,6 @@ Style/FrozenStringLiteralComment: - 'spec/controllers/notifications_controller_spec.rb' - 'spec/controllers/order_items_controller_spec.rb' - 'spec/controllers/orders_controller_spec.rb' - - 'spec/controllers/photos_controller_spec.rb' - 'spec/controllers/places_controller_spec.rb' - 'spec/controllers/plant_parts_controller_spec.rb' - 'spec/controllers/plantings_controller_spec.rb' @@ -1845,7 +1830,6 @@ Style/IndentHash: - 'config/environments/production.rb' - 'config/environments/staging.rb' - 'config/environments/test.rb' - - 'spec/controllers/photos_controller_spec.rb' - 'spec/lib/actions/oauth_signup_action_spec.rb' # Offense count: 25 @@ -1880,7 +1864,6 @@ Style/IndentationWidth: - 'db/migrate/20141119130555_change_follows_member_id_to_follower_id.rb' - 'lib/tasks/hooks.rake' - 'spec/controllers/harvests_controller_spec.rb' - - 'spec/controllers/photos_controller_spec.rb' - 'spec/features/signin_spec.rb' - 'spec/lib/haml/filters/growstuff_markdown_spec.rb' - 'spec/models/garden_spec.rb' @@ -2029,7 +2012,6 @@ Style/MultilineMethodCallIndentation: # SupportedStyles: aligned, indented Style/MultilineOperationIndentation: Exclude: - - 'app/controllers/photos_controller.rb' - 'app/controllers/registrations_controller.rb' # Offense count: 2 @@ -2159,7 +2141,6 @@ Style/PerlBackrefs: Style/PredicateName: Exclude: - 'spec/**/*' - - 'app/controllers/photos_controller.rb' - 'app/models/member.rb' # Offense count: 1 @@ -2368,7 +2349,6 @@ Style/SpaceInsideHashLiteralBraces: - 'spec/controllers/notifications_controller_spec.rb' - 'spec/controllers/order_items_controller_spec.rb' - 'spec/controllers/orders_controller_spec.rb' - - 'spec/controllers/photos_controller_spec.rb' - 'spec/controllers/plantings_controller_spec.rb' - 'spec/controllers/seeds_controller_spec.rb' - 'spec/views/notifications/show.html.haml_spec.rb' @@ -2382,7 +2362,6 @@ Style/SpaceInsideParens: Exclude: - 'app/models/crop.rb' - 'config/environments/test.rb' - - 'spec/controllers/photos_controller_spec.rb' - 'spec/lib/haml/filters/growstuff_markdown_spec.rb' - 'spec/views/posts/edit.html.haml_spec.rb' From 36d38fe624e86416f8160f4cb592957150684db3 Mon Sep 17 00:00:00 2001 From: Brenda Wallace Date: Sun, 20 Nov 2016 21:39:51 +1300 Subject: [PATCH 145/268] Turn off frozen literals requirement --- .rubocop.yml | 3 + .rubocop_todo.yml | 490 ---------------------------------------------- 2 files changed, 3 insertions(+), 490 deletions(-) diff --git a/.rubocop.yml b/.rubocop.yml index 23f203825..fb5297e0b 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -53,3 +53,6 @@ Rails/HttpPositionalArguments: Style/Documentation: Enabled: false + +Style/FrozenStringLiteralComment: + Enabled: false diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml index 5bc6935ba..7f137a1b9 100644 --- a/.rubocop_todo.yml +++ b/.rubocop_todo.yml @@ -1264,496 +1264,6 @@ Style/FormatString: - 'spec/helpers/application_helper_spec.rb' - 'spec/views/shop/index_spec.rb' -# Offense count: 485 -# Cop supports --auto-correct. -# Configuration parameters: EnforcedStyle, SupportedStyles. -# SupportedStyles: when_needed, always -Style/FrozenStringLiteralComment: - Exclude: - - 'Rakefile' - - 'app/controllers/account_types_controller.rb' - - 'app/controllers/accounts_controller.rb' - - 'app/controllers/admin/orders_controller.rb' - - 'app/controllers/admin_controller.rb' - - 'app/controllers/alternate_names_controller.rb' - - 'app/controllers/application_controller.rb' - - 'app/controllers/authentications_controller.rb' - - 'app/controllers/comments_controller.rb' - - 'app/controllers/crops_controller.rb' - - 'app/controllers/follows_controller.rb' - - 'app/controllers/forums_controller.rb' - - 'app/controllers/gardens_controller.rb' - - 'app/controllers/harvests_controller.rb' - - 'app/controllers/home_controller.rb' - - 'app/controllers/members_controller.rb' - - 'app/controllers/notifications_controller.rb' - - 'app/controllers/omniauth_callbacks_controller.rb' - - 'app/controllers/order_items_controller.rb' - - 'app/controllers/orders_controller.rb' - - 'app/controllers/pages_controller.rb' - - 'app/controllers/passwords_controller.rb' - - 'app/controllers/places_controller.rb' - - 'app/controllers/plant_parts_controller.rb' - - 'app/controllers/plantings_controller.rb' - - 'app/controllers/posts_controller.rb' - - 'app/controllers/products_controller.rb' - - 'app/controllers/registrations_controller.rb' - - 'app/controllers/robots_controller.rb' - - 'app/controllers/roles_controller.rb' - - 'app/controllers/scientific_names_controller.rb' - - 'app/controllers/seeds_controller.rb' - - 'app/controllers/sessions_controller.rb' - - 'app/controllers/shop_controller.rb' - - 'app/helpers/application_helper.rb' - - 'app/helpers/auto_suggest_helper.rb' - - 'app/helpers/crops_helper.rb' - - 'app/helpers/gardens_helper.rb' - - 'app/helpers/harvests_helper.rb' - - 'app/helpers/notifications_helper.rb' - - 'app/helpers/plantings_helper.rb' - - 'app/helpers/seeds_helper.rb' - - 'app/mailers/notifier.rb' - - 'app/models/ability.rb' - - 'app/models/account.rb' - - 'app/models/account_type.rb' - - 'app/models/alternate_name.rb' - - 'app/models/authentication.rb' - - 'app/models/comment.rb' - - 'app/models/crop.rb' - - 'app/models/follow.rb' - - 'app/models/forum.rb' - - 'app/models/garden.rb' - - 'app/models/harvest.rb' - - 'app/models/member.rb' - - 'app/models/notification.rb' - - 'app/models/order.rb' - - 'app/models/order_item.rb' - - 'app/models/photo.rb' - - 'app/models/plant_part.rb' - - 'app/models/planting.rb' - - 'app/models/post.rb' - - 'app/models/product.rb' - - 'app/models/role.rb' - - 'app/models/scientific_name.rb' - - 'app/models/seed.rb' - - 'app/validators/approved_validator.rb' - - 'bin/bundle' - - 'bin/rails' - - 'bin/rake' - - 'config.rb' - - 'config.ru' - - 'config/application.rb' - - 'config/boot.rb' - - 'config/compass.rb' - - 'config/environment.rb' - - 'config/environments/development.rb' - - 'config/environments/production.rb' - - 'config/environments/staging.rb' - - 'config/environments/test.rb' - - 'config/factory_girl.rb' - - 'config/initializers/backtrace_silencers.rb' - - 'config/initializers/comfortable_mexican_sofa.rb' - - 'config/initializers/devise.rb' - - 'config/initializers/escaped_markdown.rb' - - 'config/initializers/friendly_id.rb' - - 'config/initializers/geocoder.rb' - - 'config/initializers/growstuff_markdown.rb' - - 'config/initializers/inflections.rb' - - 'config/initializers/mime_types.rb' - - 'config/initializers/omniauth.rb' - - 'config/initializers/session_store.rb' - - 'config/initializers/sidekiq.rb' - - 'config/initializers/time_formats.rb' - - 'config/initializers/wrap_parameters.rb' - - 'config/routes.rb' - - 'config/setup_load_paths.rb' - - 'config/unicorn.rb' - - 'db/migrate/20120903092956_devise_create_users.rb' - - 'db/migrate/20120903112806_add_username_to_users.rb' - - 'db/migrate/20121001212604_create_crops.rb' - - 'db/migrate/20121003190731_require_system_name_for_crops.rb' - - 'db/migrate/20121027035231_add_slug_to_crops.rb' - - 'db/migrate/20121105032913_create_gardens.rb' - - 'db/migrate/20121106101718_add_slug_to_users.rb' - - 'db/migrate/20121107012827_create_scientific_names.rb' - - 'db/migrate/20121108105440_create_updates.rb' - - 'db/migrate/20121109130033_add_creation_index_to_updates.rb' - - 'db/migrate/20121203034745_add_tos_agreement_to_users.rb' - - 'db/migrate/20121214224227_add_slug_to_updates.rb' - - 'db/migrate/20121219022554_create_plantings.rb' - - 'db/migrate/20130113045802_rename_updates_to_posts.rb' - - 'db/migrate/20130113060852_rename_users_to_members.rb' - - 'db/migrate/20130113081521_rename_post_member_to_author.rb' - - 'db/migrate/20130113095802_rename_garden_member_to_owner.rb' - - 'db/migrate/20130118031942_add_description_to_gardens.rb' - - 'db/migrate/20130118043431_add_slug_to_plantings.rb' - - 'db/migrate/20130206033956_create_comments.rb' - - 'db/migrate/20130206051328_add_show_email_to_member.rb' - - 'db/migrate/20130208034248_require_fields_for_comments.rb' - - 'db/migrate/20130212001748_add_geo_to_members.rb' - - 'db/migrate/20130212123628_create_notifications.rb' - - 'db/migrate/20130213014511_create_forums.rb' - - 'db/migrate/20130213015708_add_forum_to_posts.rb' - - 'db/migrate/20130214024117_create_roles.rb' - - 'db/migrate/20130214034838_add_members_roles_table.rb' - - 'db/migrate/20130215131921_rename_notification_fields.rb' - - 'db/migrate/20130220044605_add_slug_to_forums.rb' - - 'db/migrate/20130220044642_add_slug_to_roles.rb' - - 'db/migrate/20130222060730_default_read_to_false.rb' - - 'db/migrate/20130326092227_change_planted_at_to_date.rb' - - 'db/migrate/20130327120024_add_send_email_to_member.rb' - - 'db/migrate/20130329045744_add_sunniness_to_planting.rb' - - 'db/migrate/20130404174459_create_authentications.rb' - - 'db/migrate/20130409103549_make_post_subject_non_null.rb' - - 'db/migrate/20130409162140_add_name_to_authentications.rb' - - 'db/migrate/20130507105357_create_products.rb' - - 'db/migrate/20130507110411_create_orders.rb' - - 'db/migrate/20130507113915_add_orders_products_table.rb' - - 'db/migrate/20130508050711_add_completed_to_order.rb' - - 'db/migrate/20130508104506_create_photos.rb' - - 'db/migrate/20130509123711_add_metadata_to_photos.rb' - - 'db/migrate/20130514124515_add_parent_to_crop.rb' - - 'db/migrate/20130515033842_create_order_items.rb' - - 'db/migrate/20130515054017_change_order_member_id_to_integer.rb' - - 'db/migrate/20130515122301_change_prices_to_integers.rb' - - 'db/migrate/20130517015920_create_account_details.rb' - - 'db/migrate/20130517051922_create_account_types.rb' - - 'db/migrate/20130517234458_require_account_type_name.rb' - - 'db/migrate/20130518000339_add_columns_to_product.rb' - - 'db/migrate/20130518002942_rename_account_detail_to_account.rb' - - 'db/migrate/20130529032813_add_express_token_to_orders.rb' - - 'db/migrate/20130531110729_add_photos_plantings_table.rb' - - 'db/migrate/20130601011725_change_flickr_photo_id_to_string.rb' - - 'db/migrate/20130606230333_change_product_description_to_text.rb' - - 'db/migrate/20130606233733_add_recommended_price_to_product.rb' - - 'db/migrate/20130705104238_add_planted_from_to_planting.rb' - - 'db/migrate/20130715110134_create_seeds.rb' - - 'db/migrate/20130718005600_change_use_by_to_plant_before_on_seed.rb' - - 'db/migrate/20130718011247_add_trading_to_seeds.rb' - - 'db/migrate/20130722050836_remove_tradable_from_seeds.rb' - - 'db/migrate/20130723103128_set_default_tradable_to_on_seed.rb' - - 'db/migrate/20130723110702_add_slug_to_seed.rb' - - 'db/migrate/20130809012511_add_bio_to_members.rb' - - 'db/migrate/20130819004549_add_planting_count_to_crop.rb' - - 'db/migrate/20130821011352_add_creator_to_crops.rb' - - 'db/migrate/20130821073736_add_creator_to_scientific_name.rb' - - 'db/migrate/20130826012139_add_owner_to_planting.rb' - - 'db/migrate/20130826023159_add_plantings_count_to_member.rb' - - 'db/migrate/20130827105823_add_newsletter_to_member.rb' - - 'db/migrate/20130913015118_add_referral_code_to_order.rb' - - 'db/migrate/20130917053547_create_harvests.rb' - - 'db/migrate/20130917060257_change_harvest_notes_to_description.rb' - - 'db/migrate/20130917071545_change_harvest_units_to_unit.rb' - - 'db/migrate/20130917075803_add_slug_to_harvests.rb' - - 'db/migrate/20130925050304_add_weight_to_harvests.rb' - - 'db/migrate/20131018101204_rename_system_name_to_name.rb' - - 'db/migrate/20131025104228_add_fields_to_gardens.rb' - - 'db/migrate/20131029053113_add_plant_part_to_harvests.rb' - - 'db/migrate/20131030230908_create_plant_parts.rb' - - 'db/migrate/20131030231202_change_plant_part_to_plant_part_id.rb' - - 'db/migrate/20131031000655_add_slug_to_plant_part.rb' - - 'db/migrate/20140718075753_default_plantings_count_to_zero.rb' - - 'db/migrate/20140829230600_add_finished_to_planting.rb' - - 'db/migrate/20140905001730_add_harvests_photos_table.rb' - - 'db/migrate/20140928044231_add_crops_posts_table.rb' - - 'db/migrate/20140928085713_add_send_planting_reminder_to_member.rb' - - 'db/migrate/20141002022459_create_index_harvest_photos.rb' - - 'db/migrate/20141018111015_create_alternate_names.rb' - - 'db/migrate/20141111130849_create_follows.rb' - - 'db/migrate/20141119130555_change_follows_member_id_to_follower_id.rb' - - 'db/migrate/20150124110540_add_properties_to_seeds.rb' - - 'db/migrate/20150127043022_add_gardens_photos_table.rb' - - 'db/migrate/20150129034206_add_si_weight_to_harvest.rb' - - 'db/migrate/20150130224814_add_requester_to_crops.rb' - - 'db/migrate/20150201052245_create_cms.rb' - - 'db/migrate/20150201053200_add_approval_status_to_crops.rb' - - 'db/migrate/20150201062506_add_reason_for_rejection_to_crops.rb' - - 'db/migrate/20150201064502_add_request_notes_to_crops.rb' - - 'db/migrate/20150209105410_add_rejection_notes_to_crops.rb' - - 'db/migrate/20150625224805_add_days_before_maturity_to_plantings.rb' - - 'db/migrate/20150824145414_add_member_preferred_image.rb' - - 'db/seeds.rb' - - 'lib/actions/oauth_signup_action.rb' - - 'lib/geocodable.rb' - - 'lib/haml/filters/escaped_markdown.rb' - - 'lib/haml/filters/growstuff_markdown.rb' - - 'lib/tasks/growstuff.rake' - - 'lib/tasks/hooks.rake' - - 'lib/tasks/testing.rake' - - 'script/check_contributors_md' - - 'script/gemfile_check' - - 'script/heroku_maintenance.rb' - - 'script/rails' - - 'spec/controllers/account_types_controller_spec.rb' - - 'spec/controllers/accounts_controller_spec.rb' - - 'spec/controllers/admin/orders_controller_spec.rb' - - 'spec/controllers/admin_controller_spec.rb' - - 'spec/controllers/authentications_controller_spec.rb' - - 'spec/controllers/comments_controller_spec.rb' - - 'spec/controllers/crops_controller_spec.rb' - - 'spec/controllers/forums_controller_spec.rb' - - 'spec/controllers/gardens_controller_spec.rb' - - 'spec/controllers/harvests_controller_spec.rb' - - 'spec/controllers/home_controller_spec.rb' - - 'spec/controllers/member_controller_spec.rb' - - 'spec/controllers/notifications_controller_spec.rb' - - 'spec/controllers/order_items_controller_spec.rb' - - 'spec/controllers/orders_controller_spec.rb' - - 'spec/controllers/places_controller_spec.rb' - - 'spec/controllers/plant_parts_controller_spec.rb' - - 'spec/controllers/plantings_controller_spec.rb' - - 'spec/controllers/posts_controller_spec.rb' - - 'spec/controllers/products_controller_spec.rb' - - 'spec/controllers/registrations_controller_spec.rb' - - 'spec/controllers/robots_controller_spec.rb' - - 'spec/controllers/roles_controller_spec.rb' - - 'spec/controllers/scientific_names_controller_spec.rb' - - 'spec/controllers/seeds_controller_spec.rb' - - 'spec/controllers/shop_controller_spec.rb' - - 'spec/custom_matchers.rb' - - 'spec/factories/account_types.rb' - - 'spec/factories/accounts.rb' - - 'spec/factories/alternate_names.rb' - - 'spec/factories/authentications.rb' - - 'spec/factories/comments.rb' - - 'spec/factories/crop.rb' - - 'spec/factories/follows.rb' - - 'spec/factories/forums.rb' - - 'spec/factories/garden.rb' - - 'spec/factories/harvests.rb' - - 'spec/factories/member.rb' - - 'spec/factories/notifications.rb' - - 'spec/factories/order_items.rb' - - 'spec/factories/orders.rb' - - 'spec/factories/photos.rb' - - 'spec/factories/plant_parts.rb' - - 'spec/factories/planting.rb' - - 'spec/factories/post.rb' - - 'spec/factories/products.rb' - - 'spec/factories/roles.rb' - - 'spec/factories/scientific_name.rb' - - 'spec/factories/seeds.rb' - - 'spec/features/admin/account_types_spec.rb' - - 'spec/features/admin/forums_spec.rb' - - 'spec/features/admin/products_spec.rb' - - 'spec/features/cms_spec.rb' - - 'spec/features/comments/commenting_a_comment_spec.rb' - - 'spec/features/crops/alternate_name_spec.rb' - - 'spec/features/crops/browse_crops_spec.rb' - - 'spec/features/crops/creating_a_crop_spec.rb' - - 'spec/features/crops/crop_detail_page_spec.rb' - - 'spec/features/crops/crop_search_spec.rb' - - 'spec/features/crops/crop_wranglers_spec.rb' - - 'spec/features/crops/crop_wrangling_button_spec.rb' - - 'spec/features/crops/inflections_spec.rb' - - 'spec/features/crops/request_new_crop_spec.rb' - - 'spec/features/following_spec.rb' - - 'spec/features/footer_spec.rb' - - 'spec/features/gardens/adding_gardens_spec.rb' - - 'spec/features/gardens_spec.rb' - - 'spec/features/harvests/browse_harvests_spec.rb' - - 'spec/features/harvests/harvesting_a_crop_spec.rb' - - 'spec/features/locale_spec.rb' - - 'spec/features/member_profile_spec.rb' - - 'spec/features/members_list_spec.rb' - - 'spec/features/notifications_spec.rb' - - 'spec/features/photos/show_photo_spec.rb' - - 'spec/features/places/searching_a_place_spec.rb' - - 'spec/features/planting_reminder_spec.rb' - - 'spec/features/plantings/planting_a_crop_spec.rb' - - 'spec/features/posts/posting_a_post_spec.rb' - - 'spec/features/rss/comments_spec.rb' - - 'spec/features/rss/crops_spec.rb' - - 'spec/features/rss/members_spec.rb' - - 'spec/features/rss/plantings_spec.rb' - - 'spec/features/rss/posts_spec.rb' - - 'spec/features/rss/seeds_spec.rb' - - 'spec/features/scientific_name_spec.rb' - - 'spec/features/seeds/adding_seeds_spec.rb' - - 'spec/features/seeds/misc_seeds_spec.rb' - - 'spec/features/shared_examples/append_date.rb' - - 'spec/features/shared_examples/crop_suggest.rb' - - 'spec/features/signin_spec.rb' - - 'spec/features/signout_spec.rb' - - 'spec/features/signup_spec.rb' - - 'spec/features/unsubscribing_spec.rb' - - 'spec/helpers/application_helper_spec.rb' - - 'spec/helpers/crops_helper_spec.rb' - - 'spec/helpers/gardens_helper_spec.rb' - - 'spec/helpers/harvests_helper_spec.rb' - - 'spec/helpers/notifications_helper_spec.rb' - - 'spec/helpers/plantings_helper_spec.rb' - - 'spec/helpers/seeds_helper_spec.rb' - - 'spec/lib/actions/oauth_signup_action_spec.rb' - - 'spec/lib/haml/filters/escaped_markdown_spec.rb' - - 'spec/lib/haml/filters/growstuff_markdown_spec.rb' - - 'spec/mailers/notifier_spec.rb' - - 'spec/models/ability_spec.rb' - - 'spec/models/account_spec.rb' - - 'spec/models/account_type_spec.rb' - - 'spec/models/alternate_name_spec.rb' - - 'spec/models/authentication_spec.rb' - - 'spec/models/comment_spec.rb' - - 'spec/models/crop_spec.rb' - - 'spec/models/follow_spec.rb' - - 'spec/models/forum_spec.rb' - - 'spec/models/garden_spec.rb' - - 'spec/models/harvest_spec.rb' - - 'spec/models/member_spec.rb' - - 'spec/models/notification_spec.rb' - - 'spec/models/order_item_spec.rb' - - 'spec/models/order_spec.rb' - - 'spec/models/photo_spec.rb' - - 'spec/models/plant_part_spec.rb' - - 'spec/models/planting_spec.rb' - - 'spec/models/post_spec.rb' - - 'spec/models/product_spec.rb' - - 'spec/models/role_spec.rb' - - 'spec/models/scientific_name_spec.rb' - - 'spec/models/seed_spec.rb' - - 'spec/rails_helper.rb' - - 'spec/requests/authentications_spec.rb' - - 'spec/requests/comments_spec.rb' - - 'spec/requests/forums_spec.rb' - - 'spec/requests/gardens_spec.rb' - - 'spec/requests/harvests_spec.rb' - - 'spec/requests/notifications_spec.rb' - - 'spec/requests/photos_spec.rb' - - 'spec/requests/plant_parts_spec.rb' - - 'spec/requests/plantings_spec.rb' - - 'spec/requests/post_spec.rb' - - 'spec/requests/scientific_names_spec.rb' - - 'spec/requests/seeds_spec.rb' - - 'spec/routing/account_types_routing_spec.rb' - - 'spec/routing/authentications_routing_spec.rb' - - 'spec/routing/comments_routing_spec.rb' - - 'spec/routing/crops_routing_spec.rb' - - 'spec/routing/follows_routing_spec.rb' - - 'spec/routing/forums_routing_spec.rb' - - 'spec/routing/gardens_routing_spec.rb' - - 'spec/routing/harvests_routing_spec.rb' - - 'spec/routing/notifications_routing_spec.rb' - - 'spec/routing/order_items_routing_spec.rb' - - 'spec/routing/orders_routing_spec.rb' - - 'spec/routing/photos_routing_spec.rb' - - 'spec/routing/plant_parts_routing_spec.rb' - - 'spec/routing/plantings_routing_spec.rb' - - 'spec/routing/products_routing_spec.rb' - - 'spec/routing/roles_routing_spec.rb' - - 'spec/routing/scientific_names_routing_spec.rb' - - 'spec/routing/seeds_routing_spec.rb' - - 'spec/routing/updates_routing_spec.rb' - - 'spec/spec_helper.rb' - - 'spec/support/controller_macros.rb' - - 'spec/support/database_cleaner.rb' - - 'spec/support/devise.rb' - - 'spec/support/elasticsearch_helpers.rb' - - 'spec/support/feature_helpers.rb' - - 'spec/views/account_types/edit.html.haml_spec.rb' - - 'spec/views/account_types/index.html.haml_spec.rb' - - 'spec/views/account_types/new.html.haml_spec.rb' - - 'spec/views/account_types/show.html.haml_spec.rb' - - 'spec/views/accounts/edit.html.haml_spec.rb' - - 'spec/views/accounts/index.html.haml_spec.rb' - - 'spec/views/accounts/new.html.haml_spec.rb' - - 'spec/views/accounts/show.html.haml_spec.rb' - - 'spec/views/admin/index_spec.rb' - - 'spec/views/admin/newsletter_spec.rb' - - 'spec/views/admin/orders/index_spec.rb' - - 'spec/views/comments/edit.html.haml_spec.rb' - - 'spec/views/comments/index.html.haml_spec.rb' - - 'spec/views/comments/index.rss.haml_spec.rb' - - 'spec/views/comments/new.html.haml_spec.rb' - - 'spec/views/comments/show.html.haml_spec.rb' - - 'spec/views/crops/_grown_for.html.haml_spec.rb' - - 'spec/views/crops/_planting_advice.html.haml_spec.rb' - - 'spec/views/crops/_popover.html.haml_spec.rb' - - 'spec/views/crops/edit.html.haml_spec.rb' - - 'spec/views/crops/hierarchy.html.haml_spec.rb' - - 'spec/views/crops/index.html.haml_spec.rb' - - 'spec/views/crops/index.rss.haml_spec.rb' - - 'spec/views/crops/new.html.haml_spec.rb' - - 'spec/views/crops/wrangle.html.haml_spec.rb' - - 'spec/views/devise/confirmations/new_spec.rb' - - 'spec/views/devise/mailer/confirmation_instructions_spec.rb' - - 'spec/views/devise/mailer/reset_password_instructions_spec.rb' - - 'spec/views/devise/mailer/unlock_instructions_spec.rb' - - 'spec/views/devise/registrations/edit_spec.rb' - - 'spec/views/devise/registrations/new_spec.rb' - - 'spec/views/devise/sessions/new_spec.rb' - - 'spec/views/devise/shared/_links_spec.rb' - - 'spec/views/devise/unlocks/new_spec.rb' - - 'spec/views/forums/edit.html.haml_spec.rb' - - 'spec/views/forums/index.html.haml_spec.rb' - - 'spec/views/forums/new.html.haml_spec.rb' - - 'spec/views/forums/show.html.haml_spec.rb' - - 'spec/views/gardens/edit.html.haml_spec.rb' - - 'spec/views/gardens/new.html.haml_spec.rb' - - 'spec/views/gardens/show.html.haml_spec.rb' - - 'spec/views/harvests/edit.html.haml_spec.rb' - - 'spec/views/harvests/index.html.haml_spec.rb' - - 'spec/views/harvests/new.html.haml_spec.rb' - - 'spec/views/harvests/show.html.haml_spec.rb' - - 'spec/views/home/_blurb.html.haml_spec.rb' - - 'spec/views/home/_crops.html.haml_spec.rb' - - 'spec/views/home/_members.html.haml_spec.rb' - - 'spec/views/home/_seeds.html.haml_spec.rb' - - 'spec/views/home/_stats.html.haml_spec.rb' - - 'spec/views/home/index_spec.rb' - - 'spec/views/layouts/_header_spec.rb' - - 'spec/views/layouts/_meta_spec.rb' - - 'spec/views/layouts/application_spec.rb' - - 'spec/views/members/_location.html.haml_spec.rb' - - 'spec/views/members/index.html.haml_spec.rb' - - 'spec/views/members/show.rss.haml_spec.rb' - - 'spec/views/notifications/index.html.haml_spec.rb' - - 'spec/views/notifications/new.html.haml_spec.rb' - - 'spec/views/notifications/show.html.haml_spec.rb' - - 'spec/views/notifier/notify.html.haml_spec.rb' - - 'spec/views/orders/index.html.haml_spec.rb' - - 'spec/views/orders/show.html.haml_spec.rb' - - 'spec/views/photos/edit.html.haml_spec.rb' - - 'spec/views/photos/index.html.haml_spec.rb' - - 'spec/views/photos/new.html.haml_spec.rb' - - 'spec/views/photos/show.html.haml_spec.rb' - - 'spec/views/places/_map_attribution.html.haml_spec.rb' - - 'spec/views/places/index.html.haml_spec.rb' - - 'spec/views/places/show.html.haml_spec.rb' - - 'spec/views/plant_parts/edit.html.haml_spec.rb' - - 'spec/views/plant_parts/index.html.haml_spec.rb' - - 'spec/views/plant_parts/new.html.haml_spec.rb' - - 'spec/views/plant_parts/show.html.haml_spec.rb' - - 'spec/views/plantings/_form.html.haml_spec.rb' - - 'spec/views/plantings/edit.html.haml_spec.rb' - - 'spec/views/plantings/index.html.haml_spec.rb' - - 'spec/views/plantings/index.rss.haml_spec.rb' - - 'spec/views/plantings/new.html.haml_spec.rb' - - 'spec/views/plantings/show.html.haml_spec.rb' - - 'spec/views/posts/_single.html.haml_spec.rb' - - 'spec/views/posts/edit.html.haml_spec.rb' - - 'spec/views/posts/index.html.haml_spec.rb' - - 'spec/views/posts/index.rss.haml_spec.rb' - - 'spec/views/posts/new.html.haml_spec.rb' - - 'spec/views/posts/show.html.haml_spec.rb' - - 'spec/views/posts/show.rss.haml_spec.rb' - - 'spec/views/products/edit.html.haml_spec.rb' - - 'spec/views/products/index.html.haml_spec.rb' - - 'spec/views/products/new.html.haml_spec.rb' - - 'spec/views/products/show.html.haml_spec.rb' - - 'spec/views/roles/edit.html.haml_spec.rb' - - 'spec/views/roles/index.html.haml_spec.rb' - - 'spec/views/roles/new.html.haml_spec.rb' - - 'spec/views/roles/show.html.haml_spec.rb' - - 'spec/views/scientific_names/edit.html.haml_spec.rb' - - 'spec/views/scientific_names/index.html.haml_spec.rb' - - 'spec/views/scientific_names/new.html.haml_spec.rb' - - 'spec/views/scientific_names/show.html.haml_spec.rb' - - 'spec/views/seeds/edit.html.haml_spec.rb' - - 'spec/views/seeds/index.rss.haml_spec.rb' - - 'spec/views/seeds/new.html.haml_spec.rb' - - 'spec/views/seeds/show.html.haml_spec.rb' - - 'spec/views/shop/index_spec.rb' - # Offense count: 35 # Configuration parameters: MinBodyLength. Style/GuardClause: From 069343803ee2c6a0e10cd438f855e0d04da9ba91 Mon Sep 17 00:00:00 2001 From: Brenda Wallace Date: Sun, 20 Nov 2016 21:46:58 +1300 Subject: [PATCH 146/268] List of types that can have photos in own method --- app/controllers/photos_controller.rb | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/app/controllers/photos_controller.rb b/app/controllers/photos_controller.rb index 1409ba748..e7e8584d3 100644 --- a/app/controllers/photos_controller.rb +++ b/app/controllers/photos_controller.rb @@ -117,15 +117,13 @@ class PhotosController < ApplicationController @photo end + def allowed_types + %w(garden harvest planting) + end + def which_collection? - case params[:type] - when 'garden' - @photo.gardens - when 'planting' - @photo.plantings - when 'harvest' - @photo.harvests - end + return unless allowed_types.include?(params[:type]) + @photo.send(params[:type].pluralize.to_sym) end def add_photo_to_collection @@ -145,7 +143,6 @@ class PhotosController < ApplicationController end def which_item? - allowed_types = %w(planting garden harvest) item_type = params[:type] item_type.camelcase.constantize.find(params[:id]) if allowed_types.include? item_type end From fb6f1ac0a889852a5e3fa3cdab2351bdfdd93a70 Mon Sep 17 00:00:00 2001 From: Brenda Wallace Date: Mon, 21 Nov 2016 09:52:43 +1300 Subject: [PATCH 147/268] Changed whitelisting of what can have photos --- app/controllers/photos_controller.rb | 37 ++++++++++++++-------------- 1 file changed, 18 insertions(+), 19 deletions(-) diff --git a/app/controllers/photos_controller.rb b/app/controllers/photos_controller.rb index e7e8584d3..64583a143 100644 --- a/app/controllers/photos_controller.rb +++ b/app/controllers/photos_controller.rb @@ -96,10 +96,6 @@ class PhotosController < ApplicationController params.key? :id end - def member_owns_item(item) - item.owner.id == current_member.id - end - def flickr_photo_id_param params[:photo][:flickr_photo_id] end @@ -117,13 +113,13 @@ class PhotosController < ApplicationController @photo end - def allowed_types - %w(garden harvest planting) - end - def which_collection? - return unless allowed_types.include?(params[:type]) - @photo.send(params[:type].pluralize.to_sym) + case params[:type] + when "garden" then @photo.gardens + when "harvest" then @photo.harvests + when "planting" then @photo.plantings + else raise "Invalid type" + end end def add_photo_to_collection @@ -134,16 +130,19 @@ class PhotosController < ApplicationController return end - item = which_item? - if item && member_owns_item(item) - collection << item unless collection.include?(item) - else - flash[:alert] = "Could not find this item owned by you" - end + item = find_item_for_photo! + collection << item unless collection.include?(item) + rescue + flash[:alert] = "Could not find this item owned by you" end - def which_item? - item_type = params[:type] - item_type.camelcase.constantize.find(params[:id]) if allowed_types.include? item_type + def find_item_for_photo! + item_class = case params[:type] + when "garden" then Garden + when "harvest" then Harvest + when "planting" then Planting + else raise "Invalid type" + end + item_class.find_by!(id: params[:id], owner_id: current_member.id) end end From 975deab4b228fbacbe95d8b4305d90180922d2c4 Mon Sep 17 00:00:00 2001 From: Brenda Wallace Date: Wed, 23 Nov 2016 20:24:02 +1300 Subject: [PATCH 148/268] Normalise translation file --- config/locales/en.yml | 353 +++++++++++++++++++----------------------- 1 file changed, 162 insertions(+), 191 deletions(-) diff --git a/config/locales/en.yml b/config/locales/en.yml index 0c8c21c0e..bb9058e53 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -1,204 +1,175 @@ -# Sample localization file for English. Add more files in this directory for other locales. -# See https://github.com/svenfuchs/rails-i18n/tree/master/rails%2Flocale for starting points. - +--- en: - forms: - optional: "(Optional)" - unauthorized: - read: - notification: "You must be signed in to view notifications." - create: - 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." - notification: "Please sign in to send a message." - all: "Please sign in or sign up to create a %{subject}." - manage: - all: "Not authorized to %{action} %{subject}." - - layouts: - header: - skip: "Skip navigation menu" - browse_crops: &browse_crops "Browse Crops" - seeds: "Seeds" - plantings: "Plantings" - harvests: "Harvests" - community_map: "Community Map" - browse_members: "Browse Members" - posts: "Posts" - forums: &forums "Forums" - support_growstuff: "Support Growstuff" - profile: "Profile" - gardens: "Gardens" - account: "Account" - inbox_unread: "Inbox (%{unread_count})" - inbox: "Inbox" - crop_wrangling: "Crop Wrangling" - admin: "Admin" - your_stuff: "Your Stuff (%{unread_count})" - - crops: - index: - title: *browse_crops - subtitle: "%{crops_size} total" - - gardens: - form: - location_helper: "If you have a location set in your profile, it will be used when - you create a new garden." - - seeds: - index: - title: - default: "Everyone's seeds" - crop_seeds: "Everyone's %{crop} seeds" - owner_seeds: "%{owner} 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." - - plantings: - index: - title: - default: "Everyone's plantings" - crop_plantings: "Everyone's %{crop} plantings" - owner_plantings: "%{owner} plantings" - form: - finish_helper: "A planting is finished when you've harvested all of the crop, or - it dies, or it's otherwise no longer growing in your garden." - - photos: - show: - thing_by: "A %{thing} by %{owner}" - - harvests: - index: - title: - default: "Everyone's harvests" - crop_harvests: "Everyone's %{crop} harvests" - owner_harvests: "%{owner} harvests" - - places: - index: - title: "%{site_name} Community Map" - - members: - index: - title: "%{site_name} members" - - posts: - index: - title: - default: "Everyone's posts" - author_posts: "%{author} posts" - - shop: - index: - title: "Shop" - - forums: - index: - title: *forums - - home: - blurb: - intro: "%{site_name} is a community of food gardeners. We're building an open source platform to help you learn about growing food, track what you plant and harvest, and swap seeds and produce with other gardeners near you." - perks: "Join now for your free garden journal, seed sharing, forums, and more." - sign_up: "Sign up" - already_html: "Or %{sign_in} if you already have an account" - sign_in_linktext: "sign in" - - crops: - our_crops: "Some of our crops" - recently_planted: "Recently planted" - recently_added: "Recently added crops" - view_all: "View all crops" - - discuss: - discussion: "Discussion" - forums: "Forums" - view_all: "View all posts" - - members: - title: "Some of our members" - view_all: "View all members" - - open: - open_source_title: "Open Source" - open_source_body_html: "%{site_name} is open source software, which means that we share this website's code for free with our community and the world. We believe that openness, sustainability, and social good go hand in hand. You can read more about %{why} or check out our code on %{github}." - why_linktext: "why Growstuff is open source" - github_linktext: "Github" - open_data_title: "Open Data and APIs" - open_data_body_html: "We're building a database of crops, planting advice, seed sources, and other information that anyone can use for free, under a %{creative_commons_link}. You can use this data for research, to build apps, or for any purpose at all. Read more about our %{wiki_link} and %{api_docs_link}." - creative_commons_linktext: "Creative Commons license" - api_docs_linktext: "API documentation" - get_involved_title: "Get Involved" - get_involved_body_html: "We believe in collaboration, and work closely with our members and the wider food-growing community. Our team includes volunteers from all walks of life and all skill levels. To get involved, visit %{talk_link} or find more information on the %{wiki_link}." - talk_linktext: "Growstuff Talk" - wiki_linktext: "Growstuff Wiki" - support_title: "Support Growstuff" - support_body_html: "Growstuff is independent, %{ad_free} and we have no outside investment. You can support our work by %{buy_account}." - ad_free_linktext: "ad-free" - buy_account_linktext: "buying a paid account" - - seeds: - title: "Seeds available to trade" - owner: "Owner" - crop: "Crop" - description: "Description" - trade_to: "Will trade to" - from: "From location" - unspecified: "unspecified" - details: "Details" - view_all: "View all seeds" - - stats: - message_html: "So far, %{member} have planted %{number_crops} %{number_plantings} in %{number_gardens}." - member_linktext: "%{count} members" - number_crops_linktext: "%{count} crops" - number_plantings_linktext: "%{count} times" - number_gardens_linktext: "%{count} gardens" - - index: - welcome: "Welcome to %{site_name}, %{member_name}" - plant: "Plant" - harvest: "Harvest" - add_seeds: "Add seeds" - post: "Post" - edit_profile: "Edit profile" - activerecord: models: comment: - one: "comment" - other: "comments" + one: comment + other: comments crop: - one: "crop" - other: "crops" + one: crop + other: crops follow: - one: "follow" - other: "follows" + one: follow + other: follows garden: - one: "garden" - other: "gardens" + one: garden + other: gardens harvest: - one: "harvest" - other: "harvests" + one: harvest + other: harvests member: - one: "member" - other: "members" + one: member + other: members photo: - one: "photo" - other: "photos" + one: photo + other: photos planting: - one: "planting" - other: "plantings" + one: planting + other: plantings post: - one: "post" - other: "posts" + one: post + other: posts seed: - one: "seed" - other: "seeds" + one: seed + other: seeds + crops: + index: + subtitle: "%{crops_size} total" + title: Browse Crops + forms: + optional: "(Optional)" + forums: + index: + title: Forums + gardens: + form: + location_helper: If you have a location set in your profile, it will be used when you create a new garden. + harvests: + index: + title: + crop_harvests: Everyone's %{crop} harvests + default: Everyone's harvests + owner_harvests: "%{owner} harvests" + home: + blurb: + already_html: Or %{sign_in} if you already have an account + intro: "%{site_name} is a community of food gardeners. We're building an open source platform to help you learn about growing food, track what you plant and harvest, and swap seeds and produce with other gardeners near you." + perks: Join now for your free garden journal, seed sharing, forums, and more. + sign_in_linktext: sign in + sign_up: Sign up + 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 + index: + add_seeds: Add seeds + edit_profile: Edit profile + harvest: Harvest + plant: Plant + post: Post + welcome: Welcome to %{site_name}, %{member_name} + members: + title: Some of our members + view_all: View all members + open: + ad_free_linktext: ad-free + api_docs_linktext: API documentation + buy_account_linktext: buying a paid account + creative_commons_linktext: Creative Commons license + get_involved_body_html: We believe in collaboration, and work closely with our members and the wider food-growing community. Our team includes volunteers from all walks of life and all skill levels. To get involved, visit %{talk_link} or find more information on the %{wiki_link}. + get_involved_title: Get Involved + github_linktext: Github + open_data_body_html: We're building a database of crops, planting advice, seed sources, and other information that anyone can use for free, under a %{creative_commons_link}. You can use this data for research, to build apps, or for any purpose at all. Read more about our %{wiki_link} and %{api_docs_link}. + open_data_title: Open Data and APIs + open_source_body_html: "%{site_name} is open source software, which means that we share this website's code for free with our community and the world. We believe that openness, sustainability, and social good go hand in hand. You can read more about %{why} or check out our code on %{github}." + open_source_title: Open Source + support_body_html: Growstuff is independent, %{ad_free} and we have no outside investment. You can support our work by %{buy_account}. + support_title: Support Growstuff + talk_linktext: Growstuff Talk + why_linktext: why Growstuff is open source + wiki_linktext: Growstuff Wiki + 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" + message_html: So far, %{member} have planted %{number_crops} %{number_plantings} in %{number_gardens}. + number_crops_linktext: "%{count} crops" + number_gardens_linktext: "%{count} gardens" + number_plantings_linktext: "%{count} times" + layouts: + header: + account: Account + admin: Admin + browse_crops: Browse Crops + browse_members: Browse Members + community_map: Community Map + crop_wrangling: Crop Wrangling + forums: Forums + gardens: Gardens + harvests: Harvests + inbox: Inbox + inbox_unread: Inbox (%{unread_count}) + plantings: Plantings + posts: Posts + profile: Profile + seeds: Seeds + skip: Skip navigation menu + support_growstuff: Support Growstuff + your_stuff: Your Stuff (%{unread_count}) + members: + index: + title: "%{site_name} members" + photos: + show: + thing_by: A %{thing} by %{owner} + places: + index: + title: "%{site_name} Community Map" + plantings: + form: + finish_helper: A planting is finished when you've harvested all of the crop, or it dies, or it's otherwise no longer growing in your garden. + index: + title: + crop_plantings: Everyone's %{crop} plantings + default: Everyone's plantings + owner_plantings: "%{owner} plantings" + posts: + index: + title: + author_posts: "%{author} posts" + default: Everyone's posts + 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. + index: + title: + crop_seeds: Everyone's %{crop} seeds + default: Everyone's seeds + owner_seeds: "%{owner} seeds" + shop: + index: + title: Shop + 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. + manage: + all: Not authorized to %{action} %{subject}. + read: + notification: You must be signed in to view notifications. From 37d01e831f07d39befc4c8681955aa9683f81142 Mon Sep 17 00:00:00 2001 From: Brenda Wallace Date: Sun, 20 Nov 2016 19:35:17 +1300 Subject: [PATCH 149/268] Reduced code duplication in growstuff.rake --- lib/tasks/growstuff.rake | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/lib/tasks/growstuff.rake b/lib/tasks/growstuff.rake index 1e3a8188e..9ef918840 100644 --- a/lib/tasks/growstuff.rake +++ b/lib/tasks/growstuff.rake @@ -4,18 +4,20 @@ namespace :growstuff do # usage: rake growstuff:admin_user name=skud task admin_user: :environment do - member = Member.find_by_login_name(ENV['name']) or raise "Usage: rake growstuff:admin_user name=whoever (login name is case-sensitive)" - admin = Role.find('admin') - member.roles << admin + add_role_to_member! ENV['name'], 'admin' end desc "Add a crop wrangler user, by name" # usage: rake growstuff:cropwrangler_user name=skud task cropwrangler_user: :environment do - member = Member.find_by_login_name(ENV['name']) or raise "Usage: rake growstuff:cropwrangler_user name=whoever (login name is case-sensitive)" - cw = Role.find('crop-wrangler') - member.roles << cw + add_role_to_member! ENV['name'], 'crop-wrangler' + end + + def add_role_to_member!(login_name, role_name) + member = Member.find_by!(login_name: login_name) + role = Role.find_by!(name: role_name) + member.roles << role end desc "Upload crops from a CSV file" From 18a8d6c5bf83c3fb25b633406e1e3cdf91de8c01 Mon Sep 17 00:00:00 2001 From: Brenda Wallace Date: Wed, 23 Nov 2016 20:37:32 +1300 Subject: [PATCH 150/268] Re-instate usage info when args not as expected --- lib/tasks/growstuff.rake | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/tasks/growstuff.rake b/lib/tasks/growstuff.rake index 9ef918840..7d5d8a13f 100644 --- a/lib/tasks/growstuff.rake +++ b/lib/tasks/growstuff.rake @@ -15,6 +15,10 @@ namespace :growstuff do end def add_role_to_member!(login_name, role_name) + unless login_name && role_name + raise "Usage: rake growstuff:[rolename] name=[username] "\ + "\n (login name is case-sensitive)\n" + end member = Member.find_by!(login_name: login_name) role = Role.find_by!(name: role_name) member.roles << role From 844f68ef4c2fa1e197bbdb2883af8d2e66236a19 Mon Sep 17 00:00:00 2001 From: Miles Gould Date: Thu, 24 Nov 2016 18:48:01 +0000 Subject: [PATCH 151/268] Auto-deploy to production on successful merge I *think* this is all that's necessary, though it's a bit hard to test :-) --- .travis.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.travis.yml b/.travis.yml index 0fc8e1e54..f01bdbeae 100644 --- a/.travis.yml +++ b/.travis.yml @@ -38,6 +38,7 @@ deploy: repo: Growstuff/growstuff app: dev: growstuff-staging + master: growstuff-prod travis_deploy: tranquil-basin-3130 travis_containers: tranquil-basin-3130 run: From 783406d730cbbcc4a3bfbbac0f46aba5acc1f13d Mon Sep 17 00:00:00 2001 From: Daniel O'Connor Date: Fri, 25 Nov 2016 09:44:12 +1000 Subject: [PATCH 152/268] Add a login splash --- app/assets/images/facebook-login-splash.png | Bin 0 -> 180402 bytes 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 app/assets/images/facebook-login-splash.png diff --git a/app/assets/images/facebook-login-splash.png b/app/assets/images/facebook-login-splash.png new file mode 100644 index 0000000000000000000000000000000000000000..445a00b300f8504f3aa6bcc2959ab9a23f1a03ce GIT binary patch literal 180402 zcmeFY`9D7ci+1k)T$iAGBEK!yeB6~%NQTBE0logdE3Va|Q-x$f(EU)S?_UFU__B_kfr{hR;*@SHO? zxC{U+yB}Eq4z}GlQ1W>2pEGy8b5}WbU;Z3-!vR1VIA?I?s`vY4#*puHgwSBIi!KhZgI{%3+sfp931$5B&SR7$m?0{NE+~daZmIw*Or-!>-E={J*2|Z!o7LF#is) zjpzb&{~dr1I0DlD4iE_Z|F`-7hS4xvxqSaEDCgC!D`Z)jwC`yIJC?r|{jZY~alyv2s)| zmjB#7P$FxM;>y~mP5W|67+wlMd?}kpo?v0&w<5R*&`1T?6*#X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Y=m;|7rAhr?QM1KZr+UIsoN5#3PXYwRCFr6*oPX7GKVW7EVf2Sr8c z!qg=JjOFtC?NZ{-+!61zE~+HP{P=b!?% z^uxbE4v0D0O7NhNX}#1h?d7HUim;f|$9C~bo)%E4X+Q7mP8r_Aft@|X>pyYoAJAg1s>J2czx>o2ajvCUW_MH2rmPehAIled?eD(hUnti&P literal 0 HcmV?d00001 From 83392ddda1b50fa72e7850e31e23c6e88021bfdb Mon Sep 17 00:00:00 2001 From: Brenda Wallace Date: Sat, 26 Nov 2016 10:51:54 +1300 Subject: [PATCH 153/268] Indentation clean ups --- .rubocop_todo.yml | 43 ------------------- app/controllers/application_controller.rb | 2 +- app/controllers/crops_controller.rb | 4 +- app/controllers/registrations_controller.rb | 2 +- app/controllers/robots_controller.rb | 2 +- app/models/crop.rb | 4 +- app/models/garden.rb | 14 +++--- app/models/post.rb | 18 ++++---- .../initializers/comfortable_mexican_sofa.rb | 2 +- ...109130033_add_creation_index_to_updates.rb | 2 +- lib/haml/filters/escaped_markdown.rb | 6 +-- lib/haml/filters/growstuff_markdown.rb | 6 +-- lib/tasks/hooks.rake | 4 +- spec/controllers/harvests_controller_spec.rb | 4 +- spec/features/signin_spec.rb | 32 +++++++------- .../haml/filters/growstuff_markdown_spec.rb | 8 ++-- spec/models/garden_spec.rb | 6 +-- spec/models/seed_spec.rb | 18 ++++---- spec/views/crops/index.html.haml_spec.rb | 4 +- spec/views/devise/registrations/new_spec.rb | 2 +- spec/views/devise/sessions/new_spec.rb | 4 +- spec/views/devise/unlocks/new_spec.rb | 2 +- spec/views/posts/_single.html.haml_spec.rb | 4 +- .../scientific_names/edit.html.haml_spec.rb | 6 +-- 24 files changed, 78 insertions(+), 121 deletions(-) diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml index 7f137a1b9..c5eb2be82 100644 --- a/.rubocop_todo.yml +++ b/.rubocop_todo.yml @@ -1342,49 +1342,6 @@ Style/IndentHash: - 'config/environments/test.rb' - 'spec/lib/actions/oauth_signup_action_spec.rb' -# Offense count: 25 -# Cop supports --auto-correct. -# Configuration parameters: EnforcedStyle, SupportedStyles. -# SupportedStyles: normal, rails -Style/IndentationConsistency: - Exclude: - - 'app/models/crop.rb' - - 'app/models/garden.rb' - - 'app/models/post.rb' - - 'lib/haml/filters/escaped_markdown.rb' - - 'lib/haml/filters/growstuff_markdown.rb' - - 'spec/lib/haml/filters/growstuff_markdown_spec.rb' - - 'spec/models/garden_spec.rb' - - 'spec/support/controller_macros.rb' - - 'spec/views/scientific_names/edit.html.haml_spec.rb' - -# Offense count: 29 -# Cop supports --auto-correct. -# Configuration parameters: Width. -Style/IndentationWidth: - Exclude: - - 'app/controllers/application_controller.rb' - - 'app/controllers/crops_controller.rb' - - 'app/controllers/registrations_controller.rb' - - 'app/controllers/robots_controller.rb' - - 'app/helpers/seeds_helper.rb' - - 'app/models/crop.rb' - - 'config/initializers/comfortable_mexican_sofa.rb' - - 'db/migrate/20121109130033_add_creation_index_to_updates.rb' - - 'db/migrate/20141119130555_change_follows_member_id_to_follower_id.rb' - - 'lib/tasks/hooks.rake' - - 'spec/controllers/harvests_controller_spec.rb' - - 'spec/features/signin_spec.rb' - - 'spec/lib/haml/filters/growstuff_markdown_spec.rb' - - 'spec/models/garden_spec.rb' - - 'spec/models/seed_spec.rb' - - 'spec/support/controller_macros.rb' - - 'spec/views/crops/index.html.haml_spec.rb' - - 'spec/views/devise/registrations/new_spec.rb' - - 'spec/views/devise/sessions/new_spec.rb' - - 'spec/views/devise/unlocks/new_spec.rb' - - 'spec/views/posts/_single.html.haml_spec.rb' - # Offense count: 7 # Cop supports --auto-correct. # Configuration parameters: EnforcedStyle, SupportedStyles. diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index f082d13cf..3ba6c165f 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -14,7 +14,7 @@ class ApplicationController < ActionController::Base request.path != "/members/confirmation" && request.path != "/members/sign_out" && !request.xhr?) - store_location_for(:member, request.fullpath) + store_location_for(:member, request.fullpath) end end diff --git a/app/controllers/crops_controller.rb b/app/controllers/crops_controller.rb index abf2102ae..c756f2752 100644 --- a/app/controllers/crops_controller.rb +++ b/app/controllers/crops_controller.rb @@ -137,10 +137,10 @@ class CropsController < ApplicationController respond_to do |format| if @crop.save params[:alt_name].each do |index, value| - @crop.alternate_names.create(name: value, creator_id: current_member.id) + @crop.alternate_names.create(name: value, creator_id: current_member.id) end params[:sci_name].each do |index, value| - @crop.scientific_names.create(scientific_name: value, creator_id: current_member.id) + @crop.scientific_names.create(scientific_name: value, creator_id: current_member.id) end unless current_member.has_role? :crop_wrangler Role.crop_wranglers.each do |w| diff --git a/app/controllers/registrations_controller.rb b/app/controllers/registrations_controller.rb index f251983eb..72e631206 100644 --- a/app/controllers/registrations_controller.rb +++ b/app/controllers/registrations_controller.rb @@ -19,7 +19,7 @@ class RegistrationsController < Devise::RegistrationsController @member = Member.find(current_member.id) successfully_updated = if needs_password?(@member, params) - @member.update_with_password(devise_parameter_sanitizer.sanitize(:account_update)) + @member.update_with_password(devise_parameter_sanitizer.sanitize(:account_update)) else # remove the virtual current_password attribute # update_without_password doesn't know how to ignore it diff --git a/app/controllers/robots_controller.rb b/app/controllers/robots_controller.rb index 090e0e031..e6d291631 100644 --- a/app/controllers/robots_controller.rb +++ b/app/controllers/robots_controller.rb @@ -4,7 +4,7 @@ class RobotsController < ApplicationController def robots filename = if subdomain && subdomain != 'www' - "config/robots.#{ subdomain }.txt" + "config/robots.#{ subdomain }.txt" end file_to_render = File.exists?(filename.to_s) ? filename : DEFAULT_FILENAME diff --git a/app/models/crop.rb b/app/models/crop.rb index 7de010b1e..8dad91a30 100644 --- a/app/models/crop.rb +++ b/app/models/crop.rb @@ -220,8 +220,8 @@ class Crop < ActiveRecord::Base # rubocop:disable Metrics/ClassLength # Crop.interesting # returns a list of interesting crops, for use on the homepage etc def Crop.interesting - howmany = 12 # max number to find - interesting_crops = [] + howmany = 12 # max number to find + interesting_crops = [] Crop.includes(:photos).randomized.each do |c| break if interesting_crops.size == howmany next unless c.interesting? diff --git a/app/models/garden.rb b/app/models/garden.rb index 448d7d60e..73ded2bf7 100644 --- a/app/models/garden.rb +++ b/app/models/garden.rb @@ -9,14 +9,14 @@ class Garden < ActiveRecord::Base has_and_belongs_to_many :photos - before_destroy do |garden| - photolist = garden.photos.to_a # save a temp copy of the photo list - garden.photos.clear # clear relationship b/w garden and photo + before_destroy do |garden| + photolist = garden.photos.to_a # save a temp copy of the photo list + garden.photos.clear # clear relationship b/w garden and photo - photolist.each do |photo| - photo.destroy_if_unused - end - end + photolist.each do |photo| + photo.destroy_if_unused + end + end # set up geocoding geocoded_by :location diff --git a/app/models/post.rb b/app/models/post.rb index 776a35c7c..8f13d313d 100644 --- a/app/models/post.rb +++ b/app/models/post.rb @@ -70,14 +70,14 @@ class Post < ActiveRecord::Base end private - def update_crops_posts_association - self.crops.destroy_all - # look for crops mentioned in the post. eg. [tomato](crop) - self.body.scan(Haml::Filters::GrowstuffMarkdown::CROP_REGEX) do |m| - # find crop case-insensitively - crop = Crop.where('lower(name) = ?', $1.downcase).first - # create association - self.crops << crop if crop && !self.crops.include?(crop) - end + def update_crops_posts_association + self.crops.destroy_all + # look for crops mentioned in the post. eg. [tomato](crop) + self.body.scan(Haml::Filters::GrowstuffMarkdown::CROP_REGEX) do |m| + # find crop case-insensitively + crop = Crop.where('lower(name) = ?', $1.downcase).first + # create association + self.crops << crop if crop && !self.crops.include?(crop) end + end end diff --git a/config/initializers/comfortable_mexican_sofa.rb b/config/initializers/comfortable_mexican_sofa.rb index fc5025933..cc8ec6301 100644 --- a/config/initializers/comfortable_mexican_sofa.rb +++ b/config/initializers/comfortable_mexican_sofa.rb @@ -9,7 +9,7 @@ ComfortableMexicanSofa.configure do |config| # Module responsible for authentication. You can replace it with your own. # It simply needs to have #authenticate method. See http_auth.rb for reference. - config.admin_auth = 'CmsDeviseAuth' + config.admin_auth = 'CmsDeviseAuth' # Module responsible for authorization on admin side. It should have #authorize # method that returns true or false based on params and loaded instance diff --git a/db/migrate/20121109130033_add_creation_index_to_updates.rb b/db/migrate/20121109130033_add_creation_index_to_updates.rb index cb94c6b26..4e3f4c560 100644 --- a/db/migrate/20121109130033_add_creation_index_to_updates.rb +++ b/db/migrate/20121109130033_add_creation_index_to_updates.rb @@ -1,5 +1,5 @@ class AddCreationIndexToUpdates < ActiveRecord::Migration def change - add_index :updates, [:created_at, :user_id] + add_index :updates, [:created_at, :user_id] end end diff --git a/lib/haml/filters/escaped_markdown.rb b/lib/haml/filters/escaped_markdown.rb index 4b0c7e9cc..1f3f35098 100644 --- a/lib/haml/filters/escaped_markdown.rb +++ b/lib/haml/filters/escaped_markdown.rb @@ -9,8 +9,8 @@ module Haml::Filters end end -# Register it as the handler for the :escaped_markdown HAML command. -# The automatic system gives us :escapedmarkdown, which is ugly. -defined['escaped_markdown'] = EscapedMarkdown + # Register it as the handler for the :escaped_markdown HAML command. + # The automatic system gives us :escapedmarkdown, which is ugly. + defined['escaped_markdown'] = EscapedMarkdown end diff --git a/lib/haml/filters/growstuff_markdown.rb b/lib/haml/filters/growstuff_markdown.rb index bb665e810..05655ccb7 100644 --- a/lib/haml/filters/growstuff_markdown.rb +++ b/lib/haml/filters/growstuff_markdown.rb @@ -56,8 +56,8 @@ module Haml::Filters end end -# Register it as the handler for the :growstuff_markdown HAML command. -# The automatic system gives us :growstuffmarkdown, which is ugly. -defined['growstuff_markdown'] = GrowstuffMarkdown + # Register it as the handler for the :growstuff_markdown HAML command. + # The automatic system gives us :growstuffmarkdown, which is ugly. + defined['growstuff_markdown'] = GrowstuffMarkdown end diff --git a/lib/tasks/hooks.rake b/lib/tasks/hooks.rake index 93d599831..ce70cb7c3 100644 --- a/lib/tasks/hooks.rake +++ b/lib/tasks/hooks.rake @@ -1,5 +1,5 @@ desc "Install git hooks" task :hooks do - FileUtils.symlink '../../script/pre-commit.sh', '.git/hooks/pre-commit', - force: true + FileUtils.symlink '../../script/pre-commit.sh', '.git/hooks/pre-commit', + force: true end diff --git a/spec/controllers/harvests_controller_spec.rb b/spec/controllers/harvests_controller_spec.rb index 753f6fbee..dc266b3ec 100644 --- a/spec/controllers/harvests_controller_spec.rb +++ b/spec/controllers/harvests_controller_spec.rb @@ -56,8 +56,8 @@ describe HarvestsController do end it "generates a csv" do - get :index, {format: "csv"} - response.status.should eq 200 + get :index, {format: "csv"} + response.status.should eq 200 end end diff --git a/spec/features/signin_spec.rb b/spec/features/signin_spec.rb index 0424f85bb..9014740e2 100644 --- a/spec/features/signin_spec.rb +++ b/spec/features/signin_spec.rb @@ -63,26 +63,26 @@ feature "signin", js: true do end context "with facebook" do - scenario "sign in" do - # Ordinarily done by database_cleaner - Member.where(login_name: 'tdawg').delete_all + scenario "sign in" do + # Ordinarily done by database_cleaner + Member.where(login_name: 'tdawg').delete_all - member = create :member, login_name: 'tdawg', email: 'example.oauth.facebook@example.com' + member = create :member, login_name: 'tdawg', email: 'example.oauth.facebook@example.com' - # Start the test - visit root_path - first('.signup a').click + # Start the test + visit root_path + first('.signup a').click - # Click the signup with facebook link + # 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 + 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(current_path).to eq root_path - expect(page.text).to include("Welcome to #{ENV['GROWSTUFF_SITE_NAME']}, tdawg") - end + # Signed up and logged in + expect(current_path).to eq root_path + expect(page.text).to include("Welcome to #{ENV['GROWSTUFF_SITE_NAME']}, tdawg") + end end end diff --git a/spec/lib/haml/filters/growstuff_markdown_spec.rb b/spec/lib/haml/filters/growstuff_markdown_spec.rb index 2aba8fb89..5bc86e131 100644 --- a/spec/lib/haml/filters/growstuff_markdown_spec.rb +++ b/spec/lib/haml/filters/growstuff_markdown_spec.rb @@ -30,10 +30,10 @@ end describe 'Haml::Filters::Growstuff_Markdown' do - it 'is registered as the handler for :growstuff_markdown' do - Haml::Filters::defined['growstuff_markdown'].should == - Haml::Filters::GrowstuffMarkdown - end + it 'is registered as the handler for :growstuff_markdown' do + Haml::Filters::defined['growstuff_markdown'].should == + Haml::Filters::GrowstuffMarkdown + end it 'converts quick crop links' do @crop = FactoryGirl.create(:crop) diff --git a/spec/models/garden_spec.rb b/spec/models/garden_spec.rb index 866e9bd7e..ac93c2a3f 100644 --- a/spec/models/garden_spec.rb +++ b/spec/models/garden_spec.rb @@ -219,15 +219,15 @@ describe Garden do it 'deletes association with photos when photo is deleted' do photo.destroy garden.reload - garden.photos.should be_empty + garden.photos.should be_empty end it 'has a default photo' do - garden.default_photo.should eq photo + garden.default_photo.should eq photo end it 'chooses the most recent photo' do - @photo2 = FactoryGirl.create(:photo) + @photo2 = FactoryGirl.create(:photo) garden.photos << @photo2 garden.default_photo.should eq @photo2 end diff --git a/spec/models/seed_spec.rb b/spec/models/seed_spec.rb index aa2238d54..6a855543e 100644 --- a/spec/models/seed_spec.rb +++ b/spec/models/seed_spec.rb @@ -91,11 +91,11 @@ describe Seed do context 'organic, gmo, heirloom' do it 'all valid organic values should work' do - ['certified organic', 'non-certified organic', - 'conventional/non-organic', 'unknown'].each do |t| - @seed = FactoryGirl.build(:seed, organic: t) - @seed.should be_valid - end + ['certified organic', 'non-certified organic', + 'conventional/non-organic', 'unknown'].each do |t| + @seed = FactoryGirl.build(:seed, organic: t) + @seed.should be_valid + end end it 'all valid GMO values should work' do @@ -107,10 +107,10 @@ describe Seed do end it 'all valid heirloom values should work' do - %w(heirloom hybrid unknown).each do |t| - @seed = FactoryGirl.build(:seed, heirloom: t) - @seed.should be_valid - end + %w(heirloom hybrid unknown).each do |t| + @seed = FactoryGirl.build(:seed, heirloom: t) + @seed.should be_valid + end end it 'should refuse invalid organic/GMO/heirloom values' do diff --git a/spec/views/crops/index.html.haml_spec.rb b/spec/views/crops/index.html.haml_spec.rb index 6db358f54..727c36ec0 100644 --- a/spec/views/crops/index.html.haml_spec.rb +++ b/spec/views/crops/index.html.haml_spec.rb @@ -40,8 +40,8 @@ describe "crops/index" do end it "linkifies crop images" do - render - assert_select "img", src: :tomato + render + assert_select "img", src: :tomato end context "logged in and crop wrangler" do diff --git a/spec/views/devise/registrations/new_spec.rb b/spec/views/devise/registrations/new_spec.rb index 994a702d1..f36125242 100644 --- a/spec/views/devise/registrations/new_spec.rb +++ b/spec/views/devise/registrations/new_spec.rb @@ -28,7 +28,7 @@ describe 'devise/registrations/new.html.haml', type: "view" do end it 'should have some fields' do - rendered.should have_content 'Email' + rendered.should have_content 'Email' end it 'has a checkbox for newsletter subscription' do diff --git a/spec/views/devise/sessions/new_spec.rb b/spec/views/devise/sessions/new_spec.rb index 3685b21a9..57426c408 100644 --- a/spec/views/devise/sessions/new_spec.rb +++ b/spec/views/devise/sessions/new_spec.rb @@ -28,8 +28,8 @@ describe 'devise/sessions/new.html.haml', type: "view" do end it 'should have some fields' do - rendered.should have_content 'Remember me' - rendered.should have_content 'Password' + rendered.should have_content 'Remember me' + rendered.should have_content 'Password' end end end diff --git a/spec/views/devise/unlocks/new_spec.rb b/spec/views/devise/unlocks/new_spec.rb index 01140c9bb..b17129f49 100644 --- a/spec/views/devise/unlocks/new_spec.rb +++ b/spec/views/devise/unlocks/new_spec.rb @@ -28,7 +28,7 @@ describe 'devise/unlocks/new.html.haml', type: "view" do end it 'should have some fields' do - rendered.should have_content 'Email' + rendered.should have_content 'Email' end end end diff --git a/spec/views/posts/_single.html.haml_spec.rb b/spec/views/posts/_single.html.haml_spec.rb index 8c2c4863b..df3ba135b 100644 --- a/spec/views/posts/_single.html.haml_spec.rb +++ b/spec/views/posts/_single.html.haml_spec.rb @@ -19,7 +19,7 @@ require 'rails_helper' describe "posts/_single" do def render_post() - render partial: "single", locals: { post: @post } + render partial: "single", locals: { post: @post } end before(:each) do @@ -121,7 +121,7 @@ describe "posts/_single" do end it "does not contain link to post" do - assert_select "a[href='#{post_path @post}']", false + assert_select "a[href='#{post_path @post}']", false end it "does not contain link to new comment" do diff --git a/spec/views/scientific_names/edit.html.haml_spec.rb b/spec/views/scientific_names/edit.html.haml_spec.rb index 8d63f80d7..4911b9aac 100644 --- a/spec/views/scientific_names/edit.html.haml_spec.rb +++ b/spec/views/scientific_names/edit.html.haml_spec.rb @@ -28,9 +28,9 @@ describe "scientific_names/edit" do render end - it "shows the creator" do - rendered.should have_content "Added by #{@scientific_name.creator} less than a minute ago." - end + it "shows the creator" do + rendered.should have_content "Added by #{@scientific_name.creator} less than a minute ago." + end it "renders the edit scientific_name form" do assert_select "form", action: scientific_names_path(@scientific_name), method: "post" do From 7eb0ee16b9bedb9e4c9fa276534b0e33f73eec6c Mon Sep 17 00:00:00 2001 From: Brenda Wallace Date: Sat, 26 Nov 2016 10:54:51 +1300 Subject: [PATCH 154/268] Indentation for multiline method calls --- .rubocop.yml | 3 +++ .rubocop_todo.yml | 8 -------- app/controllers/authentications_controller.rb | 18 +++++++++--------- 3 files changed, 12 insertions(+), 17 deletions(-) diff --git a/.rubocop.yml b/.rubocop.yml index 2f2b2f8e0..3ef44caca 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -16,6 +16,9 @@ Style/FileName: Style/StringLiterals: Enabled: false +Style/MultilineMethodCallIndentation: + EnforcedStyle: indented + Metrics/MethodLength: Description: 'Avoid methods longer than 30 lines of code.' StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#short-methods' diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml index c5eb2be82..0c2645838 100644 --- a/.rubocop_todo.yml +++ b/.rubocop_todo.yml @@ -1464,14 +1464,6 @@ Style/MultilineMethodCallBraceLayout: - 'spec/views/scientific_names/edit.html.haml_spec.rb' - 'spec/views/scientific_names/show.html.haml_spec.rb' -# Offense count: 4 -# Cop supports --auto-correct. -# Configuration parameters: EnforcedStyle, SupportedStyles, IndentationWidth. -# SupportedStyles: aligned, indented, indented_relative_to_receiver -Style/MultilineMethodCallIndentation: - Exclude: - - 'app/controllers/authentications_controller.rb' - - 'lib/actions/oauth_signup_action.rb' # Offense count: 2 # Cop supports --auto-correct. diff --git a/app/controllers/authentications_controller.rb b/app/controllers/authentications_controller.rb index 34ed65aa8..886715373 100644 --- a/app/controllers/authentications_controller.rb +++ b/app/controllers/authentications_controller.rb @@ -10,15 +10,15 @@ class AuthenticationsController < ApplicationController name = Growstuff::OauthSignupAction.new.determine_name(auth) @authentication = current_member.authentications - .create_with( - name: name, - token: auth['credentials']['token'], - secret: auth['credentials']['secret'] - ) - .find_or_create_by( - provider: auth['provider'], - uid: auth['uid'], - name: name) + .create_with( + name: name, + token: auth['credentials']['token'], + secret: auth['credentials']['secret'] + ) + .find_or_create_by( + provider: auth['provider'], + uid: auth['uid'], + name: name) flash[:notice] = "Authentication successful." else From 91d29985079cddf86959b9dedd3696b45a7bfe52 Mon Sep 17 00:00:00 2001 From: Brenda Wallace Date: Sat, 26 Nov 2016 10:56:23 +1300 Subject: [PATCH 155/268] Fixed multi-line operation indentation --- .rubocop_todo.yml | 9 --------- app/controllers/registrations_controller.rb | 2 +- 2 files changed, 1 insertion(+), 10 deletions(-) diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml index 0c2645838..610410996 100644 --- a/.rubocop_todo.yml +++ b/.rubocop_todo.yml @@ -1464,15 +1464,6 @@ Style/MultilineMethodCallBraceLayout: - 'spec/views/scientific_names/edit.html.haml_spec.rb' - 'spec/views/scientific_names/show.html.haml_spec.rb' - -# Offense count: 2 -# Cop supports --auto-correct. -# Configuration parameters: EnforcedStyle, SupportedStyles, IndentationWidth. -# SupportedStyles: aligned, indented -Style/MultilineOperationIndentation: - Exclude: - - 'app/controllers/registrations_controller.rb' - # Offense count: 2 Style/MultilineTernaryOperator: Exclude: diff --git a/app/controllers/registrations_controller.rb b/app/controllers/registrations_controller.rb index 72e631206..1be84af7e 100644 --- a/app/controllers/registrations_controller.rb +++ b/app/controllers/registrations_controller.rb @@ -42,5 +42,5 @@ end # check if we need the current password to update fields def needs_password?(member, params) params[:member][:password].present? || - params[:member][:password_confirmation].present? + params[:member][:password_confirmation].present? end From 2eddaf90cfbf7dde4b71ce23d6e2d9e310f618fe Mon Sep 17 00:00:00 2001 From: Brenda Wallace Date: Sat, 26 Nov 2016 11:00:04 +1300 Subject: [PATCH 156/268] Fixed access modifier indentation --- .rubocop_todo.yml | 8 -------- app/controllers/passwords_controller.rb | 2 +- 2 files changed, 1 insertion(+), 9 deletions(-) diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml index 610410996..12fea5928 100644 --- a/.rubocop_todo.yml +++ b/.rubocop_todo.yml @@ -303,14 +303,6 @@ Rails/Validation: - 'app/models/member.rb' - 'app/models/order_item.rb' -# Offense count: 1 -# Cop supports --auto-correct. -# Configuration parameters: EnforcedStyle, SupportedStyles, IndentationWidth. -# SupportedStyles: outdent, indent -Style/AccessModifierIndentation: - Exclude: - - 'app/controllers/passwords_controller.rb' - # Offense count: 2 # Cop supports --auto-correct. Style/AlignArray: diff --git a/app/controllers/passwords_controller.rb b/app/controllers/passwords_controller.rb index 1ec2486cc..6403db56f 100644 --- a/app/controllers/passwords_controller.rb +++ b/app/controllers/passwords_controller.rb @@ -1,6 +1,6 @@ class PasswordsController < Devise::PasswordsController -protected + protected def after_resetting_password_path_for(resource) root_path end From 5f3dd04068c02bed8c56f816431b5de5d445a07f Mon Sep 17 00:00:00 2001 From: Brenda Wallace Date: Sat, 26 Nov 2016 11:00:49 +1300 Subject: [PATCH 157/268] Fixed array indentation --- .rubocop_todo.yml | 6 ------ spec/models/planting_spec.rb | 4 ++-- 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml index 12fea5928..ae8407e59 100644 --- a/.rubocop_todo.yml +++ b/.rubocop_todo.yml @@ -303,12 +303,6 @@ Rails/Validation: - 'app/models/member.rb' - 'app/models/order_item.rb' -# Offense count: 2 -# Cop supports --auto-correct. -Style/AlignArray: - Exclude: - - 'spec/models/planting_spec.rb' - # Offense count: 93 # Cop supports --auto-correct. # Configuration parameters: EnforcedHashRocketStyle, EnforcedColonStyle, EnforcedLastArgumentHashStyle, SupportedLastArgumentHashStyles. diff --git a/spec/models/planting_spec.rb b/spec/models/planting_spec.rb index 97bfcbe2c..bc37a7d6a 100644 --- a/spec/models/planting_spec.rb +++ b/spec/models/planting_spec.rb @@ -152,8 +152,8 @@ describe Planting do it 'all valid planted_from values should work' do ['seed', 'seedling', 'cutting', 'root division', - 'runner', 'bare root plant', 'advanced plant', - 'graft', 'layering', 'bulb', 'root/tuber', nil, ''].each do |p| + 'runner', 'bare root plant', 'advanced plant', + 'graft', 'layering', 'bulb', 'root/tuber', nil, ''].each do |p| @planting = FactoryGirl.build(:planting, planted_from: p) @planting.should be_valid end From bae25cfe8f71c97d69255b60476d1a46a32d7b66 Mon Sep 17 00:00:00 2001 From: Brenda Wallace Date: Sat, 26 Nov 2016 11:16:55 +1300 Subject: [PATCH 158/268] Fixed hash alignment in a funky big DDL --- db/migrate/20150201052245_create_cms.rb | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/db/migrate/20150201052245_create_cms.rb b/db/migrate/20150201052245_create_cms.rb index 312bff94f..ddb6c25ee 100644 --- a/db/migrate/20150201052245_create_cms.rb +++ b/db/migrate/20150201052245_create_cms.rb @@ -1,5 +1,5 @@ class CreateCms < ActiveRecord::Migration - def self.up + def self.up # rubocop:disable Metrics/MethodLength text_limit = case ActiveRecord::Base.connection.adapter_name when 'PostgreSQL' { } @@ -111,7 +111,8 @@ class CreateCms < ActiveRecord::Migration t.string :label, null: false t.string :categorized_type, null: false end - add_index :comfy_cms_categories, [:site_id, :categorized_type, :label], unique: true, + add_index :comfy_cms_categories, [:site_id, :categorized_type, :label], + unique: true, name: 'index_cms_categories_on_site_id_and_cat_type_and_label' create_table :comfy_cms_categorizations, force: true do |t| @@ -119,8 +120,9 @@ class CreateCms < ActiveRecord::Migration t.string :categorized_type, null: false t.integer :categorized_id, null: false end - add_index :comfy_cms_categorizations, [:category_id, :categorized_type, :categorized_id], unique: true, - name: 'index_cms_categorizations_on_cat_id_and_catd_type_and_catd_id' + add_index :comfy_cms_categorizations, [:category_id, :categorized_type, :categorized_id], + unique: true, + name: 'index_cms_categorizations_on_cat_id_and_catd_type_and_catd_id' end def self.down From 564731667ef383d95368ea9e5851c53ac3872213 Mon Sep 17 00:00:00 2001 From: Brenda Wallace Date: Sat, 26 Nov 2016 11:17:42 +1300 Subject: [PATCH 159/268] Fixed up all remaining hash alignment --- .rubocop_todo.yml | 22 ------- app/mailers/notifier.rb | 2 +- app/models/crop.rb | 2 +- app/models/garden.rb | 6 +- app/models/harvest.rb | 12 ++-- app/models/member.rb | 2 +- app/models/planting.rb | 12 ++-- app/models/seed.rb | 27 ++++---- spec/models/harvest_spec.rb | 64 +++++++++---------- spec/models/post_spec.rb | 2 +- .../notifications/index.html.haml_spec.rb | 2 +- spec/views/photos/show.html.haml_spec.rb | 2 +- .../places/_map_attribution.html.haml_spec.rb | 4 +- spec/views/plantings/show.html.haml_spec.rb | 2 +- spec/views/posts/show.html.haml_spec.rb | 6 +- 15 files changed, 74 insertions(+), 93 deletions(-) diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml index ae8407e59..ecce71265 100644 --- a/.rubocop_todo.yml +++ b/.rubocop_todo.yml @@ -303,28 +303,6 @@ Rails/Validation: - 'app/models/member.rb' - 'app/models/order_item.rb' -# Offense count: 93 -# Cop supports --auto-correct. -# Configuration parameters: EnforcedHashRocketStyle, EnforcedColonStyle, EnforcedLastArgumentHashStyle, SupportedLastArgumentHashStyles. -# SupportedLastArgumentHashStyles: always_inspect, always_ignore, ignore_implicit, ignore_explicit -Style/AlignHash: - Exclude: - - 'app/mailers/notifier.rb' - - 'app/models/crop.rb' - - 'app/models/garden.rb' - - 'app/models/harvest.rb' - - 'app/models/member.rb' - - 'app/models/planting.rb' - - 'app/models/seed.rb' - - 'db/migrate/20150201052245_create_cms.rb' - - 'spec/models/harvest_spec.rb' - - 'spec/models/post_spec.rb' - - 'spec/views/notifications/index.html.haml_spec.rb' - - 'spec/views/photos/show.html.haml_spec.rb' - - 'spec/views/places/_map_attribution.html.haml_spec.rb' - - 'spec/views/plantings/show.html.haml_spec.rb' - - 'spec/views/posts/show.html.haml_spec.rb' - # Offense count: 143 # Cop supports --auto-correct. # Configuration parameters: EnforcedStyle, SupportedStyles, IndentationWidth. diff --git a/app/mailers/notifier.rb b/app/mailers/notifier.rb index 57974620c..65da59de5 100644 --- a/app/mailers/notifier.rb +++ b/app/mailers/notifier.rb @@ -33,7 +33,7 @@ class Notifier < ActionMailer::Base if @member.send_planting_reminder mail(to: @member.email, - subject: "What have you planted lately?") + subject: "What have you planted lately?") end end diff --git a/app/models/crop.rb b/app/models/crop.rb index 8dad91a30..709290f59 100644 --- a/app/models/crop.rb +++ b/app/models/crop.rb @@ -66,7 +66,7 @@ class Crop < ActiveRecord::Base # rubocop:disable Metrics/ClassLength # use Rails.env as a part of index name (eg. development_growstuff) index_name [Rails.env, "growstuff"].join('_') settings index: { number_of_shards: 1 }, - analysis: { + analysis: { tokenizer: { gs_edgeNGram_tokenizer: { type: "edgeNGram", # edgeNGram: NGram match from the start of a token diff --git a/app/models/garden.rb b/app/models/garden.rb index 73ded2bf7..e7a45fc1c 100644 --- a/app/models/garden.rb +++ b/app/models/garden.rb @@ -50,9 +50,9 @@ class Garden < ActiveRecord::Base "acres" => "acre" } validates :area_unit, inclusion: { in: AREA_UNITS_VALUES.values, - message: "%{value} is not a valid area unit" }, - allow_nil: true, - allow_blank: true + message: "%{value} is not a valid area unit" }, + allow_nil: true, + allow_blank: true after_validation :cleanup_area diff --git a/app/models/harvest.rb b/app/models/harvest.rb index 176562d9d..f74d36123 100644 --- a/app/models/harvest.rb +++ b/app/models/harvest.rb @@ -45,9 +45,9 @@ class Harvest < ActiveRecord::Base "bushels" => "bushel" } validates :unit, inclusion: { in: UNITS_VALUES.values, - message: "%{value} is not a valid unit" }, - allow_nil: true, - allow_blank: true + message: "%{value} is not a valid unit" }, + allow_nil: true, + allow_blank: true validates :weight_quantity, numericality: { only_integer: false }, @@ -59,9 +59,9 @@ class Harvest < ActiveRecord::Base "oz" => "oz" } validates :weight_unit, inclusion: { in: WEIGHT_UNITS_VALUES.values, - message: "%{value} is not a valid unit" }, - allow_nil: true, - allow_blank: true + message: "%{value} is not a valid unit" }, + allow_nil: true, + allow_blank: true after_validation :cleanup_quantities diff --git a/app/models/member.rb b/app/models/member.rb index 5db62f2d7..17b4352d6 100644 --- a/app/models/member.rb +++ b/app/models/member.rb @@ -59,7 +59,7 @@ class Member < ActiveRecord::Base # Requires acceptance of the Terms of Service validates_acceptance_of :tos_agreement, allow_nil: true, - accept: true + accept: true validates :login_name, length: { diff --git a/app/models/planting.rb b/app/models/planting.rb index e8eb55635..899b13e90 100644 --- a/app/models/planting.rb +++ b/app/models/planting.rb @@ -42,9 +42,9 @@ class Planting < ActiveRecord::Base SUNNINESS_VALUES = %w(sun semi-shade shade) validates :sunniness, inclusion: { in: SUNNINESS_VALUES, - message: "%{value} is not a valid sunniness value" }, - allow_nil: true, - allow_blank: true + message: "%{value} is not a valid sunniness value" }, + allow_nil: true, + allow_blank: true PLANTED_FROM_VALUES = [ 'seed', @@ -60,9 +60,9 @@ class Planting < ActiveRecord::Base 'layering' ] validates :planted_from, inclusion: { in: PLANTED_FROM_VALUES, - message: "%{value} is not a valid planting method" }, - allow_nil: true, - allow_blank: true + message: "%{value} is not a valid planting method" }, + allow_nil: true, + allow_blank: true validate :finished_must_be_after_planted diff --git a/app/models/seed.rb b/app/models/seed.rb index 9592fb1c4..1f230283d 100644 --- a/app/models/seed.rb +++ b/app/models/seed.rb @@ -30,9 +30,10 @@ class Seed < ActiveRecord::Base TRADABLE_TO_VALUES = %w(nowhere locally nationally internationally) validates :tradable_to, inclusion: { in: TRADABLE_TO_VALUES, - message: "You may only trade seed nowhere, locally, nationally, or internationally" }, - allow_nil: false, - allow_blank: false + message: "You may only trade seed nowhere, "\ + "locally, nationally, or internationally" }, + allow_nil: false, + allow_blank: false ORGANIC_VALUES = [ 'certified organic', @@ -40,9 +41,10 @@ class Seed < ActiveRecord::Base 'conventional/non-organic', 'unknown'] validates :organic, inclusion: { in: ORGANIC_VALUES, - message: "You must say whether the seeds are organic or not, or that you don't know" }, - allow_nil: false, - allow_blank: false + message: "You must say whether the seeds "\ + "are organic or not, or that you don't know" }, + allow_nil: false, + allow_blank: false GMO_VALUES = [ 'certified GMO-free', @@ -50,15 +52,16 @@ class Seed < ActiveRecord::Base 'GMO', 'unknown'] validates :gmo, inclusion: { in: GMO_VALUES, - message: "You must say whether the seeds are genetically modified or not, or that you don't know" }, - allow_nil: false, - allow_blank: false + message: "You must say whether the seeds are "\ + "genetically modified or not, or that you don't know" }, + allow_nil: false, + allow_blank: false HEIRLOOM_VALUES = %w(heirloom hybrid unknown) validates :heirloom, inclusion: { in: HEIRLOOM_VALUES, - message: "You must say whether the seeds are heirloom, hybrid, or unknown" }, - allow_nil: false, - allow_blank: false + message: "You must say whether the seeds are heirloom, hybrid, or unknown" }, + allow_nil: false, + allow_blank: false def tradable? if self.tradable_to == 'nowhere' diff --git a/spec/models/harvest_spec.rb b/spec/models/harvest_spec.rb index 3933b752a..62e846c7a 100644 --- a/spec/models/harvest_spec.rb +++ b/spec/models/harvest_spec.rb @@ -152,80 +152,80 @@ describe Harvest do it "apricots" do @h = FactoryGirl.create(:harvest, crop: crop, - quantity: nil, - unit: nil, - weight_quantity: nil, - weight_unit: nil + quantity: nil, + unit: nil, + weight_quantity: nil, + weight_unit: nil ) @h.to_s.should eq "apricots" end it "1 individual apricot" do @h = FactoryGirl.create(:harvest, crop: crop, - quantity: 1, - unit: 'individual', - weight_quantity: nil, - weight_unit: nil + quantity: 1, + unit: 'individual', + weight_quantity: nil, + weight_unit: nil ) @h.to_s.should eq "1 individual apricot" end it "10 individual apricots" do @h = FactoryGirl.create(:harvest, crop: crop, - quantity: 10, - unit: 'individual', - weight_quantity: nil, - weight_unit: nil + quantity: 10, + unit: 'individual', + weight_quantity: nil, + weight_unit: nil ) @h.to_s.should eq "10 individual apricots" end it "1 bushel of apricots" do @h = FactoryGirl.create(:harvest, crop: crop, - quantity: 1, - unit: 'bushel', - weight_quantity: nil, - weight_unit: nil + quantity: 1, + unit: 'bushel', + weight_quantity: nil, + weight_unit: nil ) @h.to_s.should eq "1 bushel of apricots" end it "1.5 bushels of apricots" do @h = FactoryGirl.create(:harvest, crop: crop, - quantity: 1.5, - unit: 'bushel', - weight_quantity: nil, - weight_unit: nil + quantity: 1.5, + unit: 'bushel', + weight_quantity: nil, + weight_unit: nil ) @h.to_s.should eq "1.5 bushels of apricots" end it "10 bushels of apricots" do @h = FactoryGirl.create(:harvest, crop: crop, - quantity: 10, - unit: 'bushel', - weight_quantity: nil, - weight_unit: nil + quantity: 10, + unit: 'bushel', + weight_quantity: nil, + weight_unit: nil ) @h.to_s.should eq "10 bushels of apricots" end it "apricots weighing 1.2 kg" do @h = FactoryGirl.create(:harvest, crop: crop, - quantity: nil, - unit: nil, - weight_quantity: 1.2, - weight_unit: 'kg' + quantity: nil, + unit: nil, + weight_quantity: 1.2, + weight_unit: 'kg' ) @h.to_s.should eq "apricots weighing 1.2 kg" end it "10 bushels of apricots weighing 100 kg" do @h = FactoryGirl.create(:harvest, crop: crop, - quantity: 10, - unit: 'bushel', - weight_quantity: 100, - weight_unit: 'kg') + quantity: 10, + unit: 'bushel', + weight_quantity: 100, + weight_unit: 'kg') @h.to_s.should eq "10 bushels of apricots weighing 100 kg" end diff --git a/spec/models/post_spec.rb b/spec/models/post_spec.rb index 2c4e7ae95..b63daa97d 100644 --- a/spec/models/post_spec.rb +++ b/spec/models/post_spec.rb @@ -79,7 +79,7 @@ describe Post do it "sets recent activity to comment time" do @comment = FactoryGirl.create(:comment, post: post, - created_at: 1.hour.ago) + created_at: 1.hour.ago) post.recent_activity.to_i.should eq @comment.created_at.to_i end diff --git a/spec/views/notifications/index.html.haml_spec.rb b/spec/views/notifications/index.html.haml_spec.rb index 55937df04..0475b1550 100644 --- a/spec/views/notifications/index.html.haml_spec.rb +++ b/spec/views/notifications/index.html.haml_spec.rb @@ -25,7 +25,7 @@ describe "notifications/index" do context "ordinary notifications" do before(:each) do @notification = FactoryGirl.create(:notification, sender: @member, - recipient: @member) + recipient: @member) assign(:notifications, Kaminari.paginate_array([ @notification, @notification ]).page(1)) render end diff --git a/spec/views/photos/show.html.haml_spec.rb b/spec/views/photos/show.html.haml_spec.rb index 2f995fd31..06f411c7f 100644 --- a/spec/views/photos/show.html.haml_spec.rb +++ b/spec/views/photos/show.html.haml_spec.rb @@ -38,7 +38,7 @@ describe "photos/show" do it "links to the CC license" do assert_select "a", href: @photo.license_url, - text: @photo.license_name + text: @photo.license_name end it "shows a link to the original image" do diff --git a/spec/views/places/_map_attribution.html.haml_spec.rb b/spec/views/places/_map_attribution.html.haml_spec.rb index 009c45290..31a717eab 100644 --- a/spec/views/places/_map_attribution.html.haml_spec.rb +++ b/spec/views/places/_map_attribution.html.haml_spec.rb @@ -23,12 +23,12 @@ describe "places/_map_attribution.html.haml", type: :view do it "links to OpenStreetMap" do assert_select "a", href: "http://openstreetmap.org", - text: "OpenStreetMap" + text: "OpenStreetMap" end it "links to the ODbL" do assert_select "a", href: "http://www.openstreetmap.org/copyright", - text: "ODbL" + text: "ODbL" end it "links to CloudMade" do diff --git a/spec/views/plantings/show.html.haml_spec.rb b/spec/views/plantings/show.html.haml_spec.rb index 48064e2fe..d2a33e5b3 100644 --- a/spec/views/plantings/show.html.haml_spec.rb +++ b/spec/views/plantings/show.html.haml_spec.rb @@ -22,7 +22,7 @@ describe "plantings/show" do @crop = FactoryGirl.create(:tomato) @planting = assign(:planting, FactoryGirl.create(:planting, garden: @garden, crop: @crop, - planted_from: 'cutting') + planted_from: 'cutting') ) end diff --git a/spec/views/posts/show.html.haml_spec.rb b/spec/views/posts/show.html.haml_spec.rb index 432879296..c8d6a00f6 100644 --- a/spec/views/posts/show.html.haml_spec.rb +++ b/spec/views/posts/show.html.haml_spec.rb @@ -84,12 +84,12 @@ describe "posts/show" do @post = assign(:post, FactoryGirl.create(:html_post, author: @author)) @comment1 = FactoryGirl.create(:comment, post: @post, body: "F1rst!!!", - created_at: Date.new(2010, 5, 17)) + created_at: Date.new(2010, 5, 17)) @comment3 = FactoryGirl.create(:comment, post: @post, body: "Th1rd!!!", - created_at: Date.new(2012, 5, 17)) + created_at: Date.new(2012, 5, 17)) @comment4 = FactoryGirl.create(:comment, post: @post, body: "F0urth!!!") @comment2 = FactoryGirl.create(:comment, post: @post, body: "S3c0nd!!1!", - created_at: Date.new(2011, 5, 17)) + created_at: Date.new(2011, 5, 17)) @comments = @post.comments render end From c878baa88616afc05d8af3e0ac782b513f8aadb0 Mon Sep 17 00:00:00 2001 From: Brenda Wallace Date: Sat, 26 Nov 2016 11:41:07 +1300 Subject: [PATCH 160/268] Indented parameters cleanup --- .rubocop.yml | 7 +- .rubocop_todo.yml | 65 ------------------- app/controllers/crops_controller.rb | 18 ++--- app/controllers/gardens_controller.rb | 2 +- app/controllers/harvests_controller.rb | 2 +- app/controllers/photos_controller.rb | 2 +- app/controllers/plantings_controller.rb | 4 +- app/controllers/products_controller.rb | 2 +- app/helpers/application_helper.rb | 2 +- app/models/member.rb | 4 +- db/migrate/20150201052245_create_cms.rb | 4 +- lib/tasks/hooks.rake | 2 +- spec/features/crops/alternate_name_spec.rb | 4 +- spec/features/crops/crop_detail_page_spec.rb | 4 +- spec/features/notifications_spec.rb | 8 +-- spec/features/scientific_name_spec.rb | 6 +- spec/models/ability_spec.rb | 8 +-- spec/models/member_spec.rb | 10 +-- spec/models/planting_spec.rb | 2 +- .../notifications/index.html.haml_spec.rb | 4 +- spec/views/posts/show.html.haml_spec.rb | 6 +- 21 files changed, 53 insertions(+), 113 deletions(-) diff --git a/.rubocop.yml b/.rubocop.yml index 3ef44caca..2631b0f0d 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -17,7 +17,12 @@ Style/StringLiterals: Enabled: false Style/MultilineMethodCallIndentation: - EnforcedStyle: indented + EnforcedStyle: indented + +# Configuration parameters: EnforcedStyle, SupportedStyles, IndentationWidth. +# SupportedStyles: with_first_parameter, with_fixed_indentation +Style/AlignParameters: + EnforcedStyle: with_fixed_indentation Metrics/MethodLength: Description: 'Avoid methods longer than 30 lines of code.' diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml index ecce71265..e7662da23 100644 --- a/.rubocop_todo.yml +++ b/.rubocop_todo.yml @@ -303,71 +303,6 @@ Rails/Validation: - 'app/models/member.rb' - 'app/models/order_item.rb' -# Offense count: 143 -# Cop supports --auto-correct. -# Configuration parameters: EnforcedStyle, SupportedStyles, IndentationWidth. -# SupportedStyles: with_first_parameter, with_fixed_indentation -Style/AlignParameters: - Exclude: - - 'app/controllers/application_controller.rb' - - 'app/controllers/comments_controller.rb' - - 'app/controllers/gardens_controller.rb' - - 'app/controllers/harvests_controller.rb' - - 'app/controllers/plantings_controller.rb' - - 'app/controllers/products_controller.rb' - - 'app/helpers/application_helper.rb' - - 'app/models/crop.rb' - - 'app/models/garden.rb' - - 'app/models/harvest.rb' - - 'app/models/member.rb' - - 'app/models/planting.rb' - - 'app/models/post.rb' - - 'app/models/product.rb' - - 'app/models/seed.rb' - - 'db/migrate/20150201052245_create_cms.rb' - - 'lib/tasks/hooks.rake' - - 'spec/controllers/order_items_controller_spec.rb' - - 'spec/helpers/gardens_helper_spec.rb' - - 'spec/helpers/harvests_helper_spec.rb' - - 'spec/helpers/plantings_helper_spec.rb' - - 'spec/helpers/seeds_helper_spec.rb' - - 'spec/models/ability_spec.rb' - - 'spec/models/crop_spec.rb' - - 'spec/models/member_spec.rb' - - 'spec/models/order_spec.rb' - - 'spec/models/plant_part_spec.rb' - - 'spec/models/planting_spec.rb' - - 'spec/models/post_spec.rb' - - 'spec/views/account_types/edit.html.haml_spec.rb' - - 'spec/views/account_types/new.html.haml_spec.rb' - - 'spec/views/account_types/show.html.haml_spec.rb' - - 'spec/views/crops/_grown_for.html.haml_spec.rb' - - 'spec/views/crops/_planting_advice.html.haml_spec.rb' - - 'spec/views/forums/edit.html.haml_spec.rb' - - 'spec/views/harvests/index.html.haml_spec.rb' - - 'spec/views/notifications/index.html.haml_spec.rb' - - 'spec/views/orders/show.html.haml_spec.rb' - - 'spec/views/photos/edit.html.haml_spec.rb' - - 'spec/views/plant_parts/edit.html.haml_spec.rb' - - 'spec/views/plant_parts/new.html.haml_spec.rb' - - 'spec/views/plantings/_form.html.haml_spec.rb' - - 'spec/views/plantings/edit.html.haml_spec.rb' - - 'spec/views/plantings/index.html.haml_spec.rb' - - 'spec/views/plantings/new.html.haml_spec.rb' - - 'spec/views/plantings/show.html.haml_spec.rb' - - 'spec/views/posts/edit.html.haml_spec.rb' - - 'spec/views/posts/index.html.haml_spec.rb' - - 'spec/views/posts/show.html.haml_spec.rb' - - 'spec/views/products/edit.html.haml_spec.rb' - - 'spec/views/products/new.html.haml_spec.rb' - - 'spec/views/roles/edit.html.haml_spec.rb' - - 'spec/views/roles/index.html.haml_spec.rb' - - 'spec/views/roles/new.html.haml_spec.rb' - - 'spec/views/roles/show.html.haml_spec.rb' - - 'spec/views/scientific_names/edit.html.haml_spec.rb' - - 'spec/views/scientific_names/show.html.haml_spec.rb' - - 'spec/views/seeds/show.html.haml_spec.rb' - # Offense count: 12 # Cop supports --auto-correct. # Configuration parameters: EnforcedStyle, SupportedStyles. diff --git a/app/controllers/crops_controller.rb b/app/controllers/crops_controller.rb index c756f2752..49dca51e3 100644 --- a/app/controllers/crops_controller.rb +++ b/app/controllers/crops_controller.rb @@ -216,14 +216,14 @@ class CropsController < ApplicationController def crop_params params.require(:crop).permit(:en_wikipedia_url, - :name, - :parent_id, - :creator_id, - :approval_status, - :request_notes, - :reason_for_rejection, - :rejection_notes, scientific_names_attributes: [:scientific_name, - :_destroy, - :id]) + :name, + :parent_id, + :creator_id, + :approval_status, + :request_notes, + :reason_for_rejection, + :rejection_notes, scientific_names_attributes: [:scientific_name, + :_destroy, + :id]) end end diff --git a/app/controllers/gardens_controller.rb b/app/controllers/gardens_controller.rb index 6fe5347be..6f53a959c 100644 --- a/app/controllers/gardens_controller.rb +++ b/app/controllers/gardens_controller.rb @@ -98,6 +98,6 @@ class GardensController < ApplicationController def garden_params params.require(:garden).permit(:name, :slug, :owner_id, :description, :active, - :location, :latitude, :longitude, :area, :area_unit) + :location, :latitude, :longitude, :area, :area_unit) end end diff --git a/app/controllers/harvests_controller.rb b/app/controllers/harvests_controller.rb index d7f153016..d599dad03 100644 --- a/app/controllers/harvests_controller.rb +++ b/app/controllers/harvests_controller.rb @@ -95,6 +95,6 @@ class HarvestsController < ApplicationController def harvest_params params.require(:harvest).permit(:crop_id, :harvested_at, :description, :owner_id, - :quantity, :unit, :weight_quantity, :weight_unit, :plant_part_id, :slug, :si_weight) + :quantity, :unit, :weight_quantity, :weight_unit, :plant_part_id, :slug, :si_weight) end end diff --git a/app/controllers/photos_controller.rb b/app/controllers/photos_controller.rb index 64583a143..ba2d24cee 100644 --- a/app/controllers/photos_controller.rb +++ b/app/controllers/photos_controller.rb @@ -102,7 +102,7 @@ class PhotosController < ApplicationController def photo_params params.require(:photo).permit(:flickr_photo_id, :owner_id, :title, :license_name, - :license_url, :thumbnail_url, :fullsize_url, :link_url) + :license_url, :thumbnail_url, :fullsize_url, :link_url) end def find_or_create_photo_from_flickr_photo diff --git a/app/controllers/plantings_controller.rb b/app/controllers/plantings_controller.rb index ca9de8ef0..fe4b0db9a 100644 --- a/app/controllers/plantings_controller.rb +++ b/app/controllers/plantings_controller.rb @@ -120,8 +120,8 @@ class PlantingsController < ApplicationController def planting_params params.require(:planting).permit(:crop_id, :description, :garden_id, :planted_at, - :quantity, :sunniness, :planted_from, :owner_id, :finished, - :finished_at) + :quantity, :sunniness, :planted_from, :owner_id, :finished, + :finished_at) end def update_days_before_maturity(planting, crop_id) diff --git a/app/controllers/products_controller.rb b/app/controllers/products_controller.rb index 1ed69703f..be3e923dd 100644 --- a/app/controllers/products_controller.rb +++ b/app/controllers/products_controller.rb @@ -74,6 +74,6 @@ class ProductsController < ApplicationController def product_params params.require(:product).permit(:description, :min_price, :recommended_price, :name, - :account_type_id, :paid_months) + :account_type_id, :paid_months) end end diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 89646d8b3..6bee33f0b 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -7,7 +7,7 @@ module ApplicationHelper # 999 cents becomes 9.99 AUD -- for products/orders/etc def price_with_currency(price) return sprintf('%.2f %s', price / 100.0, - Growstuff::Application.config.currency) + Growstuff::Application.config.currency) end def parse_date(str) diff --git a/app/models/member.rb b/app/models/member.rb index 17b4352d6..0e0aab011 100644 --- a/app/models/member.rb +++ b/app/models/member.rb @@ -45,8 +45,8 @@ class Member < ActiveRecord::Base # :token_authenticatable, :confirmable, # :lockable, :timeoutable and :omniauthable devise :database_authenticatable, :registerable, - :recoverable, :rememberable, :trackable, :validatable, - :confirmable, :lockable, :timeoutable, :omniauthable + :recoverable, :rememberable, :trackable, :validatable, + :confirmable, :lockable, :timeoutable, :omniauthable # set up geocoding geocoded_by :location diff --git a/db/migrate/20150201052245_create_cms.rb b/db/migrate/20150201052245_create_cms.rb index ddb6c25ee..8eceef012 100644 --- a/db/migrate/20150201052245_create_cms.rb +++ b/db/migrate/20150201052245_create_cms.rb @@ -121,8 +121,8 @@ class CreateCms < ActiveRecord::Migration t.integer :categorized_id, null: false end add_index :comfy_cms_categorizations, [:category_id, :categorized_type, :categorized_id], - unique: true, - name: 'index_cms_categorizations_on_cat_id_and_catd_type_and_catd_id' + unique: true, + name: 'index_cms_categorizations_on_cat_id_and_catd_type_and_catd_id' end def self.down diff --git a/lib/tasks/hooks.rake b/lib/tasks/hooks.rake index ce70cb7c3..7543404b2 100644 --- a/lib/tasks/hooks.rake +++ b/lib/tasks/hooks.rake @@ -1,5 +1,5 @@ desc "Install git hooks" task :hooks do FileUtils.symlink '../../script/pre-commit.sh', '.git/hooks/pre-commit', - force: true + force: true end diff --git a/spec/features/crops/alternate_name_spec.rb b/spec/features/crops/alternate_name_spec.rb index de8843708..319f4d7e1 100644 --- a/spec/features/crops/alternate_name_spec.rb +++ b/spec/features/crops/alternate_name_spec.rb @@ -42,7 +42,7 @@ feature "Alternate names", js: true do scenario "Crop wranglers can delete alternate names" do visit crop_path(alternate_eggplant.crop) expect(page).to have_link "Delete", - href: alternate_name_path(alternate_eggplant) + href: alternate_name_path(alternate_eggplant) within('.alternate_names') { click_on "Delete" } expect(page.status_code).to equal 200 expect(page).to_not have_content alternate_eggplant.name @@ -52,7 +52,7 @@ feature "Alternate names", js: true do scenario "Crop wranglers can add alternate names" do visit crop_path(crop) expect(page).to have_link "Add", - href: new_alternate_name_path(crop_id: crop.id) + href: new_alternate_name_path(crop_id: crop.id) within('.alternate_names') { click_on "Add" } expect(page.status_code).to equal 200 expect(page).to have_css "option[value='#{crop.id}'][selected=selected]" diff --git a/spec/features/crops/crop_detail_page_spec.rb b/spec/features/crops/crop_detail_page_spec.rb index 3e6a71cea..dbfc3ffb5 100644 --- a/spec/features/crops/crop_detail_page_spec.rb +++ b/spec/features/crops/crop_detail_page_spec.rb @@ -138,12 +138,12 @@ feature "crop detail page", js: true do scenario "has a link to OpenFarm" do expect(page).to have_link "OpenFarm - Growing guide", - href: "https://openfarm.cc/en/crops/#{URI.escape crop.name}" + href: "https://openfarm.cc/en/crops/#{URI.escape crop.name}" end scenario "has a link to gardenate" do expect(page).to have_link "Gardenate - Planting reminders", - href: "http://www.gardenate.com/plant/#{URI.escape crop.name}" + href: "http://www.gardenate.com/plant/#{URI.escape crop.name}" end end end diff --git a/spec/features/notifications_spec.rb b/spec/features/notifications_spec.rb index 05d02c764..28436a3b2 100644 --- a/spec/features/notifications_spec.rb +++ b/spec/features/notifications_spec.rb @@ -7,10 +7,10 @@ feature "Notifications", :js do context "On existing notification" do let!(:notification) { create :notification, - sender: sender, - recipient: recipient, - body: "Notification body", - post_id: nil + sender: sender, + recipient: recipient, + body: "Notification body", + post_id: nil } background do diff --git a/spec/features/scientific_name_spec.rb b/spec/features/scientific_name_spec.rb index c5b621e10..c55cf6428 100644 --- a/spec/features/scientific_name_spec.rb +++ b/spec/features/scientific_name_spec.rb @@ -42,7 +42,7 @@ feature "Scientific names", js: true do scenario "Crop wranglers can delete scientific names" do visit crop_path(zea_mays.crop) expect(page).to have_link "Delete", - href: scientific_name_path(zea_mays) + href: scientific_name_path(zea_mays) within('.scientific_names') { click_on "Delete" } expect(page.status_code).to equal 200 expect(page).to_not have_content zea_mays.scientific_name @@ -52,7 +52,7 @@ feature "Scientific names", js: true do scenario "Crop wranglers can add scientific names" do visit crop_path(crop) expect(page).to have_link "Add", - href: new_scientific_name_path(crop_id: crop.id) + href: new_scientific_name_path(crop_id: crop.id) within('.scientific_names') { click_on "Add" } expect(page.status_code).to equal 200 expect(page).to have_css "option[value='#{crop.id}'][selected=selected]" @@ -67,7 +67,7 @@ feature "Scientific names", js: true do visit scientific_name_path(zea_mays) expect(page.status_code).to equal 200 expect(page).to have_link zea_mays.crop.name, - href: crop_path(zea_mays.crop) + href: crop_path(zea_mays.crop) end context "When scientific name is pending" do diff --git a/spec/models/ability_spec.rb b/spec/models/ability_spec.rb index 53a820bd3..9c378e0a0 100644 --- a/spec/models/ability_spec.rb +++ b/spec/models/ability_spec.rb @@ -125,14 +125,14 @@ describe Ability do let(:order) { FactoryGirl.create(:order, member: member) } let(:strangers_order) { FactoryGirl.create(:order, - member: FactoryGirl.create(:member)) } + member: FactoryGirl.create(:member)) } let(:completed_order) { FactoryGirl.create(:completed_order, - member: member) } + member: member) } let(:order_item) { FactoryGirl.create(:order_item, order: order) } let(:strangers_order_item) { FactoryGirl.create(:order_item, - order: strangers_order) } + order: strangers_order) } let(:completed_order_item) { FactoryGirl.create(:order_item, - order: completed_order) } + order: completed_order) } context "standard member" do it "can read their own orders" do diff --git a/spec/models/member_spec.rb b/spec/models/member_spec.rb index 474819018..408c38376 100644 --- a/spec/models/member_spec.rb +++ b/spec/models/member_spec.rb @@ -308,14 +308,14 @@ describe 'member' do it "recognises a permanent paid account" do @account_type = FactoryGirl.create(:account_type, - is_paid: true, is_permanent_paid: true) + is_paid: true, is_permanent_paid: true) member.account.account_type = @account_type member.is_paid?.should be(true) end it "recognises a current paid account" do @account_type = FactoryGirl.create(:account_type, - is_paid: true, is_permanent_paid: false) + is_paid: true, is_permanent_paid: false) member.account.account_type = @account_type member.account.paid_until = Time.zone.now + 1.month member.is_paid?.should be(true) @@ -323,7 +323,7 @@ describe 'member' do it "recognises an expired paid account" do @account_type = FactoryGirl.create(:account_type, - is_paid: true, is_permanent_paid: false) + is_paid: true, is_permanent_paid: false) member.account.account_type = @account_type member.account.paid_until = Time.zone.now - 1.minute member.is_paid?.should be(false) @@ -331,14 +331,14 @@ describe 'member' do it "recognises a free account" do @account_type = FactoryGirl.create(:account_type, - is_paid: false, is_permanent_paid: false) + is_paid: false, is_permanent_paid: false) member.account.account_type = @account_type member.is_paid?.should be(false) end it "recognises a free account even with paid_until set" do @account_type = FactoryGirl.create(:account_type, - is_paid: false, is_permanent_paid: false) + is_paid: false, is_permanent_paid: false) member.account.account_type = @account_type member.account.paid_until = Time.zone.now + 1.month member.is_paid?.should be(false) diff --git a/spec/models/planting_spec.rb b/spec/models/planting_spec.rb index bc37a7d6a..268238672 100644 --- a/spec/models/planting_spec.rb +++ b/spec/models/planting_spec.rb @@ -6,7 +6,7 @@ describe Planting do let(:garden_owner) { FactoryGirl.create(:member) } let(:garden) { FactoryGirl.create(:garden, owner: garden_owner) } let(:planting) { FactoryGirl.create(:planting, - crop: crop, garden: garden)} + crop: crop, garden: garden)} it 'has an owner' do planting.owner.should be_an_instance_of Member diff --git a/spec/views/notifications/index.html.haml_spec.rb b/spec/views/notifications/index.html.haml_spec.rb index 0475b1550..aaddfd564 100644 --- a/spec/views/notifications/index.html.haml_spec.rb +++ b/spec/views/notifications/index.html.haml_spec.rb @@ -45,7 +45,7 @@ describe "notifications/index" do context "no subject" do it "shows (no subject)" do @notification = FactoryGirl.create(:notification, - sender: @member, recipient: @member, subject: nil) + sender: @member, recipient: @member, subject: nil) assign(:notifications, Kaminari.paginate_array([@notification]).page(1)) render rendered.should have_content "(no subject)" @@ -55,7 +55,7 @@ describe "notifications/index" do context "whitespace-only subject" do it "shows (no subject)" do @notification = FactoryGirl.create(:notification, - sender: @member, recipient: @member, subject: " ") + sender: @member, recipient: @member, subject: " ") assign(:notifications, Kaminari.paginate_array([@notification]).page(1)) render rendered.should have_content "(no subject)" diff --git a/spec/views/posts/show.html.haml_spec.rb b/spec/views/posts/show.html.haml_spec.rb index c8d6a00f6..fd1a38b0d 100644 --- a/spec/views/posts/show.html.haml_spec.rb +++ b/spec/views/posts/show.html.haml_spec.rb @@ -52,7 +52,7 @@ describe "posts/show" do it 'has an anchor to the comments' do @post = assign(:post, - FactoryGirl.create(:post, author: @author)) + FactoryGirl.create(:post, author: @author)) render assert_select 'a[name=comments]' end @@ -60,7 +60,7 @@ describe "posts/show" do context "when there is one comment" do before(:each) do @post = assign(:post, - FactoryGirl.create(:html_post, author: @author)) + FactoryGirl.create(:html_post, author: @author)) @comment = FactoryGirl.create(:comment, post: @post) @comments = @post.comments render @@ -82,7 +82,7 @@ describe "posts/show" do context "when there is more than one comment" do before(:each) do @post = assign(:post, - FactoryGirl.create(:html_post, author: @author)) + FactoryGirl.create(:html_post, author: @author)) @comment1 = FactoryGirl.create(:comment, post: @post, body: "F1rst!!!", created_at: Date.new(2010, 5, 17)) @comment3 = FactoryGirl.create(:comment, post: @post, body: "Th1rd!!!", From ebacd83dde7937a099d55a137212df48aa6ce488 Mon Sep 17 00:00:00 2001 From: Brenda Wallace Date: Sat, 26 Nov 2016 11:42:34 +1300 Subject: [PATCH 161/268] Case statement indentation clean up --- .rubocop_todo.yml | 10 ------ app/helpers/application_helper.rb | 16 ++++----- app/models/order.rb | 46 ++++++++++++------------- db/migrate/20150201052245_create_cms.rb | 8 ++--- 4 files changed, 35 insertions(+), 45 deletions(-) diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml index e7662da23..dbde64ba3 100644 --- a/.rubocop_todo.yml +++ b/.rubocop_todo.yml @@ -393,16 +393,6 @@ Style/BracesAroundHashParameters: - 'spec/views/notifier/notify.html.haml_spec.rb' - 'spec/views/photos/new.html.haml_spec.rb' -# Offense count: 13 -# Cop supports --auto-correct. -# Configuration parameters: IndentWhenRelativeTo, SupportedStyles, IndentOneStep, IndentationWidth. -# SupportedStyles: case, end -Style/CaseIndentation: - Exclude: - - 'app/helpers/application_helper.rb' - - 'app/models/order.rb' - - 'db/migrate/20150201052245_create_cms.rb' - # Offense count: 4 # Configuration parameters: EnforcedStyle, SupportedStyles. # SupportedStyles: nested, compact diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 6bee33f0b..4085ea31b 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -26,14 +26,14 @@ module ApplicationHelper def build_alert_classes(alert_type = :info) classes = 'alert alert-dismissable ' case alert_type.to_sym - when :alert, :danger, :error, :validation_errors - classes += 'alert-danger' - when :warning, :todo - classes += 'alert-warning' - when :notice, :success - classes += 'alert-success' - when :info - classes += 'alert-info' + when :alert, :danger, :error, :validation_errors + classes += 'alert-danger' + when :warning, :todo + classes += 'alert-warning' + when :notice, :success + classes += 'alert-success' + when :info + classes += 'alert-info' end classes end diff --git a/app/models/order.rb b/app/models/order.rb index 8ccdaa9db..b5e1ee1ad 100644 --- a/app/models/order.rb +++ b/app/models/order.rb @@ -65,29 +65,29 @@ class Order < ActiveRecord::Base def Order.search(args={}) if args[:for] case args[:by] - when "member" - member = Member.find_by_login_name(args[:for]) - if member - return member.orders - end - when "order_id" - order = Order.find_by_id(args[:for]) - if order - return [order] - end - when "paypal_token" - order = Order.find_by_paypal_express_token(args[:for]) - if order - return [order] - end - when "paypal_payer_id" - order = Order.find_by_paypal_express_payer_id(args[:for]) - if order - return [order] - end - when "referral_code" - # coerce to uppercase - return Order.where(referral_code: args[:for].upcase) + when "member" + member = Member.find_by_login_name(args[:for]) + if member + return member.orders + end + when "order_id" + order = Order.find_by_id(args[:for]) + if order + return [order] + end + when "paypal_token" + order = Order.find_by_paypal_express_token(args[:for]) + if order + return [order] + end + when "paypal_payer_id" + order = Order.find_by_paypal_express_payer_id(args[:for]) + if order + return [order] + end + when "referral_code" + # coerce to uppercase + return Order.where(referral_code: args[:for].upcase) end end return [] diff --git a/db/migrate/20150201052245_create_cms.rb b/db/migrate/20150201052245_create_cms.rb index 8eceef012..b5150d895 100644 --- a/db/migrate/20150201052245_create_cms.rb +++ b/db/migrate/20150201052245_create_cms.rb @@ -1,10 +1,10 @@ class CreateCms < ActiveRecord::Migration def self.up # rubocop:disable Metrics/MethodLength text_limit = case ActiveRecord::Base.connection.adapter_name - when 'PostgreSQL' - { } - else - { limit: 16777215 } + when 'PostgreSQL' + { } + else + { limit: 16777215 } end # -- Sites -------------------------------------------------------------- From 200a1c9a84746661377024b29d73405ec193446b Mon Sep 17 00:00:00 2001 From: Brenda Wallace Date: Sat, 26 Nov 2016 11:44:18 +1300 Subject: [PATCH 162/268] Closing parenthesis indentation fixed --- .rubocop_todo.yml | 46 ---------------------------------------------- 1 file changed, 46 deletions(-) diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml index dbde64ba3..e4d3872e7 100644 --- a/.rubocop_todo.yml +++ b/.rubocop_todo.yml @@ -414,52 +414,6 @@ Style/ClassMethods: - 'app/models/post.rb' - 'app/models/seed.rb' -# Offense count: 90 -# Cop supports --auto-correct. -Style/ClosingParenthesisIndentation: - Exclude: - - 'app/controllers/application_controller.rb' - - 'app/models/account.rb' - - 'app/models/crop.rb' - - 'spec/controllers/order_items_controller_spec.rb' - - 'spec/helpers/gardens_helper_spec.rb' - - 'spec/helpers/harvests_helper_spec.rb' - - 'spec/helpers/plantings_helper_spec.rb' - - 'spec/helpers/seeds_helper_spec.rb' - - 'spec/models/ability_spec.rb' - - 'spec/models/crop_spec.rb' - - 'spec/models/harvest_spec.rb' - - 'spec/models/member_spec.rb' - - 'spec/models/order_spec.rb' - - 'spec/models/plant_part_spec.rb' - - 'spec/models/planting_spec.rb' - - 'spec/models/post_spec.rb' - - 'spec/views/account_types/edit.html.haml_spec.rb' - - 'spec/views/account_types/new.html.haml_spec.rb' - - 'spec/views/account_types/show.html.haml_spec.rb' - - 'spec/views/crops/_grown_for.html.haml_spec.rb' - - 'spec/views/crops/_planting_advice.html.haml_spec.rb' - - 'spec/views/forums/edit.html.haml_spec.rb' - - 'spec/views/harvests/index.html.haml_spec.rb' - - 'spec/views/orders/show.html.haml_spec.rb' - - 'spec/views/photos/edit.html.haml_spec.rb' - - 'spec/views/plant_parts/edit.html.haml_spec.rb' - - 'spec/views/plant_parts/new.html.haml_spec.rb' - - 'spec/views/plantings/_form.html.haml_spec.rb' - - 'spec/views/plantings/edit.html.haml_spec.rb' - - 'spec/views/plantings/index.html.haml_spec.rb' - - 'spec/views/plantings/new.html.haml_spec.rb' - - 'spec/views/plantings/show.html.haml_spec.rb' - - 'spec/views/posts/edit.html.haml_spec.rb' - - 'spec/views/products/edit.html.haml_spec.rb' - - 'spec/views/products/new.html.haml_spec.rb' - - 'spec/views/roles/edit.html.haml_spec.rb' - - 'spec/views/roles/index.html.haml_spec.rb' - - 'spec/views/roles/new.html.haml_spec.rb' - - 'spec/views/roles/show.html.haml_spec.rb' - - 'spec/views/scientific_names/edit.html.haml_spec.rb' - - 'spec/views/scientific_names/show.html.haml_spec.rb' - # Offense count: 2 # Cop supports --auto-correct. Style/ColonMethodCall: From d268d2b09ec17d872a074e466fa47b9990882a98 Mon Sep 17 00:00:00 2001 From: Brenda Wallace Date: Sat, 26 Nov 2016 11:45:25 +1300 Subject: [PATCH 163/268] Fixed indentation on comments --- .rubocop_todo.yml | 31 -------------------- app/controllers/crops_controller.rb | 16 +++++------ app/controllers/harvests_controller.rb | 14 ++++----- app/controllers/members_controller.rb | 10 +++---- app/controllers/plantings_controller.rb | 14 ++++----- app/controllers/posts_controller.rb | 10 +++---- app/controllers/registrations_controller.rb | 10 +++---- app/controllers/seeds_controller.rb | 14 ++++----- app/models/crop.rb | 14 ++++----- app/models/harvest.rb | 32 ++++++++++----------- app/models/member.rb | 26 ++++++++--------- config/application.rb | 2 +- config/routes.rb | 2 +- spec/factories/comments.rb | 2 +- spec/features/footer_spec.rb | 4 +-- spec/spec_helper.rb | 4 +-- spec/views/harvests/new.html.haml_spec.rb | 2 +- spec/views/members/show.rss.haml_spec.rb | 4 +-- spec/views/posts/new.html.haml_spec.rb | 2 +- 19 files changed, 91 insertions(+), 122 deletions(-) diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml index e4d3872e7..f1a3c0a4f 100644 --- a/.rubocop_todo.yml +++ b/.rubocop_todo.yml @@ -429,37 +429,6 @@ Style/CommentAnnotation: Exclude: - 'app/controllers/crops_controller.rb' -# Offense count: 11 -# Cop supports --auto-correct. -Style/CommentIndentation: - Exclude: - - 'app/controllers/registrations_controller.rb' - - 'app/models/crop.rb' - - 'config/application.rb' - - 'config/initializers/comfortable_mexican_sofa.rb' - - 'config/routes.rb' - - 'spec/factories/comments.rb' - - 'spec/features/footer_spec.rb' - - 'spec/spec_helper.rb' - - 'spec/views/harvests/new.html.haml_spec.rb' - - 'spec/views/members/show.rss.haml_spec.rb' - - 'spec/views/posts/new.html.haml_spec.rb' - -# Offense count: 5 -# Cop supports --auto-correct. -# Configuration parameters: EnforcedStyle, SupportedStyles, SingleLineConditionsOnly. -# SupportedStyles: assign_to_condition, assign_inside_condition -Style/ConditionalAssignment: - Exclude: - - 'app/controllers/crops_controller.rb' - - 'app/controllers/harvests_controller.rb' - - 'app/models/harvest.rb' - - 'app/models/member.rb' - - 'app/controllers/posts_controller.rb' - - 'app/controllers/plantings_controller.rb' - - 'app/controllers/members_controller.rb' - - 'app/controllers/seeds_controller.rb' - # Offense count: 1 # Cop supports --auto-correct. Style/DefWithParentheses: diff --git a/app/controllers/crops_controller.rb b/app/controllers/crops_controller.rb index 49dca51e3..a917c2c78 100644 --- a/app/controllers/crops_controller.rb +++ b/app/controllers/crops_controller.rb @@ -37,14 +37,14 @@ class CropsController < ApplicationController # GET /crops/wrangle def wrangle @approval_status = params[:approval_status] - case @approval_status - when "pending" - @crops = Crop.pending_approval - when "rejected" - @crops = Crop.rejected - else - @crops = Crop.recent - end + @crops = case @approval_status + when "pending" + Crop.pending_approval + when "rejected" + Crop.rejected + else + Crop.recent + end @crops = @crops.paginate(page: params[:page]) diff --git a/app/controllers/harvests_controller.rb b/app/controllers/harvests_controller.rb index d599dad03..ad557efcd 100644 --- a/app/controllers/harvests_controller.rb +++ b/app/controllers/harvests_controller.rb @@ -7,13 +7,13 @@ class HarvestsController < ApplicationController def index @owner = Member.find_by_slug(params[:owner]) @crop = Crop.find_by_slug(params[:crop]) - if @owner - @harvests = @owner.harvests.includes(:owner, :crop) - elsif @crop - @harvests = @crop.harvests.includes(:owner, :crop) - else - @harvests = Harvest.includes(:owner, :crop) - end + @harvests = if @owner + @owner.harvests.includes(:owner, :crop) + elsif @crop + @crop.harvests.includes(:owner, :crop) + else + Harvest.includes(:owner, :crop) + end respond_to do |format| format.html { @harvests = @harvests.paginate(page: params[:page]) } diff --git a/app/controllers/members_controller.rb b/app/controllers/members_controller.rb index 027b40f21..4fecee7f1 100644 --- a/app/controllers/members_controller.rb +++ b/app/controllers/members_controller.rb @@ -7,11 +7,11 @@ class MembersController < ApplicationController def index @sort = params[:sort] - if @sort == 'recently_joined' - @members = Member.confirmed.recently_joined.paginate(page: params[:page]) - else - @members = Member.confirmed.paginate(page: params[:page]) - end + @members = if @sort == 'recently_joined' + Member.confirmed.recently_joined.paginate(page: params[:page]) + else + Member.confirmed.paginate(page: params[:page]) + end respond_to do |format| format.html # index.html.haml diff --git a/app/controllers/plantings_controller.rb b/app/controllers/plantings_controller.rb index fe4b0db9a..11e9662f8 100644 --- a/app/controllers/plantings_controller.rb +++ b/app/controllers/plantings_controller.rb @@ -7,13 +7,13 @@ class PlantingsController < ApplicationController def index @owner = Member.find_by_slug(params[:owner]) @crop = Crop.find_by_slug(params[:crop]) - if @owner - @plantings = @owner.plantings.includes(:owner, :crop, :garden).paginate(page: params[:page]) - elsif @crop - @plantings = @crop.plantings.includes(:owner, :crop, :garden).paginate(page: params[:page]) - else - @plantings = Planting.includes(:owner, :crop, :garden).paginate(page: params[:page]) - end + @plantings = if @owner + @owner.plantings.includes(:owner, :crop, :garden).paginate(page: params[:page]) + elsif @crop + @crop.plantings.includes(:owner, :crop, :garden).paginate(page: params[:page]) + else + Planting.includes(:owner, :crop, :garden).paginate(page: params[:page]) + end respond_to do |format| format.html { @plantings = @plantings.paginate(page: params[:page]) } diff --git a/app/controllers/posts_controller.rb b/app/controllers/posts_controller.rb index e30ea1f7f..f1d2b62ae 100644 --- a/app/controllers/posts_controller.rb +++ b/app/controllers/posts_controller.rb @@ -7,11 +7,11 @@ class PostsController < ApplicationController def index @author = Member.find_by_slug(params[:author]) - if @author - @posts = @author.posts.includes(:author, { comments: :author }).paginate(page: params[:page]) - else - @posts = Post.includes(:author, { comments: :author }).paginate(page: params[:page]) - end + @posts = if @author + @author.posts.includes(:author, { comments: :author }).paginate(page: params[:page]) + else + Post.includes(:author, { comments: :author }).paginate(page: params[:page]) + end respond_to do |format| format.html # index.html.haml diff --git a/app/controllers/registrations_controller.rb b/app/controllers/registrations_controller.rb index 1be84af7e..ff00e4bdd 100644 --- a/app/controllers/registrations_controller.rb +++ b/app/controllers/registrations_controller.rb @@ -8,11 +8,11 @@ class RegistrationsController < Devise::RegistrationsController render "edit" end -# we need this subclassed method so that Devise doesn't force people to -# change their password every time they want to edit their settings. -# we also check that they give their current password to change their password. -# Code copied from -# https://github.com/plataformatec/devise/wiki/How-To:-Allow-users-to-edit-their-account-without-providing-a-password + # we need this subclassed method so that Devise doesn't force people to + # change their password every time they want to edit their settings. + # we also check that they give their current password to change their password. + # Code copied from + # https://github.com/plataformatec/devise/wiki/How-To:-Allow-users-to-edit-their-account-without-providing-a-password def update diff --git a/app/controllers/seeds_controller.rb b/app/controllers/seeds_controller.rb index 70f3936a1..092dbc2ba 100644 --- a/app/controllers/seeds_controller.rb +++ b/app/controllers/seeds_controller.rb @@ -7,13 +7,13 @@ class SeedsController < ApplicationController def index @owner = Member.find_by_slug(params[:owner]) @crop = Crop.find_by_slug(params[:crop]) - if @owner - @seeds = @owner.seeds.includes(:owner, :crop).paginate(page: params[:page]) - elsif @crop - @seeds = @crop.seeds.includes(:owner, :crop).paginate(page: params[:page]) - else - @seeds = Seed.includes(:owner, :crop).paginate(page: params[:page]) - end + @seeds = if @owner + @owner.seeds.includes(:owner, :crop).paginate(page: params[:page]) + elsif @crop + @crop.seeds.includes(:owner, :crop).paginate(page: params[:page]) + else + Seed.includes(:owner, :crop).paginate(page: params[:page]) + end respond_to do |format| format.html # index.html.erb diff --git a/app/models/crop.rb b/app/models/crop.rb index 709290f59..8cae6ea08 100644 --- a/app/models/crop.rb +++ b/app/models/crop.rb @@ -230,13 +230,13 @@ class Crop < ActiveRecord::Base # rubocop:disable Metrics/ClassLength return interesting_crops end -# Crop.create_from_csv(row) -# used by db/seeds.rb and rake growstuff:import_crops -# CSV fields: -# - name (required) -# - en_wikipedia_url (required) -# - parent (name, optional) -# - scientific name (optional, can be picked up from parent if it has one) + # Crop.create_from_csv(row) + # used by db/seeds.rb and rake growstuff:import_crops + # CSV fields: + # - name (required) + # - en_wikipedia_url (required) + # - parent (name, optional) + # - scientific name (optional, can be picked up from parent if it has one) def Crop.create_from_csv(row) name,en_wikipedia_url,parent,scientific_names,alternate_names = row diff --git a/app/models/harvest.rb b/app/models/harvest.rb index f74d36123..53a1516ad 100644 --- a/app/models/harvest.rb +++ b/app/models/harvest.rb @@ -105,24 +105,24 @@ class Harvest < ActiveRecord::Base string = '' if self.quantity string += "#{number_to_human(self.quantity.to_s, strip_insignificant_zeros: true)} " - if self.unit == 'individual' - string += 'individual ' - else - if self.quantity == 1 - string += "#{self.unit} of " - else - string += "#{self.unit.pluralize} of " - end - end + string += if self.unit == 'individual' + 'individual ' + else + string += if self.quantity == 1 + "#{self.unit} of " + else + "#{self.unit.pluralize} of " + end + end end - if self.unit != 'individual' # buckets of apricot*s* - string += "#{self.crop.name.pluralize}" - elsif self.quantity == 1 - string += "#{self.crop.name}" - else - string += "#{self.crop.name.pluralize}" - end + string += if self.unit != 'individual' # buckets of apricot*s* + "#{self.crop.name.pluralize}" + elsif self.quantity == 1 + "#{self.crop.name}" + else + "#{self.crop.name.pluralize}" + end if self.weight_quantity string += " weighing #{number_to_human(self.weight_quantity, strip_insignificant_zeros: true)}"\ diff --git a/app/models/member.rb b/app/models/member.rb index 0e0aab011..d4cbec196 100644 --- a/app/models/member.rb +++ b/app/models/member.rb @@ -161,19 +161,19 @@ class Member < ActiveRecord::Base # Total is needed for pagination. def flickr_photos(page_num=1, set=nil) result = false - if set - result = flickr.photosets.getPhotos( - photoset_id: set, - page: page_num, - per_page: 30 - ) - else - result = flickr.people.getPhotos( - user_id: 'me', - page: page_num, - per_page: 30 - ) - end + result = if set + flickr.photosets.getPhotos( + photoset_id: set, + page: page_num, + per_page: 30 + ) + else + flickr.people.getPhotos( + user_id: 'me', + page: page_num, + per_page: 30 + ) + end if result return [result.photo, result.total] else diff --git a/config/application.rb b/config/application.rb index 2dff668c1..e4afdd4ba 100644 --- a/config/application.rb +++ b/config/application.rb @@ -90,7 +90,7 @@ module Growstuff config.user_agent_email = "info@growstuff.org" Gibbon::API.api_key = ENV['GROWSTUFF_MAILCHIMP_APIKEY'] || 'notarealkey' - # API key can't be blank or tests fail + # API key can't be blank or tests fail Gibbon::API.timeout = 10 Gibbon::API.throws_exceptions = false config.newsletter_list_id = ENV['GROWSTUFF_MAILCHIMP_NEWSLETTER_ID'] diff --git a/config/routes.rb b/config/routes.rb index 4f0438a11..f0fbeb9fd 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -91,7 +91,7 @@ Growstuff::Application.routes.draw do # rubocop:disable Metrics/BlockLength get '/.well-known/acme-challenge/:id' => 'pages#letsencrypt' -# CMS stuff -- must remain LAST + # CMS stuff -- must remain LAST comfy_route :cms, path: '/', sitemap: false end diff --git a/spec/factories/comments.rb b/spec/factories/comments.rb index b1a88a7a6..eb9f43e9c 100644 --- a/spec/factories/comments.rb +++ b/spec/factories/comments.rb @@ -3,6 +3,6 @@ FactoryGirl.define do post author sequence(:body) { |n| "OMG LOL #{n}" } # because our commenters are more - # polite than YouTube's + # polite than YouTube's end end diff --git a/spec/features/footer_spec.rb b/spec/features/footer_spec.rb index 8a2c21bbd..8f500ec77 100644 --- a/spec/features/footer_spec.rb +++ b/spec/features/footer_spec.rb @@ -12,6 +12,6 @@ feature "footer", js: true do expect(page).to have_selector 'a[href="http://opendefinition.org/ossd/"]' end -# NB: not testing specific content in the footer since I'm going to put them -# in the CMS and they'll be variable. + # NB: not testing specific content in the footer since I'm going to put them + # in the CMS and they'll be variable. end diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index 8c7b0b9fe..c6b0b0601 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -42,8 +42,8 @@ RSpec.configure do |config| mocks.syntax = [:should, :expect] end -# The settings below are suggested to provide a good initial experience -# with RSpec, but feel free to customize to your heart's content. + # The settings below are suggested to provide a good initial experience + # with RSpec, but feel free to customize to your heart's content. # These two settings work together to allow you to limit a spec run # to individual examples or groups you care about by tagging them with diff --git a/spec/views/harvests/new.html.haml_spec.rb b/spec/views/harvests/new.html.haml_spec.rb index 0d372d6ee..d037f5c3c 100644 --- a/spec/views/harvests/new.html.haml_spec.rb +++ b/spec/views/harvests/new.html.haml_spec.rb @@ -27,7 +27,7 @@ describe "harvests/new" do assert_select "input#crop", class: "ui-autocomplete-input" assert_select "input#harvest_crop_id", name: "harvest[crop_id]" assert_select "select#harvest_plant_part_id", name: "harvest[plant_part_id]" -# some browsers interpret without a step as "integer" + # some browsers interpret without a step as "integer" assert_select "input#harvest_quantity[step=any]", name: "harvest[quantity]" assert_select "input#harvest_weight_quantity[step=any]", name: "harvest[quantity]" assert_select "select#harvest_unit", name: "harvest[unit]" diff --git a/spec/views/members/show.rss.haml_spec.rb b/spec/views/members/show.rss.haml_spec.rb index c54253bf9..c5033fd17 100644 --- a/spec/views/members/show.rss.haml_spec.rb +++ b/spec/views/members/show.rss.haml_spec.rb @@ -34,8 +34,8 @@ describe 'members/show.rss.haml', type: "view" do end it 'renders post bodies to HTML and XML-escapes them' do -# The variable "rendered" has been entity-replaced and tag-stripped -# The literal string output contains "<strong>" etc. + # The variable "rendered" has been entity-replaced and tag-stripped + # The literal string output contains "<strong>" etc. rendered.should have_content "strong" end diff --git a/spec/views/posts/new.html.haml_spec.rb b/spec/views/posts/new.html.haml_spec.rb index e4a23d704..efdd579b0 100644 --- a/spec/views/posts/new.html.haml_spec.rb +++ b/spec/views/posts/new.html.haml_spec.rb @@ -20,7 +20,7 @@ describe "posts/new" do before(:each) do @author = FactoryGirl.create(:member) assign(:post, FactoryGirl.create(:post, author: @author)) -# assign(:forum, Forum.new) + # assign(:forum, Forum.new) sign_in @author controller.stub(:current_user) { @author } end From 4cf0f85ee891b160efdf6cbdc1386f26c1c1dcea Mon Sep 17 00:00:00 2001 From: Brenda Wallace Date: Sat, 26 Nov 2016 11:46:31 +1300 Subject: [PATCH 164/268] Indent the first parameter one step more than the start of the previous line. --- .rubocop_todo.yml | 8 -------- db/seeds.rb | 8 ++++---- 2 files changed, 4 insertions(+), 12 deletions(-) diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml index f1a3c0a4f..8a8587b5c 100644 --- a/.rubocop_todo.yml +++ b/.rubocop_todo.yml @@ -1052,14 +1052,6 @@ Style/ExtraSpacing: - 'spec/views/gardens/show.html.haml_spec.rb' - 'spec/views/photos/new.html.haml_spec.rb' -# Offense count: 1 -# Cop supports --auto-correct. -# Configuration parameters: EnforcedStyle, SupportedStyles, IndentationWidth. -# SupportedStyles: consistent, special_for_inner_method_call, special_for_inner_method_call_in_parentheses -Style/FirstParameterIndentation: - Exclude: - - 'db/seeds.rb' - # Offense count: 1 # Configuration parameters: EnforcedStyle, SupportedStyles. # SupportedStyles: for, each diff --git a/db/seeds.rb b/db/seeds.rb index c718a544b..09a105c15 100644 --- a/db/seeds.rb +++ b/db/seeds.rb @@ -75,10 +75,10 @@ def load_test_users (1..member_size).each do |i| @user = Member.new( - login_name: "test#{i}", - email: "test#{i}@example.com", - password: "password#{i}", - tos_agreement: true + login_name: "test#{i}", + email: "test#{i}@example.com", + password: "password#{i}", + tos_agreement: true ) @user.skip_confirmation! @user.save! From bbc19a54363a7a24bad4de58563a697da0d17fdd Mon Sep 17 00:00:00 2001 From: Brenda Wallace Date: Sat, 26 Nov 2016 11:49:51 +1300 Subject: [PATCH 165/268] Array indentation fixed --- .rubocop_todo.yml | 7 ---- app/controllers/members_controller.rb | 8 ++-- app/controllers/places_controller.rb | 8 ++-- spec/rails_helper.rb | 6 +-- spec/views/comments/index.html.haml_spec.rb | 6 +-- spec/views/comments/index.rss.haml_spec.rb | 6 +-- spec/views/harvests/index.html.haml_spec.rb | 20 +++++----- spec/views/photos/index.html.haml_spec.rb | 6 +-- spec/views/plantings/index.html.haml_spec.rb | 38 +++++++++---------- spec/views/posts/index.html.haml_spec.rb | 6 +-- spec/views/roles/index.html.haml_spec.rb | 18 ++++----- .../scientific_names/index.html.haml_spec.rb | 6 +-- 12 files changed, 64 insertions(+), 71 deletions(-) diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml index 8a8587b5c..04a33c017 100644 --- a/.rubocop_todo.yml +++ b/.rubocop_todo.yml @@ -1122,13 +1122,6 @@ Style/IfUnlessModifier: - 'config/initializers/geocoder.rb' - 'lib/tasks/growstuff.rake' -# Offense count: 18 -# Cop supports --auto-correct. -# Configuration parameters: SupportedStyles, IndentationWidth. -# SupportedStyles: special_inside_parentheses, consistent, align_brackets -Style/IndentArray: - EnforcedStyle: consistent - # Offense count: 24 # Cop supports --auto-correct. # Configuration parameters: EnforcedStyle, SupportedStyles, IndentationWidth. diff --git a/app/controllers/members_controller.rb b/app/controllers/members_controller.rb index 4fecee7f1..d13a5e843 100644 --- a/app/controllers/members_controller.rb +++ b/app/controllers/members_controller.rb @@ -17,8 +17,8 @@ class MembersController < ApplicationController format.html # index.html.haml format.json { render json: @members.to_json(only: [ - :id, :login_name, :slug, :bio, :created_at, :location, :latitude, :longitude - ]) + :id, :login_name, :slug, :bio, :created_at, :location, :latitude, :longitude + ]) } end end @@ -38,8 +38,8 @@ class MembersController < ApplicationController format.html # show.html.haml format.json { render json: @member.to_json(only: [ - :id, :login_name, :bio, :created_at, :slug, :location, :latitude, :longitude - ]) + :id, :login_name, :bio, :created_at, :slug, :location, :latitude, :longitude + ]) } format.rss { render( layout: false, diff --git a/app/controllers/places_controller.rb b/app/controllers/places_controller.rb index 2f7331b3a..b91e093d5 100644 --- a/app/controllers/places_controller.rb +++ b/app/controllers/places_controller.rb @@ -7,8 +7,8 @@ class PlacesController < ApplicationController # json response is whatever we want to map here format.json do render json: Member.located.to_json(only: [ - :id, :login_name, :slug, :location, :latitude, :longitude - ]) + :id, :login_name, :slug, :location, :latitude, :longitude + ]) end end end @@ -22,8 +22,8 @@ class PlacesController < ApplicationController format.html # show.html.haml format.json do render json: @nearby_members.to_json(only: [ - :id, :login_name, :slug, :location, :latitude, :longitude - ]) + :id, :login_name, :slug, :location, :latitude, :longitude + ]) end end end diff --git a/spec/rails_helper.rb b/spec/rails_helper.rb index c9ab1e79e..5ec7f100a 100644 --- a/spec/rails_helper.rb +++ b/spec/rails_helper.rb @@ -5,9 +5,9 @@ require 'coveralls' # output coverage locally AND send it to coveralls SimpleCov.formatter = SimpleCov::Formatter::MultiFormatter.new([ - SimpleCov::Formatter::HTMLFormatter, - Coveralls::SimpleCov::Formatter -]) + SimpleCov::Formatter::HTMLFormatter, + Coveralls::SimpleCov::Formatter + ]) # fail if there's a significant test coverage drop SimpleCov.maximum_coverage_drop 1 diff --git a/spec/views/comments/index.html.haml_spec.rb b/spec/views/comments/index.html.haml_spec.rb index e0eb907cc..69d9a4d88 100644 --- a/spec/views/comments/index.html.haml_spec.rb +++ b/spec/views/comments/index.html.haml_spec.rb @@ -24,9 +24,9 @@ describe "comments/index" do total_entries = 2 comments = WillPaginate::Collection.create(page, per_page, total_entries) do |pager| pager.replace([ - FactoryGirl.create(:comment), - FactoryGirl.create(:comment, body: 'ROFL') - ]) + FactoryGirl.create(:comment), + FactoryGirl.create(:comment, body: 'ROFL') + ]) end assign(:comments, comments) render diff --git a/spec/views/comments/index.rss.haml_spec.rb b/spec/views/comments/index.rss.haml_spec.rb index f2fe2c4d9..f656ec90c 100644 --- a/spec/views/comments/index.rss.haml_spec.rb +++ b/spec/views/comments/index.rss.haml_spec.rb @@ -22,9 +22,9 @@ describe 'comments/index.rss.haml' do @author = FactoryGirl.create(:member) @post = FactoryGirl.create(:post) assign(:comments, [ - FactoryGirl.create(:comment, author: @author, post: @post), - FactoryGirl.create(:comment, author: @author, post: @post) - ]) + FactoryGirl.create(:comment, author: @author, post: @post), + FactoryGirl.create(:comment, author: @author, post: @post) + ]) render end diff --git a/spec/views/harvests/index.html.haml_spec.rb b/spec/views/harvests/index.html.haml_spec.rb index 0e86f9782..cacf6b551 100644 --- a/spec/views/harvests/index.html.haml_spec.rb +++ b/spec/views/harvests/index.html.haml_spec.rb @@ -28,16 +28,16 @@ describe "harvests/index" do total_entries = 2 harvests = WillPaginate::Collection.create(page, per_page, total_entries) do |pager| pager.replace([ - FactoryGirl.create(:harvest, - crop: @tomato, - owner: @member - ), - FactoryGirl.create(:harvest, - crop: @maize, - plant_part: @pp, - owner: @member - ) - ]) + FactoryGirl.create(:harvest, + crop: @tomato, + owner: @member + ), + FactoryGirl.create(:harvest, + crop: @maize, + plant_part: @pp, + owner: @member + ) + ]) end assign(:harvests, harvests) render diff --git a/spec/views/photos/index.html.haml_spec.rb b/spec/views/photos/index.html.haml_spec.rb index 7b7479c97..bf8624665 100644 --- a/spec/views/photos/index.html.haml_spec.rb +++ b/spec/views/photos/index.html.haml_spec.rb @@ -23,9 +23,9 @@ describe "photos/index" do total_entries = 2 photos = WillPaginate::Collection.create(page, per_page, total_entries) do |pager| pager.replace([ - FactoryGirl.create(:photo), - FactoryGirl.create(:photo) - ]) + FactoryGirl.create(:photo), + FactoryGirl.create(:photo) + ]) end assign(:photos, photos) end diff --git a/spec/views/plantings/index.html.haml_spec.rb b/spec/views/plantings/index.html.haml_spec.rb index 0b584562f..7abf2a087 100644 --- a/spec/views/plantings/index.html.haml_spec.rb +++ b/spec/views/plantings/index.html.haml_spec.rb @@ -28,25 +28,25 @@ describe "plantings/index" do total_entries = 3 plantings = WillPaginate::Collection.create(page, per_page, total_entries) do |pager| pager.replace([ - FactoryGirl.create(:planting, - garden: @garden, - crop: @tomato, - owner: @member - ), - FactoryGirl.create(:planting, - garden: @garden, - crop: @maize, - description: '', - planted_at: Time.local(2013, 1, 13) - ), - FactoryGirl.create(:planting, - garden: @garden, - crop: @tomato, - planted_at: Time.local(2013, 1, 13), - finished_at: Time.local(2013, 1, 20), - finished: true - ) - ]) + FactoryGirl.create(:planting, + garden: @garden, + crop: @tomato, + owner: @member + ), + FactoryGirl.create(:planting, + garden: @garden, + crop: @maize, + description: '', + planted_at: Time.local(2013, 1, 13) + ), + FactoryGirl.create(:planting, + garden: @garden, + crop: @tomato, + planted_at: Time.local(2013, 1, 13), + finished_at: Time.local(2013, 1, 20), + finished: true + ) + ]) end assign(:plantings, plantings) render diff --git a/spec/views/posts/index.html.haml_spec.rb b/spec/views/posts/index.html.haml_spec.rb index 3d0f094d6..da6948168 100644 --- a/spec/views/posts/index.html.haml_spec.rb +++ b/spec/views/posts/index.html.haml_spec.rb @@ -25,9 +25,9 @@ describe "posts/index" do total_entries = 2 posts = WillPaginate::Collection.create(page, per_page, total_entries) do |pager| pager.replace([ - FactoryGirl.create(:post, author: @author), - FactoryGirl.create(:post, author: @author) - ]) + FactoryGirl.create(:post, author: @author), + FactoryGirl.create(:post, author: @author) + ]) end assign(:posts, posts) render diff --git a/spec/views/roles/index.html.haml_spec.rb b/spec/views/roles/index.html.haml_spec.rb index be7fd4795..bb4fbdd9e 100644 --- a/spec/views/roles/index.html.haml_spec.rb +++ b/spec/views/roles/index.html.haml_spec.rb @@ -20,15 +20,15 @@ describe "roles/index" do before(:each) do controller.stub(:current_user) { nil } assign(:roles, [ - stub_model(Role, - name: "Name", - description: "MyText" - ), - stub_model(Role, - name: "Name", - description: "MyText" - ) - ]) + stub_model(Role, + name: "Name", + description: "MyText" + ), + stub_model(Role, + name: "Name", + description: "MyText" + ) + ]) end it "renders a list of roles" do diff --git a/spec/views/scientific_names/index.html.haml_spec.rb b/spec/views/scientific_names/index.html.haml_spec.rb index 64d5cb521..ceda2cb87 100644 --- a/spec/views/scientific_names/index.html.haml_spec.rb +++ b/spec/views/scientific_names/index.html.haml_spec.rb @@ -20,9 +20,9 @@ describe "scientific_names/index" do before(:each) do controller.stub(:current_user) { nil } assign(:scientific_names, [ - FactoryGirl.create(:zea_mays), - FactoryGirl.create(:solanum_lycopersicum) - ]) + FactoryGirl.create(:zea_mays), + FactoryGirl.create(:solanum_lycopersicum) + ]) end it "renders a list of scientific_names" do From 2e46cccd210f929880a8c3b876f6d3ad328a3290 Mon Sep 17 00:00:00 2001 From: Brenda Wallace Date: Sat, 26 Nov 2016 11:52:10 +1300 Subject: [PATCH 166/268] Hash alignment --- .rubocop_todo.yml | 17 ----- app/controllers/crops_controller.rb | 8 +-- app/helpers/application_helper.rb | 6 +- app/models/crop.rb | 66 ++++++++++---------- app/models/member.rb | 16 ++--- app/models/order.rb | 8 +-- config/environments/development.rb | 10 +-- config/environments/production.rb | 12 ++-- config/environments/staging.rb | 12 ++-- config/environments/test.rb | 26 ++++---- spec/lib/actions/oauth_signup_action_spec.rb | 36 +++++------ 11 files changed, 101 insertions(+), 116 deletions(-) diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml index 04a33c017..70b9b79ea 100644 --- a/.rubocop_todo.yml +++ b/.rubocop_todo.yml @@ -1122,23 +1122,6 @@ Style/IfUnlessModifier: - 'config/initializers/geocoder.rb' - 'lib/tasks/growstuff.rake' -# Offense count: 24 -# Cop supports --auto-correct. -# Configuration parameters: EnforcedStyle, SupportedStyles, IndentationWidth. -# SupportedStyles: special_inside_parentheses, consistent, align_braces -Style/IndentHash: - Exclude: - - 'app/controllers/crops_controller.rb' - - 'app/helpers/application_helper.rb' - - 'app/models/crop.rb' - - 'app/models/member.rb' - - 'app/models/order.rb' - - 'config/environments/development.rb' - - 'config/environments/production.rb' - - 'config/environments/staging.rb' - - 'config/environments/test.rb' - - 'spec/lib/actions/oauth_signup_action_spec.rb' - # Offense count: 7 # Cop supports --auto-correct. # Configuration parameters: EnforcedStyle, SupportedStyles. diff --git a/app/controllers/crops_controller.rb b/app/controllers/crops_controller.rb index a917c2c78..cc2eb26dc 100644 --- a/app/controllers/crops_controller.rb +++ b/app/controllers/crops_controller.rb @@ -90,10 +90,10 @@ class CropsController < ApplicationController } } render json: @crop.to_json(include: { - plantings: { - include: owner_structure - } - }) + plantings: { + include: owner_structure + } + }) end end end diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 4085ea31b..a1202b5f4 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -73,9 +73,9 @@ module ApplicationHelper end Gravatar.new(member.email).image_url({ - size: size, - default: :identicon - }) + size: size, + default: :identicon + }) end # Returns a string with the quantity and the right pluralization for a diff --git a/app/models/crop.rb b/app/models/crop.rb index 8cae6ea08..b08e11692 100644 --- a/app/models/crop.rb +++ b/app/models/crop.rb @@ -67,23 +67,23 @@ class Crop < ActiveRecord::Base # rubocop:disable Metrics/ClassLength index_name [Rails.env, "growstuff"].join('_') settings index: { number_of_shards: 1 }, analysis: { - tokenizer: { - gs_edgeNGram_tokenizer: { - type: "edgeNGram", # edgeNGram: NGram match from the start of a token - min_gram: 3, - max_gram: 10, - # token_chars: Elasticsearch will split on characters - # that don’t belong to any of these classes - token_chars: [ "letter", "digit" ] - } - }, - analyzer: { - gs_edgeNGram_analyzer: { - tokenizer: "gs_edgeNGram_tokenizer", - filter: ["lowercase"] - } - }, - } do + tokenizer: { + gs_edgeNGram_tokenizer: { + type: "edgeNGram", # edgeNGram: NGram match from the start of a token + min_gram: 3, + max_gram: 10, + # token_chars: Elasticsearch will split on characters + # that don’t belong to any of these classes + token_chars: [ "letter", "digit" ] + } + }, + analyzer: { + gs_edgeNGram_analyzer: { + tokenizer: "gs_edgeNGram_tokenizer", + filter: ["lowercase"] + } + }, + } do mappings dynamic: 'false' do indexes :id, type: 'long' indexes :name, type: 'string', analyzer: 'gs_edgeNGram_analyzer' @@ -109,7 +109,7 @@ class Crop < ActiveRecord::Base # rubocop:disable Metrics/ClassLength include: { scientific_names: { only: :scientific_name }, alternate_names: { only: :name } - }) + }) end # update the Elasticsearch index (only if we're using it in this @@ -327,20 +327,22 @@ class Crop < ActiveRecord::Base # rubocop:disable Metrics/ClassLength if ENV['GROWSTUFF_ELASTICSEARCH'] == "true" search_str = query.nil? ? "" : query.downcase response = __elasticsearch__.search( { - # Finds documents which match any field, but uses the _score from - # the best field insead of adding up _score from each field. - query: { - multi_match: { - query: "#{search_str}", - analyzer: "standard", - fields: ["name", "scientific_names.scientific_name", "alternate_names.name"] - } - }, - filter: { - term: {approval_status: "approved"} - }, - size: 50 - } + # Finds documents which match any field, but uses the _score from + # the best field insead of adding up _score from each field. + query: { + multi_match: { + query: "#{search_str}", + analyzer: "standard", + fields: ["name", + "scientific_names.scientific_name", + "alternate_names.name"] + } + }, + filter: { + term: {approval_status: "approved"} + }, + size: 50 + } ) return response.records.to_a else diff --git a/app/models/member.rb b/app/models/member.rb index d4cbec196..65c534d51 100644 --- a/app/models/member.rb +++ b/app/models/member.rb @@ -239,20 +239,20 @@ class Member < ActiveRecord::Base return true if (Rails.env.test? && !testing) gb = Gibbon::API.new res = gb.lists.subscribe({ - id: Growstuff::Application.config.newsletter_list_id, - email: { email: email }, - merge_vars: { login_name: login_name }, - double_optin: false # they already confirmed their email with us - }) + id: Growstuff::Application.config.newsletter_list_id, + email: { email: email }, + merge_vars: { login_name: login_name }, + double_optin: false # they already confirmed their email with us + }) end def newsletter_unsubscribe(testing=false) return true if (Rails.env.test? && !testing) gb = Gibbon::API.new res = gb.lists.unsubscribe({ - id: Growstuff::Application.config.newsletter_list_id, - email: { email: email } - }) + id: Growstuff::Application.config.newsletter_list_id, + email: { email: email } + }) end def already_following?(member) diff --git a/app/models/order.rb b/app/models/order.rb index b5e1ee1ad..6213485ef 100644 --- a/app/models/order.rb +++ b/app/models/order.rb @@ -27,10 +27,10 @@ class Order < ActiveRecord::Base items = [] order_items.each do |i| items.push({ - name: i.product.name, - quantity: i.quantity, - amount: i.price - }) + name: i.product.name, + quantity: i.quantity, + amount: i.price + }) end return items end diff --git a/config/environments/development.rb b/config/environments/development.rb index 344fddc63..2ed9b8f0a 100644 --- a/config/environments/development.rb +++ b/config/environments/development.rb @@ -48,11 +48,11 @@ Growstuff::Application.configure do config.action_mailer.delivery_method = :letter_opener config.action_mailer.smtp_settings = { - port: '587', - address: 'smtp.mandrillapp.com', - user_name: ENV['GROWSTUFF_MANDRILL_USERNAME'], - password: ENV['GROWSTUFF_MANDRILL_APIKEY'], - authentication: :login + port: '587', + address: 'smtp.mandrillapp.com', + user_name: ENV['GROWSTUFF_MANDRILL_USERNAME'], + password: ENV['GROWSTUFF_MANDRILL_APIKEY'], + authentication: :login } config.host = 'localhost:8080' diff --git a/config/environments/production.rb b/config/environments/production.rb index 923ff4e7c..c931c058e 100644 --- a/config/environments/production.rb +++ b/config/environments/production.rb @@ -70,12 +70,12 @@ Growstuff::Application.configure do config.action_mailer.default_url_options = { host: 'growstuff.org' } ActionMailer::Base.smtp_settings = { - port: ENV['SPARKPOST_SMTP_PORT'], - address: ENV['SPARKPOST_SMTP_HOST'], - user_name: ENV['SPARKPOST_SMTP_USERNAME'], - password: ENV['SPARKPOST_SMTP_PASSWORD'], - authentication: :login, - enable_starttls_auto: true + port: ENV['SPARKPOST_SMTP_PORT'], + address: ENV['SPARKPOST_SMTP_HOST'], + user_name: ENV['SPARKPOST_SMTP_USERNAME'], + password: ENV['SPARKPOST_SMTP_PASSWORD'], + authentication: :login, + enable_starttls_auto: true } ActionMailer::Base.delivery_method = :smtp diff --git a/config/environments/staging.rb b/config/environments/staging.rb index 467b626d1..a9e242381 100644 --- a/config/environments/staging.rb +++ b/config/environments/staging.rb @@ -72,12 +72,12 @@ Growstuff::Application.configure do config.action_mailer.default_url_options = { host: 'staging.growstuff.org' } ActionMailer::Base.smtp_settings = { - port: ENV['SPARKPOST_SMTP_PORT'], - address: ENV['SPARKPOST_SMTP_HOST'], - user_name: ENV['SPARKPOST_SMTP_USERNAME'], - password: ENV['SPARKPOST_SMTP_PASSWORD'], - authentication: :login, - enable_starttls_auto: true + port: ENV['SPARKPOST_SMTP_PORT'], + address: ENV['SPARKPOST_SMTP_HOST'], + user_name: ENV['SPARKPOST_SMTP_USERNAME'], + password: ENV['SPARKPOST_SMTP_PASSWORD'], + authentication: :login, + enable_starttls_auto: true } ActionMailer::Base.delivery_method = :smtp diff --git a/config/environments/test.rb b/config/environments/test.rb index f59962926..0d08d1da5 100644 --- a/config/environments/test.rb +++ b/config/environments/test.rb @@ -110,16 +110,16 @@ 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" - } -}) + 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" + } + }) diff --git a/spec/lib/actions/oauth_signup_action_spec.rb b/spec/lib/actions/oauth_signup_action_spec.rb index da654e8e6..57dd28af4 100644 --- a/spec/lib/actions/oauth_signup_action_spec.rb +++ b/spec/lib/actions/oauth_signup_action_spec.rb @@ -9,19 +9,19 @@ describe 'Growstuff::OauthSignupAction' do context 'with a valid authentication' do before :each do @auth = OmniAuth::AuthHash.new({ - 'provider' => 'facebook', - 'uid' => '123545', - 'info' => { - 'name' => "John Testerson's Brother", - 'nickname' => 'JohnnyB', - 'email' => 'example.oauth.facebook@example.com', - 'image' => 'http://findicons.com/files/icons/1072/face_avatars/300/i04.png' - }, - 'credentials' => { - 'token' => "token", - 'secret' => "donttell" - } - }) + 'provider' => 'facebook', + 'uid' => '123545', + 'info' => { + 'name' => "John Testerson's Brother", + 'nickname' => 'JohnnyB', + 'email' => 'example.oauth.facebook@example.com', + 'image' => 'http://findicons.com/files/icons/1072/face_avatars/300/i04.png' + }, + 'credentials' => { + 'token' => "token", + 'secret' => "donttell" + } + }) end context 'no existing user' do @@ -129,11 +129,11 @@ describe 'Growstuff::OauthSignupAction' do } @existing_authentication = @existing_member.authentications.create({ - provider: 'facebook', - uid: '123545', - name: "John Testerson's Brother", - member_id: @existing_member.id - }) + provider: 'facebook', + uid: '123545', + name: "John Testerson's Brother", + member_id: @existing_member.id + }) @member = @action.find_or_create_from_authorization(@auth) @authentication = @action.establish_authentication(@auth, @member) From e62adc297a3c68d45770625dcea280ec1446ba55 Mon Sep 17 00:00:00 2001 From: Brenda Wallace Date: Sat, 26 Nov 2016 11:55:54 +1300 Subject: [PATCH 167/268] Aligning `end` on branches --- .rubocop_todo.yml | 11 ----------- app/controllers/registrations_controller.rb | 6 +++--- app/controllers/robots_controller.rb | 6 +----- db/migrate/20150201052245_create_cms.rb | 2 +- 4 files changed, 5 insertions(+), 20 deletions(-) diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml index 70b9b79ea..cc7501fce 100644 --- a/.rubocop_todo.yml +++ b/.rubocop_todo.yml @@ -48,17 +48,6 @@ Lint/DeprecatedClassMethods: - 'app/controllers/robots_controller.rb' - 'config/boot.rb' -# Offense count: 4 -# Cop supports --auto-correct. -# Configuration parameters: AlignWith, SupportedStyles, AutoCorrect. -# SupportedStyles: keyword, variable, start_of_line -Lint/EndAlignment: - Exclude: - - 'app/controllers/registrations_controller.rb' - - 'app/controllers/robots_controller.rb' - - 'app/helpers/seeds_helper.rb' - - 'db/migrate/20150201052245_create_cms.rb' - # Offense count: 1 Lint/HandleExceptions: Exclude: diff --git a/app/controllers/registrations_controller.rb b/app/controllers/registrations_controller.rb index ff00e4bdd..b29e8c849 100644 --- a/app/controllers/registrations_controller.rb +++ b/app/controllers/registrations_controller.rb @@ -18,13 +18,13 @@ class RegistrationsController < Devise::RegistrationsController @member = Member.find(current_member.id) - successfully_updated = if needs_password?(@member, params) - @member.update_with_password(devise_parameter_sanitizer.sanitize(:account_update)) + if needs_password?(@member, params) + successfully_updated = @member.update_with_password(devise_parameter_sanitizer.sanitize(:account_update)) else # remove the virtual current_password attribute # update_without_password doesn't know how to ignore it params[:member].delete(:current_password) - @member.update_without_password(devise_parameter_sanitizer.sanitize(:account_update)) + successfully_updated = @member.update_without_password(devise_parameter_sanitizer.sanitize(:account_update)) end if successfully_updated diff --git a/app/controllers/robots_controller.rb b/app/controllers/robots_controller.rb index e6d291631..b9381b2da 100644 --- a/app/controllers/robots_controller.rb +++ b/app/controllers/robots_controller.rb @@ -3,12 +3,8 @@ class RobotsController < ApplicationController DEFAULT_FILENAME = 'config/robots.txt'.freeze def robots - filename = if subdomain && subdomain != 'www' - "config/robots.#{ subdomain }.txt" - end - + filename = "config/robots.#{ subdomain }.txt" if subdomain && subdomain != 'www' file_to_render = File.exists?(filename.to_s) ? filename : DEFAULT_FILENAME - render file: file_to_render, layout: false, content_type: 'text/plain' end diff --git a/db/migrate/20150201052245_create_cms.rb b/db/migrate/20150201052245_create_cms.rb index b5150d895..a464e5b06 100644 --- a/db/migrate/20150201052245_create_cms.rb +++ b/db/migrate/20150201052245_create_cms.rb @@ -5,7 +5,7 @@ class CreateCms < ActiveRecord::Migration { } else { limit: 16777215 } - end + end # -- Sites -------------------------------------------------------------- create_table :comfy_cms_sites do |t| From 19727144d852d94a576e40f09554137a6e9d4dcc Mon Sep 17 00:00:00 2001 From: Brenda Wallace Date: Sat, 26 Nov 2016 11:57:02 +1300 Subject: [PATCH 168/268] Else statement alignment --- .rubocop_todo.yml | 7 ------- 1 file changed, 7 deletions(-) diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml index cc7501fce..c70e81ddf 100644 --- a/.rubocop_todo.yml +++ b/.rubocop_todo.yml @@ -613,13 +613,6 @@ Style/EachForSimpleLoop: - 'spec/models/crop_spec.rb' - 'spec/views/home/_crops.html.haml_spec.rb' -# Offense count: 2 -# Cop supports --auto-correct. -Style/ElseAlignment: - Exclude: - - 'app/controllers/registrations_controller.rb' - - 'app/helpers/seeds_helper.rb' - # Offense count: 1 # Cop supports --auto-correct. # Configuration parameters: EnforcedStyle, SupportedStyles. From b17e4eed7d8037214b0056592d2f315fda6fd730 Mon Sep 17 00:00:00 2001 From: Brenda Wallace Date: Sat, 26 Nov 2016 12:02:47 +1300 Subject: [PATCH 169/268] Block indentation fixups --- .rubocop_todo.yml | 9 --------- spec/features/signin_spec.rb | 30 +++++++++++++++--------------- spec/models/seed_spec.rb | 12 ++++++------ 3 files changed, 21 insertions(+), 30 deletions(-) diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml index c70e81ddf..a4706401c 100644 --- a/.rubocop_todo.yml +++ b/.rubocop_todo.yml @@ -32,15 +32,6 @@ Lint/AssignmentInCondition: Exclude: - 'app/models/member.rb' -# Offense count: 5 -# Cop supports --auto-correct. -# Configuration parameters: AlignWith, SupportedStyles. -# SupportedStyles: either, start_of_block, start_of_line -Lint/BlockAlignment: - Exclude: - - 'spec/features/signin_spec.rb' - - 'spec/models/seed_spec.rb' - # Offense count: 2 # Cop supports --auto-correct. Lint/DeprecatedClassMethods: diff --git a/spec/features/signin_spec.rb b/spec/features/signin_spec.rb index 9014740e2..b9cc183ec 100644 --- a/spec/features/signin_spec.rb +++ b/spec/features/signin_spec.rb @@ -64,25 +64,25 @@ feature "signin", js: true do context "with facebook" do scenario "sign in" do - # Ordinarily done by database_cleaner - Member.where(login_name: 'tdawg').delete_all + # Ordinarily done by database_cleaner + Member.where(login_name: 'tdawg').delete_all - member = create :member, login_name: 'tdawg', email: 'example.oauth.facebook@example.com' + member = create :member, login_name: 'tdawg', email: 'example.oauth.facebook@example.com' - # Start the test - visit root_path - first('.signup a').click + # Start the test + visit root_path + first('.signup a').click - # Click the signup with facebook link + # 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 + 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(current_path).to eq root_path - expect(page.text).to include("Welcome to #{ENV['GROWSTUFF_SITE_NAME']}, tdawg") - end + # Signed up and logged in + expect(current_path).to eq root_path + expect(page.text).to include("Welcome to #{ENV['GROWSTUFF_SITE_NAME']}, tdawg") + end end end diff --git a/spec/models/seed_spec.rb b/spec/models/seed_spec.rb index 6a855543e..eb0dcadb9 100644 --- a/spec/models/seed_spec.rb +++ b/spec/models/seed_spec.rb @@ -93,9 +93,9 @@ describe Seed do it 'all valid organic values should work' do ['certified organic', 'non-certified organic', 'conventional/non-organic', 'unknown'].each do |t| - @seed = FactoryGirl.build(:seed, organic: t) - @seed.should be_valid - end + @seed = FactoryGirl.build(:seed, organic: t) + @seed.should be_valid + end end it 'all valid GMO values should work' do @@ -108,9 +108,9 @@ describe Seed do it 'all valid heirloom values should work' do %w(heirloom hybrid unknown).each do |t| - @seed = FactoryGirl.build(:seed, heirloom: t) - @seed.should be_valid - end + @seed = FactoryGirl.build(:seed, heirloom: t) + @seed.should be_valid + end end it 'should refuse invalid organic/GMO/heirloom values' do From 62e7c716ddb9c245b70839add73979e7266c95e3 Mon Sep 17 00:00:00 2001 From: Brenda Wallace Date: Sat, 26 Nov 2016 12:06:02 +1300 Subject: [PATCH 170/268] Removed extra empty blank lines --- .rubocop_todo.yml | 390 ------------------ app/controllers/accounts_controller.rb | 1 - app/controllers/admin/orders_controller.rb | 1 - app/controllers/application_controller.rb | 1 - app/controllers/crops_controller.rb | 2 - app/controllers/follows_controller.rb | 1 - app/controllers/gardens_controller.rb | 1 - app/controllers/home_controller.rb | 2 - .../omniauth_callbacks_controller.rb | 1 + app/controllers/orders_controller.rb | 2 - app/controllers/passwords_controller.rb | 2 +- app/controllers/places_controller.rb | 1 - app/controllers/registrations_controller.rb | 2 - app/controllers/robots_controller.rb | 1 - app/helpers/application_helper.rb | 1 - app/helpers/auto_suggest_helper.rb | 2 - app/helpers/gardens_helper.rb | 1 - app/helpers/harvests_helper.rb | 2 - app/helpers/plantings_helper.rb | 2 - app/mailers/notifier.rb | 1 - app/models/account.rb | 1 - app/models/comment.rb | 1 - app/models/crop.rb | 2 - app/models/follow.rb | 2 - app/models/forum.rb | 1 - app/models/garden.rb | 1 - app/models/harvest.rb | 1 - app/models/member.rb | 1 - app/models/notification.rb | 1 - app/models/order.rb | 1 - app/models/photo.rb | 2 - app/models/plant_part.rb | 1 - app/models/post.rb | 2 +- app/models/product.rb | 1 - app/models/seed.rb | 1 - config.rb | 1 - config/application.rb | 1 - config/environments/test.rb | 1 - .../initializers/comfortable_mexican_sofa.rb | 1 - config/routes.rb | 3 - config/unicorn.rb | 2 - .../20120903092956_devise_create_users.rb | 1 - ...002942_rename_account_detail_to_account.rb | 1 - ...011725_change_flickr_photo_id_to_string.rb | 1 + db/seeds.rb | 1 - lib/actions/oauth_signup_action.rb | 1 - lib/geocodable.rb | 1 - lib/haml/filters/escaped_markdown.rb | 1 - lib/haml/filters/growstuff_markdown.rb | 3 - lib/tasks/growstuff.rake | 12 - .../account_types_controller_spec.rb | 6 - spec/controllers/accounts_controller_spec.rb | 6 - .../admin/orders_controller_spec.rb | 7 - spec/controllers/admin_controller_spec.rb | 5 - .../authentications_controller_spec.rb | 6 - spec/controllers/comments_controller_spec.rb | 6 - spec/controllers/crops_controller_spec.rb | 6 - spec/controllers/forums_controller_spec.rb | 6 - spec/controllers/gardens_controller_spec.rb | 6 - spec/controllers/harvests_controller_spec.rb | 6 - spec/controllers/home_controller_spec.rb | 5 - spec/controllers/member_controller_spec.rb | 8 - .../notifications_controller_spec.rb | 6 - .../order_items_controller_spec.rb | 6 - spec/controllers/orders_controller_spec.rb | 6 - spec/controllers/places_controller_spec.rb | 5 - .../plant_parts_controller_spec.rb | 5 - spec/controllers/plantings_controller_spec.rb | 8 - spec/controllers/posts_controller_spec.rb | 6 - spec/controllers/products_controller_spec.rb | 6 - .../registrations_controller_spec.rb | 6 - spec/controllers/roles_controller_spec.rb | 6 - .../scientific_names_controller_spec.rb | 6 - spec/controllers/seeds_controller_spec.rb | 4 - spec/controllers/shop_controller_spec.rb | 7 - spec/factories/account_types.rb | 1 - spec/factories/crop.rb | 3 - spec/factories/follows.rb | 1 - spec/factories/garden.rb | 1 - spec/factories/member.rb | 2 - spec/factories/post.rb | 2 - spec/factories/scientific_name.rb | 1 - spec/features/crops/browse_crops_spec.rb | 1 - spec/features/crops/crop_detail_page_spec.rb | 5 - spec/features/crops/crop_wranglers_spec.rb | 2 - spec/features/footer_spec.rb | 1 - spec/features/gardens_spec.rb | 1 - .../features/harvests/browse_harvests_spec.rb | 1 - spec/features/locale_spec.rb | 1 - spec/features/member_profile_spec.rb | 4 - spec/features/signin_spec.rb | 1 - spec/features/signout_spec.rb | 1 - spec/features/signup_spec.rb | 1 - spec/helpers/harvests_helper_spec.rb | 2 - spec/helpers/notifications_helper_spec.rb | 3 - spec/helpers/plantings_helper_spec.rb | 3 - .../lib/haml/filters/escaped_markdown_spec.rb | 1 - .../haml/filters/growstuff_markdown_spec.rb | 3 - spec/mailers/notifier_spec.rb | 6 - spec/models/ability_spec.rb | 20 - spec/models/account_spec.rb | 2 - spec/models/alternate_name_spec.rb | 1 - spec/models/authentication_spec.rb | 1 - spec/models/comment_spec.rb | 4 - spec/models/crop_spec.rb | 16 - spec/models/follow_spec.rb | 3 - spec/models/forum_spec.rb | 2 - spec/models/garden_spec.rb | 6 - spec/models/harvest_spec.rb | 5 - spec/models/member_spec.rb | 12 - spec/models/notification_spec.rb | 2 - spec/models/order_item_spec.rb | 2 - spec/models/order_spec.rb | 3 - spec/models/photo_spec.rb | 3 - spec/models/plant_part_spec.rb | 1 - spec/models/planting_spec.rb | 4 - spec/models/post_spec.rb | 2 - spec/models/product_spec.rb | 2 - spec/models/scientific_name_spec.rb | 1 - spec/models/seed_spec.rb | 5 - spec/routing/account_types_routing_spec.rb | 2 - spec/routing/authentications_routing_spec.rb | 1 - spec/routing/comments_routing_spec.rb | 2 - spec/routing/crops_routing_spec.rb | 2 - spec/routing/follows_routing_spec.rb | 2 - spec/routing/forums_routing_spec.rb | 2 - spec/routing/gardens_routing_spec.rb | 2 - spec/routing/harvests_routing_spec.rb | 2 - spec/routing/notifications_routing_spec.rb | 2 - spec/routing/order_items_routing_spec.rb | 2 - spec/routing/orders_routing_spec.rb | 2 - spec/routing/photos_routing_spec.rb | 2 - spec/routing/plant_parts_routing_spec.rb | 2 - spec/routing/plantings_routing_spec.rb | 2 - spec/routing/products_routing_spec.rb | 2 - spec/routing/roles_routing_spec.rb | 2 - spec/routing/scientific_names_routing_spec.rb | 2 - spec/routing/seeds_routing_spec.rb | 2 - spec/routing/updates_routing_spec.rb | 2 - spec/spec_helper.rb | 1 - spec/support/database_cleaner.rb | 2 - spec/support/feature_helpers.rb | 2 - .../account_types/edit.html.haml_spec.rb | 4 - .../account_types/index.html.haml_spec.rb | 4 - .../views/account_types/new.html.haml_spec.rb | 4 - .../account_types/show.html.haml_spec.rb | 4 - spec/views/accounts/edit.html.haml_spec.rb | 4 - spec/views/accounts/index.html.haml_spec.rb | 4 - spec/views/accounts/new.html.haml_spec.rb | 4 - spec/views/accounts/show.html.haml_spec.rb | 4 - spec/views/admin/index_spec.rb | 4 - spec/views/admin/newsletter_spec.rb | 4 - spec/views/admin/orders/index_spec.rb | 4 - spec/views/comments/edit.html.haml_spec.rb | 4 - spec/views/comments/index.html.haml_spec.rb | 4 - spec/views/comments/index.rss.haml_spec.rb | 5 - spec/views/comments/new.html.haml_spec.rb | 5 - spec/views/comments/show.html.haml_spec.rb | 4 - spec/views/crops/_grown_for.html.haml_spec.rb | 4 - .../crops/_planting_advice.html.haml_spec.rb | 7 - spec/views/crops/_popover.html.haml_spec.rb | 5 - spec/views/crops/edit.html.haml_spec.rb | 5 - spec/views/crops/hierarchy.html.haml_spec.rb | 4 - spec/views/crops/index.html.haml_spec.rb | 4 - spec/views/crops/index.rss.haml_spec.rb | 5 - spec/views/crops/new.html.haml_spec.rb | 5 - spec/views/crops/wrangle.html.haml_spec.rb | 5 - spec/views/devise/confirmations/new_spec.rb | 1 - .../mailer/confirmation_instructions_spec.rb | 5 - .../reset_password_instructions_spec.rb | 5 - .../devise/mailer/unlock_instructions_spec.rb | 4 - spec/views/devise/registrations/edit_spec.rb | 9 - spec/views/devise/registrations/new_spec.rb | 5 - spec/views/devise/sessions/new_spec.rb | 5 - spec/views/devise/shared/_links_spec.rb | 1 - spec/views/devise/unlocks/new_spec.rb | 5 - spec/views/forums/edit.html.haml_spec.rb | 4 - spec/views/forums/index.html.haml_spec.rb | 5 - spec/views/forums/new.html.haml_spec.rb | 4 - spec/views/forums/show.html.haml_spec.rb | 4 - spec/views/gardens/edit.html.haml_spec.rb | 6 - spec/views/gardens/new.html.haml_spec.rb | 4 - spec/views/gardens/show.html.haml_spec.rb | 6 - spec/views/harvests/edit.html.haml_spec.rb | 4 - spec/views/harvests/index.html.haml_spec.rb | 5 - spec/views/harvests/new.html.haml_spec.rb | 4 - spec/views/harvests/show.html.haml_spec.rb | 5 - spec/views/home/_blurb.html.haml_spec.rb | 5 - spec/views/home/_crops.html.haml_spec.rb | 4 - spec/views/home/_members.html.haml_spec.rb | 5 - spec/views/home/_seeds.html.haml_spec.rb | 4 - spec/views/home/_stats.html.haml_spec.rb | 4 - spec/views/home/index_spec.rb | 5 - spec/views/layouts/_header_spec.rb | 7 - spec/views/layouts/_meta_spec.rb | 5 - spec/views/layouts/application_spec.rb | 5 - .../views/members/_location.html.haml_spec.rb | 6 - spec/views/members/index.html.haml_spec.rb | 5 - spec/views/members/show.rss.haml_spec.rb | 5 - .../notifications/index.html.haml_spec.rb | 6 - .../views/notifications/new.html.haml_spec.rb | 5 - .../notifications/show.html.haml_spec.rb | 5 - spec/views/notifier/notify.html.haml_spec.rb | 5 - spec/views/orders/index.html.haml_spec.rb | 4 - spec/views/orders/show.html.haml_spec.rb | 7 - spec/views/photos/edit.html.haml_spec.rb | 5 - spec/views/photos/index.html.haml_spec.rb | 4 - spec/views/photos/new.html.haml_spec.rb | 5 - spec/views/photos/show.html.haml_spec.rb | 6 - .../places/_map_attribution.html.haml_spec.rb | 4 - spec/views/places/index.html.haml_spec.rb | 4 - spec/views/places/show.html.haml_spec.rb | 5 - spec/views/plant_parts/edit.html.haml_spec.rb | 4 - .../views/plant_parts/index.html.haml_spec.rb | 5 - spec/views/plant_parts/new.html.haml_spec.rb | 4 - spec/views/plant_parts/show.html.haml_spec.rb | 4 - spec/views/plantings/_form.html.haml_spec.rb | 5 - spec/views/plantings/edit.html.haml_spec.rb | 6 - spec/views/plantings/index.html.haml_spec.rb | 4 - spec/views/plantings/index.rss.haml_spec.rb | 4 - spec/views/plantings/new.html.haml_spec.rb | 5 - spec/views/plantings/show.html.haml_spec.rb | 4 - spec/views/posts/_single.html.haml_spec.rb | 7 - spec/views/posts/edit.html.haml_spec.rb | 5 - spec/views/posts/index.html.haml_spec.rb | 4 - spec/views/posts/index.rss.haml_spec.rb | 5 - spec/views/posts/new.html.haml_spec.rb | 5 - spec/views/posts/show.html.haml_spec.rb | 6 - spec/views/posts/show.rss.haml_spec.rb | 5 - spec/views/products/edit.html.haml_spec.rb | 4 - spec/views/products/index.html.haml_spec.rb | 4 - spec/views/products/new.html.haml_spec.rb | 4 - spec/views/products/show.html.haml_spec.rb | 4 - spec/views/roles/edit.html.haml_spec.rb | 4 - spec/views/roles/index.html.haml_spec.rb | 4 - spec/views/roles/new.html.haml_spec.rb | 4 - spec/views/roles/show.html.haml_spec.rb | 4 - .../scientific_names/edit.html.haml_spec.rb | 5 - .../scientific_names/index.html.haml_spec.rb | 4 - .../scientific_names/new.html.haml_spec.rb | 6 - .../scientific_names/show.html.haml_spec.rb | 5 - spec/views/seeds/edit.html.haml_spec.rb | 4 - spec/views/seeds/index.rss.haml_spec.rb | 5 - spec/views/seeds/new.html.haml_spec.rb | 5 - spec/views/seeds/show.html.haml_spec.rb | 5 - spec/views/shop/index_spec.rb | 6 - 246 files changed, 4 insertions(+), 1285 deletions(-) diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml index a4706401c..24a74057f 100644 --- a/.rubocop_todo.yml +++ b/.rubocop_todo.yml @@ -604,396 +604,6 @@ Style/EachForSimpleLoop: - 'spec/models/crop_spec.rb' - 'spec/views/home/_crops.html.haml_spec.rb' -# Offense count: 1 -# Cop supports --auto-correct. -# Configuration parameters: EnforcedStyle, SupportedStyles. -# SupportedStyles: empty, nil, both -Style/EmptyElse: - Exclude: - -# Offense count: 2 -# Cop supports --auto-correct. -# Configuration parameters: AllowAdjacentOneLineDefs. -Style/EmptyLineBetweenDefs: - Exclude: - - 'app/controllers/omniauth_callbacks_controller.rb' - - 'db/migrate/20130601011725_change_flickr_photo_id_to_string.rb' - -# Offense count: 536 -# Cop supports --auto-correct. -Style/EmptyLines: - Exclude: - - 'app/controllers/gardens_controller.rb' - - 'app/models/follow.rb' - - 'app/models/member.rb' - - 'app/models/post.rb' - - 'config.rb' - - 'config/application.rb' - - 'config/routes.rb' - - 'db/migrate/20120903092956_devise_create_users.rb' - - 'db/seeds.rb' - - 'lib/tasks/growstuff.rake' - - 'spec/controllers/account_types_controller_spec.rb' - - 'spec/controllers/accounts_controller_spec.rb' - - 'spec/controllers/admin/orders_controller_spec.rb' - - 'spec/controllers/admin_controller_spec.rb' - - 'spec/controllers/authentications_controller_spec.rb' - - 'spec/controllers/comments_controller_spec.rb' - - 'spec/controllers/crops_controller_spec.rb' - - 'spec/controllers/forums_controller_spec.rb' - - 'spec/controllers/gardens_controller_spec.rb' - - 'spec/controllers/harvests_controller_spec.rb' - - 'spec/controllers/home_controller_spec.rb' - - 'spec/controllers/member_controller_spec.rb' - - 'spec/controllers/notifications_controller_spec.rb' - - 'spec/controllers/order_items_controller_spec.rb' - - 'spec/controllers/orders_controller_spec.rb' - - 'spec/controllers/places_controller_spec.rb' - - 'spec/controllers/plant_parts_controller_spec.rb' - - 'spec/controllers/plantings_controller_spec.rb' - - 'spec/controllers/posts_controller_spec.rb' - - 'spec/controllers/products_controller_spec.rb' - - 'spec/controllers/registrations_controller_spec.rb' - - 'spec/controllers/roles_controller_spec.rb' - - 'spec/controllers/scientific_names_controller_spec.rb' - - 'spec/controllers/seeds_controller_spec.rb' - - 'spec/controllers/shop_controller_spec.rb' - - 'spec/features/crops/crop_wranglers_spec.rb' - - 'spec/features/signin_spec.rb' - - 'spec/helpers/notifications_helper_spec.rb' - - 'spec/lib/haml/filters/growstuff_markdown_spec.rb' - - 'spec/mailers/notifier_spec.rb' - - 'spec/models/ability_spec.rb' - - 'spec/models/crop_spec.rb' - - 'spec/models/harvest_spec.rb' - - 'spec/models/seed_spec.rb' - - 'spec/views/account_types/edit.html.haml_spec.rb' - - 'spec/views/account_types/index.html.haml_spec.rb' - - 'spec/views/account_types/new.html.haml_spec.rb' - - 'spec/views/account_types/show.html.haml_spec.rb' - - 'spec/views/accounts/edit.html.haml_spec.rb' - - 'spec/views/accounts/index.html.haml_spec.rb' - - 'spec/views/accounts/new.html.haml_spec.rb' - - 'spec/views/accounts/show.html.haml_spec.rb' - - 'spec/views/admin/index_spec.rb' - - 'spec/views/admin/newsletter_spec.rb' - - 'spec/views/admin/orders/index_spec.rb' - - 'spec/views/comments/edit.html.haml_spec.rb' - - 'spec/views/comments/index.html.haml_spec.rb' - - 'spec/views/comments/index.rss.haml_spec.rb' - - 'spec/views/comments/new.html.haml_spec.rb' - - 'spec/views/comments/show.html.haml_spec.rb' - - 'spec/views/crops/_grown_for.html.haml_spec.rb' - - 'spec/views/crops/_planting_advice.html.haml_spec.rb' - - 'spec/views/crops/_popover.html.haml_spec.rb' - - 'spec/views/crops/edit.html.haml_spec.rb' - - 'spec/views/crops/hierarchy.html.haml_spec.rb' - - 'spec/views/crops/index.html.haml_spec.rb' - - 'spec/views/crops/index.rss.haml_spec.rb' - - 'spec/views/crops/new.html.haml_spec.rb' - - 'spec/views/crops/wrangle.html.haml_spec.rb' - - 'spec/views/devise/mailer/confirmation_instructions_spec.rb' - - 'spec/views/devise/mailer/reset_password_instructions_spec.rb' - - 'spec/views/devise/mailer/unlock_instructions_spec.rb' - - 'spec/views/devise/registrations/edit_spec.rb' - - 'spec/views/devise/registrations/new_spec.rb' - - 'spec/views/devise/sessions/new_spec.rb' - - 'spec/views/devise/unlocks/new_spec.rb' - - 'spec/views/forums/edit.html.haml_spec.rb' - - 'spec/views/forums/index.html.haml_spec.rb' - - 'spec/views/forums/new.html.haml_spec.rb' - - 'spec/views/forums/show.html.haml_spec.rb' - - 'spec/views/gardens/edit.html.haml_spec.rb' - - 'spec/views/gardens/new.html.haml_spec.rb' - - 'spec/views/gardens/show.html.haml_spec.rb' - - 'spec/views/harvests/edit.html.haml_spec.rb' - - 'spec/views/harvests/index.html.haml_spec.rb' - - 'spec/views/harvests/new.html.haml_spec.rb' - - 'spec/views/harvests/show.html.haml_spec.rb' - - 'spec/views/home/_blurb.html.haml_spec.rb' - - 'spec/views/home/_crops.html.haml_spec.rb' - - 'spec/views/home/_members.html.haml_spec.rb' - - 'spec/views/home/_seeds.html.haml_spec.rb' - - 'spec/views/home/_stats.html.haml_spec.rb' - - 'spec/views/home/index_spec.rb' - - 'spec/views/layouts/_header_spec.rb' - - 'spec/views/layouts/_meta_spec.rb' - - 'spec/views/layouts/application_spec.rb' - - 'spec/views/members/_location.html.haml_spec.rb' - - 'spec/views/members/index.html.haml_spec.rb' - - 'spec/views/members/show.rss.haml_spec.rb' - - 'spec/views/notifications/index.html.haml_spec.rb' - - 'spec/views/notifications/new.html.haml_spec.rb' - - 'spec/views/notifications/show.html.haml_spec.rb' - - 'spec/views/notifier/notify.html.haml_spec.rb' - - 'spec/views/orders/index.html.haml_spec.rb' - - 'spec/views/orders/show.html.haml_spec.rb' - - 'spec/views/photos/edit.html.haml_spec.rb' - - 'spec/views/photos/index.html.haml_spec.rb' - - 'spec/views/photos/new.html.haml_spec.rb' - - 'spec/views/photos/show.html.haml_spec.rb' - - 'spec/views/places/_map_attribution.html.haml_spec.rb' - - 'spec/views/places/index.html.haml_spec.rb' - - 'spec/views/places/show.html.haml_spec.rb' - - 'spec/views/plant_parts/edit.html.haml_spec.rb' - - 'spec/views/plant_parts/index.html.haml_spec.rb' - - 'spec/views/plant_parts/new.html.haml_spec.rb' - - 'spec/views/plant_parts/show.html.haml_spec.rb' - - 'spec/views/plantings/_form.html.haml_spec.rb' - - 'spec/views/plantings/edit.html.haml_spec.rb' - - 'spec/views/plantings/index.html.haml_spec.rb' - - 'spec/views/plantings/index.rss.haml_spec.rb' - - 'spec/views/plantings/new.html.haml_spec.rb' - - 'spec/views/plantings/show.html.haml_spec.rb' - - 'spec/views/posts/_single.html.haml_spec.rb' - - 'spec/views/posts/edit.html.haml_spec.rb' - - 'spec/views/posts/index.html.haml_spec.rb' - - 'spec/views/posts/index.rss.haml_spec.rb' - - 'spec/views/posts/new.html.haml_spec.rb' - - 'spec/views/posts/show.html.haml_spec.rb' - - 'spec/views/posts/show.rss.haml_spec.rb' - - 'spec/views/products/edit.html.haml_spec.rb' - - 'spec/views/products/index.html.haml_spec.rb' - - 'spec/views/products/new.html.haml_spec.rb' - - 'spec/views/products/show.html.haml_spec.rb' - - 'spec/views/roles/edit.html.haml_spec.rb' - - 'spec/views/roles/index.html.haml_spec.rb' - - 'spec/views/roles/new.html.haml_spec.rb' - - 'spec/views/roles/show.html.haml_spec.rb' - - 'spec/views/scientific_names/edit.html.haml_spec.rb' - - 'spec/views/scientific_names/index.html.haml_spec.rb' - - 'spec/views/scientific_names/new.html.haml_spec.rb' - - 'spec/views/scientific_names/show.html.haml_spec.rb' - - 'spec/views/seeds/edit.html.haml_spec.rb' - - 'spec/views/seeds/index.rss.haml_spec.rb' - - 'spec/views/seeds/new.html.haml_spec.rb' - - 'spec/views/seeds/show.html.haml_spec.rb' - - 'spec/views/shop/index_spec.rb' - -# Offense count: 2 -# Cop supports --auto-correct. -Style/EmptyLinesAroundAccessModifier: - Exclude: - - 'app/controllers/passwords_controller.rb' - - 'app/models/post.rb' - -# Offense count: 314 -# Cop supports --auto-correct. -# Configuration parameters: EnforcedStyle, SupportedStyles. -# SupportedStyles: empty_lines, no_empty_lines -Style/EmptyLinesAroundBlockBody: - Exclude: - - 'config/environments/test.rb' - - 'config/initializers/comfortable_mexican_sofa.rb' - - 'config/routes.rb' - - 'config/unicorn.rb' - - 'lib/tasks/growstuff.rake' - - 'spec/controllers/account_types_controller_spec.rb' - - 'spec/controllers/accounts_controller_spec.rb' - - 'spec/controllers/admin/orders_controller_spec.rb' - - 'spec/controllers/admin_controller_spec.rb' - - 'spec/controllers/authentications_controller_spec.rb' - - 'spec/controllers/comments_controller_spec.rb' - - 'spec/controllers/crops_controller_spec.rb' - - 'spec/controllers/forums_controller_spec.rb' - - 'spec/controllers/gardens_controller_spec.rb' - - 'spec/controllers/harvests_controller_spec.rb' - - 'spec/controllers/home_controller_spec.rb' - - 'spec/controllers/member_controller_spec.rb' - - 'spec/controllers/notifications_controller_spec.rb' - - 'spec/controllers/order_items_controller_spec.rb' - - 'spec/controllers/orders_controller_spec.rb' - - 'spec/controllers/places_controller_spec.rb' - - 'spec/controllers/plant_parts_controller_spec.rb' - - 'spec/controllers/plantings_controller_spec.rb' - - 'spec/controllers/posts_controller_spec.rb' - - 'spec/controllers/products_controller_spec.rb' - - 'spec/controllers/registrations_controller_spec.rb' - - 'spec/controllers/roles_controller_spec.rb' - - 'spec/controllers/scientific_names_controller_spec.rb' - - 'spec/controllers/shop_controller_spec.rb' - - 'spec/factories/account_types.rb' - - 'spec/factories/crop.rb' - - 'spec/factories/follows.rb' - - 'spec/factories/garden.rb' - - 'spec/factories/member.rb' - - 'spec/factories/post.rb' - - 'spec/factories/scientific_name.rb' - - 'spec/features/crops/browse_crops_spec.rb' - - 'spec/features/crops/crop_detail_page_spec.rb' - - 'spec/features/crops/crop_wranglers_spec.rb' - - 'spec/features/footer_spec.rb' - - 'spec/features/gardens_spec.rb' - - 'spec/features/harvests/browse_harvests_spec.rb' - - 'spec/features/locale_spec.rb' - - 'spec/features/member_profile_spec.rb' - - 'spec/features/signout_spec.rb' - - 'spec/features/signup_spec.rb' - - 'spec/helpers/harvests_helper_spec.rb' - - 'spec/helpers/notifications_helper_spec.rb' - - 'spec/helpers/plantings_helper_spec.rb' - - 'spec/lib/haml/filters/escaped_markdown_spec.rb' - - 'spec/lib/haml/filters/growstuff_markdown_spec.rb' - - 'spec/mailers/notifier_spec.rb' - - 'spec/models/ability_spec.rb' - - 'spec/models/account_spec.rb' - - 'spec/models/alternate_name_spec.rb' - - 'spec/models/authentication_spec.rb' - - 'spec/models/comment_spec.rb' - - 'spec/models/crop_spec.rb' - - 'spec/models/follow_spec.rb' - - 'spec/models/forum_spec.rb' - - 'spec/models/garden_spec.rb' - - 'spec/models/harvest_spec.rb' - - 'spec/models/member_spec.rb' - - 'spec/models/notification_spec.rb' - - 'spec/models/order_item_spec.rb' - - 'spec/models/order_spec.rb' - - 'spec/models/photo_spec.rb' - - 'spec/models/plant_part_spec.rb' - - 'spec/models/planting_spec.rb' - - 'spec/models/post_spec.rb' - - 'spec/models/product_spec.rb' - - 'spec/models/scientific_name_spec.rb' - - 'spec/models/seed_spec.rb' - - 'spec/routing/account_types_routing_spec.rb' - - 'spec/routing/authentications_routing_spec.rb' - - 'spec/routing/comments_routing_spec.rb' - - 'spec/routing/crops_routing_spec.rb' - - 'spec/routing/follows_routing_spec.rb' - - 'spec/routing/forums_routing_spec.rb' - - 'spec/routing/gardens_routing_spec.rb' - - 'spec/routing/harvests_routing_spec.rb' - - 'spec/routing/notifications_routing_spec.rb' - - 'spec/routing/order_items_routing_spec.rb' - - 'spec/routing/orders_routing_spec.rb' - - 'spec/routing/photos_routing_spec.rb' - - 'spec/routing/plant_parts_routing_spec.rb' - - 'spec/routing/plantings_routing_spec.rb' - - 'spec/routing/products_routing_spec.rb' - - 'spec/routing/roles_routing_spec.rb' - - 'spec/routing/scientific_names_routing_spec.rb' - - 'spec/routing/seeds_routing_spec.rb' - - 'spec/routing/updates_routing_spec.rb' - - 'spec/spec_helper.rb' - - 'spec/support/database_cleaner.rb' - - 'spec/views/comments/index.rss.haml_spec.rb' - - 'spec/views/comments/new.html.haml_spec.rb' - - 'spec/views/crops/_planting_advice.html.haml_spec.rb' - - 'spec/views/crops/_popover.html.haml_spec.rb' - - 'spec/views/crops/edit.html.haml_spec.rb' - - 'spec/views/crops/index.rss.haml_spec.rb' - - 'spec/views/crops/new.html.haml_spec.rb' - - 'spec/views/crops/wrangle.html.haml_spec.rb' - - 'spec/views/devise/confirmations/new_spec.rb' - - 'spec/views/devise/mailer/confirmation_instructions_spec.rb' - - 'spec/views/devise/mailer/reset_password_instructions_spec.rb' - - 'spec/views/devise/registrations/edit_spec.rb' - - 'spec/views/devise/registrations/new_spec.rb' - - 'spec/views/devise/sessions/new_spec.rb' - - 'spec/views/devise/shared/_links_spec.rb' - - 'spec/views/devise/unlocks/new_spec.rb' - - 'spec/views/forums/index.html.haml_spec.rb' - - 'spec/views/gardens/edit.html.haml_spec.rb' - - 'spec/views/gardens/show.html.haml_spec.rb' - - 'spec/views/harvests/index.html.haml_spec.rb' - - 'spec/views/harvests/show.html.haml_spec.rb' - - 'spec/views/home/_blurb.html.haml_spec.rb' - - 'spec/views/home/_members.html.haml_spec.rb' - - 'spec/views/home/index_spec.rb' - - 'spec/views/layouts/_header_spec.rb' - - 'spec/views/layouts/_meta_spec.rb' - - 'spec/views/layouts/application_spec.rb' - - 'spec/views/members/_location.html.haml_spec.rb' - - 'spec/views/members/index.html.haml_spec.rb' - - 'spec/views/members/show.rss.haml_spec.rb' - - 'spec/views/notifications/index.html.haml_spec.rb' - - 'spec/views/notifications/new.html.haml_spec.rb' - - 'spec/views/notifications/show.html.haml_spec.rb' - - 'spec/views/notifier/notify.html.haml_spec.rb' - - 'spec/views/orders/show.html.haml_spec.rb' - - 'spec/views/photos/edit.html.haml_spec.rb' - - 'spec/views/photos/new.html.haml_spec.rb' - - 'spec/views/photos/show.html.haml_spec.rb' - - 'spec/views/places/show.html.haml_spec.rb' - - 'spec/views/plant_parts/index.html.haml_spec.rb' - - 'spec/views/plantings/_form.html.haml_spec.rb' - - 'spec/views/plantings/edit.html.haml_spec.rb' - - 'spec/views/plantings/new.html.haml_spec.rb' - - 'spec/views/posts/_single.html.haml_spec.rb' - - 'spec/views/posts/edit.html.haml_spec.rb' - - 'spec/views/posts/index.rss.haml_spec.rb' - - 'spec/views/posts/new.html.haml_spec.rb' - - 'spec/views/posts/show.html.haml_spec.rb' - - 'spec/views/posts/show.rss.haml_spec.rb' - - 'spec/views/scientific_names/edit.html.haml_spec.rb' - - 'spec/views/scientific_names/new.html.haml_spec.rb' - - 'spec/views/scientific_names/show.html.haml_spec.rb' - - 'spec/views/seeds/index.rss.haml_spec.rb' - - 'spec/views/seeds/new.html.haml_spec.rb' - - 'spec/views/seeds/show.html.haml_spec.rb' - - 'spec/views/shop/index_spec.rb' - -# Offense count: 21 -# Cop supports --auto-correct. -# Configuration parameters: EnforcedStyle, SupportedStyles. -# SupportedStyles: empty_lines, empty_lines_except_namespace, no_empty_lines -Style/EmptyLinesAroundClassBody: - Exclude: - - 'app/controllers/accounts_controller.rb' - - 'app/controllers/application_controller.rb' - - 'app/controllers/home_controller.rb' - - 'app/controllers/passwords_controller.rb' - - 'app/controllers/places_controller.rb' - - 'app/controllers/robots_controller.rb' - - 'app/mailers/notifier.rb' - - 'app/models/account.rb' - - 'app/models/comment.rb' - - 'app/models/crop.rb' - - 'app/models/follow.rb' - - 'app/models/forum.rb' - - 'app/models/garden.rb' - - 'app/models/harvest.rb' - - 'app/models/notification.rb' - - 'app/models/order.rb' - - 'app/models/photo.rb' - - 'app/models/plant_part.rb' - - 'app/models/product.rb' - - 'db/migrate/20130518002942_rename_account_detail_to_account.rb' - - 'lib/actions/oauth_signup_action.rb' - -# Offense count: 14 -# Cop supports --auto-correct. -Style/EmptyLinesAroundMethodBody: - Exclude: - - 'app/controllers/admin/orders_controller.rb' - - 'app/controllers/crops_controller.rb' - - 'app/controllers/follows_controller.rb' - - 'app/controllers/home_controller.rb' - - 'app/controllers/orders_controller.rb' - - 'app/controllers/registrations_controller.rb' - - 'app/models/crop.rb' - - 'app/models/photo.rb' - - 'app/models/seed.rb' - - 'lib/haml/filters/growstuff_markdown.rb' - -# Offense count: 14 -# Cop supports --auto-correct. -# Configuration parameters: EnforcedStyle, SupportedStyles. -# SupportedStyles: empty_lines, empty_lines_except_namespace, no_empty_lines -Style/EmptyLinesAroundModuleBody: - Exclude: - - 'app/helpers/application_helper.rb' - - 'app/helpers/auto_suggest_helper.rb' - - 'app/helpers/gardens_helper.rb' - - 'app/helpers/harvests_helper.rb' - - 'app/helpers/plantings_helper.rb' - - 'app/helpers/seeds_helper.rb' - - 'lib/geocodable.rb' - - 'lib/haml/filters/escaped_markdown.rb' - - 'lib/haml/filters/growstuff_markdown.rb' - - 'spec/support/feature_helpers.rb' - # Offense count: 1 # Cop supports --auto-correct. Style/EmptyLiteral: diff --git a/app/controllers/accounts_controller.rb b/app/controllers/accounts_controller.rb index a4904646c..b2daf95ed 100644 --- a/app/controllers/accounts_controller.rb +++ b/app/controllers/accounts_controller.rb @@ -43,5 +43,4 @@ class AccountsController < ApplicationController def account_params params.require(:account).permit(:account_type_id, :member_id, :paid_until) end - end diff --git a/app/controllers/admin/orders_controller.rb b/app/controllers/admin/orders_controller.rb index c092ba7f2..88b9bc611 100644 --- a/app/controllers/admin/orders_controller.rb +++ b/app/controllers/admin/orders_controller.rb @@ -17,6 +17,5 @@ class Admin::OrdersController < ApplicationController respond_to do |format| format.html # index.html.haml end - end end diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index 3ba6c165f..9cd3fa3de 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -78,5 +78,4 @@ class ApplicationController < ActionController::Base ) end end - end diff --git a/app/controllers/crops_controller.rb b/app/controllers/crops_controller.rb index cc2eb26dc..4dc5377fd 100644 --- a/app/controllers/crops_controller.rb +++ b/app/controllers/crops_controller.rb @@ -116,13 +116,11 @@ class CropsController < ApplicationController @crop = Crop.find(params[:id]) @crop.alternate_names.build if @crop.alternate_names.blank? @crop.scientific_names.build if @crop.scientific_names.blank? - end # POST /crops # POST /crops.json def create - @crop = Crop.new(crop_params) if current_member.has_role? :crop_wrangler diff --git a/app/controllers/follows_controller.rb b/app/controllers/follows_controller.rb index 2e2e5ec48..4e62925e6 100644 --- a/app/controllers/follows_controller.rb +++ b/app/controllers/follows_controller.rb @@ -5,7 +5,6 @@ class FollowsController < ApplicationController # POST /follows def create - @follow = current_member.follows.build(followed_id: follow_params[:followed_id]) if @follow.save diff --git a/app/controllers/gardens_controller.rb b/app/controllers/gardens_controller.rb index 6f53a959c..5820b83d3 100644 --- a/app/controllers/gardens_controller.rb +++ b/app/controllers/gardens_controller.rb @@ -2,7 +2,6 @@ class GardensController < ApplicationController before_filter :authenticate_member!, except: [:index, :show] load_and_authorize_resource - # GET /gardens # GET /gardens.json def index diff --git a/app/controllers/home_controller.rb b/app/controllers/home_controller.rb index 69e9a95a2..9eb6e5003 100644 --- a/app/controllers/home_controller.rb +++ b/app/controllers/home_controller.rb @@ -2,7 +2,6 @@ class HomeController < ApplicationController skip_authorize_resource def index - # we were previously generating a lot of instance variables like # @members_count and @interesting_crops in here, but now we call # the relevant class methods directly in the view, so that fragment @@ -12,5 +11,4 @@ class HomeController < ApplicationController format.html # index.html.haml end end - end diff --git a/app/controllers/omniauth_callbacks_controller.rb b/app/controllers/omniauth_callbacks_controller.rb index bf479ccbc..f6912f55f 100644 --- a/app/controllers/omniauth_callbacks_controller.rb +++ b/app/controllers/omniauth_callbacks_controller.rb @@ -10,6 +10,7 @@ class OmniauthCallbacksController < Devise::OmniauthCallbacksController def facebook create end + def failure flash[:alert] = "Authentication failed." redirect_to request.env['omniauth.origin'] || "/" diff --git a/app/controllers/orders_controller.rb b/app/controllers/orders_controller.rb index 82bb337f9..234c760f2 100644 --- a/app/controllers/orders_controller.rb +++ b/app/controllers/orders_controller.rb @@ -49,7 +49,6 @@ class OrdersController < ApplicationController format.html { render action: "show" } end end - end def complete @@ -78,7 +77,6 @@ class OrdersController < ApplicationController respond_to do |format| format.html # new.html.erb end - end def cancel diff --git a/app/controllers/passwords_controller.rb b/app/controllers/passwords_controller.rb index 6403db56f..c14a02b40 100644 --- a/app/controllers/passwords_controller.rb +++ b/app/controllers/passwords_controller.rb @@ -1,6 +1,6 @@ class PasswordsController < Devise::PasswordsController - protected + def after_resetting_password_path_for(resource) root_path end diff --git a/app/controllers/places_controller.rb b/app/controllers/places_controller.rb index b91e093d5..4982b1830 100644 --- a/app/controllers/places_controller.rb +++ b/app/controllers/places_controller.rb @@ -43,5 +43,4 @@ class PlacesController < ApplicationController end end end - end diff --git a/app/controllers/registrations_controller.rb b/app/controllers/registrations_controller.rb index b29e8c849..98651eb00 100644 --- a/app/controllers/registrations_controller.rb +++ b/app/controllers/registrations_controller.rb @@ -15,7 +15,6 @@ class RegistrationsController < Devise::RegistrationsController # https://github.com/plataformatec/devise/wiki/How-To:-Allow-users-to-edit-their-account-without-providing-a-password def update - @member = Member.find(current_member.id) if needs_password?(@member, params) @@ -35,7 +34,6 @@ class RegistrationsController < Devise::RegistrationsController else render "edit" end - end end diff --git a/app/controllers/robots_controller.rb b/app/controllers/robots_controller.rb index b9381b2da..777bc9aa4 100644 --- a/app/controllers/robots_controller.rb +++ b/app/controllers/robots_controller.rb @@ -1,5 +1,4 @@ class RobotsController < ApplicationController - DEFAULT_FILENAME = 'config/robots.txt'.freeze def robots diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index a1202b5f4..60e057301 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -1,5 +1,4 @@ module ApplicationHelper - def price_in_dollars(price) return sprintf('%.2f', price / 100.0) end diff --git a/app/helpers/auto_suggest_helper.rb b/app/helpers/auto_suggest_helper.rb index 9750b342b..fb29cdfc3 100644 --- a/app/helpers/auto_suggest_helper.rb +++ b/app/helpers/auto_suggest_helper.rb @@ -1,5 +1,4 @@ module AutoSuggestHelper - def auto_suggest(resource, source, options={}) if options[:default] && !options[:default].new_record? default = options[:default] @@ -23,5 +22,4 @@ module AutoSuggestHelper type="hidden" name="#{resource}[#{source}_id]" value="#{default_id}"> }.html_safe end - end diff --git a/app/helpers/gardens_helper.rb b/app/helpers/gardens_helper.rb index fc2beae4f..5d1895e8f 100644 --- a/app/helpers/gardens_helper.rb +++ b/app/helpers/gardens_helper.rb @@ -1,5 +1,4 @@ module GardensHelper - def display_garden_description(garden) if garden.description.nil? "no description provided." diff --git a/app/helpers/harvests_helper.rb b/app/helpers/harvests_helper.rb index b5f695a9d..431083de3 100644 --- a/app/helpers/harvests_helper.rb +++ b/app/helpers/harvests_helper.rb @@ -1,5 +1,4 @@ module HarvestsHelper - def display_quantity(harvest) human_quantity = display_human_quantity(harvest) weight = display_weight(harvest) @@ -44,5 +43,4 @@ module HarvestsHelper harvest.description end end - end diff --git a/app/helpers/plantings_helper.rb b/app/helpers/plantings_helper.rb index fb6e2e7dc..e237ae27d 100644 --- a/app/helpers/plantings_helper.rb +++ b/app/helpers/plantings_helper.rb @@ -1,5 +1,4 @@ module PlantingsHelper - def display_days_before_maturity(planting) if planting.finished? 0 @@ -41,5 +40,4 @@ module PlantingsHelper return "#{planting.owner}." end end - end diff --git a/app/mailers/notifier.rb b/app/mailers/notifier.rb index 65da59de5..281f0b6ee 100644 --- a/app/mailers/notifier.rb +++ b/app/mailers/notifier.rb @@ -51,5 +51,4 @@ class Notifier < ActionMailer::Base @member, @crop = member, crop mail(to: @member.email, subject: "#{crop.name.capitalize} has been rejected") end - end diff --git a/app/models/account.rb b/app/models/account.rb index 926640b30..449697e05 100644 --- a/app/models/account.rb +++ b/app/models/account.rb @@ -21,5 +21,4 @@ class Account < ActiveRecord::Base return paid_until.to_s end end - end diff --git a/app/models/comment.rb b/app/models/comment.rb index e649eb2b4..c1a49a2bb 100644 --- a/app/models/comment.rb +++ b/app/models/comment.rb @@ -19,5 +19,4 @@ class Comment < ActiveRecord::Base ) end end - end diff --git a/app/models/crop.rb b/app/models/crop.rb index b08e11692..0bf6916e3 100644 --- a/app/models/crop.rb +++ b/app/models/crop.rb @@ -261,7 +261,6 @@ class Crop < ActiveRecord::Base # rubocop:disable Metrics/ClassLength crop.add_scientific_names_from_csv(scientific_names) crop.add_alternate_names_from_csv(alternate_names) - end def add_scientific_names_from_csv(scientific_names) @@ -387,5 +386,4 @@ class Crop < ActiveRecord::Base # rubocop:disable Metrics/ClassLength errors.add(:rejection_notes, "must be added if the reason for rejection is \"other\"") end end - end diff --git a/app/models/follow.rb b/app/models/follow.rb index 997352ebf..733c4fb43 100644 --- a/app/models/follow.rb +++ b/app/models/follow.rb @@ -11,6 +11,4 @@ class Follow < ActiveRecord::Base body: "#{self.follower.login_name} just followed you on #{ENV["GROWSTUFF_SITE_NAME"]}. " ) end - - end diff --git a/app/models/forum.rb b/app/models/forum.rb index 0e2e2615d..810653d7c 100644 --- a/app/models/forum.rb +++ b/app/models/forum.rb @@ -8,5 +8,4 @@ class Forum < ActiveRecord::Base def to_s return name end - end diff --git a/app/models/garden.rb b/app/models/garden.rb index e7a45fc1c..f13754946 100644 --- a/app/models/garden.rb +++ b/app/models/garden.rb @@ -103,5 +103,4 @@ class Garden < ActiveRecord::Base def default_photo return photos.first end - end diff --git a/app/models/harvest.rb b/app/models/harvest.rb index 53a1516ad..7ac418287 100644 --- a/app/models/harvest.rb +++ b/app/models/harvest.rb @@ -135,5 +135,4 @@ class Harvest < ActiveRecord::Base def default_photo return photos.first || crop.default_photo end - end diff --git a/app/models/member.rb b/app/models/member.rb index 65c534d51..4e403deb5 100644 --- a/app/models/member.rb +++ b/app/models/member.rb @@ -27,7 +27,6 @@ class Member < ActiveRecord::Base has_many :photos - default_scope { order("lower(login_name) asc") } scope :confirmed, -> { where('confirmed_at IS NOT NULL') } scope :located, -> { where("location <> '' and latitude IS NOT NULL and longitude IS NOT NULL") } diff --git a/app/models/notification.rb b/app/models/notification.rb index 567867b00..c970d4218 100644 --- a/app/models/notification.rb +++ b/app/models/notification.rb @@ -26,5 +26,4 @@ class Notification < ActiveRecord::Base Notifier.notify(self).deliver_later end end - end diff --git a/app/models/order.rb b/app/models/order.rb index 6213485ef..9a15091d6 100644 --- a/app/models/order.rb +++ b/app/models/order.rb @@ -92,5 +92,4 @@ class Order < ActiveRecord::Base end return [] end - end diff --git a/app/models/photo.rb b/app/models/photo.rb index 1abef6047..6d7fdbcba 100644 --- a/app/models/photo.rb +++ b/app/models/photo.rb @@ -34,11 +34,9 @@ class Photo < ActiveRecord::Base fullsize_url: FlickRaw.url_z(info), link_url: FlickRaw.url_photopage(info) } - end def set_flickr_metadata self.update_attributes(flickr_metadata) end - end diff --git a/app/models/plant_part.rb b/app/models/plant_part.rb index 652bc894b..16f23822a 100644 --- a/app/models/plant_part.rb +++ b/app/models/plant_part.rb @@ -20,5 +20,4 @@ class PlantPart < ActiveRecord::Base def crops return super.reorder('name') end - end diff --git a/app/models/post.rb b/app/models/post.rb index 8f13d313d..f875c8ad8 100644 --- a/app/models/post.rb +++ b/app/models/post.rb @@ -44,7 +44,6 @@ class Post < ActiveRecord::Base }, length: { maximum: 255 } - def author_date_subject # slugs are created before created_at is set time = created_at || Time.zone.now @@ -70,6 +69,7 @@ class Post < ActiveRecord::Base end private + def update_crops_posts_association self.crops.destroy_all # look for crops mentioned in the post. eg. [tomato](crop) diff --git a/app/models/product.rb b/app/models/product.rb index 942e2603b..8cab945a7 100644 --- a/app/models/product.rb +++ b/app/models/product.rb @@ -11,5 +11,4 @@ class Product < ActiveRecord::Base def to_s name end - end diff --git a/app/models/seed.rb b/app/models/seed.rb index 1f230283d..153b18a48 100644 --- a/app/models/seed.rb +++ b/app/models/seed.rb @@ -92,7 +92,6 @@ class Seed < ActiveRecord::Base end return interesting_seeds - end def seed_slug diff --git a/config.rb b/config.rb index 609849e17..bb4bb0a7d 100644 --- a/config.rb +++ b/config.rb @@ -16,7 +16,6 @@ images_dir = "app/assets/images" # To disable debugging comments that display the original location of your selectors. Uncomment: # line_comments = false - # If you prefer the indented syntax, you might want to regenerate this # project again passing --syntax sass, or you can uncomment this: preferred_syntax = :sass diff --git a/config/application.rb b/config/application.rb index e4afdd4ba..5280dce7e 100644 --- a/config/application.rb +++ b/config/application.rb @@ -82,7 +82,6 @@ module Growstuff g.javascripts false end - # Growstuff-specific configuration variables config.currency = 'AUD' config.bot_email = "noreply@growstuff.org" diff --git a/config/environments/test.rb b/config/environments/test.rb index 0d08d1da5..d00fecf0e 100644 --- a/config/environments/test.rb +++ b/config/environments/test.rb @@ -54,7 +54,6 @@ Growstuff::Application.configure do ::STANDARD_GATEWAY = ActiveMerchant::Billing::PaypalBogusGateway.new ::EXPRESS_GATEWAY = ActiveMerchant::Billing::PaypalBogusGateway.new end - end Geocoder.configure(lookup: :test) diff --git a/config/initializers/comfortable_mexican_sofa.rb b/config/initializers/comfortable_mexican_sofa.rb index cc8ec6301..3206e14d9 100644 --- a/config/initializers/comfortable_mexican_sofa.rb +++ b/config/initializers/comfortable_mexican_sofa.rb @@ -91,7 +91,6 @@ ComfortableMexicanSofa.configure do |config| # Reveal partials that can be overwritten in the admin area. # Default is false. # config.reveal_cms_partials = false - end module CmsDeviseAuth diff --git a/config/routes.rb b/config/routes.rb index f0fbeb9fd..e12cca00e 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -1,5 +1,4 @@ Growstuff::Application.routes.draw do # rubocop:disable Metrics/BlockLength - get '/robots.txt' => 'robots#robots' resources :plant_parts @@ -58,7 +57,6 @@ Growstuff::Application.routes.draw do # rubocop:disable Metrics/BlockLength get '/members/:login_name/follows' => 'members#view_follows', :as => 'member_follows' get '/members/:login_name/followers' => 'members#view_followers', :as => 'member_followers' - get '/places' => 'places#index' get '/places/search' => 'places#search', :as => 'search_places' get '/places/:place' => 'places#show', :as => 'place' @@ -93,5 +91,4 @@ Growstuff::Application.routes.draw do # rubocop:disable Metrics/BlockLength # CMS stuff -- must remain LAST comfy_route :cms, path: '/', sitemap: false - end diff --git a/config/unicorn.rb b/config/unicorn.rb index dfd7ac833..e4153a81f 100644 --- a/config/unicorn.rb +++ b/config/unicorn.rb @@ -4,7 +4,6 @@ timeout 30 preload_app true before_fork do |server, worker| - Signal.trap 'TERM' do puts 'Unicorn master intercepting TERM and sending myself QUIT instead' Process.kill 'QUIT', Process.pid @@ -15,7 +14,6 @@ before_fork do |server, worker| end after_fork do |server, worker| - Signal.trap 'TERM' do puts 'Unicorn worker intercepting TERM and doing nothing. Wait for master to sent QUIT' end diff --git a/db/migrate/20120903092956_devise_create_users.rb b/db/migrate/20120903092956_devise_create_users.rb index f956c1e5a..cf02cbe2a 100644 --- a/db/migrate/20120903092956_devise_create_users.rb +++ b/db/migrate/20120903092956_devise_create_users.rb @@ -33,7 +33,6 @@ class DeviseCreateUsers < ActiveRecord::Migration ## Token authenticatable # t.string :authentication_token - t.timestamps null: true end diff --git a/db/migrate/20130518002942_rename_account_detail_to_account.rb b/db/migrate/20130518002942_rename_account_detail_to_account.rb index 8c2243431..0a8434694 100644 --- a/db/migrate/20130518002942_rename_account_detail_to_account.rb +++ b/db/migrate/20130518002942_rename_account_detail_to_account.rb @@ -2,5 +2,4 @@ class RenameAccountDetailToAccount < ActiveRecord::Migration def change rename_table :account_details, :accounts end - end diff --git a/db/migrate/20130601011725_change_flickr_photo_id_to_string.rb b/db/migrate/20130601011725_change_flickr_photo_id_to_string.rb index 84cf7a7b4..01afc35d3 100644 --- a/db/migrate/20130601011725_change_flickr_photo_id_to_string.rb +++ b/db/migrate/20130601011725_change_flickr_photo_id_to_string.rb @@ -3,6 +3,7 @@ class ChangeFlickrPhotoIdToString < ActiveRecord::Migration remove_column :photos, :flickr_photo_id add_column :photos, :flickr_photo_id, :string end + def down # Postgres doesn't allow you to cast strings to integers # Hence there's no way of rolling back this migration without losing diff --git a/db/seeds.rb b/db/seeds.rb index 09a105c15..551dd8308 100644 --- a/db/seeds.rb +++ b/db/seeds.rb @@ -69,7 +69,6 @@ def load_test_users puts "Warning: unable to open suburbs.csv" end - # rake parameter (eg. 'rake db:seed member_size=10') member_size = ENV['member_size'] ? ENV['member_size'].to_i : 3 diff --git a/lib/actions/oauth_signup_action.rb b/lib/actions/oauth_signup_action.rb index 5c8825495..533a69b64 100644 --- a/lib/actions/oauth_signup_action.rb +++ b/lib/actions/oauth_signup_action.rb @@ -1,5 +1,4 @@ class Growstuff::OauthSignupAction - # # Inspects the omniauth information # and determines if we have an existing member diff --git a/lib/geocodable.rb b/lib/geocodable.rb index 2b914b535..3e960b0de 100644 --- a/lib/geocodable.rb +++ b/lib/geocodable.rb @@ -18,5 +18,4 @@ module Geocodable self.longitude = nil end end - end diff --git a/lib/haml/filters/escaped_markdown.rb b/lib/haml/filters/escaped_markdown.rb index 1f3f35098..1986b905d 100644 --- a/lib/haml/filters/escaped_markdown.rb +++ b/lib/haml/filters/escaped_markdown.rb @@ -12,5 +12,4 @@ module Haml::Filters # Register it as the handler for the :escaped_markdown HAML command. # The automatic system gives us :escapedmarkdown, which is ugly. defined['escaped_markdown'] = EscapedMarkdown - end diff --git a/lib/haml/filters/growstuff_markdown.rb b/lib/haml/filters/growstuff_markdown.rb index 05655ccb7..ebd3ecebe 100644 --- a/lib/haml/filters/growstuff_markdown.rb +++ b/lib/haml/filters/growstuff_markdown.rb @@ -9,7 +9,6 @@ module Haml::Filters include Haml::Filters::Base def render(text) - # turn [tomato](crop) into [tomato](http://growstuff.org/crops/tomato) expanded = text.gsub(CROP_REGEX) do |m| crop_str = $1 @@ -52,12 +51,10 @@ module Haml::Filters expanded = expanded.gsub(MEMBER_ESCAPE_AT_REGEX, "") return BlueCloth.new(expanded).to_html - end end # Register it as the handler for the :growstuff_markdown HAML command. # The automatic system gives us :growstuffmarkdown, which is ugly. defined['growstuff_markdown'] = GrowstuffMarkdown - end diff --git a/lib/tasks/growstuff.rake b/lib/tasks/growstuff.rake index 89be5f63f..fd0258309 100644 --- a/lib/tasks/growstuff.rake +++ b/lib/tasks/growstuff.rake @@ -1,5 +1,4 @@ namespace :growstuff do - desc "Add an admin user, by name" # usage: rake growstuff:admin_user name=skud @@ -38,7 +37,6 @@ namespace :growstuff do end Rails.cache.delete('full_crop_hierarchy') puts "Finished loading crops" - end desc "Send planting reminder email" @@ -73,10 +71,8 @@ namespace :growstuff do desc "One-off tasks needed at various times and kept for posterity" namespace :oneoff do - desc "May 2013: replace any empty notification subjects with (no subject)" task empty_subjects: :environment do - # this is inefficient as it checks every Notification, but the # site is small and there aren't many of them, so it shouldn't matter # for this one-off script. @@ -88,7 +84,6 @@ namespace :growstuff do desc "May 2013: replace any empty garden names with Garden" task empty_garden_names: :environment do - # this is inefficient as it checks every Garden, but the # site is small and there aren't many of them, so it shouldn't matter # for this one-off script. @@ -100,7 +95,6 @@ namespace :growstuff do end end - desc "June 2013: create account types and products." task setup_shop: :environment do puts "Adding account types..." @@ -163,7 +157,6 @@ namespace :growstuff do desc "June 2013: replace nil account_types with free accounts" task nil_account_type: :environment do - free = AccountType.find_by_name("Free") raise "Free account type not found: run rake growstuff:oneoff:setup_shop"\ unless free @@ -177,7 +170,6 @@ namespace :growstuff do desc "July 2013: replace nil seed.tradable_to with nowhere" task tradable_to_nowhere: :environment do - Seed.all.each do |s| unless s.tradable_to s.tradable_to = 'nowhere' @@ -188,7 +180,6 @@ namespace :growstuff do desc "August 2013: set up plantings_count cache on crop" task reset_crop_plantings_count: :environment do - Crop.find_each do |c| Crop.reset_counters c.id, :plantings end @@ -196,7 +187,6 @@ namespace :growstuff do desc "August 2013: set default creator on existing crops" task set_default_crop_creator: :environment do - cropbot = Member.find_by_login_name("cropbot") raise "cropbot not found: create cropbot member on site or run rake db:seed" unless cropbot cropbot.account.account_type = AccountType.find_by_name("Staff") # set this just because it's nice @@ -213,7 +203,6 @@ namespace :growstuff do sn.save end end - end desc "August 2013: set planting owner" @@ -339,5 +328,4 @@ namespace :growstuff do Crop.import end end # end oneoff section - end diff --git a/spec/controllers/account_types_controller_spec.rb b/spec/controllers/account_types_controller_spec.rb index 4fd0450aa..633311b6e 100644 --- a/spec/controllers/account_types_controller_spec.rb +++ b/spec/controllers/account_types_controller_spec.rb @@ -10,19 +10,13 @@ ## If you submit a pull request containing new view or controller tests, it will not be ## merged. - - - - require 'rails_helper' describe AccountTypesController do - # This automatically creates a "Free" account type login_member(:admin_member) def valid_attributes { "name" => "MyString" } end - end diff --git a/spec/controllers/accounts_controller_spec.rb b/spec/controllers/accounts_controller_spec.rb index e8d6648e5..da21a1ba3 100644 --- a/spec/controllers/accounts_controller_spec.rb +++ b/spec/controllers/accounts_controller_spec.rb @@ -10,14 +10,9 @@ ## If you submit a pull request containing new view or controller tests, it will not be ## merged. - - - - require 'rails_helper' describe AccountsController do - login_member(:admin_member) def valid_attributes @@ -32,5 +27,4 @@ describe AccountsController do member = FactoryGirl.create(:member) return member.account end - end diff --git a/spec/controllers/admin/orders_controller_spec.rb b/spec/controllers/admin/orders_controller_spec.rb index b5e66b3b1..0efdc0969 100644 --- a/spec/controllers/admin/orders_controller_spec.rb +++ b/spec/controllers/admin/orders_controller_spec.rb @@ -10,15 +10,9 @@ ## If you submit a pull request containing new view or controller tests, it will not be ## merged. - - - - - require 'rails_helper' describe Admin::OrdersController do - login_member(:admin_member) describe "GET search" do @@ -34,5 +28,4 @@ describe Admin::OrdersController do flash[:alert].should match /Couldn't find order with/ end end - end diff --git a/spec/controllers/admin_controller_spec.rb b/spec/controllers/admin_controller_spec.rb index bb669d80c..0b36fe583 100644 --- a/spec/controllers/admin_controller_spec.rb +++ b/spec/controllers/admin_controller_spec.rb @@ -10,14 +10,9 @@ ## If you submit a pull request containing new view or controller tests, it will not be ## merged. - - - - require 'rails_helper' describe AdminController do - login_member(:admin_member) describe "GET admin/newsletter" do diff --git a/spec/controllers/authentications_controller_spec.rb b/spec/controllers/authentications_controller_spec.rb index 91de89aae..47be30487 100644 --- a/spec/controllers/authentications_controller_spec.rb +++ b/spec/controllers/authentications_controller_spec.rb @@ -10,14 +10,9 @@ ## If you submit a pull request containing new view or controller tests, it will not be ## merged. - - - - require 'rails_helper' describe AuthenticationsController do - before(:each) do @member = FactoryGirl.create(:member) sign_in @member @@ -30,5 +25,4 @@ describe AuthenticationsController do 'credentials' => { 'token' => 'blah', 'secret' => 'blah' } } end - end diff --git a/spec/controllers/comments_controller_spec.rb b/spec/controllers/comments_controller_spec.rb index 36b77fdf9..be816dfa9 100644 --- a/spec/controllers/comments_controller_spec.rb +++ b/spec/controllers/comments_controller_spec.rb @@ -10,14 +10,9 @@ ## If you submit a pull request containing new view or controller tests, it will not be ## merged. - - - - require 'rails_helper' describe CommentsController do - before(:each) do @member = FactoryGirl.create(:member) sign_in @member @@ -86,5 +81,4 @@ describe CommentsController do response.should redirect_to(post) end end - end diff --git a/spec/controllers/crops_controller_spec.rb b/spec/controllers/crops_controller_spec.rb index 876c289d4..9a0a1dcdc 100644 --- a/spec/controllers/crops_controller_spec.rb +++ b/spec/controllers/crops_controller_spec.rb @@ -10,14 +10,9 @@ ## If you submit a pull request containing new view or controller tests, it will not be ## merged. - - - - require 'rails_helper' describe CropsController do - login_member(:crop_wrangling_member) def valid_attributes @@ -61,5 +56,4 @@ describe CropsController do response.content_type.should eq("application/rss+xml") end end - end diff --git a/spec/controllers/forums_controller_spec.rb b/spec/controllers/forums_controller_spec.rb index 233654d53..f320204e2 100644 --- a/spec/controllers/forums_controller_spec.rb +++ b/spec/controllers/forums_controller_spec.rb @@ -10,14 +10,9 @@ ## If you submit a pull request containing new view or controller tests, it will not be ## merged. - - - - require 'rails_helper' describe ForumsController do - login_member(:admin_member) def valid_attributes @@ -31,5 +26,4 @@ describe ForumsController do def valid_session {} end - end diff --git a/spec/controllers/gardens_controller_spec.rb b/spec/controllers/gardens_controller_spec.rb index 869cbad98..3483d70c3 100644 --- a/spec/controllers/gardens_controller_spec.rb +++ b/spec/controllers/gardens_controller_spec.rb @@ -10,19 +10,13 @@ ## If you submit a pull request containing new view or controller tests, it will not be ## merged. - - - - require 'rails_helper' describe GardensController do - login_member def valid_attributes member = FactoryGirl.create(:member) {name: 'My Garden', owner_id: member.id } end - end diff --git a/spec/controllers/harvests_controller_spec.rb b/spec/controllers/harvests_controller_spec.rb index dc266b3ec..2eedfc2e3 100644 --- a/spec/controllers/harvests_controller_spec.rb +++ b/spec/controllers/harvests_controller_spec.rb @@ -10,14 +10,9 @@ ## If you submit a pull request containing new view or controller tests, it will not be ## merged. - - - - require 'rails_helper' describe HarvestsController do - login_member def valid_attributes @@ -179,5 +174,4 @@ describe HarvestsController do response.should redirect_to(harvests_url) end end - end diff --git a/spec/controllers/home_controller_spec.rb b/spec/controllers/home_controller_spec.rb index ba3d4fce8..eb71e1f4a 100644 --- a/spec/controllers/home_controller_spec.rb +++ b/spec/controllers/home_controller_spec.rb @@ -10,14 +10,9 @@ ## If you submit a pull request containing new view or controller tests, it will not be ## merged. - - - - require 'rails_helper' describe HomeController do - describe "GET index" do end end diff --git a/spec/controllers/member_controller_spec.rb b/spec/controllers/member_controller_spec.rb index 77912b2df..58ad66c8a 100644 --- a/spec/controllers/member_controller_spec.rb +++ b/spec/controllers/member_controller_spec.rb @@ -10,14 +10,9 @@ ## If you submit a pull request containing new view or controller tests, it will not be ## merged. - - - - require 'rails_helper' describe MembersController do - before :each do @member = FactoryGirl.create(:member) @posts = [ FactoryGirl.create(:post, author: @member) ] @@ -40,7 +35,6 @@ describe MembersController do end describe "GET show" do - it "provides JSON for member profile" do get :show, { id: @member.id , format: 'json' } response.should be_success @@ -69,7 +63,6 @@ describe MembersController do @member2 = FactoryGirl.create(:unconfirmed_member) lambda { get :show, {id: @member2.id} }.should raise_error(ActiveRecord::RecordNotFound) end - end describe "GET member's RSS feed" do @@ -80,5 +73,4 @@ describe MembersController do response.content_type.should eq("application/rss+xml") end end - end diff --git a/spec/controllers/notifications_controller_spec.rb b/spec/controllers/notifications_controller_spec.rb index c4366bf6a..6a6e411ad 100644 --- a/spec/controllers/notifications_controller_spec.rb +++ b/spec/controllers/notifications_controller_spec.rb @@ -10,14 +10,9 @@ ## If you submit a pull request containing new view or controller tests, it will not be ## merged. - - - - require 'rails_helper' describe NotificationsController do - login_member def valid_attributes @@ -105,6 +100,5 @@ describe NotificationsController do response.should redirect_to(notifications_path) end end - end end diff --git a/spec/controllers/order_items_controller_spec.rb b/spec/controllers/order_items_controller_spec.rb index 4170e140e..07e7d3e38 100644 --- a/spec/controllers/order_items_controller_spec.rb +++ b/spec/controllers/order_items_controller_spec.rb @@ -10,14 +10,9 @@ ## If you submit a pull request containing new view or controller tests, it will not be ## merged. - - - - require 'rails_helper' describe OrderItemsController do - login_member(:admin_member) before(:each) do @@ -33,7 +28,6 @@ describe OrderItemsController do end describe "POST create" do - it "redirects to order" do @order = FactoryGirl.create(:order, member: @member) post :create, {order_item: { diff --git a/spec/controllers/orders_controller_spec.rb b/spec/controllers/orders_controller_spec.rb index cb408b051..a1dd1fce9 100644 --- a/spec/controllers/orders_controller_spec.rb +++ b/spec/controllers/orders_controller_spec.rb @@ -10,14 +10,9 @@ ## If you submit a pull request containing new view or controller tests, it will not be ## merged. - - - - require 'rails_helper' describe OrdersController do - login_member(:admin_member) def valid_attributes @@ -67,5 +62,4 @@ describe OrdersController do response.should redirect_to(shop_url) end end - end diff --git a/spec/controllers/places_controller_spec.rb b/spec/controllers/places_controller_spec.rb index 9dc3110e5..e635d82b3 100644 --- a/spec/controllers/places_controller_spec.rb +++ b/spec/controllers/places_controller_spec.rb @@ -10,10 +10,6 @@ ## If you submit a pull request containing new view or controller tests, it will not be ## merged. - - - - require 'rails_helper' describe PlacesController do @@ -36,7 +32,6 @@ describe PlacesController do get :show, { place: @member_london.location } assigns(:nearby_members).should eq [@member_london, @member_south_pole] end - end describe "GET search" do diff --git a/spec/controllers/plant_parts_controller_spec.rb b/spec/controllers/plant_parts_controller_spec.rb index 4784cfbdf..239422efa 100644 --- a/spec/controllers/plant_parts_controller_spec.rb +++ b/spec/controllers/plant_parts_controller_spec.rb @@ -10,12 +10,7 @@ ## If you submit a pull request containing new view or controller tests, it will not be ## merged. - - - - require 'rails_helper' describe PlantPartsController do - end diff --git a/spec/controllers/plantings_controller_spec.rb b/spec/controllers/plantings_controller_spec.rb index d7d143498..1dc38ba72 100644 --- a/spec/controllers/plantings_controller_spec.rb +++ b/spec/controllers/plantings_controller_spec.rb @@ -10,14 +10,9 @@ ## If you submit a pull request containing new view or controller tests, it will not be ## merged. - - - - require 'rails_helper' describe PlantingsController do - login_member def valid_attributes @@ -56,7 +51,6 @@ describe PlantingsController do end describe "GET new" do - it "picks up crop from params" do crop = FactoryGirl.create(:crop) get :new, {crop_id: crop.id} @@ -89,7 +83,5 @@ describe PlantingsController do post :create, { planting: valid_attributes } assigns(:planting).owner.should eq subject.current_member end - end - end diff --git a/spec/controllers/posts_controller_spec.rb b/spec/controllers/posts_controller_spec.rb index 6074d0655..1c26cfe12 100644 --- a/spec/controllers/posts_controller_spec.rb +++ b/spec/controllers/posts_controller_spec.rb @@ -10,14 +10,9 @@ ## If you submit a pull request containing new view or controller tests, it will not be ## merged. - - - - require 'rails_helper' describe PostsController do - login_member def valid_attributes @@ -43,5 +38,4 @@ describe PostsController do response.content_type.should eq("application/rss+xml") end end - end diff --git a/spec/controllers/products_controller_spec.rb b/spec/controllers/products_controller_spec.rb index ad56da174..63c17aa66 100644 --- a/spec/controllers/products_controller_spec.rb +++ b/spec/controllers/products_controller_spec.rb @@ -10,14 +10,9 @@ ## If you submit a pull request containing new view or controller tests, it will not be ## merged. - - - - require 'rails_helper' describe ProductsController do - login_member(:admin_member) def valid_attributes @@ -31,5 +26,4 @@ describe ProductsController do def valid_session {} end - end diff --git a/spec/controllers/registrations_controller_spec.rb b/spec/controllers/registrations_controller_spec.rb index 053c67b8c..56d277b75 100644 --- a/spec/controllers/registrations_controller_spec.rb +++ b/spec/controllers/registrations_controller_spec.rb @@ -10,14 +10,9 @@ ## If you submit a pull request containing new view or controller tests, it will not be ## merged. - - - - require 'rails_helper' describe RegistrationsController do - before :each do @member = FactoryGirl.create(:member) sign_in @member @@ -43,5 +38,4 @@ describe RegistrationsController do assigns(:flickr_auth).should eq @auth end end - end diff --git a/spec/controllers/roles_controller_spec.rb b/spec/controllers/roles_controller_spec.rb index 402d1c61c..f62289379 100644 --- a/spec/controllers/roles_controller_spec.rb +++ b/spec/controllers/roles_controller_spec.rb @@ -10,14 +10,9 @@ ## If you submit a pull request containing new view or controller tests, it will not be ## merged. - - - - require 'rails_helper' describe RolesController do - def valid_attributes { "name" => "MyString" } end @@ -32,5 +27,4 @@ describe RolesController do assigns(:roles).should eq([Role.find_by_name('admin'), role]) end end - end diff --git a/spec/controllers/scientific_names_controller_spec.rb b/spec/controllers/scientific_names_controller_spec.rb index ec8ff53cd..db0c7baf7 100644 --- a/spec/controllers/scientific_names_controller_spec.rb +++ b/spec/controllers/scientific_names_controller_spec.rb @@ -10,14 +10,9 @@ ## If you submit a pull request containing new view or controller tests, it will not be ## merged. - - - - require 'rails_helper' describe ScientificNamesController do - login_member(:crop_wrangling_member) before(:each) do @@ -33,6 +28,5 @@ describe ScientificNamesController do get :new, { crop_id: 1 } assigns(:crop).should be_an_instance_of Crop end - end end diff --git a/spec/controllers/seeds_controller_spec.rb b/spec/controllers/seeds_controller_spec.rb index fbf57fc81..e79160dfd 100644 --- a/spec/controllers/seeds_controller_spec.rb +++ b/spec/controllers/seeds_controller_spec.rb @@ -10,10 +10,6 @@ ## If you submit a pull request containing new view or controller tests, it will not be ## merged. - - - - require 'rails_helper' describe SeedsController do diff --git a/spec/controllers/shop_controller_spec.rb b/spec/controllers/shop_controller_spec.rb index 7abdbd5d7..82b07a4b4 100644 --- a/spec/controllers/shop_controller_spec.rb +++ b/spec/controllers/shop_controller_spec.rb @@ -10,14 +10,9 @@ ## If you submit a pull request containing new view or controller tests, it will not be ## merged. - - - - require 'rails_helper' describe ShopController do - before :each do @product1 = FactoryGirl.create(:product) @product2 = FactoryGirl.create(:product) @@ -46,7 +41,5 @@ describe ShopController do get :index, {} assigns(:order).should eq @order end - end - end diff --git a/spec/factories/account_types.rb b/spec/factories/account_types.rb index 832ddf0ce..0187a9e3d 100644 --- a/spec/factories/account_types.rb +++ b/spec/factories/account_types.rb @@ -24,5 +24,4 @@ FactoryGirl.define do is_permanent_paid true end end - end diff --git a/spec/factories/crop.rb b/spec/factories/crop.rb index 5857c9828..c4d73f9d1 100644 --- a/spec/factories/crop.rb +++ b/spec/factories/crop.rb @@ -1,5 +1,4 @@ FactoryGirl.define do - factory :crop do name "magic bean" en_wikipedia_url "http://en.wikipedia.org/wiki/Magic_bean" @@ -73,7 +72,5 @@ FactoryGirl.define do approval_status "rejected" reason_for_rejection "Totally fake" end - end - end diff --git a/spec/factories/follows.rb b/spec/factories/follows.rb index 4bf6b33ac..f54acc0e8 100644 --- a/spec/factories/follows.rb +++ b/spec/factories/follows.rb @@ -3,5 +3,4 @@ FactoryGirl.define do follower followed end - end diff --git a/spec/factories/garden.rb b/spec/factories/garden.rb index 8730c079c..8d6429e2a 100644 --- a/spec/factories/garden.rb +++ b/spec/factories/garden.rb @@ -20,6 +20,5 @@ FactoryGirl.define do factory :garden_z do name 'Zzzz this garden makes me sleepy' end - end end diff --git a/spec/factories/member.rb b/spec/factories/member.rb index b8b23a58a..76493d773 100644 --- a/spec/factories/member.rb +++ b/spec/factories/member.rb @@ -103,7 +103,5 @@ FactoryGirl.define do factory :no_email_notifications_member do send_notification_email false end - end - end diff --git a/spec/factories/post.rb b/spec/factories/post.rb index d9e6e0be5..562912214 100644 --- a/spec/factories/post.rb +++ b/spec/factories/post.rb @@ -1,5 +1,4 @@ FactoryGirl.define do - factory :post do subject "A Post" body "This is some text." @@ -20,5 +19,4 @@ FactoryGirl.define do forum end end - end diff --git a/spec/factories/scientific_name.rb b/spec/factories/scientific_name.rb index 43d9ad74a..9e053dbc9 100644 --- a/spec/factories/scientific_name.rb +++ b/spec/factories/scientific_name.rb @@ -13,6 +13,5 @@ FactoryGirl.define do association :crop, factory: :tomato scientific_name "Solanum lycopersicum" end - end end diff --git a/spec/features/crops/browse_crops_spec.rb b/spec/features/crops/browse_crops_spec.rb index 1345d8738..c486d3963 100644 --- a/spec/features/crops/browse_crops_spec.rb +++ b/spec/features/crops/browse_crops_spec.rb @@ -1,7 +1,6 @@ require 'rails_helper' feature "browse crops" do - let(:tomato) { create :tomato } let(:maize) { create :maize } let(:pending_crop) { create :crop_request } diff --git a/spec/features/crops/crop_detail_page_spec.rb b/spec/features/crops/crop_detail_page_spec.rb index dbfc3ffb5..e80e235ad 100644 --- a/spec/features/crops/crop_detail_page_spec.rb +++ b/spec/features/crops/crop_detail_page_spec.rb @@ -35,7 +35,6 @@ feature "crop detail page", js: true do let!(:roma4) { create :crop, name: 'Roma tomato 4', parent: crop } scenario "The crop has 4 varieties" do - subject within ".varieties" do @@ -52,7 +51,6 @@ feature "crop detail page", js: true do subject within ".varieties" do - # It lists the first 5 items (note: including the top level item.) # It HAS have "Show all" toggle link but not "Show less" link expect(page).to have_selector('li', text: /tomato/i, count: 5) @@ -96,7 +94,6 @@ feature "crop detail page", js: true do end context "action buttons" do - background { subject } scenario "has a link to plant the crop" do @@ -108,11 +105,9 @@ feature "crop detail page", js: true do scenario "has a link to add seeds" do expect(page).to have_link "Add seeds to stash", href: new_seed_path(crop_id: crop.id) end - end context "SEO" do - background { subject } scenario "has seed heading with SEO" do diff --git a/spec/features/crops/crop_wranglers_spec.rb b/spec/features/crops/crop_wranglers_spec.rb index 620034fb2..817f01ae7 100644 --- a/spec/features/crops/crop_wranglers_spec.rb +++ b/spec/features/crops/crop_wranglers_spec.rb @@ -62,8 +62,6 @@ feature "crop wranglers", js: true do visit crop_path(rejected_crop) expect(page).to have_content "This crop was rejected for the following reason: Totally fake" end - - end context "signed in non-wrangler" do diff --git a/spec/features/footer_spec.rb b/spec/features/footer_spec.rb index 8f500ec77..b7d109773 100644 --- a/spec/features/footer_spec.rb +++ b/spec/features/footer_spec.rb @@ -1,7 +1,6 @@ require 'rails_helper' feature "footer", js: true do - before { visit root_path } scenario "footer is on home page" do diff --git a/spec/features/gardens_spec.rb b/spec/features/gardens_spec.rb index 90f2f9ed7..78a7c1285 100644 --- a/spec/features/gardens_spec.rb +++ b/spec/features/gardens_spec.rb @@ -46,7 +46,6 @@ feature "Planting a crop", js: true do end context "Clicking edit from the index page" do - background do visit gardens_path end diff --git a/spec/features/harvests/browse_harvests_spec.rb b/spec/features/harvests/browse_harvests_spec.rb index 28784d7a8..d103ec3c9 100644 --- a/spec/features/harvests/browse_harvests_spec.rb +++ b/spec/features/harvests/browse_harvests_spec.rb @@ -18,7 +18,6 @@ feature "browse harvests" do scenario 'read more' do expect(page).not_to have_link "Read more" end - end feature "filled in optional fields" do diff --git a/spec/features/locale_spec.rb b/spec/features/locale_spec.rb index 74cf208be..01d164f3c 100644 --- a/spec/features/locale_spec.rb +++ b/spec/features/locale_spec.rb @@ -1,7 +1,6 @@ require 'rails_helper' feature "Changing locales", js: true do - after { I18n.locale = :en } scenario "Locale can be set with a query param" do diff --git a/spec/features/member_profile_spec.rb b/spec/features/member_profile_spec.rb index 0551e3873..0c27c7be2 100644 --- a/spec/features/member_profile_spec.rb +++ b/spec/features/member_profile_spec.rb @@ -1,7 +1,6 @@ require 'rails_helper' feature "member profile", js: true do - context "signed out member" do let(:member) { create :member } @@ -42,7 +41,6 @@ feature "member profile", js: true do expect(page).not_to have_css("#membermap") expect(page).not_to have_content "See other members" end - end context "email privacy" do @@ -70,7 +68,6 @@ feature "member profile", js: true do end context "activity stats" do - scenario "with no activity" do visit member_path(member) expect(page).to have_content "Activity" @@ -91,7 +88,6 @@ feature "member profile", js: true do expect(page).to have_link "4 seeds", href: seeds_by_owner_path(owner: member) expect(page).to have_link "5 posts", href: posts_by_author_path(author: member) end - end scenario "twitter link" do diff --git a/spec/features/signin_spec.rb b/spec/features/signin_spec.rb index b9cc183ec..41aa1ecd1 100644 --- a/spec/features/signin_spec.rb +++ b/spec/features/signin_spec.rb @@ -1,6 +1,5 @@ require 'rails_helper' - feature "signin", js: true do let(:member) { create :member } let(:recipient) { create :member } diff --git a/spec/features/signout_spec.rb b/spec/features/signout_spec.rb index 2d5d1a230..433286078 100644 --- a/spec/features/signout_spec.rb +++ b/spec/features/signout_spec.rb @@ -26,5 +26,4 @@ feature "signout" do expect(current_path).to eq new_member_session_path end end - end diff --git a/spec/features/signup_spec.rb b/spec/features/signup_spec.rb index d3ebaad8d..6afb28119 100644 --- a/spec/features/signup_spec.rb +++ b/spec/features/signup_spec.rb @@ -1,7 +1,6 @@ require 'rails_helper' feature "signup", js: true do - scenario "sign up for new account from top menubar" do visit crops_path # something other than front page, which has multiple signup links click_link 'Sign up' diff --git a/spec/helpers/harvests_helper_spec.rb b/spec/helpers/harvests_helper_spec.rb index c65d8b36e..15cafc9c5 100644 --- a/spec/helpers/harvests_helper_spec.rb +++ b/spec/helpers/harvests_helper_spec.rb @@ -2,7 +2,6 @@ require 'rails_helper' describe HarvestsHelper do describe "display_quantity" do - it "blank" do harvest = FactoryGirl.create(:harvest, quantity: nil, @@ -74,6 +73,5 @@ describe HarvestsHelper do result = helper.display_quantity(harvest) result.should eq '3 bunches, weighing 3 kg' end - end end diff --git a/spec/helpers/notifications_helper_spec.rb b/spec/helpers/notifications_helper_spec.rb index abbc17b0b..d79ea409d 100644 --- a/spec/helpers/notifications_helper_spec.rb +++ b/spec/helpers/notifications_helper_spec.rb @@ -2,7 +2,6 @@ require 'rails_helper' describe NotificationsHelper do describe "reply_link" do - let(:member) { FactoryGirl.create(:member) } it "replies to PMs with PMs" do @@ -23,7 +22,5 @@ describe NotificationsHelper do post_id: notification.post.id ) end - - end end diff --git a/spec/helpers/plantings_helper_spec.rb b/spec/helpers/plantings_helper_spec.rb index b7acfaaca..9485af81d 100644 --- a/spec/helpers/plantings_helper_spec.rb +++ b/spec/helpers/plantings_helper_spec.rb @@ -2,7 +2,6 @@ require 'rails_helper' describe PlantingsHelper do describe "display_planting" do - let!(:member) { FactoryGirl.build(:member, login_name: 'crop_lady') } it "does not have a quantity nor a planted from value provided" do @@ -67,8 +66,6 @@ describe PlantingsHelper do result = helper.display_planting(planting) expect(result).to eq "crop_lady planted 1 seed." end - end - end end diff --git a/spec/lib/haml/filters/escaped_markdown_spec.rb b/spec/lib/haml/filters/escaped_markdown_spec.rb index 60066160f..23f275f96 100644 --- a/spec/lib/haml/filters/escaped_markdown_spec.rb +++ b/spec/lib/haml/filters/escaped_markdown_spec.rb @@ -19,5 +19,4 @@ describe 'Haml::Filters::Escaped_Markdown' do rendered = Haml::Filters::EscapedMarkdown.render("[#{@crop.name}](crop)") rendered.should match /<a href="/ end - end diff --git a/spec/lib/haml/filters/growstuff_markdown_spec.rb b/spec/lib/haml/filters/growstuff_markdown_spec.rb index 5bc86e131..ecefbadd2 100644 --- a/spec/lib/haml/filters/growstuff_markdown_spec.rb +++ b/spec/lib/haml/filters/growstuff_markdown_spec.rb @@ -28,7 +28,6 @@ def output_member_link(member, name=nil) end end - describe 'Haml::Filters::Growstuff_Markdown' do it 'is registered as the handler for :growstuff_markdown' do Haml::Filters::defined['growstuff_markdown'].should == @@ -97,7 +96,6 @@ describe 'Haml::Filters::Growstuff_Markdown' do rendered.should match /\[#{@member.login_name}\]\(member\)/ end - it 'converts @ member links' do @member = FactoryGirl.create(:member) rendered = Haml::Filters::GrowstuffMarkdown.render("Hey @#{@member.login_name}! What's up") @@ -122,5 +120,4 @@ describe 'Haml::Filters::Growstuff_Markdown' do rendered = Haml::Filters::GrowstuffMarkdown.render("Hey \\@#{@member.login_name}! What's up") rendered.should match /Hey @#{@member.login_name}!/ end - end diff --git a/spec/mailers/notifier_spec.rb b/spec/mailers/notifier_spec.rb index ce552f99b..c766528b7 100644 --- a/spec/mailers/notifier_spec.rb +++ b/spec/mailers/notifier_spec.rb @@ -1,7 +1,6 @@ require "rails_helper" describe Notifier do - describe "notifications" do let(:notification) { FactoryGirl.create(:notification) } let(:mail) { Notifier.notify(notification) } @@ -42,10 +41,8 @@ describe Notifier do it 'includes the new harvest URL' do mail.body.encoded.should match new_harvest_path end - end - describe "new crop request" do let(:member) { FactoryGirl.create(:crop_wrangling_member) } let(:crop) { FactoryGirl.create(:crop_request) } @@ -94,7 +91,6 @@ describe Notifier do expect(mail.body.encoded).to match "#{new_harvest_url}\\?crop_id=#{crop.id}" expect(mail.body.encoded).to match "#{new_seed_url}\\?crop_id=#{crop.id}" end - end describe "crop rejected" do @@ -122,6 +118,4 @@ describe Notifier do expect(mail.body.encoded).to match "Totally fake" end end - - end diff --git a/spec/models/ability_spec.rb b/spec/models/ability_spec.rb index 9c378e0a0..4bb68c674 100644 --- a/spec/models/ability_spec.rb +++ b/spec/models/ability_spec.rb @@ -2,12 +2,10 @@ require 'rails_helper' require 'cancan/matchers' describe Ability do - let(:member) { FactoryGirl.create(:member) } let(:ability) { Ability.new(member) } context "notifications" do - it 'member can view their own notifications' do notification = FactoryGirl.create(:notification, recipient: member) ability.should be_able_to(:read, notification) @@ -38,7 +36,6 @@ describe Ability do end context "crop wrangling" do - let(:crop) { FactoryGirl.create(:crop) } context "standard member" do @@ -57,7 +54,6 @@ describe Ability do end context "crop wrangler" do - let(:role) { FactoryGirl.create(:crop_wrangler) } before(:each) do @@ -81,7 +77,6 @@ describe Ability do end context "products" do - let(:product) { FactoryGirl.create(:product) } context "standard member" do @@ -91,11 +86,9 @@ describe Ability do ability.should_not be_able_to(:update, product) ability.should_not be_able_to(:destroy, product) end - end context "admin" do - let(:role) { FactoryGirl.create(:admin) } before do @@ -122,7 +115,6 @@ describe Ability do end context "orders" do - let(:order) { FactoryGirl.create(:order, member: member) } let(:strangers_order) { FactoryGirl.create(:order, member: FactoryGirl.create(:member)) } @@ -208,12 +200,9 @@ describe Ability do it "can't delete items from completed orders" do ability.should_not be_able_to(:destroy, completed_order_item) end - - end context "admin" do - let(:role) { FactoryGirl.create(:admin) } before do @@ -239,12 +228,10 @@ describe Ability do it "cannot delete orders" do ability.should_not be_able_to(:destroy, order) end - end end context 'account details' do - let(:account) { member.account } context 'ordinary member' do @@ -259,7 +246,6 @@ describe Ability do end context 'admin' do - let(:role) { FactoryGirl.create(:admin) } before do @@ -274,13 +260,10 @@ describe Ability do ability.should be_able_to(:update, account) ability.should be_able_to(:destroy, account) end - end - end context 'plant parts' do - let(:plant_part) { FactoryGirl.create(:plant_part) } context 'ordinary member' do @@ -295,7 +278,6 @@ describe Ability do end context 'admin' do - let(:role) { FactoryGirl.create(:admin) } before do @@ -318,8 +300,6 @@ describe Ability do @harvest = FactoryGirl.create(:harvest, plant_part: plant_part) ability.should_not be_able_to(:destroy, plant_part) end - end end - end diff --git a/spec/models/account_spec.rb b/spec/models/account_spec.rb index 1274a825e..52caf725f 100644 --- a/spec/models/account_spec.rb +++ b/spec/models/account_spec.rb @@ -1,7 +1,6 @@ require 'rails_helper' describe Account do - let(:member) { FactoryGirl.create(:member) } it "auto-creates an account detail record when a member is created" do @@ -25,5 +24,4 @@ describe Account do member.account.paid_until = @time member.account.paid_until_string.should eq @time.to_s end - end diff --git a/spec/models/alternate_name_spec.rb b/spec/models/alternate_name_spec.rb index 5e12b02de..ec5684bcb 100644 --- a/spec/models/alternate_name_spec.rb +++ b/spec/models/alternate_name_spec.rb @@ -18,5 +18,4 @@ describe AlternateName do expect(crop.alternate_names).to include an expect(crop.alternate_names).to include an2 end - end diff --git a/spec/models/authentication_spec.rb b/spec/models/authentication_spec.rb index 0159361ff..10f6ac3d6 100644 --- a/spec/models/authentication_spec.rb +++ b/spec/models/authentication_spec.rb @@ -1,7 +1,6 @@ require 'rails_helper' describe Authentication do - it 'creates an authentication' do @auth = FactoryGirl.create(:authentication) @auth.should be_an_instance_of Authentication diff --git a/spec/models/comment_spec.rb b/spec/models/comment_spec.rb index d26653f0d..0badd5be6 100644 --- a/spec/models/comment_spec.rb +++ b/spec/models/comment_spec.rb @@ -1,9 +1,7 @@ require 'rails_helper' describe Comment do - context "basic" do - let(:comment) { FactoryGirl.create(:comment) } it "belongs to a post" do @@ -16,7 +14,6 @@ describe Comment do end context "notifications" do - let(:comment) { FactoryGirl.create(:comment) } it "sends a notification when a comment is posted" do @@ -60,5 +57,4 @@ describe Comment do Comment.post_order.should eq [@c1, @c2] end end - end diff --git a/spec/models/crop_spec.rb b/spec/models/crop_spec.rb index 6ff1bd47b..fbde31504 100644 --- a/spec/models/crop_spec.rb +++ b/spec/models/crop_spec.rb @@ -2,7 +2,6 @@ require 'rails_helper' describe Crop do context 'all fields present' do - let(:crop) { FactoryGirl.create(:tomato) } it 'should save a basic crop' do @@ -51,7 +50,6 @@ describe Crop do end context 'popularity' do - let(:tomato) { FactoryGirl.create(:tomato) } let(:maize) { FactoryGirl.create(:maize) } let(:cucumber) { FactoryGirl.create(:crop, name: 'cucumber') } @@ -66,7 +64,6 @@ describe Crop do FactoryGirl.create_list(:planting, 10, crop: tomato) Crop.popular.first.should eq tomato end - end it 'finds a default scientific name' do @@ -149,7 +146,6 @@ describe Crop do end end - context 'with no plantings or harvests' do it 'has no default photo' do @crop.default_photo.should eq nil @@ -158,7 +154,6 @@ describe Crop do end context 'sunniness' do - let(:crop) { FactoryGirl.create(:tomato) } it 'returns a hash of sunniness values' do @@ -186,7 +181,6 @@ describe Crop do end context 'planted_from' do - let(:crop) { FactoryGirl.create(:tomato) } it 'returns a hash of sunniness values' do @@ -214,7 +208,6 @@ describe Crop do end context 'popular plant parts' do - let(:crop) { FactoryGirl.create(:tomato) } it 'returns a hash of plant_part values' do @@ -244,7 +237,6 @@ describe Crop do ) crop.popular_plant_parts.should == { @fruit => 2, @seed => 1, @root => 1 } end - end context 'interesting' do @@ -295,7 +287,6 @@ describe Crop do Crop.interesting.should include @crop1 Crop.interesting.should_not include @crop2 Crop.interesting.size.should == 1 - end it 'ignores crops without photos' do @@ -322,7 +313,6 @@ describe Crop do Crop.interesting.should_not include @crop2 Crop.interesting.size.should == 1 end - end context "harvests" do @@ -364,7 +354,6 @@ describe Crop do end context "search" do - let(:mushroom) { FactoryGirl.create(:crop, name: 'mushroom') } before do @@ -396,7 +385,6 @@ describe Crop do end context "csv loading" do - before(:each) do # don't use 'let' for this -- we need to actually create it, # regardless of whether it's used. @@ -404,7 +392,6 @@ describe Crop do end context "scientific names" do - it "adds a scientific name to a crop that has none" do tomato = FactoryGirl.create(:tomato) expect(tomato.scientific_names.size).to eq 0 @@ -469,7 +456,6 @@ describe Crop do tomato.add_scientific_names_from_csv("Baz, Quux") # multiple spaces expect(tomato.scientific_names.size).to eq 4 end - end # scientific names context "alternate names" do @@ -571,9 +557,7 @@ describe Crop do expect(loaded.name).to eq "tomato" expect(loaded.en_wikipedia_url).to eq 'http://en.wikipedia.org/wiki/Tomato' expect(loaded.creator).to eq @cropbot - end - end context "crop-post association" do diff --git a/spec/models/follow_spec.rb b/spec/models/follow_spec.rb index 6005583f8..2fd0b6b80 100644 --- a/spec/models/follow_spec.rb +++ b/spec/models/follow_spec.rb @@ -1,7 +1,6 @@ require 'spec_helper' describe Follow do - before(:each) do @member1 = FactoryGirl.create(:member) @member2 = FactoryGirl.create(:member) @@ -21,7 +20,6 @@ describe Follow do end context "when follow is created" do - before (:each) do @follow = Follow.create(follower_id: @member1.id, followed_id: @member2.id) end @@ -41,5 +39,4 @@ describe Follow do expect(@member2.followers).not_to include(@member1) end end - end diff --git a/spec/models/forum_spec.rb b/spec/models/forum_spec.rb index 72fafd31c..4c1c42275 100644 --- a/spec/models/forum_spec.rb +++ b/spec/models/forum_spec.rb @@ -1,7 +1,6 @@ require 'rails_helper' describe Forum do - let(:forum) { FactoryGirl.create(:forum) } it "belongs to an owner" do @@ -27,5 +26,4 @@ describe Forum do @post2 = FactoryGirl.create(:forum_post, forum: forum, created_at: 1.day.ago) forum.posts.first.should eq @post2 end - end diff --git a/spec/models/garden_spec.rb b/spec/models/garden_spec.rb index ac93c2a3f..b56ac2056 100644 --- a/spec/models/garden_spec.rb +++ b/spec/models/garden_spec.rb @@ -1,7 +1,6 @@ require 'rails_helper' describe Garden do - let(:owner) { FactoryGirl.create(:member) } let(:garden) { FactoryGirl.create(:garden, owner: owner) } @@ -37,7 +36,6 @@ describe Garden do end context "featured plantings" do - let(:tomato) { FactoryGirl.create(:tomato) } let(:maize) { FactoryGirl.create(:maize) } let(:chard) { FactoryGirl.create(:chard) } @@ -50,7 +48,6 @@ describe Garden do @p2 = FactoryGirl.create(:planting, crop: maize, garden: garden) garden.featured_plantings.should eq [@p2, @p1] - end it "should fetch most recent 4 featured plantings" do @@ -153,7 +150,6 @@ describe Garden do end context 'active scopes' do - let(:active) { FactoryGirl.create(:garden) } let(:inactive) { FactoryGirl.create(:inactive_garden) } @@ -204,7 +200,6 @@ describe Garden do end context 'photos' do - let(:garden) { FactoryGirl.create(:garden) } let(:photo) { FactoryGirl.create(:photo) } @@ -232,5 +227,4 @@ describe Garden do garden.default_photo.should eq @photo2 end end - end diff --git a/spec/models/harvest_spec.rb b/spec/models/harvest_spec.rb index 62e846c7a..f4ef03c04 100644 --- a/spec/models/harvest_spec.rb +++ b/spec/models/harvest_spec.rb @@ -1,7 +1,6 @@ require 'rails_helper' describe Harvest do - it "has an owner" do harvest = FactoryGirl.create(:harvest) harvest.owner.should be_an_instance_of Member @@ -147,7 +146,6 @@ describe Harvest do end context "stringification" do - let(:crop) { FactoryGirl.create(:crop, name: "apricot") } it "apricots" do @@ -228,11 +226,9 @@ describe Harvest do weight_unit: 'kg') @h.to_s.should eq "10 bushels of apricots weighing 100 kg" end - end context 'photos' do - before :each do @harvest = FactoryGirl.create(:harvest) end @@ -288,7 +284,6 @@ describe Harvest do end end - context 'and a second photo' do before :each do @photo2 = FactoryGirl.create(:photo) diff --git a/spec/models/member_spec.rb b/spec/models/member_spec.rb index 408c38376..e3dc5d2f0 100644 --- a/spec/models/member_spec.rb +++ b/spec/models/member_spec.rb @@ -1,9 +1,7 @@ require 'rails_helper' describe 'member' do - context 'valid member' do - let(:member) { FactoryGirl.create(:member) } it 'should be fetchable from the database' do @@ -91,11 +89,9 @@ describe 'member' do member.latitude.should be_nil member.longitude.should be_nil end - end context 'no TOS agreement' do - let(:member) { FactoryGirl.build(:no_tos_member) } it "should refuse to save a member who hasn't agreed to the TOS" do @@ -188,7 +184,6 @@ describe 'member' do end context 'roles' do - let(:member) { FactoryGirl.create(:member) } let(:role) { FactoryGirl.create(:role) } @@ -281,9 +276,7 @@ describe 'member' do @member3.updated_at = 1.days.ago Member.interesting.should eq [ @member3, @member2, @member1 ] - end - end context 'orders' do @@ -303,7 +296,6 @@ describe 'member' do end context "paid accounts" do - let(:member) { FactoryGirl.create(:member) } it "recognises a permanent paid account" do @@ -343,11 +335,9 @@ describe 'member' do member.account.paid_until = Time.zone.now + 1.month member.is_paid?.should be(false) end - end context "update account" do - let(:product) { FactoryGirl.create(:product, paid_months: 3 )} @@ -407,7 +397,5 @@ describe 'member' do expect(member1.get_follow(member3)).to be_nil end end - end - end diff --git a/spec/models/notification_spec.rb b/spec/models/notification_spec.rb index e38444d5d..04cb028f3 100644 --- a/spec/models/notification_spec.rb +++ b/spec/models/notification_spec.rb @@ -1,7 +1,6 @@ require 'rails_helper' describe Notification do - let(:notification) { FactoryGirl.create(:notification) } it "belongs to a post" do @@ -56,5 +55,4 @@ describe Notification do notification = FactoryGirl.create(:notification, subject: " ") notification.subject.should == "(no subject)" end - end diff --git a/spec/models/order_item_spec.rb b/spec/models/order_item_spec.rb index 67f86415c..a6ede25d8 100644 --- a/spec/models/order_item_spec.rb +++ b/spec/models/order_item_spec.rb @@ -1,7 +1,6 @@ require 'rails_helper' describe OrderItem do - let(:order_item) { FactoryGirl.create(:order_item) } it "has an order and a product" do @@ -24,5 +23,4 @@ describe OrderItem do @order_item2 = FactoryGirl.build(:order_item, order: @order) @order_item2.should_not be_valid end - end diff --git a/spec/models/order_spec.rb b/spec/models/order_spec.rb index 0f12d9b2f..89c29785d 100644 --- a/spec/models/order_spec.rb +++ b/spec/models/order_spec.rb @@ -81,7 +81,6 @@ describe Order do quantity: 1, amount: 1111 }] - end context "referral codes" do @@ -126,7 +125,5 @@ describe Order do order = FactoryGirl.create(:order, referral_code: 'baz') Order.search(by: 'referral_code', for: 'baz').should eq [order] end - end - end diff --git a/spec/models/photo_spec.rb b/spec/models/photo_spec.rb index bd6335be2..5ec32bf73 100644 --- a/spec/models/photo_spec.rb +++ b/spec/models/photo_spec.rb @@ -1,7 +1,6 @@ require 'rails_helper' describe Photo do - describe 'add/delete functionality' do let(:photo) { FactoryGirl.create(:photo) } let(:planting) { FactoryGirl.create(:planting) } @@ -105,9 +104,7 @@ describe Photo do planting.destroy # photo is still used by the harvest expect(photo).to be_an_instance_of Photo end - end # removing photos - end # add/delete functionality describe 'flickr_metadata' do diff --git a/spec/models/plant_part_spec.rb b/spec/models/plant_part_spec.rb index ef3705ef2..bd2ee6407 100644 --- a/spec/models/plant_part_spec.rb +++ b/spec/models/plant_part_spec.rb @@ -35,5 +35,4 @@ describe PlantPart do ) @pp1.crops.should eq [@maize] end - end diff --git a/spec/models/planting_spec.rb b/spec/models/planting_spec.rb index 268238672..e4a5f11b7 100644 --- a/spec/models/planting_spec.rb +++ b/spec/models/planting_spec.rb @@ -1,7 +1,6 @@ require 'rails_helper' describe Planting do - let(:crop) { FactoryGirl.create(:tomato) } let(:garden_owner) { FactoryGirl.create(:member) } let(:garden) { FactoryGirl.create(:garden, owner: garden_owner) } @@ -123,7 +122,6 @@ describe Planting do end context 'sunniness' do - let(:planting) { FactoryGirl.create(:sunny_planting) } it 'should have a sunniness value' do @@ -169,7 +167,6 @@ describe Planting do # we decided that all the tests for the planting/photo association would # be done on this side, not on the photos side context 'photos' do - let(:planting) { FactoryGirl.create(:planting) } let(:photo) { FactoryGirl.create(:photo) } @@ -278,7 +275,6 @@ describe Planting do Planting.interesting(3, false).size.should eq 3 end end - end # interesting plantings context "finished" do diff --git a/spec/models/post_spec.rb b/spec/models/post_spec.rb index b63daa97d..375b56586 100644 --- a/spec/models/post_spec.rb +++ b/spec/models/post_spec.rb @@ -1,7 +1,6 @@ require 'rails_helper' describe Post do - let(:member) { FactoryGirl.create(:member) } it "should be sorted in reverse order" do @@ -66,7 +65,6 @@ describe Post do end context "recent activity" do - before do Time.stub(now: Time.now) end diff --git a/spec/models/product_spec.rb b/spec/models/product_spec.rb index af1a02ba5..6526ecf27 100644 --- a/spec/models/product_spec.rb +++ b/spec/models/product_spec.rb @@ -1,10 +1,8 @@ require 'rails_helper' describe Product do - it "stringifies using the name" do @product = FactoryGirl.create(:product) @product.to_s.should eq @product.name end - end diff --git a/spec/models/scientific_name_spec.rb b/spec/models/scientific_name_spec.rb index e506acccf..b4b498db0 100644 --- a/spec/models/scientific_name_spec.rb +++ b/spec/models/scientific_name_spec.rb @@ -2,7 +2,6 @@ require 'rails_helper' describe ScientificName do context 'all fields present' do - let(:sn) { FactoryGirl.create(:zea_mays) } it 'should save a basic scientific name' do diff --git a/spec/models/seed_spec.rb b/spec/models/seed_spec.rb index eb0dcadb9..5e6a9ff19 100644 --- a/spec/models/seed_spec.rb +++ b/spec/models/seed_spec.rb @@ -1,7 +1,6 @@ require 'rails_helper' describe Seed do - let(:seed) { FactoryGirl.build(:seed) } it 'should save a basic seed' do @@ -85,7 +84,6 @@ describe Seed do @untradable = FactoryGirl.create(:untradable_seed) Seed.tradable.should include @tradable Seed.tradable.should_not include @untradable - end end @@ -131,10 +129,8 @@ describe Seed do end end - context 'interesting' do it 'lists interesting seeds' do - # to be interesting a seed must: # 1) be tradable # 2) the owner must have a location set @@ -152,5 +148,4 @@ describe Seed do Seed.interesting.size.should == 1 end end - end diff --git a/spec/routing/account_types_routing_spec.rb b/spec/routing/account_types_routing_spec.rb index 83dba34a5..8402dd727 100644 --- a/spec/routing/account_types_routing_spec.rb +++ b/spec/routing/account_types_routing_spec.rb @@ -2,7 +2,6 @@ require "rails_helper" describe AccountTypesController do describe "routing" do - it "routes to #index" do get("/account_types").should route_to("account_types#index") end @@ -30,6 +29,5 @@ describe AccountTypesController do it "routes to #destroy" do delete("/account_types/1").should route_to("account_types#destroy", id: "1") end - end end diff --git a/spec/routing/authentications_routing_spec.rb b/spec/routing/authentications_routing_spec.rb index 75f86fd49..0601b9924 100644 --- a/spec/routing/authentications_routing_spec.rb +++ b/spec/routing/authentications_routing_spec.rb @@ -9,6 +9,5 @@ describe AuthenticationsController do it "routes to #destroy" do delete("/authentications/1").should route_to("authentications#destroy", id: "1") end - end end diff --git a/spec/routing/comments_routing_spec.rb b/spec/routing/comments_routing_spec.rb index b5466af43..5390ab066 100644 --- a/spec/routing/comments_routing_spec.rb +++ b/spec/routing/comments_routing_spec.rb @@ -2,7 +2,6 @@ require "rails_helper" describe CommentsController do describe "routing" do - it "routes to #index" do get("/comments").should route_to("comments#index") end @@ -30,6 +29,5 @@ describe CommentsController do it "routes to #destroy" do delete("/comments/1").should route_to("comments#destroy", id: "1") end - end end diff --git a/spec/routing/crops_routing_spec.rb b/spec/routing/crops_routing_spec.rb index 95985917f..97c1a874c 100644 --- a/spec/routing/crops_routing_spec.rb +++ b/spec/routing/crops_routing_spec.rb @@ -2,7 +2,6 @@ require "rails_helper" describe CropsController do describe "routing" do - it "routes to #index" do get("/crops").should route_to("crops#index") end @@ -30,6 +29,5 @@ describe CropsController do it "routes to #destroy" do delete("/crops/1").should route_to("crops#destroy", id: "1") end - end end diff --git a/spec/routing/follows_routing_spec.rb b/spec/routing/follows_routing_spec.rb index 4158502c7..ddb01e00c 100644 --- a/spec/routing/follows_routing_spec.rb +++ b/spec/routing/follows_routing_spec.rb @@ -2,7 +2,6 @@ require "spec_helper" describe FollowsController do describe "routing" do - it "routes to #create" do post("/follows").should route_to("follows#create") end @@ -10,6 +9,5 @@ describe FollowsController do it "routes to #destroy" do delete("/follows/1").should route_to("follows#destroy", id: "1") end - end end diff --git a/spec/routing/forums_routing_spec.rb b/spec/routing/forums_routing_spec.rb index 12730c556..9ce6f427b 100644 --- a/spec/routing/forums_routing_spec.rb +++ b/spec/routing/forums_routing_spec.rb @@ -2,7 +2,6 @@ require "rails_helper" describe ForumsController do describe "routing" do - it "routes to #index" do get("/forums").should route_to("forums#index") end @@ -30,6 +29,5 @@ describe ForumsController do it "routes to #destroy" do delete("/forums/1").should route_to("forums#destroy", id: "1") end - end end diff --git a/spec/routing/gardens_routing_spec.rb b/spec/routing/gardens_routing_spec.rb index 5270195ec..6888f099f 100644 --- a/spec/routing/gardens_routing_spec.rb +++ b/spec/routing/gardens_routing_spec.rb @@ -2,7 +2,6 @@ require "rails_helper" describe GardensController do describe "routing" do - it "routes to #index" do get("/gardens").should route_to("gardens#index") end @@ -30,6 +29,5 @@ describe GardensController do it "routes to #destroy" do delete("/gardens/1").should route_to("gardens#destroy", id: "1") end - end end diff --git a/spec/routing/harvests_routing_spec.rb b/spec/routing/harvests_routing_spec.rb index 4d532bcfc..c6890df15 100644 --- a/spec/routing/harvests_routing_spec.rb +++ b/spec/routing/harvests_routing_spec.rb @@ -2,7 +2,6 @@ require "rails_helper" describe HarvestsController do describe "routing" do - it "routes to #index" do get("/harvests").should route_to("harvests#index") end @@ -30,6 +29,5 @@ describe HarvestsController do it "routes to #destroy" do delete("/harvests/1").should route_to("harvests#destroy", id: "1") end - end end diff --git a/spec/routing/notifications_routing_spec.rb b/spec/routing/notifications_routing_spec.rb index d3c2b9f61..bb7335e1b 100644 --- a/spec/routing/notifications_routing_spec.rb +++ b/spec/routing/notifications_routing_spec.rb @@ -2,7 +2,6 @@ require "rails_helper" describe NotificationsController do describe "routing" do - it "routes to #index" do get("/notifications").should route_to("notifications#index") end @@ -30,6 +29,5 @@ describe NotificationsController do it "routes to #destroy" do delete("/notifications/1").should route_to("notifications#destroy", id: "1") end - end end diff --git a/spec/routing/order_items_routing_spec.rb b/spec/routing/order_items_routing_spec.rb index 6562e3a17..7487cb9f5 100644 --- a/spec/routing/order_items_routing_spec.rb +++ b/spec/routing/order_items_routing_spec.rb @@ -2,7 +2,6 @@ require "rails_helper" describe OrderItemsController do describe "routing" do - it "routes to #index" do get("/order_items").should route_to("order_items#index") end @@ -30,6 +29,5 @@ describe OrderItemsController do it "routes to #destroy" do delete("/order_items/1").should route_to("order_items#destroy", id: "1") end - end end diff --git a/spec/routing/orders_routing_spec.rb b/spec/routing/orders_routing_spec.rb index 61410745e..38184ef33 100644 --- a/spec/routing/orders_routing_spec.rb +++ b/spec/routing/orders_routing_spec.rb @@ -2,7 +2,6 @@ require "rails_helper" describe OrdersController do describe "routing" do - it "routes to #index" do get("/orders").should route_to("orders#index") end @@ -30,6 +29,5 @@ describe OrdersController do it "routes to #destroy" do delete("/orders/1").should route_to("orders#destroy", id: "1") end - end end diff --git a/spec/routing/photos_routing_spec.rb b/spec/routing/photos_routing_spec.rb index fb96758c2..a645d0a60 100644 --- a/spec/routing/photos_routing_spec.rb +++ b/spec/routing/photos_routing_spec.rb @@ -2,7 +2,6 @@ require "rails_helper" describe PhotosController do describe "routing" do - it "routes to #index" do get("/photos").should route_to("photos#index") end @@ -30,6 +29,5 @@ describe PhotosController do it "routes to #destroy" do delete("/photos/1").should route_to("photos#destroy", id: "1") end - end end diff --git a/spec/routing/plant_parts_routing_spec.rb b/spec/routing/plant_parts_routing_spec.rb index 4a4137cd6..966047f3f 100644 --- a/spec/routing/plant_parts_routing_spec.rb +++ b/spec/routing/plant_parts_routing_spec.rb @@ -2,7 +2,6 @@ require "rails_helper" describe PlantPartsController do describe "routing" do - it "routes to #index" do get("/plant_parts").should route_to("plant_parts#index") end @@ -30,6 +29,5 @@ describe PlantPartsController do it "routes to #destroy" do delete("/plant_parts/1").should route_to("plant_parts#destroy", id: "1") end - end end diff --git a/spec/routing/plantings_routing_spec.rb b/spec/routing/plantings_routing_spec.rb index 1be8416d4..473fe827e 100644 --- a/spec/routing/plantings_routing_spec.rb +++ b/spec/routing/plantings_routing_spec.rb @@ -2,7 +2,6 @@ require "rails_helper" describe PlantingsController do describe "routing" do - it "routes to #index" do get("/plantings").should route_to("plantings#index") end @@ -30,6 +29,5 @@ describe PlantingsController do it "routes to #destroy" do delete("/plantings/1").should route_to("plantings#destroy", id: "1") end - end end diff --git a/spec/routing/products_routing_spec.rb b/spec/routing/products_routing_spec.rb index 189bbe59a..15166a805 100644 --- a/spec/routing/products_routing_spec.rb +++ b/spec/routing/products_routing_spec.rb @@ -2,7 +2,6 @@ require "rails_helper" describe ProductsController do describe "routing" do - it "routes to #index" do get("/products").should route_to("products#index") end @@ -30,6 +29,5 @@ describe ProductsController do it "routes to #destroy" do delete("/products/1").should route_to("products#destroy", id: "1") end - end end diff --git a/spec/routing/roles_routing_spec.rb b/spec/routing/roles_routing_spec.rb index 752bd7c49..7b6469efb 100644 --- a/spec/routing/roles_routing_spec.rb +++ b/spec/routing/roles_routing_spec.rb @@ -2,7 +2,6 @@ require "rails_helper" describe RolesController do describe "routing" do - it "routes to #index" do get("/roles").should route_to("roles#index") end @@ -30,6 +29,5 @@ describe RolesController do it "routes to #destroy" do delete("/roles/1").should route_to("roles#destroy", id: "1") end - end end diff --git a/spec/routing/scientific_names_routing_spec.rb b/spec/routing/scientific_names_routing_spec.rb index f5bfa780e..7bbbfa764 100644 --- a/spec/routing/scientific_names_routing_spec.rb +++ b/spec/routing/scientific_names_routing_spec.rb @@ -2,7 +2,6 @@ require "rails_helper" describe ScientificNamesController do describe "routing" do - it "routes to #index" do get("/scientific_names").should route_to("scientific_names#index") end @@ -30,6 +29,5 @@ describe ScientificNamesController do it "routes to #destroy" do delete("/scientific_names/1").should route_to("scientific_names#destroy", id: "1") end - end end diff --git a/spec/routing/seeds_routing_spec.rb b/spec/routing/seeds_routing_spec.rb index 5ac7ae02c..74f4aff64 100644 --- a/spec/routing/seeds_routing_spec.rb +++ b/spec/routing/seeds_routing_spec.rb @@ -2,7 +2,6 @@ require "rails_helper" describe SeedsController do describe "routing" do - it "routes to #index" do get("/seeds").should route_to("seeds#index") end @@ -30,6 +29,5 @@ describe SeedsController do it "routes to #destroy" do delete("/seeds/1").should route_to("seeds#destroy", id: "1") end - end end diff --git a/spec/routing/updates_routing_spec.rb b/spec/routing/updates_routing_spec.rb index 32be13b86..966647515 100644 --- a/spec/routing/updates_routing_spec.rb +++ b/spec/routing/updates_routing_spec.rb @@ -2,7 +2,6 @@ require "rails_helper" describe PostsController do describe "routing" do - it "routes to #index" do get("/posts").should route_to("posts#index") end @@ -30,6 +29,5 @@ describe PostsController do it "routes to #destroy" do delete("/posts/1").should route_to("posts#destroy", id: "1") end - end end diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index c6b0b0601..7b314e901 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -85,5 +85,4 @@ RSpec.configure do |config| # test failures related to randomization by passing the same `--seed` value # as the one that triggered the failure. Kernel.srand config.seed - end diff --git a/spec/support/database_cleaner.rb b/spec/support/database_cleaner.rb index 36c994e6f..e0dbc9aa8 100644 --- a/spec/support/database_cleaner.rb +++ b/spec/support/database_cleaner.rb @@ -1,5 +1,4 @@ RSpec.configure do |config| - config.before(:suite) do DatabaseCleaner.clean_with(:truncation) end @@ -19,5 +18,4 @@ RSpec.configure do |config| config.after(:each) do DatabaseCleaner.clean end - end diff --git a/spec/support/feature_helpers.rb b/spec/support/feature_helpers.rb index bf23c2854..f3562b07c 100644 --- a/spec/support/feature_helpers.rb +++ b/spec/support/feature_helpers.rb @@ -1,5 +1,4 @@ module FeatureHelpers - def fill_autocomplete(field, options={}) fill_in field, with: options[:with] @@ -12,7 +11,6 @@ module FeatureHelpers selector = %Q{ul.ui-autocomplete li.ui-menu-item a:contains("#{select}")} page.execute_script %Q{ $('#{selector}').mouseenter().click() } end - end RSpec.configure do |config| diff --git a/spec/views/account_types/edit.html.haml_spec.rb b/spec/views/account_types/edit.html.haml_spec.rb index 6ab88a3b7..c53272c0e 100644 --- a/spec/views/account_types/edit.html.haml_spec.rb +++ b/spec/views/account_types/edit.html.haml_spec.rb @@ -10,10 +10,6 @@ ## If you submit a pull request containing new view or controller tests, it will not be ## merged. - - - - require 'rails_helper' describe "account_types/edit" do diff --git a/spec/views/account_types/index.html.haml_spec.rb b/spec/views/account_types/index.html.haml_spec.rb index fb583fc5d..ca86626f3 100644 --- a/spec/views/account_types/index.html.haml_spec.rb +++ b/spec/views/account_types/index.html.haml_spec.rb @@ -10,10 +10,6 @@ ## If you submit a pull request containing new view or controller tests, it will not be ## merged. - - - - require 'rails_helper' describe "account_types/index" do diff --git a/spec/views/account_types/new.html.haml_spec.rb b/spec/views/account_types/new.html.haml_spec.rb index ea3864926..01e1f025a 100644 --- a/spec/views/account_types/new.html.haml_spec.rb +++ b/spec/views/account_types/new.html.haml_spec.rb @@ -10,10 +10,6 @@ ## If you submit a pull request containing new view or controller tests, it will not be ## merged. - - - - require 'rails_helper' describe "account_types/new" do diff --git a/spec/views/account_types/show.html.haml_spec.rb b/spec/views/account_types/show.html.haml_spec.rb index e04be6b75..adad83ad8 100644 --- a/spec/views/account_types/show.html.haml_spec.rb +++ b/spec/views/account_types/show.html.haml_spec.rb @@ -10,10 +10,6 @@ ## If you submit a pull request containing new view or controller tests, it will not be ## merged. - - - - require 'rails_helper' describe "account_types/show" do diff --git a/spec/views/accounts/edit.html.haml_spec.rb b/spec/views/accounts/edit.html.haml_spec.rb index bff632495..4b278acc2 100644 --- a/spec/views/accounts/edit.html.haml_spec.rb +++ b/spec/views/accounts/edit.html.haml_spec.rb @@ -10,10 +10,6 @@ ## If you submit a pull request containing new view or controller tests, it will not be ## merged. - - - - require 'rails_helper' describe "accounts/edit" do diff --git a/spec/views/accounts/index.html.haml_spec.rb b/spec/views/accounts/index.html.haml_spec.rb index cde04c48b..192c86dab 100644 --- a/spec/views/accounts/index.html.haml_spec.rb +++ b/spec/views/accounts/index.html.haml_spec.rb @@ -10,10 +10,6 @@ ## If you submit a pull request containing new view or controller tests, it will not be ## merged. - - - - require 'rails_helper' describe "accounts/index" do diff --git a/spec/views/accounts/new.html.haml_spec.rb b/spec/views/accounts/new.html.haml_spec.rb index 669017206..bc2b711fa 100644 --- a/spec/views/accounts/new.html.haml_spec.rb +++ b/spec/views/accounts/new.html.haml_spec.rb @@ -10,10 +10,6 @@ ## If you submit a pull request containing new view or controller tests, it will not be ## merged. - - - - require 'rails_helper' describe "accounts/new" do diff --git a/spec/views/accounts/show.html.haml_spec.rb b/spec/views/accounts/show.html.haml_spec.rb index e5932cae6..351a8fb24 100644 --- a/spec/views/accounts/show.html.haml_spec.rb +++ b/spec/views/accounts/show.html.haml_spec.rb @@ -10,10 +10,6 @@ ## If you submit a pull request containing new view or controller tests, it will not be ## merged. - - - - require 'rails_helper' describe "accounts/show" do diff --git a/spec/views/admin/index_spec.rb b/spec/views/admin/index_spec.rb index 981170249..32e77b9ee 100644 --- a/spec/views/admin/index_spec.rb +++ b/spec/views/admin/index_spec.rb @@ -10,10 +10,6 @@ ## If you submit a pull request containing new view or controller tests, it will not be ## merged. - - - - require 'rails_helper' describe 'admin/index.html.haml', type: "view" do diff --git a/spec/views/admin/newsletter_spec.rb b/spec/views/admin/newsletter_spec.rb index a98e8ef49..fb49b2e61 100644 --- a/spec/views/admin/newsletter_spec.rb +++ b/spec/views/admin/newsletter_spec.rb @@ -10,10 +10,6 @@ ## If you submit a pull request containing new view or controller tests, it will not be ## merged. - - - - require 'rails_helper' describe 'admin/newsletter.html.haml', type: "view" do diff --git a/spec/views/admin/orders/index_spec.rb b/spec/views/admin/orders/index_spec.rb index fa354a583..ea1331c94 100644 --- a/spec/views/admin/orders/index_spec.rb +++ b/spec/views/admin/orders/index_spec.rb @@ -10,10 +10,6 @@ ## If you submit a pull request containing new view or controller tests, it will not be ## merged. - - - - require 'rails_helper' describe 'admin/orders/index.html.haml', type: "view" do diff --git a/spec/views/comments/edit.html.haml_spec.rb b/spec/views/comments/edit.html.haml_spec.rb index 167168271..5446d2877 100644 --- a/spec/views/comments/edit.html.haml_spec.rb +++ b/spec/views/comments/edit.html.haml_spec.rb @@ -10,10 +10,6 @@ ## If you submit a pull request containing new view or controller tests, it will not be ## merged. - - - - require 'rails_helper' describe "comments/edit" do diff --git a/spec/views/comments/index.html.haml_spec.rb b/spec/views/comments/index.html.haml_spec.rb index 69d9a4d88..86c30c508 100644 --- a/spec/views/comments/index.html.haml_spec.rb +++ b/spec/views/comments/index.html.haml_spec.rb @@ -10,10 +10,6 @@ ## If you submit a pull request containing new view or controller tests, it will not be ## merged. - - - - require 'rails_helper' describe "comments/index" do diff --git a/spec/views/comments/index.rss.haml_spec.rb b/spec/views/comments/index.rss.haml_spec.rb index f656ec90c..68888611e 100644 --- a/spec/views/comments/index.rss.haml_spec.rb +++ b/spec/views/comments/index.rss.haml_spec.rb @@ -10,10 +10,6 @@ ## If you submit a pull request containing new view or controller tests, it will not be ## merged. - - - - require 'rails_helper' describe 'comments/index.rss.haml' do @@ -44,5 +40,4 @@ describe 'comments/index.rss.haml' do it 'shows content of comments' do rendered.should have_content "OMG LOL" end - end diff --git a/spec/views/comments/new.html.haml_spec.rb b/spec/views/comments/new.html.haml_spec.rb index a33eed8ae..2e55c843d 100644 --- a/spec/views/comments/new.html.haml_spec.rb +++ b/spec/views/comments/new.html.haml_spec.rb @@ -10,10 +10,6 @@ ## If you submit a pull request containing new view or controller tests, it will not be ## merged. - - - - require 'rails_helper' describe "comments/new" do @@ -47,5 +43,4 @@ describe "comments/new" do it 'shows markdown help' do rendered.should have_content 'Markdown' end - end diff --git a/spec/views/comments/show.html.haml_spec.rb b/spec/views/comments/show.html.haml_spec.rb index f69a635d3..4cc8a8a71 100644 --- a/spec/views/comments/show.html.haml_spec.rb +++ b/spec/views/comments/show.html.haml_spec.rb @@ -10,10 +10,6 @@ ## If you submit a pull request containing new view or controller tests, it will not be ## merged. - - - - require 'rails_helper' describe "comments/show" do diff --git a/spec/views/crops/_grown_for.html.haml_spec.rb b/spec/views/crops/_grown_for.html.haml_spec.rb index 81009b7e5..776d3bdf3 100644 --- a/spec/views/crops/_grown_for.html.haml_spec.rb +++ b/spec/views/crops/_grown_for.html.haml_spec.rb @@ -10,10 +10,6 @@ ## If you submit a pull request containing new view or controller tests, it will not be ## merged. - - - - require 'rails_helper' describe "crops/_grown_for" do diff --git a/spec/views/crops/_planting_advice.html.haml_spec.rb b/spec/views/crops/_planting_advice.html.haml_spec.rb index 2abed9015..1c0390e23 100644 --- a/spec/views/crops/_planting_advice.html.haml_spec.rb +++ b/spec/views/crops/_planting_advice.html.haml_spec.rb @@ -10,10 +10,6 @@ ## If you submit a pull request containing new view or controller tests, it will not be ## merged. - - - - require 'rails_helper' describe "crops/_planting_advice" do @@ -48,11 +44,9 @@ describe "crops/_planting_advice" do rendered.should have_content "Plant in:" rendered.should have_content "sun (2), shade (1)" end - end context "planted from" do - it "doesn't show planted_from if none are set" do render partial: 'crops/planting_advice', locals: { crop: @crop } rendered.should have_content "Plant from: not known." @@ -74,5 +68,4 @@ describe "crops/_planting_advice" do rendered.should have_content "seed (2), cutting (1)" end end - end diff --git a/spec/views/crops/_popover.html.haml_spec.rb b/spec/views/crops/_popover.html.haml_spec.rb index bad5008a1..af97d7645 100644 --- a/spec/views/crops/_popover.html.haml_spec.rb +++ b/spec/views/crops/_popover.html.haml_spec.rb @@ -10,10 +10,6 @@ ## If you submit a pull request containing new view or controller tests, it will not be ## merged. - - - - require 'rails_helper' describe "crops/_popover" do @@ -32,5 +28,4 @@ describe "crops/_popover" do it 'shows count of plantings' do rendered.should have_content '1 time' end - end diff --git a/spec/views/crops/edit.html.haml_spec.rb b/spec/views/crops/edit.html.haml_spec.rb index 464041a66..436114f78 100644 --- a/spec/views/crops/edit.html.haml_spec.rb +++ b/spec/views/crops/edit.html.haml_spec.rb @@ -10,10 +10,6 @@ ## If you submit a pull request containing new view or controller tests, it will not be ## merged. - - - - require 'rails_helper' describe "crops/edit" do @@ -32,5 +28,4 @@ describe "crops/edit" do it "shows the creator" do rendered.should have_content "Added by #{@crop.creator} less than a minute ago." end - end diff --git a/spec/views/crops/hierarchy.html.haml_spec.rb b/spec/views/crops/hierarchy.html.haml_spec.rb index 076d13b64..077add247 100644 --- a/spec/views/crops/hierarchy.html.haml_spec.rb +++ b/spec/views/crops/hierarchy.html.haml_spec.rb @@ -10,10 +10,6 @@ ## If you submit a pull request containing new view or controller tests, it will not be ## merged. - - - - require 'rails_helper' describe "crops/hierarchy" do diff --git a/spec/views/crops/index.html.haml_spec.rb b/spec/views/crops/index.html.haml_spec.rb index 727c36ec0..7b5f27805 100644 --- a/spec/views/crops/index.html.haml_spec.rb +++ b/spec/views/crops/index.html.haml_spec.rb @@ -10,10 +10,6 @@ ## If you submit a pull request containing new view or controller tests, it will not be ## merged. - - - - require 'rails_helper' describe "crops/index" do diff --git a/spec/views/crops/index.rss.haml_spec.rb b/spec/views/crops/index.rss.haml_spec.rb index d7b139b7f..5726c162c 100644 --- a/spec/views/crops/index.rss.haml_spec.rb +++ b/spec/views/crops/index.rss.haml_spec.rb @@ -10,10 +10,6 @@ ## If you submit a pull request containing new view or controller tests, it will not be ## merged. - - - - require 'rails_helper' describe 'crops/index.rss.haml' do @@ -34,5 +30,4 @@ describe 'crops/index.rss.haml' do rendered.should have_content @tomato.name rendered.should have_content @maize.name end - end diff --git a/spec/views/crops/new.html.haml_spec.rb b/spec/views/crops/new.html.haml_spec.rb index 0b01ae76a..406b5e5c2 100644 --- a/spec/views/crops/new.html.haml_spec.rb +++ b/spec/views/crops/new.html.haml_spec.rb @@ -10,10 +10,6 @@ ## If you submit a pull request containing new view or controller tests, it will not be ## merged. - - - - require 'rails_helper' describe "crops/new" do @@ -32,5 +28,4 @@ describe "crops/new" do it "shows a link to crop wrangling guidelines" do assert_select "a[href^='http://wiki.growstuff.org']", "crop wrangling guide" end - end diff --git a/spec/views/crops/wrangle.html.haml_spec.rb b/spec/views/crops/wrangle.html.haml_spec.rb index a8e7612b6..d2eb584bb 100644 --- a/spec/views/crops/wrangle.html.haml_spec.rb +++ b/spec/views/crops/wrangle.html.haml_spec.rb @@ -10,10 +10,6 @@ ## If you submit a pull request containing new view or controller tests, it will not be ## merged. - - - - require 'rails_helper' describe "crops/wrangle" do @@ -48,5 +44,4 @@ describe "crops/wrangle" do assert_select "a", text: @maize.name assert_select "a", text: @tomato.name end - end diff --git a/spec/views/devise/confirmations/new_spec.rb b/spec/views/devise/confirmations/new_spec.rb index 8d567d793..720822083 100644 --- a/spec/views/devise/confirmations/new_spec.rb +++ b/spec/views/devise/confirmations/new_spec.rb @@ -1,5 +1,4 @@ describe 'devise/confirmations/new.html.haml', type: "view" do - before(:each) do @view.stub(:resource).and_return(Member.new) @view.stub(:resource_name).and_return("member") diff --git a/spec/views/devise/mailer/confirmation_instructions_spec.rb b/spec/views/devise/mailer/confirmation_instructions_spec.rb index 0ed226dc2..f10eb6176 100644 --- a/spec/views/devise/mailer/confirmation_instructions_spec.rb +++ b/spec/views/devise/mailer/confirmation_instructions_spec.rb @@ -10,14 +10,9 @@ ## If you submit a pull request containing new view or controller tests, it will not be ## merged. - - - - require 'rails_helper' describe 'devise/mailer/confirmation_instructions.html.haml', type: "view" do - context "logged in" do before(:each) do @resource = FactoryGirl.create(:member) diff --git a/spec/views/devise/mailer/reset_password_instructions_spec.rb b/spec/views/devise/mailer/reset_password_instructions_spec.rb index 332f9a106..7d0cdfe6a 100644 --- a/spec/views/devise/mailer/reset_password_instructions_spec.rb +++ b/spec/views/devise/mailer/reset_password_instructions_spec.rb @@ -10,14 +10,9 @@ ## If you submit a pull request containing new view or controller tests, it will not be ## merged. - - - - require 'rails_helper' describe 'devise/mailer/reset_password_instructions.html.haml', type: "view" do - context "logged in" do before(:each) do @resource = mock_model(Member) diff --git a/spec/views/devise/mailer/unlock_instructions_spec.rb b/spec/views/devise/mailer/unlock_instructions_spec.rb index da74564c1..e0fb50e50 100644 --- a/spec/views/devise/mailer/unlock_instructions_spec.rb +++ b/spec/views/devise/mailer/unlock_instructions_spec.rb @@ -10,10 +10,6 @@ ## If you submit a pull request containing new view or controller tests, it will not be ## merged. - - - - require 'rails_helper' describe 'devise/mailer/unlock_instructions.html.haml', type: "view" do context "logged in" do diff --git a/spec/views/devise/registrations/edit_spec.rb b/spec/views/devise/registrations/edit_spec.rb index 311b6bb15..2aef2fa70 100644 --- a/spec/views/devise/registrations/edit_spec.rb +++ b/spec/views/devise/registrations/edit_spec.rb @@ -10,14 +10,9 @@ ## If you submit a pull request containing new view or controller tests, it will not be ## merged. - - - - require 'rails_helper' describe 'devise/registrations/edit.html.haml', type: "view" do - context "logged in" do before(:each) do controller.stub(:current_user) { nil } @@ -75,7 +70,6 @@ describe 'devise/registrations/edit.html.haml', type: "view" do end context 'other sites section' do - context 'not connected to twitter' do it 'has a link to connect' do render @@ -115,9 +109,6 @@ describe 'devise/registrations/edit.html.haml', type: "view" do assert_select "a", href: @flickr_auth, text: "Disconnect" end end - end - end - end diff --git a/spec/views/devise/registrations/new_spec.rb b/spec/views/devise/registrations/new_spec.rb index f36125242..be00abae9 100644 --- a/spec/views/devise/registrations/new_spec.rb +++ b/spec/views/devise/registrations/new_spec.rb @@ -10,14 +10,9 @@ ## If you submit a pull request containing new view or controller tests, it will not be ## merged. - - - - require 'rails_helper' describe 'devise/registrations/new.html.haml', type: "view" do - context "logged in" do before(:each) do @view.stub(:resource).and_return(Member.new) diff --git a/spec/views/devise/sessions/new_spec.rb b/spec/views/devise/sessions/new_spec.rb index 57426c408..93b14b9c3 100644 --- a/spec/views/devise/sessions/new_spec.rb +++ b/spec/views/devise/sessions/new_spec.rb @@ -10,14 +10,9 @@ ## If you submit a pull request containing new view or controller tests, it will not be ## merged. - - - - require 'rails_helper' describe 'devise/sessions/new.html.haml', type: "view" do - context "logged in" do before(:each) do @view.stub(:resource).and_return(Member.new) diff --git a/spec/views/devise/shared/_links_spec.rb b/spec/views/devise/shared/_links_spec.rb index 7e71bbc12..d40a84d88 100644 --- a/spec/views/devise/shared/_links_spec.rb +++ b/spec/views/devise/shared/_links_spec.rb @@ -1,5 +1,4 @@ describe 'devise/shared/_links.haml', type: "view" do - def devise_mapping(register, recover, confirm, lock, oauth) dm = double("mappings") dm.stub(registerable?: register) diff --git a/spec/views/devise/unlocks/new_spec.rb b/spec/views/devise/unlocks/new_spec.rb index b17129f49..c53968a8d 100644 --- a/spec/views/devise/unlocks/new_spec.rb +++ b/spec/views/devise/unlocks/new_spec.rb @@ -10,14 +10,9 @@ ## If you submit a pull request containing new view or controller tests, it will not be ## merged. - - - - require 'rails_helper' describe 'devise/unlocks/new.html.haml', type: "view" do - context "logged in" do before(:each) do @view.stub(:resource).and_return(Member.new) diff --git a/spec/views/forums/edit.html.haml_spec.rb b/spec/views/forums/edit.html.haml_spec.rb index c068ef295..002a52f3e 100644 --- a/spec/views/forums/edit.html.haml_spec.rb +++ b/spec/views/forums/edit.html.haml_spec.rb @@ -10,10 +10,6 @@ ## If you submit a pull request containing new view or controller tests, it will not be ## merged. - - - - require 'rails_helper' describe "forums/edit" do diff --git a/spec/views/forums/index.html.haml_spec.rb b/spec/views/forums/index.html.haml_spec.rb index 470781a4f..7fc1a6574 100644 --- a/spec/views/forums/index.html.haml_spec.rb +++ b/spec/views/forums/index.html.haml_spec.rb @@ -10,10 +10,6 @@ ## If you submit a pull request containing new view or controller tests, it will not be ## merged. - - - - require 'rails_helper' describe "forums/index" do @@ -51,6 +47,5 @@ describe "forums/index" do it "displays comment count" do assert_select "td", text: "1" end - end end diff --git a/spec/views/forums/new.html.haml_spec.rb b/spec/views/forums/new.html.haml_spec.rb index b9a8abcb2..de0be5b3c 100644 --- a/spec/views/forums/new.html.haml_spec.rb +++ b/spec/views/forums/new.html.haml_spec.rb @@ -10,10 +10,6 @@ ## If you submit a pull request containing new view or controller tests, it will not be ## merged. - - - - require 'rails_helper' describe "forums/new" do diff --git a/spec/views/forums/show.html.haml_spec.rb b/spec/views/forums/show.html.haml_spec.rb index 3b2d41783..f2fa920a6 100644 --- a/spec/views/forums/show.html.haml_spec.rb +++ b/spec/views/forums/show.html.haml_spec.rb @@ -10,10 +10,6 @@ ## If you submit a pull request containing new view or controller tests, it will not be ## merged. - - - - require 'rails_helper' describe "forums/show" do diff --git a/spec/views/gardens/edit.html.haml_spec.rb b/spec/views/gardens/edit.html.haml_spec.rb index 340feaeef..f8b4b5e03 100644 --- a/spec/views/gardens/edit.html.haml_spec.rb +++ b/spec/views/gardens/edit.html.haml_spec.rb @@ -10,14 +10,9 @@ ## If you submit a pull request containing new view or controller tests, it will not be ## merged. - - - - require 'rails_helper' describe "gardens/edit" do - context "logged in" do before(:each) do @owner = FactoryGirl.create(:member) @@ -41,5 +36,4 @@ describe "gardens/edit" do end end end - end diff --git a/spec/views/gardens/new.html.haml_spec.rb b/spec/views/gardens/new.html.haml_spec.rb index 58bd6a335..337b9066c 100644 --- a/spec/views/gardens/new.html.haml_spec.rb +++ b/spec/views/gardens/new.html.haml_spec.rb @@ -10,10 +10,6 @@ ## If you submit a pull request containing new view or controller tests, it will not be ## merged. - - - - require 'rails_helper' describe "gardens/new" do diff --git a/spec/views/gardens/show.html.haml_spec.rb b/spec/views/gardens/show.html.haml_spec.rb index b122abfd4..d4f9eb38b 100644 --- a/spec/views/gardens/show.html.haml_spec.rb +++ b/spec/views/gardens/show.html.haml_spec.rb @@ -10,10 +10,6 @@ ## If you submit a pull request containing new view or controller tests, it will not be ## merged. - - - - require 'rails_helper' describe "gardens/show" do @@ -51,7 +47,6 @@ describe "gardens/show" do end context 'signed in' do - before :each do sign_in @owner render @@ -69,5 +64,4 @@ describe "gardens/show" do assert_select("a[href='#{new_planting_path}?garden_id=#{@garden.id}']") end end - end diff --git a/spec/views/harvests/edit.html.haml_spec.rb b/spec/views/harvests/edit.html.haml_spec.rb index 265925dd1..e0959b451 100644 --- a/spec/views/harvests/edit.html.haml_spec.rb +++ b/spec/views/harvests/edit.html.haml_spec.rb @@ -10,10 +10,6 @@ ## If you submit a pull request containing new view or controller tests, it will not be ## merged. - - - - require 'rails_helper' describe "harvests/edit" do diff --git a/spec/views/harvests/index.html.haml_spec.rb b/spec/views/harvests/index.html.haml_spec.rb index cacf6b551..cc24f1591 100644 --- a/spec/views/harvests/index.html.haml_spec.rb +++ b/spec/views/harvests/index.html.haml_spec.rb @@ -10,10 +10,6 @@ ## If you submit a pull request containing new view or controller tests, it will not be ## merged. - - - - require 'rails_helper' describe "harvests/index" do @@ -61,5 +57,4 @@ describe "harvests/index" do render view.content_for(:title).should have_content @tomato.name end - end diff --git a/spec/views/harvests/new.html.haml_spec.rb b/spec/views/harvests/new.html.haml_spec.rb index d037f5c3c..1b300f1e3 100644 --- a/spec/views/harvests/new.html.haml_spec.rb +++ b/spec/views/harvests/new.html.haml_spec.rb @@ -10,10 +10,6 @@ ## If you submit a pull request containing new view or controller tests, it will not be ## merged. - - - - require 'rails_helper' describe "harvests/new" do diff --git a/spec/views/harvests/show.html.haml_spec.rb b/spec/views/harvests/show.html.haml_spec.rb index 6ae30919b..b6a1ec7a0 100644 --- a/spec/views/harvests/show.html.haml_spec.rb +++ b/spec/views/harvests/show.html.haml_spec.rb @@ -10,10 +10,6 @@ ## If you submit a pull request containing new view or controller tests, it will not be ## merged. - - - - require 'rails_helper' describe "harvests/show" do @@ -29,5 +25,4 @@ describe "harvests/show" do rendered.should have_content @harvest.harvested_at.to_s rendered.should have_content @harvest.plant_part.to_s end - end diff --git a/spec/views/home/_blurb.html.haml_spec.rb b/spec/views/home/_blurb.html.haml_spec.rb index 75314118a..710fcd4d4 100644 --- a/spec/views/home/_blurb.html.haml_spec.rb +++ b/spec/views/home/_blurb.html.haml_spec.rb @@ -10,10 +10,6 @@ ## If you submit a pull request containing new view or controller tests, it will not be ## merged. - - - - require 'rails_helper' describe 'home/_blurb.html.haml', type: "view" do @@ -37,5 +33,4 @@ describe 'home/_blurb.html.haml', type: "view" do assert_select "a", href: new_member_session_path end end - end diff --git a/spec/views/home/_crops.html.haml_spec.rb b/spec/views/home/_crops.html.haml_spec.rb index 5a0c06325..8f375f3e1 100644 --- a/spec/views/home/_crops.html.haml_spec.rb +++ b/spec/views/home/_crops.html.haml_spec.rb @@ -10,10 +10,6 @@ ## If you submit a pull request containing new view or controller tests, it will not be ## merged. - - - - require 'rails_helper' describe 'home/_crops.html.haml', type: "view" do diff --git a/spec/views/home/_members.html.haml_spec.rb b/spec/views/home/_members.html.haml_spec.rb index 6cf6c0099..a4391da51 100644 --- a/spec/views/home/_members.html.haml_spec.rb +++ b/spec/views/home/_members.html.haml_spec.rb @@ -10,10 +10,6 @@ ## If you submit a pull request containing new view or controller tests, it will not be ## merged. - - - - require 'rails_helper' describe 'home/_members.html.haml', type: "view" do @@ -35,5 +31,4 @@ describe 'home/_members.html.haml', type: "view" do rendered.should have_content @member.location rendered.should have_content @planting.crop_name end - end diff --git a/spec/views/home/_seeds.html.haml_spec.rb b/spec/views/home/_seeds.html.haml_spec.rb index ac47b1c1a..a904f47ff 100644 --- a/spec/views/home/_seeds.html.haml_spec.rb +++ b/spec/views/home/_seeds.html.haml_spec.rb @@ -10,10 +10,6 @@ ## If you submit a pull request containing new view or controller tests, it will not be ## merged. - - - - require 'rails_helper' describe 'home/_seeds.html.haml', type: "view" do diff --git a/spec/views/home/_stats.html.haml_spec.rb b/spec/views/home/_stats.html.haml_spec.rb index 2bee43768..6bfc3e6fe 100644 --- a/spec/views/home/_stats.html.haml_spec.rb +++ b/spec/views/home/_stats.html.haml_spec.rb @@ -10,10 +10,6 @@ ## If you submit a pull request containing new view or controller tests, it will not be ## merged. - - - - require 'rails_helper' describe 'home/_stats.html.haml', type: "view" do diff --git a/spec/views/home/index_spec.rb b/spec/views/home/index_spec.rb index c7f6f0927..b5a726e23 100644 --- a/spec/views/home/index_spec.rb +++ b/spec/views/home/index_spec.rb @@ -10,10 +10,6 @@ ## If you submit a pull request containing new view or controller tests, it will not be ## merged. - - - - require 'rails_helper' describe 'home/index.html.haml', type: "view" do @@ -57,5 +53,4 @@ describe 'home/index.html.haml', type: "view" do rendered.should have_content "Welcome to #{ENV['GROWSTUFF_SITE_NAME']}, #{@member.login_name}" end end - end diff --git a/spec/views/layouts/_header_spec.rb b/spec/views/layouts/_header_spec.rb index 8742796c1..2e6f8e36a 100644 --- a/spec/views/layouts/_header_spec.rb +++ b/spec/views/layouts/_header_spec.rb @@ -10,10 +10,6 @@ ## If you submit a pull request containing new view or controller tests, it will not be ## merged. - - - - require 'rails_helper' describe 'layouts/_header.html.haml', type: "view" do @@ -64,11 +60,9 @@ describe 'layouts/_header.html.haml', type: "view" do assert_select("form[action='#{crops_search_path}']") assert_select("input#term") end - end context "logged in" do - before(:each) do @member = FactoryGirl.create(:member) sign_in @member @@ -110,6 +104,5 @@ describe 'layouts/_header.html.haml', type: "view" do rendered.should have_content 'Inbox (1)' end end - end end diff --git a/spec/views/layouts/_meta_spec.rb b/spec/views/layouts/_meta_spec.rb index bd58962a3..805f0298d 100644 --- a/spec/views/layouts/_meta_spec.rb +++ b/spec/views/layouts/_meta_spec.rb @@ -10,10 +10,6 @@ ## If you submit a pull request containing new view or controller tests, it will not be ## merged. - - - - require 'rails_helper' describe 'layouts/_meta.html.haml', type: "view" do @@ -39,5 +35,4 @@ describe 'layouts/_meta.html.haml', type: "view" do it 'should have a title' do assert_select "head>title" end - end diff --git a/spec/views/layouts/application_spec.rb b/spec/views/layouts/application_spec.rb index a2a0c74f6..b773cce58 100644 --- a/spec/views/layouts/application_spec.rb +++ b/spec/views/layouts/application_spec.rb @@ -10,10 +10,6 @@ ## If you submit a pull request containing new view or controller tests, it will not be ## merged. - - - - require 'rails_helper' describe 'layouts/application.html.haml', type: "view" do @@ -27,5 +23,4 @@ describe 'layouts/application.html.haml', type: "view" do assert_select "script", text: 'alert("foo!")' rendered.should_not have_content 'script' end - end diff --git a/spec/views/members/_location.html.haml_spec.rb b/spec/views/members/_location.html.haml_spec.rb index 4a247d9eb..23beefc69 100644 --- a/spec/views/members/_location.html.haml_spec.rb +++ b/spec/views/members/_location.html.haml_spec.rb @@ -10,10 +10,6 @@ ## If you submit a pull request containing new view or controller tests, it will not be ## merged. - - - - require 'rails_helper' describe "members/_location" do @@ -45,7 +41,5 @@ describe "members/_location" do it "doesn't link anywhere" do assert_select "a", false end - end - end diff --git a/spec/views/members/index.html.haml_spec.rb b/spec/views/members/index.html.haml_spec.rb index ee1537b77..b54c9f4bb 100644 --- a/spec/views/members/index.html.haml_spec.rb +++ b/spec/views/members/index.html.haml_spec.rb @@ -10,10 +10,6 @@ ## If you submit a pull request containing new view or controller tests, it will not be ## merged. - - - - require 'rails_helper' describe "members/index" do @@ -37,5 +33,4 @@ describe "members/index" do it 'contains member locations' do rendered.should have_content @member.location end - end diff --git a/spec/views/members/show.rss.haml_spec.rb b/spec/views/members/show.rss.haml_spec.rb index c5033fd17..5a3320a8b 100644 --- a/spec/views/members/show.rss.haml_spec.rb +++ b/spec/views/members/show.rss.haml_spec.rb @@ -10,10 +10,6 @@ ## If you submit a pull request containing new view or controller tests, it will not be ## merged. - - - - require 'rails_helper' describe 'members/show.rss.haml', type: "view" do @@ -42,5 +38,4 @@ describe 'members/show.rss.haml', type: "view" do it 'gives the author in the item title' do rendered.should have_content "#{@post1.subject} by #{@post1.author}" end - end diff --git a/spec/views/notifications/index.html.haml_spec.rb b/spec/views/notifications/index.html.haml_spec.rb index aaddfd564..2331215e2 100644 --- a/spec/views/notifications/index.html.haml_spec.rb +++ b/spec/views/notifications/index.html.haml_spec.rb @@ -10,10 +10,6 @@ ## If you submit a pull request containing new view or controller tests, it will not be ## merged. - - - - require 'rails_helper' describe "notifications/index" do @@ -30,7 +26,6 @@ describe "notifications/index" do render end - it "renders a list of notifications" do assert_select "table" assert_select "tr>td", text: @notification.sender.to_s, count: 2 @@ -61,5 +56,4 @@ describe "notifications/index" do rendered.should have_content "(no subject)" end end - end diff --git a/spec/views/notifications/new.html.haml_spec.rb b/spec/views/notifications/new.html.haml_spec.rb index 92829806d..f3538efdc 100644 --- a/spec/views/notifications/new.html.haml_spec.rb +++ b/spec/views/notifications/new.html.haml_spec.rb @@ -10,10 +10,6 @@ ## If you submit a pull request containing new view or controller tests, it will not be ## merged. - - - - require 'rails_helper' describe "notifications/new" do @@ -63,5 +59,4 @@ describe "notifications/new" do render rendered.should have_content 'Markdown' end - end diff --git a/spec/views/notifications/show.html.haml_spec.rb b/spec/views/notifications/show.html.haml_spec.rb index 9e10d0a85..4d59495fa 100644 --- a/spec/views/notifications/show.html.haml_spec.rb +++ b/spec/views/notifications/show.html.haml_spec.rb @@ -10,10 +10,6 @@ ## If you submit a pull request containing new view or controller tests, it will not be ## merged. - - - - require 'rails_helper' describe "notifications/show" do @@ -38,5 +34,4 @@ describe "notifications/show" do it "includes a reply button" do assert_select "a", {href: @reply_link}, "Reply" end - end diff --git a/spec/views/notifier/notify.html.haml_spec.rb b/spec/views/notifier/notify.html.haml_spec.rb index c0913d8e7..e3a7cbdb4 100644 --- a/spec/views/notifier/notify.html.haml_spec.rb +++ b/spec/views/notifier/notify.html.haml_spec.rb @@ -10,14 +10,9 @@ ## If you submit a pull request containing new view or controller tests, it will not be ## merged. - - - - require 'rails_helper' describe 'notifier/notify.html.haml', type: "view" do - before(:each) do @notification = FactoryGirl.create(:notification) @reply_link = "http://example.com" diff --git a/spec/views/orders/index.html.haml_spec.rb b/spec/views/orders/index.html.haml_spec.rb index 8b39c7fbe..182542cc5 100644 --- a/spec/views/orders/index.html.haml_spec.rb +++ b/spec/views/orders/index.html.haml_spec.rb @@ -10,10 +10,6 @@ ## If you submit a pull request containing new view or controller tests, it will not be ## merged. - - - - require 'rails_helper' describe "orders/index" do diff --git a/spec/views/orders/show.html.haml_spec.rb b/spec/views/orders/show.html.haml_spec.rb index 8d8d9f5c4..b6c3da53b 100644 --- a/spec/views/orders/show.html.haml_spec.rb +++ b/spec/views/orders/show.html.haml_spec.rb @@ -10,14 +10,9 @@ ## If you submit a pull request containing new view or controller tests, it will not be ## merged. - - - - require 'rails_helper' describe "orders/show" do - before(:each) do @member = FactoryGirl.create(:member) sign_in @member @@ -84,7 +79,5 @@ describe "orders/show" do it "doesn't show delete order button" do assert_select "a", text: "Delete this order", count: 0 end - end - end diff --git a/spec/views/photos/edit.html.haml_spec.rb b/spec/views/photos/edit.html.haml_spec.rb index c9b440a66..5ff07030b 100644 --- a/spec/views/photos/edit.html.haml_spec.rb +++ b/spec/views/photos/edit.html.haml_spec.rb @@ -10,10 +10,6 @@ ## If you submit a pull request containing new view or controller tests, it will not be ## merged. - - - - require 'rails_helper' describe "photos/edit" do @@ -25,5 +21,4 @@ describe "photos/edit" do fullsize_url: "MyString" )) end - end diff --git a/spec/views/photos/index.html.haml_spec.rb b/spec/views/photos/index.html.haml_spec.rb index bf8624665..a59e4eb2c 100644 --- a/spec/views/photos/index.html.haml_spec.rb +++ b/spec/views/photos/index.html.haml_spec.rb @@ -10,10 +10,6 @@ ## If you submit a pull request containing new view or controller tests, it will not be ## merged. - - - - require 'rails_helper' describe "photos/index" do diff --git a/spec/views/photos/new.html.haml_spec.rb b/spec/views/photos/new.html.haml_spec.rb index b22240e4e..0b19ba81b 100644 --- a/spec/views/photos/new.html.haml_spec.rb +++ b/spec/views/photos/new.html.haml_spec.rb @@ -10,10 +10,6 @@ ## If you submit a pull request containing new view or controller tests, it will not be ## merged. - - - - require 'rails_helper' describe "photos/new" do @@ -53,5 +49,4 @@ describe "photos/new" do assert_select "h2", "foo" # the name of the set end end - end diff --git a/spec/views/photos/show.html.haml_spec.rb b/spec/views/photos/show.html.haml_spec.rb index 06f411c7f..2a2e7afeb 100644 --- a/spec/views/photos/show.html.haml_spec.rb +++ b/spec/views/photos/show.html.haml_spec.rb @@ -10,10 +10,6 @@ ## If you submit a pull request containing new view or controller tests, it will not be ## merged. - - - - require 'rails_helper' describe "photos/show" do @@ -59,7 +55,5 @@ describe "photos/show" do it "contains the phrase 'All rights reserved'" do rendered.should have_content "All rights reserved" end - end - end diff --git a/spec/views/places/_map_attribution.html.haml_spec.rb b/spec/views/places/_map_attribution.html.haml_spec.rb index 31a717eab..efc101bc1 100644 --- a/spec/views/places/_map_attribution.html.haml_spec.rb +++ b/spec/views/places/_map_attribution.html.haml_spec.rb @@ -10,10 +10,6 @@ ## If you submit a pull request containing new view or controller tests, it will not be ## merged. - - - - require 'rails_helper' describe "places/_map_attribution.html.haml", type: :view do diff --git a/spec/views/places/index.html.haml_spec.rb b/spec/views/places/index.html.haml_spec.rb index 8efcca42e..44299c286 100644 --- a/spec/views/places/index.html.haml_spec.rb +++ b/spec/views/places/index.html.haml_spec.rb @@ -10,10 +10,6 @@ ## If you submit a pull request containing new view or controller tests, it will not be ## merged. - - - - require 'rails_helper' describe "places/index" do diff --git a/spec/views/places/show.html.haml_spec.rb b/spec/views/places/show.html.haml_spec.rb index 5a312f360..57f7e9742 100644 --- a/spec/views/places/show.html.haml_spec.rb +++ b/spec/views/places/show.html.haml_spec.rb @@ -10,10 +10,6 @@ ## If you submit a pull request containing new view or controller tests, it will not be ## merged. - - - - require 'rails_helper' describe "places/show" do @@ -39,5 +35,4 @@ describe "places/show" do rendered.should have_content m.login_name end end - end diff --git a/spec/views/plant_parts/edit.html.haml_spec.rb b/spec/views/plant_parts/edit.html.haml_spec.rb index c9a1533fa..2eeb4e535 100644 --- a/spec/views/plant_parts/edit.html.haml_spec.rb +++ b/spec/views/plant_parts/edit.html.haml_spec.rb @@ -10,10 +10,6 @@ ## If you submit a pull request containing new view or controller tests, it will not be ## merged. - - - - require 'rails_helper' describe "plant_parts/edit" do diff --git a/spec/views/plant_parts/index.html.haml_spec.rb b/spec/views/plant_parts/index.html.haml_spec.rb index 8b16b48ff..adb0f9a46 100644 --- a/spec/views/plant_parts/index.html.haml_spec.rb +++ b/spec/views/plant_parts/index.html.haml_spec.rb @@ -10,10 +10,6 @@ ## If you submit a pull request containing new view or controller tests, it will not be ## merged. - - - - require 'rails_helper' describe "plant_parts/index" do @@ -28,5 +24,4 @@ describe "plant_parts/index" do rendered.should have_content @pp.name assert_select "a", href: plant_part_path(@pp) end - end diff --git a/spec/views/plant_parts/new.html.haml_spec.rb b/spec/views/plant_parts/new.html.haml_spec.rb index 9e977bd42..e25ba2da1 100644 --- a/spec/views/plant_parts/new.html.haml_spec.rb +++ b/spec/views/plant_parts/new.html.haml_spec.rb @@ -10,10 +10,6 @@ ## If you submit a pull request containing new view or controller tests, it will not be ## merged. - - - - require 'rails_helper' describe "plant_parts/new" do diff --git a/spec/views/plant_parts/show.html.haml_spec.rb b/spec/views/plant_parts/show.html.haml_spec.rb index 66a6ddbb7..8b267c449 100644 --- a/spec/views/plant_parts/show.html.haml_spec.rb +++ b/spec/views/plant_parts/show.html.haml_spec.rb @@ -10,10 +10,6 @@ ## If you submit a pull request containing new view or controller tests, it will not be ## merged. - - - - require 'rails_helper' describe "plant_parts/show" do diff --git a/spec/views/plantings/_form.html.haml_spec.rb b/spec/views/plantings/_form.html.haml_spec.rb index d2cdcf441..1ba3be93e 100644 --- a/spec/views/plantings/_form.html.haml_spec.rb +++ b/spec/views/plantings/_form.html.haml_spec.rb @@ -10,10 +10,6 @@ ## If you submit a pull request containing new view or controller tests, it will not be ## merged. - - - - require 'rails_helper' describe "plantings/_form" do @@ -36,5 +32,4 @@ describe "plantings/_form" do it "has a free-form text field containing the planting date in ISO format" do assert_select "input#planting_planted_at[type='text'][value='2013-03-01']" end - end diff --git a/spec/views/plantings/edit.html.haml_spec.rb b/spec/views/plantings/edit.html.haml_spec.rb index 234d83646..1ea5fc586 100644 --- a/spec/views/plantings/edit.html.haml_spec.rb +++ b/spec/views/plantings/edit.html.haml_spec.rb @@ -10,10 +10,6 @@ ## If you submit a pull request containing new view or controller tests, it will not be ## merged. - - - - require 'rails_helper' describe "plantings/edit" do @@ -35,7 +31,6 @@ describe "plantings/edit" do @planting = assign(:planting, FactoryGirl.create(:planting, garden: @garden, crop: @tomato) ) - end context "logged in" do @@ -66,6 +61,5 @@ describe "plantings/edit" do assert_select "select#planting_garden_id", html: /option selected value="#{@garden.id}"/ end - end end diff --git a/spec/views/plantings/index.html.haml_spec.rb b/spec/views/plantings/index.html.haml_spec.rb index 7abf2a087..63b612297 100644 --- a/spec/views/plantings/index.html.haml_spec.rb +++ b/spec/views/plantings/index.html.haml_spec.rb @@ -10,10 +10,6 @@ ## If you submit a pull request containing new view or controller tests, it will not be ## merged. - - - - require 'rails_helper' describe "plantings/index" do diff --git a/spec/views/plantings/index.rss.haml_spec.rb b/spec/views/plantings/index.rss.haml_spec.rb index eefb49c6a..9d7933ef6 100644 --- a/spec/views/plantings/index.rss.haml_spec.rb +++ b/spec/views/plantings/index.rss.haml_spec.rb @@ -10,10 +10,6 @@ ## If you submit a pull request containing new view or controller tests, it will not be ## merged. - - - - require 'rails_helper' describe 'plantings/index.rss.haml' do diff --git a/spec/views/plantings/new.html.haml_spec.rb b/spec/views/plantings/new.html.haml_spec.rb index 3521d34f6..2fadcf38b 100644 --- a/spec/views/plantings/new.html.haml_spec.rb +++ b/spec/views/plantings/new.html.haml_spec.rb @@ -10,10 +10,6 @@ ## If you submit a pull request containing new view or controller tests, it will not be ## merged. - - - - require 'rails_helper' describe "plantings/new" do @@ -31,7 +27,6 @@ describe "plantings/new" do garden: @garden_a, crop: @crop2 )) - end context "logged in" do diff --git a/spec/views/plantings/show.html.haml_spec.rb b/spec/views/plantings/show.html.haml_spec.rb index d2a33e5b3..e89d6bb92 100644 --- a/spec/views/plantings/show.html.haml_spec.rb +++ b/spec/views/plantings/show.html.haml_spec.rb @@ -10,10 +10,6 @@ ## If you submit a pull request containing new view or controller tests, it will not be ## merged. - - - - require 'rails_helper' describe "plantings/show" do diff --git a/spec/views/posts/_single.html.haml_spec.rb b/spec/views/posts/_single.html.haml_spec.rb index df3ba135b..49830a45a 100644 --- a/spec/views/posts/_single.html.haml_spec.rb +++ b/spec/views/posts/_single.html.haml_spec.rb @@ -10,14 +10,9 @@ ## If you submit a pull request containing new view or controller tests, it will not be ## merged. - - - - require 'rails_helper' describe "posts/_single" do - def render_post() render partial: "single", locals: { post: @post } end @@ -127,7 +122,6 @@ describe "posts/_single" do it "does not contain link to new comment" do assert_select "a[href='#{new_comment_path(post_id: @post.id)}']", false end - end context "when post has been edited" do @@ -199,5 +193,4 @@ describe "posts/_single" do rendered.should_not have_content "edited at #{@comment.updated_at}" end end - end diff --git a/spec/views/posts/edit.html.haml_spec.rb b/spec/views/posts/edit.html.haml_spec.rb index 9b4a14146..00b063d4a 100644 --- a/spec/views/posts/edit.html.haml_spec.rb +++ b/spec/views/posts/edit.html.haml_spec.rb @@ -10,10 +10,6 @@ ## If you submit a pull request containing new view or controller tests, it will not be ## merged. - - - - require 'rails_helper' describe "posts/edit" do @@ -62,6 +58,5 @@ describe "posts/edit" do rendered.should have_content "This post will be posted in the forum #{@forum.name}" end end - end end diff --git a/spec/views/posts/index.html.haml_spec.rb b/spec/views/posts/index.html.haml_spec.rb index da6948168..731be8ea8 100644 --- a/spec/views/posts/index.html.haml_spec.rb +++ b/spec/views/posts/index.html.haml_spec.rb @@ -10,10 +10,6 @@ ## If you submit a pull request containing new view or controller tests, it will not be ## merged. - - - - require 'rails_helper' describe "posts/index" do diff --git a/spec/views/posts/index.rss.haml_spec.rb b/spec/views/posts/index.rss.haml_spec.rb index 8a2b78329..a5ee08423 100644 --- a/spec/views/posts/index.rss.haml_spec.rb +++ b/spec/views/posts/index.rss.haml_spec.rb @@ -10,10 +10,6 @@ ## If you submit a pull request containing new view or controller tests, it will not be ## merged. - - - - require 'rails_helper' describe 'posts/index.rss.haml', type: "view" do @@ -37,5 +33,4 @@ describe 'posts/index.rss.haml', type: "view" do it 'gives the author in the item title' do rendered.should have_content "#{@post1.subject} by #{@post1.author}" end - end diff --git a/spec/views/posts/new.html.haml_spec.rb b/spec/views/posts/new.html.haml_spec.rb index efdd579b0..53c01fa35 100644 --- a/spec/views/posts/new.html.haml_spec.rb +++ b/spec/views/posts/new.html.haml_spec.rb @@ -10,10 +10,6 @@ ## If you submit a pull request containing new view or controller tests, it will not be ## merged. - - - - require 'rails_helper' describe "posts/new" do @@ -74,5 +70,4 @@ describe "posts/new" do render rendered.should have_content 'Markdown' end - end diff --git a/spec/views/posts/show.html.haml_spec.rb b/spec/views/posts/show.html.haml_spec.rb index fd1a38b0d..11ac223ad 100644 --- a/spec/views/posts/show.html.haml_spec.rb +++ b/spec/views/posts/show.html.haml_spec.rb @@ -10,10 +10,6 @@ ## If you submit a pull request containing new view or controller tests, it will not be ## merged. - - - - require 'rails_helper' describe "posts/show" do @@ -120,7 +116,5 @@ describe "posts/show" do it 'shows a comment button' do assert_select "a", {href: new_comment_path(post_id: @post.id)}, "Comment" end - end - end diff --git a/spec/views/posts/show.rss.haml_spec.rb b/spec/views/posts/show.rss.haml_spec.rb index b1f2977d2..7fd1d8891 100644 --- a/spec/views/posts/show.rss.haml_spec.rb +++ b/spec/views/posts/show.rss.haml_spec.rb @@ -10,10 +10,6 @@ ## If you submit a pull request containing new view or controller tests, it will not be ## merged. - - - - require 'rails_helper' describe 'posts/show.rss.haml' do @@ -43,5 +39,4 @@ describe 'posts/show.rss.haml' do it 'shows content of comments' do rendered.should have_content "OMG LOL" end - end diff --git a/spec/views/products/edit.html.haml_spec.rb b/spec/views/products/edit.html.haml_spec.rb index 7822d1289..cb8269d9c 100644 --- a/spec/views/products/edit.html.haml_spec.rb +++ b/spec/views/products/edit.html.haml_spec.rb @@ -10,10 +10,6 @@ ## If you submit a pull request containing new view or controller tests, it will not be ## merged. - - - - require 'rails_helper' describe "products/edit" do diff --git a/spec/views/products/index.html.haml_spec.rb b/spec/views/products/index.html.haml_spec.rb index 848bbab5b..f69492169 100644 --- a/spec/views/products/index.html.haml_spec.rb +++ b/spec/views/products/index.html.haml_spec.rb @@ -10,10 +10,6 @@ ## If you submit a pull request containing new view or controller tests, it will not be ## merged. - - - - require 'rails_helper' describe "products/index" do diff --git a/spec/views/products/new.html.haml_spec.rb b/spec/views/products/new.html.haml_spec.rb index a2f9d9dac..172cdf2ee 100644 --- a/spec/views/products/new.html.haml_spec.rb +++ b/spec/views/products/new.html.haml_spec.rb @@ -10,10 +10,6 @@ ## If you submit a pull request containing new view or controller tests, it will not be ## merged. - - - - require 'rails_helper' describe "products/new" do diff --git a/spec/views/products/show.html.haml_spec.rb b/spec/views/products/show.html.haml_spec.rb index 83d517750..2aeffa783 100644 --- a/spec/views/products/show.html.haml_spec.rb +++ b/spec/views/products/show.html.haml_spec.rb @@ -10,10 +10,6 @@ ## If you submit a pull request containing new view or controller tests, it will not be ## merged. - - - - require 'rails_helper' describe "products/show" do diff --git a/spec/views/roles/edit.html.haml_spec.rb b/spec/views/roles/edit.html.haml_spec.rb index 72584b4b0..44e32b306 100644 --- a/spec/views/roles/edit.html.haml_spec.rb +++ b/spec/views/roles/edit.html.haml_spec.rb @@ -10,10 +10,6 @@ ## If you submit a pull request containing new view or controller tests, it will not be ## merged. - - - - require 'rails_helper' describe "roles/edit" do diff --git a/spec/views/roles/index.html.haml_spec.rb b/spec/views/roles/index.html.haml_spec.rb index bb4fbdd9e..00aca2be7 100644 --- a/spec/views/roles/index.html.haml_spec.rb +++ b/spec/views/roles/index.html.haml_spec.rb @@ -10,10 +10,6 @@ ## If you submit a pull request containing new view or controller tests, it will not be ## merged. - - - - require 'rails_helper' describe "roles/index" do diff --git a/spec/views/roles/new.html.haml_spec.rb b/spec/views/roles/new.html.haml_spec.rb index 341bd91f8..e884d6e64 100644 --- a/spec/views/roles/new.html.haml_spec.rb +++ b/spec/views/roles/new.html.haml_spec.rb @@ -10,10 +10,6 @@ ## If you submit a pull request containing new view or controller tests, it will not be ## merged. - - - - require 'rails_helper' describe "roles/new" do diff --git a/spec/views/roles/show.html.haml_spec.rb b/spec/views/roles/show.html.haml_spec.rb index ec2934088..cb208b487 100644 --- a/spec/views/roles/show.html.haml_spec.rb +++ b/spec/views/roles/show.html.haml_spec.rb @@ -10,10 +10,6 @@ ## If you submit a pull request containing new view or controller tests, it will not be ## merged. - - - - require 'rails_helper' describe "roles/show" do diff --git a/spec/views/scientific_names/edit.html.haml_spec.rb b/spec/views/scientific_names/edit.html.haml_spec.rb index 4911b9aac..e3aad3288 100644 --- a/spec/views/scientific_names/edit.html.haml_spec.rb +++ b/spec/views/scientific_names/edit.html.haml_spec.rb @@ -10,10 +10,6 @@ ## If you submit a pull request containing new view or controller tests, it will not be ## merged. - - - - require 'rails_helper' describe "scientific_names/edit" do @@ -39,5 +35,4 @@ describe "scientific_names/edit" do end end end - end diff --git a/spec/views/scientific_names/index.html.haml_spec.rb b/spec/views/scientific_names/index.html.haml_spec.rb index ceda2cb87..feb4d3535 100644 --- a/spec/views/scientific_names/index.html.haml_spec.rb +++ b/spec/views/scientific_names/index.html.haml_spec.rb @@ -10,10 +10,6 @@ ## If you submit a pull request containing new view or controller tests, it will not be ## merged. - - - - require 'rails_helper' describe "scientific_names/index" do diff --git a/spec/views/scientific_names/new.html.haml_spec.rb b/spec/views/scientific_names/new.html.haml_spec.rb index 4fbf196e0..90bbcd8e5 100644 --- a/spec/views/scientific_names/new.html.haml_spec.rb +++ b/spec/views/scientific_names/new.html.haml_spec.rb @@ -10,10 +10,6 @@ ## If you submit a pull request containing new view or controller tests, it will not be ## merged. - - - - require 'rails_helper' describe "scientific_names/new" do @@ -37,7 +33,5 @@ describe "scientific_names/new" do assert_select "select#scientific_name_crop_id", name: "scientific_name[crop_id]" end end - end - end diff --git a/spec/views/scientific_names/show.html.haml_spec.rb b/spec/views/scientific_names/show.html.haml_spec.rb index 2f0228a3e..d044bfbcc 100644 --- a/spec/views/scientific_names/show.html.haml_spec.rb +++ b/spec/views/scientific_names/show.html.haml_spec.rb @@ -10,10 +10,6 @@ ## If you submit a pull request containing new view or controller tests, it will not be ## merged. - - - - require 'rails_helper' describe "scientific_names/show" do @@ -31,7 +27,6 @@ describe "scientific_names/show" do end context 'signed in' do - before :each do @wrangler = FactoryGirl.create(:crop_wrangling_member) sign_in @wrangler diff --git a/spec/views/seeds/edit.html.haml_spec.rb b/spec/views/seeds/edit.html.haml_spec.rb index 995060c45..9ed744295 100644 --- a/spec/views/seeds/edit.html.haml_spec.rb +++ b/spec/views/seeds/edit.html.haml_spec.rb @@ -10,10 +10,6 @@ ## If you submit a pull request containing new view or controller tests, it will not be ## merged. - - - - require 'rails_helper' describe "seeds/edit" do diff --git a/spec/views/seeds/index.rss.haml_spec.rb b/spec/views/seeds/index.rss.haml_spec.rb index 5e1ceb62f..b2634d6b8 100644 --- a/spec/views/seeds/index.rss.haml_spec.rb +++ b/spec/views/seeds/index.rss.haml_spec.rb @@ -10,10 +10,6 @@ ## If you submit a pull request containing new view or controller tests, it will not be ## merged. - - - - require 'rails_helper' describe 'seeds/index.rss.haml' do @@ -48,7 +44,6 @@ describe 'seeds/index.rss.haml' do it 'mentions that one seed is tradable' do rendered.should have_content "Will trade #{@tradable.tradable_to} from #{@tradable.owner.location}" end - end context "one member's seeds" do diff --git a/spec/views/seeds/new.html.haml_spec.rb b/spec/views/seeds/new.html.haml_spec.rb index 2d90ede1f..2cc82f641 100644 --- a/spec/views/seeds/new.html.haml_spec.rb +++ b/spec/views/seeds/new.html.haml_spec.rb @@ -10,10 +10,6 @@ ## If you submit a pull request containing new view or controller tests, it will not be ## merged. - - - - require 'rails_helper' describe "seeds/new" do @@ -62,5 +58,4 @@ describe "seeds/new" do assert_select "a", text: "Change your location." end end - end diff --git a/spec/views/seeds/show.html.haml_spec.rb b/spec/views/seeds/show.html.haml_spec.rb index 553a92fa2..c970a2518 100644 --- a/spec/views/seeds/show.html.haml_spec.rb +++ b/spec/views/seeds/show.html.haml_spec.rb @@ -10,10 +10,6 @@ ## If you submit a pull request containing new view or controller tests, it will not be ## merged. - - - - require 'rails_helper' describe "seeds/show" do @@ -73,6 +69,5 @@ describe "seeds/show" do render rendered.should have_content "Request seeds" end - end end diff --git a/spec/views/shop/index_spec.rb b/spec/views/shop/index_spec.rb index 5c1f9caef..736168b63 100644 --- a/spec/views/shop/index_spec.rb +++ b/spec/views/shop/index_spec.rb @@ -10,10 +10,6 @@ ## If you submit a pull request containing new view or controller tests, it will not be ## merged. - - - - require 'rails_helper' describe 'shop/index.html.haml', type: "view" do @@ -83,7 +79,6 @@ describe 'shop/index.html.haml', type: "view" do render assert_select "form", false end - end context "signed out" do @@ -96,5 +91,4 @@ describe 'shop/index.html.haml', type: "view" do rendered.should have_content "sign in or sign up" end end - end From 723ebff92390fcdef1272ab810deda26791b76d7 Mon Sep 17 00:00:00 2001 From: Brenda Wallace Date: Sat, 26 Nov 2016 12:13:17 +1300 Subject: [PATCH 171/268] Spacing fixes --- .rubocop_todo.yml | 195 ------------------ app/controllers/admin/orders_controller.rb | 2 +- app/controllers/application_controller.rb | 2 +- app/controllers/crops_controller.rb | 6 +- app/controllers/follows_controller.rb | 4 +- app/controllers/harvests_controller.rb | 2 +- .../omniauth_callbacks_controller.rb | 2 +- app/controllers/plantings_controller.rb | 2 +- app/controllers/posts_controller.rb | 2 +- app/controllers/robots_controller.rb | 2 +- app/controllers/seeds_controller.rb | 4 +- app/helpers/application_helper.rb | 2 +- app/helpers/auto_suggest_helper.rb | 2 +- app/helpers/crops_helper.rb | 2 +- app/helpers/harvests_helper.rb | 6 +- app/models/ability.rb | 2 +- app/models/crop.rb | 26 +-- app/models/garden.rb | 2 +- app/models/harvest.rb | 4 +- app/models/member.rb | 14 +- app/models/order.rb | 2 +- app/models/planting.rb | 8 +- app/models/post.rb | 6 +- app/models/seed.rb | 2 +- bin/rails | 2 +- config.ru | 2 +- config/environments/test.rb | 4 +- config/initializers/devise.rb | 10 +- db/migrate/20150201052245_create_cms.rb | 6 +- db/seeds.rb | 4 +- lib/actions/oauth_signup_action.rb | 4 +- lib/geocodable.rb | 2 +- script/rails | 4 +- .../admin/orders_controller_spec.rb | 4 +- spec/controllers/comments_controller_spec.rb | 10 +- spec/controllers/gardens_controller_spec.rb | 2 +- spec/controllers/harvests_controller_spec.rb | 34 +-- spec/controllers/member_controller_spec.rb | 14 +- .../notifications_controller_spec.rb | 10 +- .../order_items_controller_spec.rb | 12 +- spec/controllers/orders_controller_spec.rb | 8 +- spec/controllers/plantings_controller_spec.rb | 8 +- spec/controllers/robots_controller_spec.rb | 2 +- spec/controllers/seeds_controller_spec.rb | 2 +- spec/custom_matchers.rb | 2 +- spec/factories/crop.rb | 2 +- spec/factories/member.rb | 6 +- spec/features/crops/browse_crops_spec.rb | 2 +- spec/features/crops/crop_detail_page_spec.rb | 10 +- spec/features/rss/plantings_spec.rb | 2 +- spec/features/rss/posts_spec.rb | 2 +- spec/features/rss/seeds_spec.rb | 2 +- spec/lib/actions/oauth_signup_action_spec.rb | 2 +- .../haml/filters/growstuff_markdown_spec.rb | 6 +- spec/models/crop_spec.rb | 2 +- spec/models/harvest_spec.rb | 3 +- spec/models/member_spec.rb | 2 +- spec/models/planting_spec.rb | 2 +- spec/models/role_spec.rb | 2 +- spec/rails_helper.rb | 4 +- spec/support/controller_macros.rb | 2 +- spec/support/elasticsearch_helpers.rb | 2 +- spec/support/feature_helpers.rb | 2 +- .../crops/_planting_advice.html.haml_spec.rb | 2 +- spec/views/crops/index.html.haml_spec.rb | 2 +- spec/views/crops/wrangle.html.haml_spec.rb | 2 +- spec/views/devise/shared/_links_spec.rb | 4 +- spec/views/forums/index.html.haml_spec.rb | 2 +- spec/views/gardens/show.html.haml_spec.rb | 2 +- spec/views/harvests/index.html.haml_spec.rb | 2 +- spec/views/members/index.html.haml_spec.rb | 2 +- .../notifications/index.html.haml_spec.rb | 2 +- .../views/notifications/new.html.haml_spec.rb | 2 +- .../notifications/show.html.haml_spec.rb | 2 +- spec/views/orders/index.html.haml_spec.rb | 2 +- spec/views/photos/new.html.haml_spec.rb | 4 +- spec/views/plantings/index.html.haml_spec.rb | 2 +- spec/views/plantings/index.rss.haml_spec.rb | 2 +- spec/views/posts/_single.html.haml_spec.rb | 4 +- spec/views/posts/edit.html.haml_spec.rb | 2 +- spec/views/posts/show.html.haml_spec.rb | 2 +- spec/views/seeds/index.rss.haml_spec.rb | 4 +- 82 files changed, 177 insertions(+), 371 deletions(-) diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml index 24a74057f..72007840e 100644 --- a/.rubocop_todo.yml +++ b/.rubocop_todo.yml @@ -610,31 +610,6 @@ Style/EmptyLiteral: Exclude: - 'app/models/member.rb' -# Offense count: 23 -# Cop supports --auto-correct. -# Configuration parameters: AllowForAlignment, ForceEqualSignAlignment. -Style/ExtraSpacing: - Exclude: - - 'app/controllers/harvests_controller.rb' - - 'app/controllers/seeds_controller.rb' - - 'app/models/ability.rb' - - 'app/models/crop.rb' - - 'app/models/member.rb' - - 'app/models/post.rb' - - 'bin/rails' - - 'config.ru' - - 'config/environments/test.rb' - - 'db/migrate/20150201052245_create_cms.rb' - - 'script/rails' - - 'spec/features/crops/browse_crops_spec.rb' - - 'spec/lib/actions/oauth_signup_action_spec.rb' - - 'spec/models/planting_spec.rb' - - 'spec/models/role_spec.rb' - - 'spec/views/crops/_planting_advice.html.haml_spec.rb' - - 'spec/views/devise/shared/_links_spec.rb' - - 'spec/views/gardens/show.html.haml_spec.rb' - - 'spec/views/photos/new.html.haml_spec.rb' - # Offense count: 1 # Configuration parameters: EnforcedStyle, SupportedStyles. # SupportedStyles: for, each @@ -714,16 +689,6 @@ Style/Lambda: - 'spec/controllers/member_controller_spec.rb' - 'spec/models/photo_spec.rb' -# Offense count: 6 -# Cop supports --auto-correct. -Style/LeadingCommentSpace: - Exclude: - - 'app/controllers/application_controller.rb' - - 'app/controllers/omniauth_callbacks_controller.rb' - - 'app/controllers/plantings_controller.rb' - - 'app/controllers/posts_controller.rb' - - 'app/controllers/seeds_controller.rb' - - 'spec/factories/crop.rb' # Offense count: 3 # Cop supports --auto-correct. @@ -1032,166 +997,6 @@ Style/SelfAssignment: Exclude: - 'app/helpers/crops_helper.rb' -# Offense count: 20 -# Cop supports --auto-correct. -Style/SpaceAfterComma: - Exclude: - - 'app/models/crop.rb' - - 'db/seeds.rb' - - 'lib/actions/oauth_signup_action.rb' - - 'spec/models/harvest_spec.rb' - - 'spec/rails_helper.rb' - -# Offense count: 6 -# Cop supports --auto-correct. -Style/SpaceAfterNot: - Exclude: - - 'app/helpers/harvests_helper.rb' - - 'app/models/crop.rb' - - 'app/models/garden.rb' - -# Offense count: 2 -# Cop supports --auto-correct. -# Configuration parameters: EnforcedStyleInsidePipes, SupportedStyles. -# SupportedStyles: space, no_space -Style/SpaceAroundBlockParameters: - Exclude: - - 'spec/custom_matchers.rb' - -# Offense count: 14 -# Cop supports --auto-correct. -# Configuration parameters: EnforcedStyle, SupportedStyles. -# SupportedStyles: space, no_space -Style/SpaceAroundEqualsInParameterDefault: - Exclude: - - 'app/helpers/application_helper.rb' - - 'app/helpers/auto_suggest_helper.rb' - - 'app/models/crop.rb' - - 'app/models/member.rb' - - 'app/models/order.rb' - - 'app/models/planting.rb' - - 'spec/lib/haml/filters/growstuff_markdown_spec.rb' - - 'spec/support/controller_macros.rb' - - 'spec/support/feature_helpers.rb' - -# Offense count: 13 -# Cop supports --auto-correct. -# Configuration parameters: AllowForAlignment. -Style/SpaceAroundOperators: - Exclude: - - 'app/controllers/harvests_controller.rb' - - 'app/controllers/seeds_controller.rb' - - 'app/models/planting.rb' - - 'app/models/post.rb' - - 'config/environments/test.rb' - - 'db/seeds.rb' - - 'spec/views/crops/_planting_advice.html.haml_spec.rb' - - 'spec/views/gardens/show.html.haml_spec.rb' - - 'spec/views/harvests/index.html.haml_spec.rb' - - 'spec/views/plantings/index.html.haml_spec.rb' - -# Offense count: 2 -# Cop supports --auto-correct. -# Configuration parameters: EnforcedStyle, SupportedStyles. -# SupportedStyles: space, no_space -Style/SpaceBeforeBlockBraces: - Exclude: - - 'app/models/crop.rb' - - 'app/models/post.rb' - -# Offense count: 1 -# Cop supports --auto-correct. -Style/SpaceBeforeComma: - Exclude: - - 'spec/controllers/member_controller_spec.rb' - -# Offense count: 16 -# Cop supports --auto-correct. -# Configuration parameters: EnforcedStyle, SupportedStyles, EnforcedStyleForEmptyBraces, SpaceBeforeBlockParameters. -# SupportedStyles: space, no_space -Style/SpaceInsideBlockBraces: - Exclude: - - 'app/helpers/crops_helper.rb' - - 'app/models/crop.rb' - - 'app/models/member.rb' - - 'app/models/post.rb' - - 'spec/factories/member.rb' - - 'spec/rails_helper.rb' - - 'spec/support/elasticsearch_helpers.rb' - - 'spec/views/notifications/new.html.haml_spec.rb' - -# Offense count: 43 -# Cop supports --auto-correct. -Style/SpaceInsideBrackets: - Exclude: - - 'app/models/crop.rb' - - 'config/initializers/devise.rb' - - 'spec/controllers/member_controller_spec.rb' - - 'spec/factories/member.rb' - - 'spec/models/crop_spec.rb' - - 'spec/models/member_spec.rb' - - 'spec/views/crops/index.html.haml_spec.rb' - - 'spec/views/crops/wrangle.html.haml_spec.rb' - - 'spec/views/forums/index.html.haml_spec.rb' - - 'spec/views/members/index.html.haml_spec.rb' - - 'spec/views/notifications/index.html.haml_spec.rb' - - 'spec/views/orders/index.html.haml_spec.rb' - - 'spec/views/plantings/index.rss.haml_spec.rb' - - 'spec/views/seeds/index.rss.haml_spec.rb' - -# Offense count: 137 -# Cop supports --auto-correct. -# Configuration parameters: EnforcedStyle, EnforcedStyleForEmptyBraces, SupportedStyles. -# SupportedStyles: space, no_space, compact -Style/SpaceInsideHashLiteralBraces: - Exclude: - - 'app/controllers/admin/orders_controller.rb' - - 'app/controllers/crops_controller.rb' - - 'app/models/crop.rb' - - 'app/models/harvest.rb' - - 'app/models/member.rb' - - 'app/models/planting.rb' - - 'app/models/seed.rb' - - 'db/migrate/20150201052245_create_cms.rb' - - 'lib/geocodable.rb' - - 'spec/controllers/admin/orders_controller_spec.rb' - - 'spec/controllers/comments_controller_spec.rb' - - 'spec/controllers/gardens_controller_spec.rb' - - 'spec/controllers/harvests_controller_spec.rb' - - 'spec/controllers/member_controller_spec.rb' - - 'spec/controllers/notifications_controller_spec.rb' - - 'spec/controllers/order_items_controller_spec.rb' - - 'spec/controllers/orders_controller_spec.rb' - - 'spec/controllers/plantings_controller_spec.rb' - - 'spec/controllers/seeds_controller_spec.rb' - - 'spec/views/notifications/show.html.haml_spec.rb' - - 'spec/views/photos/new.html.haml_spec.rb' - - 'spec/views/posts/_single.html.haml_spec.rb' - - 'spec/views/posts/show.html.haml_spec.rb' - -# Offense count: 5 -# Cop supports --auto-correct. -Style/SpaceInsideParens: - Exclude: - - 'app/models/crop.rb' - - 'config/environments/test.rb' - - 'spec/lib/haml/filters/growstuff_markdown_spec.rb' - - 'spec/views/posts/edit.html.haml_spec.rb' - -# Offense count: 12 -# Cop supports --auto-correct. -# Configuration parameters: EnforcedStyle, SupportedStyles. -# SupportedStyles: space, no_space -Style/SpaceInsideStringInterpolation: - Exclude: - - 'app/controllers/follows_controller.rb' - - 'app/controllers/robots_controller.rb' - - 'spec/controllers/robots_controller_spec.rb' - - 'spec/features/crops/crop_detail_page_spec.rb' - - 'spec/features/rss/plantings_spec.rb' - - 'spec/features/rss/posts_spec.rb' - - 'spec/features/rss/seeds_spec.rb' - # Offense count: 2 # Cop supports --auto-correct. # Configuration parameters: SupportedStyles. diff --git a/app/controllers/admin/orders_controller.rb b/app/controllers/admin/orders_controller.rb index 88b9bc611..574afc024 100644 --- a/app/controllers/admin/orders_controller.rb +++ b/app/controllers/admin/orders_controller.rb @@ -8,7 +8,7 @@ class Admin::OrdersController < ApplicationController def search authorize! :manage, :all - @orders = Order.search({by: params[:search_by], for: params[:search_text]}) + @orders = Order.search({ by: params[:search_by], for: params[:search_text] }) if @orders.empty? flash[:alert] = "Couldn't find order with #{params[:search_by]} = #{params[:search_text]}" diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index 9cd3fa3de..45c657b64 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -73,7 +73,7 @@ class ApplicationController < ActionController::Base :bio, :location, :latitude, :longitude, # email settings :show_email, :newsletter, :send_notification_email, :send_planting_reminder, - #update password + # update password :current_password ) end diff --git a/app/controllers/crops_controller.rb b/app/controllers/crops_controller.rb index 4dc5377fd..dac763665 100644 --- a/app/controllers/crops_controller.rb +++ b/app/controllers/crops_controller.rb @@ -11,11 +11,11 @@ class CropsController < ApplicationController @sort = params[:sort] if @sort == 'alpha' # alphabetical order - @crops = Crop.includes(:scientific_names, {plantings: :photos}) + @crops = Crop.includes(:scientific_names, { plantings: :photos }) @paginated_crops = @crops.approved.paginate(page: params[:page]) else # default to sorting by popularity - @crops = Crop.popular.includes(:scientific_names, {plantings: :photos}) + @crops = Crop.popular.includes(:scientific_names, { plantings: :photos }) @paginated_crops = @crops.approved.paginate(page: params[:page]) end @@ -77,7 +77,7 @@ class CropsController < ApplicationController # GET /crops/1 # GET /crops/1.json def show - @crop = Crop.includes(:scientific_names, {plantings: :photos}).find(params[:id]) + @crop = Crop.includes(:scientific_names, { plantings: :photos }).find(params[:id]) @posts = @crop.posts.paginate(page: params[:page]) respond_to do |format| diff --git a/app/controllers/follows_controller.rb b/app/controllers/follows_controller.rb index 4e62925e6..58a1ce795 100644 --- a/app/controllers/follows_controller.rb +++ b/app/controllers/follows_controller.rb @@ -8,7 +8,7 @@ class FollowsController < ApplicationController @follow = current_member.follows.build(followed_id: follow_params[:followed_id]) if @follow.save - flash[:notice] = "Followed #{ @follow.followed.login_name }" + flash[:notice] = "Followed #{@follow.followed.login_name}" redirect_to :back else flash[:error] = "Already following or error while following." @@ -22,7 +22,7 @@ class FollowsController < ApplicationController unfollowed_name = @follow.followed.login_name @follow.destroy - flash[:notice] = "Unfollowed #{ unfollowed_name }" + flash[:notice] = "Unfollowed #{unfollowed_name}" redirect_to root_path end diff --git a/app/controllers/harvests_controller.rb b/app/controllers/harvests_controller.rb index ad557efcd..051cb1132 100644 --- a/app/controllers/harvests_controller.rb +++ b/app/controllers/harvests_controller.rb @@ -32,7 +32,7 @@ class HarvestsController < ApplicationController @harvest = Harvest.new('harvested_at' => Date.today) # using find_by_id here because it returns nil, unlike find - @crop = Crop.find_by_id(params[:crop_id]) || Crop.new + @crop = Crop.find_by_id(params[:crop_id]) || Crop.new respond_to do |format| format.html # new.html.erb diff --git a/app/controllers/omniauth_callbacks_controller.rb b/app/controllers/omniauth_callbacks_controller.rb index f6912f55f..e89f7577a 100644 --- a/app/controllers/omniauth_callbacks_controller.rb +++ b/app/controllers/omniauth_callbacks_controller.rb @@ -28,7 +28,7 @@ class OmniauthCallbacksController < Devise::OmniauthCallbacksController @authentication = action.establish_authentication(auth, member) unless action.member_created? - sign_in_and_redirect member, event: :authentication #this will throw if @user is not activated + sign_in_and_redirect member, event: :authentication # this will throw if @user is not activated set_flash_message(:notice, :success, kind: auth['provider']) if is_navigational_format? else raise "Invalid provider" unless ['facebook', 'twitter', 'flickr'].index(auth['provider'].to_s) diff --git a/app/controllers/plantings_controller.rb b/app/controllers/plantings_controller.rb index 11e9662f8..2c4589e40 100644 --- a/app/controllers/plantings_controller.rb +++ b/app/controllers/plantings_controller.rb @@ -18,7 +18,7 @@ class PlantingsController < ApplicationController respond_to do |format| format.html { @plantings = @plantings.paginate(page: params[:page]) } format.json { render json: @plantings } - format.rss { render layout: false } #index.rss.builder + format.rss { render layout: false } # index.rss.builder format.csv do specifics = (@owner ? "#{@owner.login_name}-" : @crop ? "#{@crop.name}-" : nil) @filename = "Growstuff-#{specifics}Plantings-#{Time.zone.now.to_s(:number)}.csv" diff --git a/app/controllers/posts_controller.rb b/app/controllers/posts_controller.rb index f1d2b62ae..48216ac87 100644 --- a/app/controllers/posts_controller.rb +++ b/app/controllers/posts_controller.rb @@ -16,7 +16,7 @@ class PostsController < ApplicationController respond_to do |format| format.html # index.html.haml format.json { render json: @posts } - format.rss { render layout: false } #index.rss.builder + format.rss { render layout: false } # index.rss.builder end end diff --git a/app/controllers/robots_controller.rb b/app/controllers/robots_controller.rb index 777bc9aa4..d74ffe20f 100644 --- a/app/controllers/robots_controller.rb +++ b/app/controllers/robots_controller.rb @@ -2,7 +2,7 @@ class RobotsController < ApplicationController DEFAULT_FILENAME = 'config/robots.txt'.freeze def robots - filename = "config/robots.#{ subdomain }.txt" if subdomain && subdomain != 'www' + filename = "config/robots.#{subdomain}.txt" if subdomain && subdomain != 'www' file_to_render = File.exists?(filename.to_s) ? filename : DEFAULT_FILENAME render file: file_to_render, layout: false, content_type: 'text/plain' end diff --git a/app/controllers/seeds_controller.rb b/app/controllers/seeds_controller.rb index 092dbc2ba..188855f45 100644 --- a/app/controllers/seeds_controller.rb +++ b/app/controllers/seeds_controller.rb @@ -18,7 +18,7 @@ class SeedsController < ApplicationController respond_to do |format| format.html # index.html.erb format.json { render json: @seeds } - format.rss { render layout: false } #index.rss.builder + format.rss { render layout: false } # index.rss.builder format.csv do if @owner @filename = "Growstuff-#{@owner}-Seeds-#{Time.zone.now.to_s(:number)}.csv" @@ -49,7 +49,7 @@ class SeedsController < ApplicationController @seed = Seed.new # using find_by_id here because it returns nil, unlike find - @crop = Crop.find_by_id(params[:crop_id]) || Crop.new + @crop = Crop.find_by_id(params[:crop_id]) || Crop.new respond_to do |format| format.html # new.html.erb diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 60e057301..0aa552bdf 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -38,7 +38,7 @@ module ApplicationHelper end # Produces a cache key for uniquely identifying cached fragments. - def cache_key_for(klass, identifier="all") + def cache_key_for(klass, identifier = "all") count = klass.count max_updated_at = klass.maximum(:updated_at).try(:utc).try(:to_s, :number) "#{klass.name.downcase.pluralize}/#{identifier}-#{count}-#{max_updated_at}" diff --git a/app/helpers/auto_suggest_helper.rb b/app/helpers/auto_suggest_helper.rb index fb29cdfc3..a8a86de56 100644 --- a/app/helpers/auto_suggest_helper.rb +++ b/app/helpers/auto_suggest_helper.rb @@ -1,5 +1,5 @@ module AutoSuggestHelper - def auto_suggest(resource, source, options={}) + def auto_suggest(resource, source, options = {}) if options[:default] && !options[:default].new_record? default = options[:default] default_id = options[:default].try(:id) diff --git a/app/helpers/crops_helper.rb b/app/helpers/crops_helper.rb index 512efce8d..da3f72f10 100644 --- a/app/helpers/crops_helper.rb +++ b/app/helpers/crops_helper.rb @@ -2,7 +2,7 @@ module CropsHelper def display_seed_availability(member, crop) total_quantity = 0 - seeds = member.seeds.select {|seed| seed.crop.name == crop.name } + seeds = member.seeds.select { |seed| seed.crop.name == crop.name } seeds.each do |seed| total_quantity = total_quantity + seed.quantity if seed.quantity diff --git a/app/helpers/harvests_helper.rb b/app/helpers/harvests_helper.rb index 431083de3..d848d919f 100644 --- a/app/helpers/harvests_helper.rb +++ b/app/helpers/harvests_helper.rb @@ -15,10 +15,10 @@ module HarvestsHelper end def display_human_quantity(harvest) - if ! harvest.quantity.blank? && harvest.quantity > 0 + if !harvest.quantity.blank? && harvest.quantity > 0 if harvest.unit == 'individual' # just the number number_to_human(harvest.quantity, strip_insignificant_zeros: true) - elsif ! harvest.unit.blank? # pluralize anything else + elsif !harvest.unit.blank? # pluralize anything else return pluralize(number_to_human(harvest.quantity, strip_insignificant_zeros: true), harvest.unit) else return "#{number_to_human(harvest.quantity, strip_insignificant_zeros: true)} #{harvest.unit}" @@ -29,7 +29,7 @@ module HarvestsHelper end def display_weight(harvest) - if ! harvest.weight_quantity.blank? && harvest.weight_quantity > 0 + if !harvest.weight_quantity.blank? && harvest.weight_quantity > 0 return "#{number_to_human(harvest.weight_quantity, strip_insignificant_zeros: true)} #{harvest.weight_unit}" else return nil diff --git a/app/models/ability.rb b/app/models/ability.rb index d0b9c2f56..4ce056438 100644 --- a/app/models/ability.rb +++ b/app/models/ability.rb @@ -108,7 +108,7 @@ class Ability can :cancel, Order, member_id: member.id, completed_at: nil can :destroy, Order, member_id: member.id, completed_at: nil - can :create, OrderItem + can :create, OrderItem # for now, let's not let people mess with individual order items cannot :read, OrderItem, order: { member_id: member.id } cannot :update, OrderItem, order: { member_id: member.id, completed_at: nil } diff --git a/app/models/crop.rb b/app/models/crop.rb index 0bf6916e3..47829f463 100644 --- a/app/models/crop.rb +++ b/app/models/crop.rb @@ -19,7 +19,7 @@ class Crop < ActiveRecord::Base # rubocop:disable Metrics/ClassLength belongs_to :parent, class_name: 'Crop' has_many :varieties, class_name: 'Crop', foreign_key: 'parent_id' has_and_belongs_to_many :posts - before_destroy {|crop| crop.posts.clear} + before_destroy { |crop| crop.posts.clear } default_scope { order("lower(name) asc") } scope :recent, lambda { @@ -31,7 +31,7 @@ class Crop < ActiveRecord::Base # rubocop:disable Metrics/ClassLength scope :popular, lambda { where(approval_status: "approved").reorder("plantings_count desc, lower(name) asc") } - scope :randomized, lambda { + scope :randomized, lambda { # ok on sqlite and psql, but not on mysql where(approval_status: "approved").reorder('random()') } @@ -69,12 +69,12 @@ class Crop < ActiveRecord::Base # rubocop:disable Metrics/ClassLength analysis: { tokenizer: { gs_edgeNGram_tokenizer: { - type: "edgeNGram", # edgeNGram: NGram match from the start of a token + type: "edgeNGram", # edgeNGram: NGram match from the start of a token min_gram: 3, max_gram: 10, # token_chars: Elasticsearch will split on characters # that don’t belong to any of these classes - token_chars: [ "letter", "digit" ] + token_chars: ["letter", "digit"] } }, analyzer: { @@ -103,7 +103,7 @@ class Crop < ActiveRecord::Base # rubocop:disable Metrics/ClassLength end end - def as_indexed_json(options={}) + def as_indexed_json(options = {}) self.as_json( only: [:id, :name, :approval_status], include: { @@ -210,11 +210,11 @@ class Crop < ActiveRecord::Base # rubocop:disable Metrics/ClassLength end def approval_statuses - [ 'rejected', 'pending', 'approved' ] + ['rejected', 'pending', 'approved'] end def reasons_for_rejection - [ "already in database", "not edible", "not enough information", "other" ] + ["already in database", "not edible", "not enough information", "other"] end # Crop.interesting @@ -239,7 +239,7 @@ class Crop < ActiveRecord::Base # rubocop:disable Metrics/ClassLength # - scientific name (optional, can be picked up from parent if it has one) def Crop.create_from_csv(row) - name,en_wikipedia_url,parent,scientific_names,alternate_names = row + name, en_wikipedia_url, parent, scientific_names, alternate_names = row cropbot = Member.find_by_login_name('cropbot') raise "cropbot account not found: run rake db:seed" unless cropbot @@ -265,10 +265,10 @@ class Crop < ActiveRecord::Base # rubocop:disable Metrics/ClassLength def add_scientific_names_from_csv(scientific_names) names_to_add = [] - if ! scientific_names.blank? # i.e. we actually passed something in, which isn't a given + if !scientific_names.blank? # i.e. we actually passed something in, which isn't a given names_to_add = scientific_names.split(%r{,\s*}) elsif parent && parent.scientific_names.size > 0 # pick up from parent - names_to_add = parent.scientific_names.map{|s| s.scientific_name} + names_to_add = parent.scientific_names.map { |s| s.scientific_name } else logger.warn("Warning: no scientific name (not even on parent crop) for #{self}") end @@ -293,7 +293,7 @@ class Crop < ActiveRecord::Base # rubocop:disable Metrics/ClassLength def add_alternate_names_from_csv(alternate_names) names_to_add = [] - if ! alternate_names.blank? # i.e. we actually passed something in, which isn't a given + if !alternate_names.blank? # i.e. we actually passed something in, which isn't a given cropbot = Member.find_by_login_name('cropbot') raise "cropbot account not found: run rake db:seed" unless cropbot @@ -325,7 +325,7 @@ class Crop < ActiveRecord::Base # rubocop:disable Metrics/ClassLength def self.search(query) if ENV['GROWSTUFF_ELASTICSEARCH'] == "true" search_str = query.nil? ? "" : query.downcase - response = __elasticsearch__.search( { + response = __elasticsearch__.search({ # Finds documents which match any field, but uses the _score from # the best field insead of adding up _score from each field. query: { @@ -338,7 +338,7 @@ class Crop < ActiveRecord::Base # rubocop:disable Metrics/ClassLength } }, filter: { - term: {approval_status: "approved"} + term: { approval_status: "approved" } }, size: 50 } diff --git a/app/models/garden.rb b/app/models/garden.rb index f13754946..79ebe0260 100644 --- a/app/models/garden.rb +++ b/app/models/garden.rb @@ -76,7 +76,7 @@ class Garden < ActiveRecord::Base seen_crops = [] plantings.each do |p| - if (! seen_crops.include?(p.crop)) + if (!seen_crops.include?(p.crop)) unique_plantings.push(p) seen_crops.push(p.crop) end diff --git a/app/models/harvest.rb b/app/models/harvest.rb index 7ac418287..425ae0da9 100644 --- a/app/models/harvest.rb +++ b/app/models/harvest.rb @@ -22,9 +22,9 @@ class Harvest < ActiveRecord::Base validates :crop, approved: true - validates :crop, presence: {message: "must be present and exist in our database"} + validates :crop, presence: { message: "must be present and exist in our database" } - validates :plant_part, presence: {message: "must be present and exist in our database"} + validates :plant_part, presence: { message: "must be present and exist in our database" } validates :quantity, numericality: { diff --git a/app/models/member.rb b/app/models/member.rb index 4e403deb5..018860365 100644 --- a/app/models/member.rb +++ b/app/models/member.rb @@ -4,7 +4,7 @@ class Member < ActiveRecord::Base friendly_id :login_name, use: [:slugged, :finders] - has_many :posts, foreign_key: 'author_id' + has_many :posts, foreign_key: 'author_id' has_many :comments, foreign_key: 'author_id' has_many :forums, foreign_key: 'owner_id' @@ -79,12 +79,12 @@ class Member < ActiveRecord::Base } # Give each new member a default garden - after_create {|member| Garden.create(name: "Garden", owner_id: member.id) } + after_create { |member| Garden.create(name: "Garden", owner_id: member.id) } # and an account record (for paid accounts etc) # we use find_or_create to avoid accidentally creating a second one, # which can happen sometimes especially with FactoryGirl associations - after_create {|member| Account.find_or_create_by(member_id: member.id) } + after_create { |member| Account.find_or_create_by(member_id: member.id) } after_save :update_newsletter_subscription @@ -158,7 +158,7 @@ class Member < ActiveRecord::Base # Fetches a collection of photos from Flickr # Returns a [[page of photos], total] pair. # Total is needed for pagination. - def flickr_photos(page_num=1, set=nil) + def flickr_photos(page_num = 1, set = nil) result = false result = if set flickr.photosets.getPhotos( @@ -212,7 +212,7 @@ class Member < ActiveRecord::Base def Member.nearest_to(place) nearby_members = [] if place - latitude, longitude = Geocoder.coordinates(place, params: {limit: 1}) + latitude, longitude = Geocoder.coordinates(place, params: { limit: 1 }) if latitude && longitude nearby_members = Member.located.sort_by { |x| x.distance_from([latitude, longitude]) } end @@ -234,7 +234,7 @@ class Member < ActiveRecord::Base end end - def newsletter_subscribe(testing=false) + def newsletter_subscribe(testing = false) return true if (Rails.env.test? && !testing) gb = Gibbon::API.new res = gb.lists.subscribe({ @@ -245,7 +245,7 @@ class Member < ActiveRecord::Base }) end - def newsletter_unsubscribe(testing=false) + def newsletter_unsubscribe(testing = false) return true if (Rails.env.test? && !testing) gb = Gibbon::API.new res = gb.lists.unsubscribe({ diff --git a/app/models/order.rb b/app/models/order.rb index 9a15091d6..df8609184 100644 --- a/app/models/order.rb +++ b/app/models/order.rb @@ -62,7 +62,7 @@ class Order < ActiveRecord::Base # search orders (used by admin/orders) # usage: Order.search({ :by => 'member', :for => 'Skud' }) # can search by: member, order_id, paypal_token, paypal_payer_id, - def Order.search(args={}) + def Order.search(args = {}) if args[:for] case args[:by] when "member" diff --git a/app/models/planting.rb b/app/models/planting.rb index 899b13e90..8dc339687 100644 --- a/app/models/planting.rb +++ b/app/models/planting.rb @@ -32,7 +32,7 @@ class Planting < ActiveRecord::Base validates :crop, approved: true - validates :crop, presence: {message: "must be present and exist in our database"} + validates :crop, presence: { message: "must be present and exist in our database" } validates :quantity, numericality: { @@ -105,7 +105,7 @@ class Planting < ActiveRecord::Base if differences.compact.empty? nil else - differences.compact.sum/differences.compact.size + differences.compact.sum / differences.compact.size end end @@ -120,7 +120,7 @@ class Planting < ActiveRecord::Base return 0 if current_date < planted_at return 100 if days > days_before_maturity - percent = (days/days_before_maturity*100).to_i + percent = (days / days_before_maturity * 100).to_i if percent >= 100 percent = 100 @@ -132,7 +132,7 @@ class Planting < ActiveRecord::Base # return a list of interesting plantings, for the homepage etc. # we can't do this via a scope (as far as we know) so sadly we have to # do it this way. - def Planting.interesting(howmany=12, require_photo=true) + def Planting.interesting(howmany = 12, require_photo = true) interesting_plantings = [] seen_owners = Hash.new(false) # keep track of which owners we've seen already diff --git a/app/models/post.rb b/app/models/post.rb index f875c8ad8..ed4bcad73 100644 --- a/app/models/post.rb +++ b/app/models/post.rb @@ -5,14 +5,14 @@ class Post < ActiveRecord::Base belongs_to :forum has_many :comments, dependent: :destroy has_and_belongs_to_many :crops - before_destroy {|post| post.crops.clear} + before_destroy { |post| post.crops.clear } after_save :update_crops_posts_association # also has_many notifications, but kinda meaningless to get at them # from this direction, so we won't set up an association for now. after_create do recipients = [] - sender = self.author.id + sender = self.author.id self.body.scan(Haml::Filters::GrowstuffMarkdown::MEMBER_REGEX) do |m| # find member case-insensitively and add to list of recipients member = Member.where('lower(login_name) = ?', $1.downcase).first @@ -24,7 +24,7 @@ class Post < ActiveRecord::Base recipients << member if member && !recipients.include?(member) end # don't send notifications to yourself - recipients.map{ |r| r.id }.each do |recipient| + recipients.map { |r| r.id }.each do |recipient| if recipient != sender Notification.create( recipient_id: recipient, diff --git a/app/models/seed.rb b/app/models/seed.rb index 153b18a48..4c8a1c1c7 100644 --- a/app/models/seed.rb +++ b/app/models/seed.rb @@ -9,7 +9,7 @@ class Seed < ActiveRecord::Base validates :crop, approved: true - validates :crop, presence: {message: "must be present and exist in our database"} + validates :crop, presence: { message: "must be present and exist in our database" } validates :quantity, numericality: { only_integer: true, diff --git a/bin/rails b/bin/rails index 728cd85aa..5191e6927 100755 --- a/bin/rails +++ b/bin/rails @@ -1,4 +1,4 @@ #!/usr/bin/env ruby -APP_PATH = File.expand_path('../../config/application', __FILE__) +APP_PATH = File.expand_path('../../config/application', __FILE__) require_relative '../config/boot' require 'rails/commands' diff --git a/config.ru b/config.ru index f2d9c08c2..d30ee4f18 100644 --- a/config.ru +++ b/config.ru @@ -1,4 +1,4 @@ # This file is used by Rack-based servers to start the application. -require ::File.expand_path('../config/environment', __FILE__) +require ::File.expand_path('../config/environment', __FILE__) run Growstuff::Application diff --git a/config/environments/test.rb b/config/environments/test.rb index d00fecf0e..35836c90b 100644 --- a/config/environments/test.rb +++ b/config/environments/test.rb @@ -26,7 +26,7 @@ Growstuff::Application.configure do config.action_dispatch.show_exceptions = true # Disable request forgery protection in test environment - config.action_controller.allow_forgery_protection = false + config.action_controller.allow_forgery_protection = false # Tell Action Mailer not to deliver emails to the real world. # The :test delivery method accumulates sent emails in the @@ -100,7 +100,7 @@ Geocoder::Lookup::Test.add_stub( ) # Unknown location -Geocoder::Lookup::Test.add_stub( "Tatooine", []) +Geocoder::Lookup::Test.add_stub("Tatooine", []) Capybara.configure do |config| config.always_include_port = true diff --git a/config/initializers/devise.rb b/config/initializers/devise.rb index 3a7e49d44..ad33e335d 100644 --- a/config/initializers/devise.rb +++ b/config/initializers/devise.rb @@ -26,7 +26,7 @@ Devise.setup do |config| # session. If you need permissions, you should implement that in a before filter. # You can also supply a hash where the value is a boolean determining whether # or not authentication should be aborted when the value is not present. - config.authentication_keys = [ :login ] + config.authentication_keys = [:login] # Configure parameters from the request object used for authentication. Each entry # given should be a request method and it will automatically be passed to the @@ -38,12 +38,12 @@ Devise.setup do |config| # Configure which authentication keys should be case-insensitive. # These keys will be downcased upon creating or modifying a user and when used # to authenticate or find a user. Default is :email. - config.case_insensitive_keys = [ :email ] + config.case_insensitive_keys = [:email] # Configure which authentication keys should have whitespace stripped. # These keys will have whitespace before and after removed upon creating or # modifying a user and when used to authenticate or find a user. Default is :email. - config.strip_whitespace_keys = [ :email, :login_name ] + config.strip_whitespace_keys = [:email, :login_name] # Tell if authentication through request.params is enabled. True by default. # It can be set to an array that will enable params authentication only for the @@ -102,7 +102,7 @@ Devise.setup do |config| config.reconfirmable = true # Defines which key will be used when confirming an account - config.confirmation_keys = [ :login ] + config.confirmation_keys = [:login] # ==> Configuration for :rememberable # The time the user will be remembered without asking for credentials again. @@ -158,7 +158,7 @@ Devise.setup do |config| # ==> Configuration for :recoverable # # Defines which key will be used when recovering the password for an account - config.reset_password_keys = [ :login ] + config.reset_password_keys = [:login] # Time interval you can reset your password with a reset password key. # Don't put a too small interval or your users won't have the time to diff --git a/db/migrate/20150201052245_create_cms.rb b/db/migrate/20150201052245_create_cms.rb index a464e5b06..2a187e66f 100644 --- a/db/migrate/20150201052245_create_cms.rb +++ b/db/migrate/20150201052245_create_cms.rb @@ -2,7 +2,7 @@ class CreateCms < ActiveRecord::Migration def self.up # rubocop:disable Metrics/MethodLength text_limit = case ActiveRecord::Base.connection.adapter_name when 'PostgreSQL' - { } + {} else { limit: 16777215 } end @@ -42,7 +42,7 @@ class CreateCms < ActiveRecord::Migration t.integer :layout_id t.integer :parent_id t.integer :target_page_id - t.string :label, null: false + t.string :label, null: false t.string :slug t.string :full_path, null: false t.text :content_cache, text_limit @@ -80,7 +80,7 @@ class CreateCms < ActiveRecord::Migration # -- Files -------------------------------------------------------------- create_table :comfy_cms_files do |t| - t.integer :site_id, null: false + t.integer :site_id, null: false t.integer :block_id t.string :label, null: false t.string :file_file_name, null: false diff --git a/db/seeds.rb b/db/seeds.rb index 551dd8308..6503cde74 100644 --- a/db/seeds.rb +++ b/db/seeds.rb @@ -87,7 +87,7 @@ def load_test_users suburb_file.pos = 0 if suburb_file.eof? row = CSV.parse(suburb_file.readline) - suburb,country,state,latitude,longitude = row[0] + suburb, country, state, latitude, longitude = row[0] # Using 'update_column' method instead of 'update' so that # it avoids accessing Geocoding service for faster processing @user.gardens.first.update_columns(location: suburb, latitude: latitude, longitude: longitude) @@ -198,7 +198,7 @@ def load_plant_parts end def select_random_item(array) - array[rand(0..array.size-1) % array.size] + array[rand(0..array.size - 1) % array.size] end load_data diff --git a/lib/actions/oauth_signup_action.rb b/lib/actions/oauth_signup_action.rb index 533a69b64..7d4913c21 100644 --- a/lib/actions/oauth_signup_action.rb +++ b/lib/actions/oauth_signup_action.rb @@ -11,14 +11,14 @@ class Growstuff::OauthSignupAction def find_or_create_from_authorization(auth) member ||= Member.where(email: auth.info.email).first_or_create do |m| m.email = auth.info.email - m.password = Devise.friendly_token[0,20] + m.password = Devise.friendly_token[0, 20] # First, try the nickname or friendly generate from the email m.login_name = auth.info.nickname || auth.info.email.split("@").first.gsub(/[^A-Za-z]+/, '_').underscore # Do we have a collision with an existing account? Generate a 20 character long random name # so the user can update it later - m.login_name = Devise.friendly_token[0,20] if Member.where(login_name: m.login_name).any? + m.login_name = Devise.friendly_token[0, 20] if Member.where(login_name: m.login_name).any? m.preferred_avatar_uri = auth.info.image # assuming the user model has an image m.skip_confirmation! diff --git a/lib/geocodable.rb b/lib/geocodable.rb index 3e960b0de..68b137acf 100644 --- a/lib/geocodable.rb +++ b/lib/geocodable.rb @@ -8,7 +8,7 @@ module Geocodable def geocode unless self.location.blank? self.latitude, self.longitude = - Geocoder.coordinates(location, params: {limit: 1}) + Geocoder.coordinates(location, params: { limit: 1 }) end end diff --git a/script/rails b/script/rails index 8c7d72b27..9092f9f3c 100755 --- a/script/rails +++ b/script/rails @@ -2,6 +2,6 @@ # This command will automatically be run when you run "rails" # with Rails 3 gems installed from the root of your application. -APP_PATH = File.expand_path('../../config/application', __FILE__) -require File.expand_path('../../config/boot', __FILE__) +APP_PATH = File.expand_path('../../config/application', __FILE__) +require File.expand_path('../../config/boot', __FILE__) require 'rails/commands' diff --git a/spec/controllers/admin/orders_controller_spec.rb b/spec/controllers/admin/orders_controller_spec.rb index 0efdc0969..4c407c34d 100644 --- a/spec/controllers/admin/orders_controller_spec.rb +++ b/spec/controllers/admin/orders_controller_spec.rb @@ -18,13 +18,13 @@ describe Admin::OrdersController do describe "GET search" do it "assigns @orders" do order = FactoryGirl.create(:order) - get :search, {search_by: 'order_id', search_text: order.id} + get :search, { search_by: 'order_id', search_text: order.id } assigns(:orders).should eq([order]) end it "sets an error message if nothing found" do order = FactoryGirl.create(:order) - get :search, {search_by: 'order_id', search_text: 'foo'} + get :search, { search_by: 'order_id', search_text: 'foo' } flash[:alert].should match /Couldn't find order with/ end end diff --git a/spec/controllers/comments_controller_spec.rb b/spec/controllers/comments_controller_spec.rb index be816dfa9..01d41e7b7 100644 --- a/spec/controllers/comments_controller_spec.rb +++ b/spec/controllers/comments_controller_spec.rb @@ -36,14 +36,14 @@ describe CommentsController do describe "GET new" do it "picks up post from params" do post = FactoryGirl.create(:post) - get :new, {post_id: post.id} + get :new, { post_id: post.id } assigns(:post).should eq(post) end it "assigns the old comments as @comments" do post = FactoryGirl.create(:post) old_comment = FactoryGirl.create(:comment, post: post) - get :new, {post_id: post.id} + get :new, { post_id: post.id } assigns(:comments).should eq [old_comment] end @@ -58,7 +58,7 @@ describe CommentsController do post = FactoryGirl.create(:post) old_comment = FactoryGirl.create(:comment, post: post) comment = FactoryGirl.create(:comment, post: post, author: @member) - get :edit, {id: comment.to_param} + get :edit, { id: comment.to_param } assigns(:comments).should eq([comment, old_comment]) end end @@ -67,7 +67,7 @@ describe CommentsController do describe "with valid params" do it "redirects to the comment's post" do comment = Comment.create! valid_attributes - put :update, {id: comment.to_param, comment: valid_attributes} + put :update, { id: comment.to_param, comment: valid_attributes } response.should redirect_to(comment.post) end end @@ -77,7 +77,7 @@ describe CommentsController do it "redirects to the post the comment was on" do comment = Comment.create! valid_attributes post = comment.post - delete :destroy, {id: comment.to_param} + delete :destroy, { id: comment.to_param } response.should redirect_to(post) end end diff --git a/spec/controllers/gardens_controller_spec.rb b/spec/controllers/gardens_controller_spec.rb index 3483d70c3..790e1f8be 100644 --- a/spec/controllers/gardens_controller_spec.rb +++ b/spec/controllers/gardens_controller_spec.rb @@ -17,6 +17,6 @@ describe GardensController do def valid_attributes member = FactoryGirl.create(:member) - {name: 'My Garden', owner_id: member.id } + { name: 'My Garden', owner_id: member.id } end end diff --git a/spec/controllers/harvests_controller_spec.rb b/spec/controllers/harvests_controller_spec.rb index 2eedfc2e3..b07f1c08a 100644 --- a/spec/controllers/harvests_controller_spec.rb +++ b/spec/controllers/harvests_controller_spec.rb @@ -39,19 +39,19 @@ describe HarvestsController do end it "picks up owner from params and shows owner's harvests only" do - get :index, {owner: @member1.slug} + get :index, { owner: @member1.slug } assigns(:owner).should eq @member1 assigns(:harvests).should eq [@harvest1] end it "picks up crop from params and shows the harvests for the crop only" do - get :index, {crop: @maize.name} + get :index, { crop: @maize.name } assigns(:crop).should eq @maize assigns(:harvests).should eq [@harvest2] end it "generates a csv" do - get :index, {format: "csv"} + get :index, { format: "csv" } response.status.should eq 200 end end @@ -59,7 +59,7 @@ describe HarvestsController do describe "GET show" do it "assigns the requested harvest as @harvest" do harvest = Harvest.create! valid_attributes - get :show, {id: harvest.to_param} + get :show, { id: harvest.to_param } assigns(:harvest).should eq(harvest) end end @@ -74,7 +74,7 @@ describe HarvestsController do describe "GET edit" do it "assigns the requested harvest as @harvest" do harvest = Harvest.create! valid_attributes - get :edit, {id: harvest.to_param} + get :edit, { id: harvest.to_param } assigns(:harvest).should eq(harvest) end end @@ -83,18 +83,18 @@ describe HarvestsController do describe "with valid params" do it "creates a new Harvest" do expect { - post :create, {harvest: valid_attributes} + post :create, { harvest: valid_attributes } }.to change(Harvest, :count).by(1) end it "assigns a newly created harvest as @harvest" do - post :create, {harvest: valid_attributes} + post :create, { harvest: valid_attributes } assigns(:harvest).should be_a(Harvest) assigns(:harvest).should be_persisted end it "redirects to the created harvest" do - post :create, {harvest: valid_attributes} + post :create, { harvest: valid_attributes } response.should redirect_to(Harvest.last) end end @@ -103,14 +103,14 @@ describe HarvestsController do it "assigns a newly created but unsaved harvest as @harvest" do # Trigger the behavior that occurs when invalid params are submitted Harvest.any_instance.stub(:save).and_return(false) - post :create, {harvest: { "crop_id" => "invalid value" }} + post :create, { harvest: { "crop_id" => "invalid value" } } assigns(:harvest).should be_a_new(Harvest) end it "re-renders the 'new' template" do # Trigger the behavior that occurs when invalid params are submitted Harvest.any_instance.stub(:save).and_return(false) - post :create, {harvest: { "crop_id" => "invalid value" }} + post :create, { harvest: { "crop_id" => "invalid value" } } response.should render_template("new") end end @@ -125,18 +125,18 @@ describe HarvestsController do # receives the :update message with whatever params are # submitted in the request. Harvest.any_instance.should_receive(:update).with({ "crop_id" => "1" }) - put :update, {id: harvest.to_param, harvest: { "crop_id" => "1" }} + put :update, { id: harvest.to_param, harvest: { "crop_id" => "1" } } end it "assigns the requested harvest as @harvest" do harvest = Harvest.create! valid_attributes - put :update, {id: harvest.to_param, harvest: valid_attributes} + put :update, { id: harvest.to_param, harvest: valid_attributes } assigns(:harvest).should eq(harvest) end it "redirects to the harvest" do harvest = Harvest.create! valid_attributes - put :update, {id: harvest.to_param, harvest: valid_attributes} + put :update, { id: harvest.to_param, harvest: valid_attributes } response.should redirect_to(harvest) end end @@ -146,7 +146,7 @@ describe HarvestsController do harvest = Harvest.create! valid_attributes # Trigger the behavior that occurs when invalid params are submitted Harvest.any_instance.stub(:save).and_return(false) - put :update, {id: harvest.to_param, harvest: { "crop_id" => "invalid value" }} + put :update, { id: harvest.to_param, harvest: { "crop_id" => "invalid value" } } assigns(:harvest).should eq(harvest) end @@ -154,7 +154,7 @@ describe HarvestsController do harvest = Harvest.create! valid_attributes # Trigger the behavior that occurs when invalid params are submitted Harvest.any_instance.stub(:save).and_return(false) - put :update, {id: harvest.to_param, harvest: { "crop_id" => "invalid value" }} + put :update, { id: harvest.to_param, harvest: { "crop_id" => "invalid value" } } response.should render_template("edit") end end @@ -164,13 +164,13 @@ describe HarvestsController do it "destroys the requested harvest" do harvest = Harvest.create! valid_attributes expect { - delete :destroy, {id: harvest.to_param} + delete :destroy, { id: harvest.to_param } }.to change(Harvest, :count).by(-1) end it "redirects to the harvests list" do harvest = Harvest.create! valid_attributes - delete :destroy, {id: harvest.to_param} + delete :destroy, { id: harvest.to_param } response.should redirect_to(harvests_url) end end diff --git a/spec/controllers/member_controller_spec.rb b/spec/controllers/member_controller_spec.rb index 58ad66c8a..735a4c825 100644 --- a/spec/controllers/member_controller_spec.rb +++ b/spec/controllers/member_controller_spec.rb @@ -15,7 +15,7 @@ require 'rails_helper' describe MembersController do before :each do @member = FactoryGirl.create(:member) - @posts = [ FactoryGirl.create(:post, author: @member) ] + @posts = [FactoryGirl.create(:post, author: @member)] @twitter_auth = FactoryGirl.create(:authentication, member: @member) @flickr_auth = FactoryGirl.create(:flickr_authentication, member: @member) end @@ -36,32 +36,32 @@ describe MembersController do describe "GET show" do it "provides JSON for member profile" do - get :show, { id: @member.id , format: 'json' } + get :show, { id: @member.id, format: 'json' } response.should be_success end it "assigns @posts with the member's posts" do - get :show, {id: @member.id} + get :show, { id: @member.id } assigns(:posts).should eq(@posts) end it "assigns @twitter_auth" do - get :show, {id: @member.id} + get :show, { id: @member.id } assigns(:twitter_auth).should eq(@twitter_auth) end it "assigns @flickr_auth" do - get :show, {id: @member.id} + get :show, { id: @member.id } assigns(:flickr_auth).should eq(@flickr_auth) end it "doesn't show completely nonsense members" do - lambda { get :show, {id: 9999} }.should raise_error(ActiveRecord::RecordNotFound) + lambda { get :show, { id: 9999 } }.should raise_error(ActiveRecord::RecordNotFound) end it "doesn't show unconfirmed members" do @member2 = FactoryGirl.create(:unconfirmed_member) - lambda { get :show, {id: @member2.id} }.should raise_error(ActiveRecord::RecordNotFound) + lambda { get :show, { id: @member2.id } }.should raise_error(ActiveRecord::RecordNotFound) end end diff --git a/spec/controllers/notifications_controller_spec.rb b/spec/controllers/notifications_controller_spec.rb index 6a6e411ad..2231edaad 100644 --- a/spec/controllers/notifications_controller_spec.rb +++ b/spec/controllers/notifications_controller_spec.rb @@ -51,14 +51,14 @@ describe NotificationsController do describe "GET show" do it "assigns the requested notification as @notification" do notification = FactoryGirl.create(:notification, recipient_id: subject.current_member.id) - get :show, {id: notification.to_param} + get :show, { id: notification.to_param } assigns(:notification).should eq(notification) end it "assigns the reply link for a post comment" do notification = FactoryGirl.create(:notification, recipient_id: subject.current_member.id) - get :show, {id: notification.to_param} + get :show, { id: notification.to_param } assigns(:reply_link).should_not be_nil assigns(:reply_link).should eq new_comment_url( post_id: notification.post.id @@ -67,7 +67,7 @@ describe NotificationsController do it "marks notifications as read" do notification = FactoryGirl.create(:notification, recipient_id: subject.current_member.id) - get :show, {id: notification.to_param} + get :show, { id: notification.to_param } # we need to fetch it from the db again, can't test against the old one n = Notification.find(notification.id) n.read.should eq true @@ -77,7 +77,7 @@ describe NotificationsController do describe "GET reply" do it "marks notifications as read" do notification = FactoryGirl.create(:notification, recipient_id: subject.current_member.id) - get :reply, {id: notification.to_param} + get :reply, { id: notification.to_param } # we need to fetch it from the db again, can't test against the old one n = Notification.find(notification.id) n.read.should eq true @@ -87,7 +87,7 @@ describe NotificationsController do describe "GET new" do it "assigns a recipient" do @recipient = FactoryGirl.create(:member) - get :new, {recipient_id: @recipient.id } + get :new, { recipient_id: @recipient.id } assigns(:recipient).should be_an_instance_of(Member) end end diff --git a/spec/controllers/order_items_controller_spec.rb b/spec/controllers/order_items_controller_spec.rb index 07e7d3e38..d455cbe9b 100644 --- a/spec/controllers/order_items_controller_spec.rb +++ b/spec/controllers/order_items_controller_spec.rb @@ -30,11 +30,11 @@ describe OrderItemsController do describe "POST create" do it "redirects to order" do @order = FactoryGirl.create(:order, member: @member) - post :create, {order_item: { + post :create, { order_item: { order_id: @order.id, product_id: @product.id, price: @product.min_price - }} + } } response.should redirect_to(OrderItem.last.order) end @@ -43,10 +43,10 @@ describe OrderItemsController do sign_in @member @product = FactoryGirl.create(:product) expect { - post :create, {order_item: { + post :create, { order_item: { product_id: @product.id, price: @product.min_price - }} + } } }.to change(Order, :count).by(1) OrderItem.last.order.should be_an_instance_of Order end @@ -56,11 +56,11 @@ describe OrderItemsController do @order = FactoryGirl.create(:order, member: @member) @product = FactoryGirl.create(:product, min_price: 1) expect { - post :create, {order_item: { + post :create, { order_item: { order_id: @order.id, product_id: @product.id, price: 3.33 - }} + } } }.to change(OrderItem, :count).by(1) OrderItem.last.price.should eq 333 end diff --git a/spec/controllers/orders_controller_spec.rb b/spec/controllers/orders_controller_spec.rb index a1dd1fce9..78bc0b99a 100644 --- a/spec/controllers/orders_controller_spec.rb +++ b/spec/controllers/orders_controller_spec.rb @@ -28,7 +28,7 @@ describe OrdersController do member = FactoryGirl.create(:member) sign_in member order = Order.create!(member_id: member.id) - get :checkout, {id: order.to_param, referral_code: 'FOOBAR'} + get :checkout, { id: order.to_param, referral_code: 'FOOBAR' } order.reload order.referral_code.should eq 'FOOBAR' end @@ -37,7 +37,7 @@ describe OrdersController do member = FactoryGirl.create(:member) sign_in member order = Order.create!(member_id: member.id) - get :checkout, {id: order.to_param} + get :checkout, { id: order.to_param } response.status.should eq 302 response.redirect_url.should match /paypal\.com/ end @@ -48,7 +48,7 @@ describe OrdersController do member = FactoryGirl.create(:member) sign_in member order = Order.create!(member_id: member.id) - get :complete, {id: order.to_param} + get :complete, { id: order.to_param } assigns(:order).should eq(order) end end @@ -58,7 +58,7 @@ describe OrdersController do member = FactoryGirl.create(:member) sign_in member order = Order.create!(member_id: member.id) - delete :destroy, {id: order.id} + delete :destroy, { id: order.id } response.should redirect_to(shop_url) end end diff --git a/spec/controllers/plantings_controller_spec.rb b/spec/controllers/plantings_controller_spec.rb index 1dc38ba72..f51086114 100644 --- a/spec/controllers/plantings_controller_spec.rb +++ b/spec/controllers/plantings_controller_spec.rb @@ -38,13 +38,13 @@ describe PlantingsController do end it "picks up owner from params and shows owner's plantings only" do - get :index, {owner: @member1.slug} + get :index, { owner: @member1.slug } assigns(:owner).should eq @member1 assigns(:plantings).should eq [@planting1] end it "picks up crop from params and shows the plantings for the crop only" do - get :index, {crop: @maize.name} + get :index, { crop: @maize.name } assigns(:crop).should eq @maize assigns(:plantings).should eq [@planting2] end @@ -53,7 +53,7 @@ describe PlantingsController do describe "GET new" do it "picks up crop from params" do crop = FactoryGirl.create(:crop) - get :new, {crop_id: crop.id} + get :new, { crop_id: crop.id } assigns(:crop).should eq(crop) end @@ -65,7 +65,7 @@ describe PlantingsController do it "picks up garden from params" do member = FactoryGirl.create(:member) garden = FactoryGirl.create(:garden, owner: member) - get :new, {garden_id: garden.id} + get :new, { garden_id: garden.id } assigns(:garden).should eq(garden) end diff --git a/spec/controllers/robots_controller_spec.rb b/spec/controllers/robots_controller_spec.rb index 16220cfe2..e8917aa29 100644 --- a/spec/controllers/robots_controller_spec.rb +++ b/spec/controllers/robots_controller_spec.rb @@ -6,7 +6,7 @@ describe RobotsController do let(:staging_filename) { 'config/robots.staging.txt' } before do - @request.host = "#{ subdomain }.localhost.com" + @request.host = "#{subdomain}.localhost.com" end context 'subdomain is staging' do diff --git a/spec/controllers/seeds_controller_spec.rb b/spec/controllers/seeds_controller_spec.rb index e79160dfd..b17a948c4 100644 --- a/spec/controllers/seeds_controller_spec.rb +++ b/spec/controllers/seeds_controller_spec.rb @@ -16,7 +16,7 @@ describe SeedsController do describe "GET index" do it "picks up owner from params" do owner = FactoryGirl.create(:member) - get :index, {owner: owner.slug} + get :index, { owner: owner.slug } assigns(:owner).should eq(owner) end end diff --git a/spec/custom_matchers.rb b/spec/custom_matchers.rb index 6d52388bb..1cb9d61ab 100644 --- a/spec/custom_matchers.rb +++ b/spec/custom_matchers.rb @@ -1,6 +1,6 @@ require 'rspec/expectations' -RSpec::Matchers.define :have_optional do | expected | +RSpec::Matchers.define :have_optional do |expected| match do |actual| actual.has_selector? "#{expected} + span", text: '(Optional)' end diff --git a/spec/factories/crop.rb b/spec/factories/crop.rb index c4d73f9d1..6467cb813 100644 --- a/spec/factories/crop.rb +++ b/spec/factories/crop.rb @@ -58,7 +58,7 @@ FactoryGirl.define do creator "cropbot" end - #for testing crop request + # for testing crop request factory :crop_request do name "Ultra berry" en_wikipedia_url "" diff --git a/spec/factories/member.rb b/spec/factories/member.rb index 76493d773..7fb02594b 100644 --- a/spec/factories/member.rb +++ b/spec/factories/member.rb @@ -60,12 +60,12 @@ FactoryGirl.define do end factory :admin_member do - roles { [ FactoryGirl.create(:admin) ] } + roles { [FactoryGirl.create(:admin)] } end factory :crop_wrangling_member do - roles { [ FactoryGirl.create(:crop_wrangler) ] } - sequence(:login_name) {|n| "wrangler#{n}"} + roles { [FactoryGirl.create(:crop_wrangler)] } + sequence(:login_name) { |n| "wrangler#{n}" } end factory :invalid_member_shortname do diff --git a/spec/features/crops/browse_crops_spec.rb b/spec/features/crops/browse_crops_spec.rb index c486d3963..72e63c8fd 100644 --- a/spec/features/crops/browse_crops_spec.rb +++ b/spec/features/crops/browse_crops_spec.rb @@ -3,7 +3,7 @@ require 'rails_helper' feature "browse crops" do let(:tomato) { create :tomato } let(:maize) { create :maize } - let(:pending_crop) { create :crop_request } + let(:pending_crop) { create :crop_request } let(:rejected_crop) { create :rejected_crop } scenario "has a form for sorting by" do diff --git a/spec/features/crops/crop_detail_page_spec.rb b/spec/features/crops/crop_detail_page_spec.rb index e80e235ad..cf2d3f502 100644 --- a/spec/features/crops/crop_detail_page_spec.rb +++ b/spec/features/crops/crop_detail_page_spec.rb @@ -111,23 +111,23 @@ feature "crop detail page", js: true do background { subject } scenario "has seed heading with SEO" do - expect(page).to have_content "Find #{ crop.name } seeds" + expect(page).to have_content "Find #{crop.name} seeds" end scenario "has harvest heading with SEO" do - expect(page).to have_content "#{ crop.name.capitalize } harvests" + expect(page).to have_content "#{crop.name.capitalize} harvests" end scenario "has planting heading with SEO" do - expect(page).to have_content "See who's planted #{ crop.name.pluralize }" + expect(page).to have_content "See who's planted #{crop.name.pluralize}" end scenario "has planting advice with SEO" do - expect(page).to have_content "How to grow #{ crop.name }" + expect(page).to have_content "How to grow #{crop.name}" end scenario "has a link to Wikipedia with SEO" do - expect(page).to have_content "Learn more about #{ crop.name }" + expect(page).to have_content "Learn more about #{crop.name}" expect(page).to have_link "Wikipedia (English)", href: crop.en_wikipedia_url end diff --git a/spec/features/rss/plantings_spec.rb b/spec/features/rss/plantings_spec.rb index 597d82c01..59833eff1 100644 --- a/spec/features/rss/plantings_spec.rb +++ b/spec/features/rss/plantings_spec.rb @@ -9,6 +9,6 @@ feature 'Plantings RSS feed' do scenario 'The index title is what we expect' do visit plantings_path(format: 'rss') expect(page).to have_content "Recent plantings from "\ - "#{ @owner ? @owner : 'all members' } (#{ENV['GROWSTUFF_SITE_NAME']})" + "#{@owner ? @owner : 'all members'} (#{ENV['GROWSTUFF_SITE_NAME']})" end end diff --git a/spec/features/rss/posts_spec.rb b/spec/features/rss/posts_spec.rb index 8c48ad5d2..445a50cca 100644 --- a/spec/features/rss/posts_spec.rb +++ b/spec/features/rss/posts_spec.rb @@ -9,6 +9,6 @@ feature 'Posts RSS feed' do scenario 'The index title is what we expect' do visit posts_path(format: 'rss') expect(page).to have_content "Recent posts from "\ - "#{ @author ? @author : 'all members' } (#{ENV['GROWSTUFF_SITE_NAME']})" + "#{@author ? @author : 'all members'} (#{ENV['GROWSTUFF_SITE_NAME']})" end end diff --git a/spec/features/rss/seeds_spec.rb b/spec/features/rss/seeds_spec.rb index 0d3957f19..888cc42ec 100644 --- a/spec/features/rss/seeds_spec.rb +++ b/spec/features/rss/seeds_spec.rb @@ -9,6 +9,6 @@ feature 'Seeds RSS feed' do scenario 'The index title is what we expect' do visit seeds_path(format: 'rss') expect(page).to have_content "Recent seeds from "\ - "#{ @owner ? @owner : 'all members' } (#{ENV['GROWSTUFF_SITE_NAME']})" + "#{@owner ? @owner : 'all members'} (#{ENV['GROWSTUFF_SITE_NAME']})" end end diff --git a/spec/lib/actions/oauth_signup_action_spec.rb b/spec/lib/actions/oauth_signup_action_spec.rb index 57dd28af4..4bb4f74bb 100644 --- a/spec/lib/actions/oauth_signup_action_spec.rb +++ b/spec/lib/actions/oauth_signup_action_spec.rb @@ -28,7 +28,7 @@ describe 'Growstuff::OauthSignupAction' do before :each do @auth['info']['email'] = 'no.existing.user@gmail.com' - Member.where(email: @auth['info']['email']).delete_all + Member.where(email: @auth['info']['email']).delete_all @member = @action.find_or_create_from_authorization(@auth) @authentication = @action.establish_authentication(@auth, @member) diff --git a/spec/lib/haml/filters/growstuff_markdown_spec.rb b/spec/lib/haml/filters/growstuff_markdown_spec.rb index ecefbadd2..debce3111 100644 --- a/spec/lib/haml/filters/growstuff_markdown_spec.rb +++ b/spec/lib/haml/filters/growstuff_markdown_spec.rb @@ -6,7 +6,7 @@ def input_link(name) return "[#{name}](crop)" end -def output_link(crop, name=nil) +def output_link(crop, name = nil) url = Rails.application.routes.url_helpers.crop_url(crop, host: Growstuff::Application.config.host) if name return "#{name}" @@ -19,7 +19,7 @@ def input_member_link(name) return "[#{name}](member)" end -def output_member_link(member, name=nil) +def output_member_link(member, name = nil) url = Rails.application.routes.url_helpers.member_url(member, only_path: true) if name return "#{name}" @@ -47,7 +47,7 @@ describe 'Haml::Filters::Growstuff_Markdown' do it "doesn't convert escaped crop links" do @crop = FactoryGirl.create(:crop) - rendered = Haml::Filters::GrowstuffMarkdown.render( "\\" << input_link(@crop.name)) + rendered = Haml::Filters::GrowstuffMarkdown.render("\\" << input_link(@crop.name)) rendered.should match /\[#{@crop.name}\]\(crop\)/ end diff --git a/spec/models/crop_spec.rb b/spec/models/crop_spec.rb index fbde31504..b497b6222 100644 --- a/spec/models/crop_spec.rb +++ b/spec/models/crop_spec.rb @@ -100,7 +100,7 @@ describe Crop do it 'toplevel scope works' do @tomato = FactoryGirl.create(:tomato) @roma = FactoryGirl.create(:roma, parent_id: @tomato.id) - Crop.toplevel.should eq [ @tomato ] + Crop.toplevel.should eq [@tomato] end end diff --git a/spec/models/harvest_spec.rb b/spec/models/harvest_spec.rb index f4ef03c04..a3aedddf2 100644 --- a/spec/models/harvest_spec.rb +++ b/spec/models/harvest_spec.rb @@ -45,7 +45,8 @@ describe Harvest do context 'units' do it 'all valid units should work' do - ['individual','bunch','sprig','handful','litre','pint','quart','bucket','basket','bushel', nil, ''].each do |s| + ['individual', 'bunch', 'sprig', 'handful', 'litre', + 'pint', 'quart', 'bucket', 'basket', 'bushel', nil, ''].each do |s| @harvest = FactoryGirl.build(:harvest, unit: s) @harvest.should be_valid end diff --git a/spec/models/member_spec.rb b/spec/models/member_spec.rb index e3dc5d2f0..cc6281fc4 100644 --- a/spec/models/member_spec.rb +++ b/spec/models/member_spec.rb @@ -275,7 +275,7 @@ describe 'member' do @member2.updated_at = 2.days.ago @member3.updated_at = 1.days.ago - Member.interesting.should eq [ @member3, @member2, @member1 ] + Member.interesting.should eq [@member3, @member2, @member1] end end diff --git a/spec/models/planting_spec.rb b/spec/models/planting_spec.rb index e4a5f11b7..327379fc3 100644 --- a/spec/models/planting_spec.rb +++ b/spec/models/planting_spec.rb @@ -300,7 +300,7 @@ describe Planting do context "finished date validation" do it 'requires finished date after planting date' do - @f = FactoryGirl.build(:finished_planting, planted_at: '2014-01-01', finished_at: '2013-01-01') + @f = FactoryGirl.build(:finished_planting, planted_at: '2014-01-01', finished_at: '2013-01-01') @f.should_not be_valid end diff --git a/spec/models/role_spec.rb b/spec/models/role_spec.rb index 6ea5d1a9d..f8393ae84 100644 --- a/spec/models/role_spec.rb +++ b/spec/models/role_spec.rb @@ -1,7 +1,7 @@ require 'rails_helper' describe Role do - let(:member) { FactoryGirl.create(:member) } + let(:member) { FactoryGirl.create(:member) } subject do role = FactoryGirl.create(:role, name: 'Crop Wrangler') diff --git a/spec/rails_helper.rb b/spec/rails_helper.rb index 5ec7f100a..cdfb951cb 100644 --- a/spec/rails_helper.rb +++ b/spec/rails_helper.rb @@ -37,7 +37,7 @@ if ENV['GROWSTUFF_CAPYBARA_DRIVER'].present? end Capybara::Screenshot.register_filename_prefix_formatter(:rspec) do |example| - "screenshot_#{example.description.gsub(' ', '-').gsub(/^.*\/spec\//,'')}" + "screenshot_#{example.description.gsub(' ', '-').gsub(/^.*\/spec\//, '')}" end Capybara.app_host = 'http://localhost' @@ -59,7 +59,7 @@ include Warden::Test::Helpers # require only the support files necessary. # Dir[Rails.root.join("spec/support/**/*.rb")].each { |f| require f } -Dir[Rails.root.join("spec/features/shared_examples/**/*.rb")].each {|f| require f} +Dir[Rails.root.join("spec/features/shared_examples/**/*.rb")].each { |f| require f } # Checks for pending migrations before tests are run. # If you are not using ActiveRecord, you can remove this line. diff --git a/spec/support/controller_macros.rb b/spec/support/controller_macros.rb index ce2e124fd..393d7221b 100644 --- a/spec/support/controller_macros.rb +++ b/spec/support/controller_macros.rb @@ -1,6 +1,6 @@ # Taken unashamedly from https://github.com/plataformatec/devise/wiki/How-To%3a-Controllers-and-Views-tests-with-Rails-3-%28and-rspec%29 module ControllerMacros - def login_member(member_factory=:member) + def login_member(member_factory = :member) let(:member) { member = FactoryGirl.create(member_factory || :member) } before(:each) do @request.env["devise.mapping"] = Devise.mappings[:member] diff --git a/spec/support/elasticsearch_helpers.rb b/spec/support/elasticsearch_helpers.rb index 94cf447ff..1d1db1db3 100644 --- a/spec/support/elasticsearch_helpers.rb +++ b/spec/support/elasticsearch_helpers.rb @@ -1,7 +1,7 @@ module ElasticsearchHelpers def sync_elasticsearch(crops) if ENV['GROWSTUFF_ELASTICSEARCH'] == "true" - crops.each {|crop| crop.__elasticsearch__.index_document} + crops.each { |crop| crop.__elasticsearch__.index_document } Crop.__elasticsearch__.refresh_index! end end diff --git a/spec/support/feature_helpers.rb b/spec/support/feature_helpers.rb index f3562b07c..dbe4f327b 100644 --- a/spec/support/feature_helpers.rb +++ b/spec/support/feature_helpers.rb @@ -1,5 +1,5 @@ module FeatureHelpers - def fill_autocomplete(field, options={}) + def fill_autocomplete(field, options = {}) fill_in field, with: options[:with] page.execute_script %Q{ $('##{field}').trigger('focus'); } diff --git a/spec/views/crops/_planting_advice.html.haml_spec.rb b/spec/views/crops/_planting_advice.html.haml_spec.rb index 1c0390e23..62d85bcfa 100644 --- a/spec/views/crops/_planting_advice.html.haml_spec.rb +++ b/spec/views/crops/_planting_advice.html.haml_spec.rb @@ -14,7 +14,7 @@ require 'rails_helper' describe "crops/_planting_advice" do before(:each) do - @owner = FactoryGirl.create(:member) + @owner = FactoryGirl.create(:member) @crop = FactoryGirl.create(:crop) @garden = FactoryGirl.create(:garden, owner: @owner) @planting = FactoryGirl.create(:planting, diff --git a/spec/views/crops/index.html.haml_spec.rb b/spec/views/crops/index.html.haml_spec.rb index 7b5f27805..a11cbcb76 100644 --- a/spec/views/crops/index.html.haml_spec.rb +++ b/spec/views/crops/index.html.haml_spec.rb @@ -22,7 +22,7 @@ describe "crops/index" do @maize = FactoryGirl.create(:maize) assign(:crops, [@tomato, @maize]) paginated_crops = WillPaginate::Collection.create(page, per_page, total_entries) do |pager| - pager.replace([ @tomato, @maize ]) + pager.replace([@tomato, @maize]) end assign(:paginated_crops, paginated_crops) end diff --git a/spec/views/crops/wrangle.html.haml_spec.rb b/spec/views/crops/wrangle.html.haml_spec.rb index d2eb584bb..b0ff06281 100644 --- a/spec/views/crops/wrangle.html.haml_spec.rb +++ b/spec/views/crops/wrangle.html.haml_spec.rb @@ -22,7 +22,7 @@ describe "crops/wrangle" do @tomato = FactoryGirl.create(:tomato) @maize = FactoryGirl.create(:maize) crops = WillPaginate::Collection.create(page, per_page, total_entries) do |pager| - pager.replace([ @tomato, @maize ]) + pager.replace([@tomato, @maize]) end assign(:crops, crops) assign(:crop_wranglers, Role.crop_wranglers) diff --git a/spec/views/devise/shared/_links_spec.rb b/spec/views/devise/shared/_links_spec.rb index d40a84d88..c567339d6 100644 --- a/spec/views/devise/shared/_links_spec.rb +++ b/spec/views/devise/shared/_links_spec.rb @@ -12,14 +12,14 @@ describe 'devise/shared/_links.haml', type: "view" do it 'should have a sign-in link if not in sessions' do @view.stub(:controller_name).and_return("anything but sessions") @view.stub(:resource_name).and_return("member") - @view.stub(devise_mapping: devise_mapping(false, false, false, false, false)) + @view.stub(devise_mapping: devise_mapping(false, false, false, false, false)) render end it "shouldn't have a sign-in link if in sessions" do @view.stub(:controller_name).and_return("sessions") @view.stub(:resource_name).and_return("member") - @view.stub(devise_mapping: devise_mapping(false, false, false, false, false)) + @view.stub(devise_mapping: devise_mapping(false, false, false, false, false)) render end end diff --git a/spec/views/forums/index.html.haml_spec.rb b/spec/views/forums/index.html.haml_spec.rb index 7fc1a6574..701504d7f 100644 --- a/spec/views/forums/index.html.haml_spec.rb +++ b/spec/views/forums/index.html.haml_spec.rb @@ -18,7 +18,7 @@ describe "forums/index" do controller.stub(:current_user) { @admin } @forum1 = FactoryGirl.create(:forum) @forum2 = FactoryGirl.create(:forum) - assign(:forums, [ @forum1, @forum2 ]) + assign(:forums, [@forum1, @forum2]) end it "renders a list of forums" do diff --git a/spec/views/gardens/show.html.haml_spec.rb b/spec/views/gardens/show.html.haml_spec.rb index d4f9eb38b..0e166e453 100644 --- a/spec/views/gardens/show.html.haml_spec.rb +++ b/spec/views/gardens/show.html.haml_spec.rb @@ -14,7 +14,7 @@ require 'rails_helper' describe "gardens/show" do before(:each) do - @owner = FactoryGirl.create(:member) + @owner = FactoryGirl.create(:member) controller.stub(:current_user) { @owner } @garden = FactoryGirl.create(:garden, owner: @owner) @planting = FactoryGirl.create(:planting, garden: @garden) diff --git a/spec/views/harvests/index.html.haml_spec.rb b/spec/views/harvests/index.html.haml_spec.rb index cc24f1591..32baadc1a 100644 --- a/spec/views/harvests/index.html.haml_spec.rb +++ b/spec/views/harvests/index.html.haml_spec.rb @@ -15,7 +15,7 @@ require 'rails_helper' describe "harvests/index" do before(:each) do controller.stub(:current_user) { nil } - @member = FactoryGirl.create(:member) + @member = FactoryGirl.create(:member) @tomato = FactoryGirl.create(:tomato) @maize = FactoryGirl.create(:maize) @pp = FactoryGirl.create(:plant_part) diff --git a/spec/views/members/index.html.haml_spec.rb b/spec/views/members/index.html.haml_spec.rb index b54c9f4bb..122b88b48 100644 --- a/spec/views/members/index.html.haml_spec.rb +++ b/spec/views/members/index.html.haml_spec.rb @@ -20,7 +20,7 @@ describe "members/index" do total_entries = 2 @member = FactoryGirl.create(:london_member) members = WillPaginate::Collection.create(page, per_page, total_entries) do |pager| - pager.replace([ @member, @member ]) + pager.replace([@member, @member]) end assign(:members, members) render diff --git a/spec/views/notifications/index.html.haml_spec.rb b/spec/views/notifications/index.html.haml_spec.rb index 2331215e2..5e0f95beb 100644 --- a/spec/views/notifications/index.html.haml_spec.rb +++ b/spec/views/notifications/index.html.haml_spec.rb @@ -22,7 +22,7 @@ describe "notifications/index" do before(:each) do @notification = FactoryGirl.create(:notification, sender: @member, recipient: @member) - assign(:notifications, Kaminari.paginate_array([ @notification, @notification ]).page(1)) + assign(:notifications, Kaminari.paginate_array([@notification, @notification]).page(1)) render end diff --git a/spec/views/notifications/new.html.haml_spec.rb b/spec/views/notifications/new.html.haml_spec.rb index f3538efdc..a5daa64f5 100644 --- a/spec/views/notifications/new.html.haml_spec.rb +++ b/spec/views/notifications/new.html.haml_spec.rb @@ -18,7 +18,7 @@ describe "notifications/new" do @sender = FactoryGirl.create(:member) assign(:notification, FactoryGirl.create(:notification, recipient_id: @recipient.id, sender_id: @sender.id)) sign_in @sender - controller.stub(:current_user) { @sender} + controller.stub(:current_user) { @sender } end it "renders new message form" do diff --git a/spec/views/notifications/show.html.haml_spec.rb b/spec/views/notifications/show.html.haml_spec.rb index 4d59495fa..4d5a71dfc 100644 --- a/spec/views/notifications/show.html.haml_spec.rb +++ b/spec/views/notifications/show.html.haml_spec.rb @@ -32,6 +32,6 @@ describe "notifications/show" do end it "includes a reply button" do - assert_select "a", {href: @reply_link}, "Reply" + assert_select "a", { href: @reply_link }, "Reply" end end diff --git a/spec/views/orders/index.html.haml_spec.rb b/spec/views/orders/index.html.haml_spec.rb index 182542cc5..38ab39362 100644 --- a/spec/views/orders/index.html.haml_spec.rb +++ b/spec/views/orders/index.html.haml_spec.rb @@ -18,7 +18,7 @@ describe "orders/index" do sign_in @member @order1 = FactoryGirl.create(:order, member: @member) @order2 = FactoryGirl.create(:completed_order, member: @member) - assign(:orders, [ @order1, @order2 ]) + assign(:orders, [@order1, @order2]) end it "shows your current account status" do diff --git a/spec/views/photos/new.html.haml_spec.rb b/spec/views/photos/new.html.haml_spec.rb index 0b19ba81b..dab06e8b0 100644 --- a/spec/views/photos/new.html.haml_spec.rb +++ b/spec/views/photos/new.html.haml_spec.rb @@ -35,7 +35,7 @@ describe "photos/new" do context "user has photosets" do before(:each) do - assign(:sets, {"foo" => "bar"}) # Hash of names => IDs + assign(:sets, { "foo" => "bar" }) # Hash of names => IDs end it "shows a dropdown with sets from Flickr" do @@ -44,7 +44,7 @@ describe "photos/new" do end it "shows the current photoset" do - assign(:current_set, "bar") # the ID of the set + assign(:current_set, "bar") # the ID of the set render assert_select "h2", "foo" # the name of the set end diff --git a/spec/views/plantings/index.html.haml_spec.rb b/spec/views/plantings/index.html.haml_spec.rb index 63b612297..54f2bb63a 100644 --- a/spec/views/plantings/index.html.haml_spec.rb +++ b/spec/views/plantings/index.html.haml_spec.rb @@ -15,7 +15,7 @@ require 'rails_helper' describe "plantings/index" do before(:each) do controller.stub(:current_user) { nil } - @member = FactoryGirl.create(:member) + @member = FactoryGirl.create(:member) @garden = FactoryGirl.create(:garden, owner: @member) @tomato = FactoryGirl.create(:tomato) @maize = FactoryGirl.create(:maize) diff --git a/spec/views/plantings/index.rss.haml_spec.rb b/spec/views/plantings/index.rss.haml_spec.rb index 9d7933ef6..58a4a2996 100644 --- a/spec/views/plantings/index.rss.haml_spec.rb +++ b/spec/views/plantings/index.rss.haml_spec.rb @@ -50,7 +50,7 @@ describe 'plantings/index.rss.haml' do context "one person's plantings" do before :each do @planting = FactoryGirl.create(:planting) - assign(:plantings, [@planting ]) + assign(:plantings, [@planting]) assign(:owner, @planting.owner) render end diff --git a/spec/views/posts/_single.html.haml_spec.rb b/spec/views/posts/_single.html.haml_spec.rb index 49830a45a..656a4194b 100644 --- a/spec/views/posts/_single.html.haml_spec.rb +++ b/spec/views/posts/_single.html.haml_spec.rb @@ -32,7 +32,7 @@ describe "posts/_single" do end it "doesn't contain a link to new comment" do - assert_select("a", {href: new_comment_path(post_id: @post.id)}, false) + assert_select("a", { href: new_comment_path(post_id: @post.id) }, false) end end @@ -45,7 +45,7 @@ describe "posts/_single" do end it "contains link to new comment" do - assert_select("a", {href: new_comment_path(post_id: @post.id)}, "Reply") + assert_select("a", { href: new_comment_path(post_id: @post.id) }, "Reply") end it "does not contain an edit link" do diff --git a/spec/views/posts/edit.html.haml_spec.rb b/spec/views/posts/edit.html.haml_spec.rb index 00b063d4a..d3342f5b9 100644 --- a/spec/views/posts/edit.html.haml_spec.rb +++ b/spec/views/posts/edit.html.haml_spec.rb @@ -43,7 +43,7 @@ describe "posts/edit" do context "forum specified" do before(:each) do @forum = assign(:forum, FactoryGirl.create(:forum)) - assign(:post, FactoryGirl.create( :post, + assign(:post, FactoryGirl.create(:post, forum: @forum, author: @author )) diff --git a/spec/views/posts/show.html.haml_spec.rb b/spec/views/posts/show.html.haml_spec.rb index 11ac223ad..9564e7ee8 100644 --- a/spec/views/posts/show.html.haml_spec.rb +++ b/spec/views/posts/show.html.haml_spec.rb @@ -114,7 +114,7 @@ describe "posts/show" do end it 'shows a comment button' do - assert_select "a", {href: new_comment_path(post_id: @post.id)}, "Comment" + assert_select "a", { href: new_comment_path(post_id: @post.id) }, "Comment" end end end diff --git a/spec/views/seeds/index.rss.haml_spec.rb b/spec/views/seeds/index.rss.haml_spec.rb index b2634d6b8..2de2fff1f 100644 --- a/spec/views/seeds/index.rss.haml_spec.rb +++ b/spec/views/seeds/index.rss.haml_spec.rb @@ -21,7 +21,7 @@ describe 'seeds/index.rss.haml' do before(:each) do @seed = FactoryGirl.create(:seed) @tradable = FactoryGirl.create(:tradable_seed) - assign(:seeds, [ @seed, @tradable ]) + assign(:seeds, [@seed, @tradable]) render end @@ -49,7 +49,7 @@ describe 'seeds/index.rss.haml' do context "one member's seeds" do before(:each) do @seed = FactoryGirl.create(:seed) - assign(:seeds, [ @seed ]) + assign(:seeds, [@seed]) assign(:owner, @seed.owner) render end From c02562518d9042812603bf344160657eaf7ed6fd Mon Sep 17 00:00:00 2001 From: Brenda Wallace Date: Sat, 26 Nov 2016 12:20:51 +1300 Subject: [PATCH 172/268] Fixed double handling in harvest.to_s --- app/models/harvest.rb | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/app/models/harvest.rb b/app/models/harvest.rb index 425ae0da9..04f4608f2 100644 --- a/app/models/harvest.rb +++ b/app/models/harvest.rb @@ -107,12 +107,10 @@ class Harvest < ActiveRecord::Base string += "#{number_to_human(self.quantity.to_s, strip_insignificant_zeros: true)} " string += if self.unit == 'individual' 'individual ' + elsif self.quantity == 1 + "#{self.unit} of " else - string += if self.quantity == 1 - "#{self.unit} of " - else - "#{self.unit.pluralize} of " - end + "#{self.unit.pluralize} of " end end From 20c72e1205930357bf0df81542d423137dc00320 Mon Sep 17 00:00:00 2001 From: Brenda Wallace Date: Sat, 26 Nov 2016 13:43:04 +1300 Subject: [PATCH 173/268] Upgrading poltergeist --- Gemfile | 7 +++++-- Gemfile.lock | 16 ++++++++-------- 2 files changed, 13 insertions(+), 10 deletions(-) diff --git a/Gemfile b/Gemfile index 0a445dc62..e752f553a 100644 --- a/Gemfile +++ b/Gemfile @@ -110,14 +110,17 @@ group :development, :test do gem 'capybara' # integration tests gem 'capybara-email' # integration tests for email gem 'capybara-screenshot' # for test debugging - gem 'poltergeist', '~> 1.6' # for headless JS testing + gem 'poltergeist' # for headless JS testing gem 'i18n-tasks' # adds tests for finding missing and unused translations gem 'selenium-webdriver' - gem "codeclimate-test-reporter", group: :test, require: nil gem "active_merchant-paypal-bogus-gateway" gem 'rubocop', require: false end +group :test do + gem 'codeclimate-test-reporter', require: false +end + group :travis do gem 'heroku-api' end diff --git a/Gemfile.lock b/Gemfile.lock index 8f6230ac2..9455fd3c3 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -48,7 +48,8 @@ GEM minitest (~> 5.1) thread_safe (~> 0.3, >= 0.3.4) tzinfo (~> 1.1) - addressable (2.4.0) + addressable (2.5.0) + public_suffix (~> 2.0, >= 2.0.2) arel (6.0.3) ast (2.3.0) autoprefixer-rails (6.4.0.2) @@ -74,7 +75,7 @@ GEM builder (3.2.2) byebug (9.0.5) cancancan (1.15.0) - capybara (2.8.0) + capybara (2.10.1) addressable mime-types (>= 1.16) nokogiri (>= 1.3.3) @@ -277,9 +278,8 @@ GEM multipart-post (2.0.0) nenv (0.3.0) newrelic_rpm (3.16.1.320) - nokogiri (1.6.8) + nokogiri (1.6.8.1) mini_portile2 (~> 2.1.0) - pkg-config (~> 1.1.7) notiffany (0.1.1) nenv (~> 0.1) shellany (~> 0.0) @@ -317,10 +317,9 @@ GEM parser (2.3.1.2) ast (~> 2.2) pg (0.18.4) - pkg-config (1.1.7) plupload-rails (1.2.1) rails (>= 3.1) - poltergeist (1.10.0) + poltergeist (1.11.0) capybara (~> 2.1) cliver (~> 0.3.1) websocket-driver (>= 0.2.0) @@ -329,9 +328,10 @@ GEM coderay (~> 1.1.0) method_source (~> 0.8.1) slop (~> 3.4) + public_suffix (2.0.4) quiet_assets (1.1.0) railties (>= 3.1, < 5.0) - rack (1.6.4) + rack (1.6.5) rack-protection (1.5.3) rack rack-test (0.6.3) @@ -540,7 +540,7 @@ DEPENDENCIES omniauth-flickr (>= 0.0.15) omniauth-twitter pg - poltergeist (~> 1.6) + poltergeist pry quiet_assets rails (~> 4.2.1) From bcdd2a9167390c23507556d195d8c4d979a19dec Mon Sep 17 00:00:00 2001 From: Brenda Wallace Date: Sat, 26 Nov 2016 15:55:38 +1300 Subject: [PATCH 174/268] Changed called to rails dynamic find_by --- .rubocop_todo.yml | 24 ------------------- app/controllers/alternate_names_controller.rb | 2 +- app/controllers/comments_controller.rb | 2 +- app/controllers/gardens_controller.rb | 2 +- app/controllers/harvests_controller.rb | 6 ++--- app/controllers/notifications_controller.rb | 4 ++-- app/controllers/plantings_controller.rb | 8 +++---- app/controllers/posts_controller.rb | 4 ++-- .../scientific_names_controller.rb | 2 +- app/controllers/seeds_controller.rb | 6 ++--- app/models/crop.rb | 10 ++++---- app/models/member.rb | 2 +- app/models/order.rb | 8 +++---- db/seeds.rb | 2 +- lib/tasks/growstuff.rake | 12 +++++----- spec/controllers/roles_controller_spec.rb | 2 +- spec/models/crop_spec.rb | 2 +- spec/models/scientific_name_spec.rb | 2 +- 18 files changed, 38 insertions(+), 62 deletions(-) diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml index 72007840e..ecf35d1e1 100644 --- a/.rubocop_todo.yml +++ b/.rubocop_todo.yml @@ -162,30 +162,6 @@ Rails/Date: - 'spec/features/plantings/planting_a_crop_spec.rb' - 'spec/features/shared_examples/append_date.rb' -# Offense count: 42 -# Cop supports --auto-correct. -# Configuration parameters: Whitelist. -# Whitelist: find_by_sql -Rails/DynamicFindBy: - Exclude: - - 'app/controllers/alternate_names_controller.rb' - - 'app/controllers/comments_controller.rb' - - 'app/controllers/gardens_controller.rb' - - 'app/controllers/harvests_controller.rb' - - 'app/controllers/notifications_controller.rb' - - 'app/controllers/plantings_controller.rb' - - 'app/controllers/posts_controller.rb' - - 'app/controllers/scientific_names_controller.rb' - - 'app/controllers/seeds_controller.rb' - - 'app/models/crop.rb' - - 'app/models/member.rb' - - 'app/models/order.rb' - - 'db/seeds.rb' - - 'lib/tasks/growstuff.rake' - - 'spec/controllers/roles_controller_spec.rb' - - 'spec/models/crop_spec.rb' - - 'spec/models/scientific_name_spec.rb' - # Offense count: 7 # Cop supports --auto-correct. # Configuration parameters: Include. diff --git a/app/controllers/alternate_names_controller.rb b/app/controllers/alternate_names_controller.rb index bfcbb2a4f..a02c0d9cb 100644 --- a/app/controllers/alternate_names_controller.rb +++ b/app/controllers/alternate_names_controller.rb @@ -17,7 +17,7 @@ class AlternateNamesController < ApplicationController # GET /alternate_names/new.json def new @alternate_name = AlternateName.new - @crop = Crop.find_by_id(params[:crop_id]) || Crop.new + @crop = Crop.find_by(id: params[:crop_id]) || Crop.new respond_to do |format| format.html # new.html.haml diff --git a/app/controllers/comments_controller.rb b/app/controllers/comments_controller.rb index 0f078e2dd..967a386f8 100644 --- a/app/controllers/comments_controller.rb +++ b/app/controllers/comments_controller.rb @@ -18,7 +18,7 @@ class CommentsController < ApplicationController # GET /comments/new.json def new @comment = Comment.new - @post = Post.find_by_id(params[:post_id]) + @post = Post.find_by(id: params[:post_id]) if @post @comments = @post.comments diff --git a/app/controllers/gardens_controller.rb b/app/controllers/gardens_controller.rb index 5820b83d3..8720a693d 100644 --- a/app/controllers/gardens_controller.rb +++ b/app/controllers/gardens_controller.rb @@ -6,7 +6,7 @@ class GardensController < ApplicationController # GET /gardens.json def index @gardens = Garden.paginate(page: params[:page]) - @owner = Member.find_by_slug(params[:owner]) + @owner = Member.find_by(slug: params[:owner]) if @owner @gardens = @owner.gardens.paginate(page: params[:page]) end diff --git a/app/controllers/harvests_controller.rb b/app/controllers/harvests_controller.rb index 051cb1132..948edfb63 100644 --- a/app/controllers/harvests_controller.rb +++ b/app/controllers/harvests_controller.rb @@ -5,8 +5,8 @@ class HarvestsController < ApplicationController # GET /harvests # GET /harvests.json def index - @owner = Member.find_by_slug(params[:owner]) - @crop = Crop.find_by_slug(params[:crop]) + @owner = Member.find_by(slug: params[:owner]) + @crop = Crop.find_by(slug: params[:crop]) @harvests = if @owner @owner.harvests.includes(:owner, :crop) elsif @crop @@ -32,7 +32,7 @@ class HarvestsController < ApplicationController @harvest = Harvest.new('harvested_at' => Date.today) # using find_by_id here because it returns nil, unlike find - @crop = Crop.find_by_id(params[:crop_id]) || Crop.new + @crop = Crop.find_by(id: params[:crop_id]) || Crop.new respond_to do |format| format.html # new.html.erb diff --git a/app/controllers/notifications_controller.rb b/app/controllers/notifications_controller.rb index b6e0acbec..39f48b85d 100644 --- a/app/controllers/notifications_controller.rb +++ b/app/controllers/notifications_controller.rb @@ -28,7 +28,7 @@ class NotificationsController < ApplicationController def new @notification = Notification.new - @recipient = Member.find_by_id(params[:recipient_id]) + @recipient = Member.find_by(id: params[:recipient_id]) @subject = params[:subject] || "" respond_to do |format| @@ -66,7 +66,7 @@ class NotificationsController < ApplicationController def create params[:notification][:sender_id] = current_member.id @notification = Notification.new(notification_params) - @recipient = Member.find_by_id(params[:notification][:recipient_id]) + @recipient = Member.find_by(id: params[:notification][:recipient_id]) respond_to do |format| if @notification.save diff --git a/app/controllers/plantings_controller.rb b/app/controllers/plantings_controller.rb index 2c4589e40..222944151 100644 --- a/app/controllers/plantings_controller.rb +++ b/app/controllers/plantings_controller.rb @@ -5,8 +5,8 @@ class PlantingsController < ApplicationController # GET /plantings # GET /plantings.json def index - @owner = Member.find_by_slug(params[:owner]) - @crop = Crop.find_by_slug(params[:crop]) + @owner = Member.find_by(slug: params[:owner]) + @crop = Crop.find_by(slug: params[:crop]) @plantings = if @owner @owner.plantings.includes(:owner, :crop, :garden).paginate(page: params[:page]) elsif @crop @@ -44,8 +44,8 @@ class PlantingsController < ApplicationController @planting = Planting.new('planted_at' => Date.today) # using find_by_id here because it returns nil, unlike find - @crop = Crop.find_by_id(params[:crop_id]) || Crop.new - @garden = Garden.find_by_id(params[:garden_id]) || Garden.new + @crop = Crop.find_by(id: params[:crop_id]) || Crop.new + @garden = Garden.find_by(id: params[:garden_id]) || Garden.new respond_to do |format| format.html # new.html.erb diff --git a/app/controllers/posts_controller.rb b/app/controllers/posts_controller.rb index 48216ac87..75a4a7d49 100644 --- a/app/controllers/posts_controller.rb +++ b/app/controllers/posts_controller.rb @@ -6,7 +6,7 @@ class PostsController < ApplicationController # GET /posts.json def index - @author = Member.find_by_slug(params[:author]) + @author = Member.find_by(slug: params[:author]) @posts = if @author @author.posts.includes(:author, { comments: :author }).paginate(page: params[:page]) else @@ -39,7 +39,7 @@ class PostsController < ApplicationController # GET /posts/new.json def new @post = Post.new - @forum = Forum.find_by_id(params[:forum_id]) + @forum = Forum.find_by(id: params[:forum_id]) respond_to do |format| format.html # new.html.haml diff --git a/app/controllers/scientific_names_controller.rb b/app/controllers/scientific_names_controller.rb index cc7723b0b..1bbfcd4c6 100644 --- a/app/controllers/scientific_names_controller.rb +++ b/app/controllers/scientific_names_controller.rb @@ -28,7 +28,7 @@ class ScientificNamesController < ApplicationController # GET /scientific_names/new.json def new @scientific_name = ScientificName.new - @crop = Crop.find_by_id(params[:crop_id]) || Crop.new + @crop = Crop.find_by(id: params[:crop_id]) || Crop.new respond_to do |format| format.html # new.html.haml diff --git a/app/controllers/seeds_controller.rb b/app/controllers/seeds_controller.rb index 188855f45..45b14cb16 100644 --- a/app/controllers/seeds_controller.rb +++ b/app/controllers/seeds_controller.rb @@ -5,8 +5,8 @@ class SeedsController < ApplicationController # GET /seeds # GET /seeds.json def index - @owner = Member.find_by_slug(params[:owner]) - @crop = Crop.find_by_slug(params[:crop]) + @owner = Member.find_by(slug: params[:owner]) + @crop = Crop.find_by(slug: params[:crop]) @seeds = if @owner @owner.seeds.includes(:owner, :crop).paginate(page: params[:page]) elsif @crop @@ -49,7 +49,7 @@ class SeedsController < ApplicationController @seed = Seed.new # using find_by_id here because it returns nil, unlike find - @crop = Crop.find_by_id(params[:crop_id]) || Crop.new + @crop = Crop.find_by(id: params[:crop_id]) || Crop.new respond_to do |format| format.html # new.html.erb diff --git a/app/models/crop.rb b/app/models/crop.rb index 47829f463..7bc50c400 100644 --- a/app/models/crop.rb +++ b/app/models/crop.rb @@ -241,7 +241,7 @@ class Crop < ActiveRecord::Base # rubocop:disable Metrics/ClassLength def Crop.create_from_csv(row) name, en_wikipedia_url, parent, scientific_names, alternate_names = row - cropbot = Member.find_by_login_name('cropbot') + cropbot = Member.find_by(login_name: 'cropbot') raise "cropbot account not found: run rake db:seed" unless cropbot crop = Crop.find_or_create_by(name: name) @@ -251,7 +251,7 @@ class Crop < ActiveRecord::Base # rubocop:disable Metrics/ClassLength ) if parent - parent = Crop.find_by_name(parent) + parent = Crop.find_by(name: parent) if parent crop.update_attributes(parent_id: parent.id) else @@ -274,7 +274,7 @@ class Crop < ActiveRecord::Base # rubocop:disable Metrics/ClassLength end if names_to_add.size > 0 - cropbot = Member.find_by_login_name('cropbot') + cropbot = Member.find_by(login_name: 'cropbot') raise "cropbot account not found: run rake db:seed" unless cropbot names_to_add.each do |n| @@ -294,7 +294,7 @@ class Crop < ActiveRecord::Base # rubocop:disable Metrics/ClassLength def add_alternate_names_from_csv(alternate_names) names_to_add = [] if !alternate_names.blank? # i.e. we actually passed something in, which isn't a given - cropbot = Member.find_by_login_name('cropbot') + cropbot = Member.find_by(login_name: 'cropbot') raise "cropbot account not found: run rake db:seed" unless cropbot names_to_add = alternate_names.split(%r{,\s*}) @@ -354,7 +354,7 @@ class Crop < ActiveRecord::Base # rubocop:disable Metrics/ClassLength # we want to make sure that exact matches come first, even if not # using elasticsearch (eg. in development) - exact_match = Crop.approved.find_by_name(query) + exact_match = Crop.approved.find_by(name: query) if exact_match matches.delete(exact_match) matches.unshift(exact_match) diff --git a/app/models/member.rb b/app/models/member.rb index 018860365..331328988 100644 --- a/app/models/member.rb +++ b/app/models/member.rb @@ -137,7 +137,7 @@ class Member < ActiveRecord::Base end def auth(provider) - return authentications.find_by_provider(provider) + return authentications.find_by(provider: provider) end # Authenticates against Flickr and returns an object we can use for subsequent api calls diff --git a/app/models/order.rb b/app/models/order.rb index df8609184..c5d19b7cd 100644 --- a/app/models/order.rb +++ b/app/models/order.rb @@ -66,22 +66,22 @@ class Order < ActiveRecord::Base if args[:for] case args[:by] when "member" - member = Member.find_by_login_name(args[:for]) + member = Member.find_by(login_name: args[:for]) if member return member.orders end when "order_id" - order = Order.find_by_id(args[:for]) + order = Order.find_by(id: args[:for]) if order return [order] end when "paypal_token" - order = Order.find_by_paypal_express_token(args[:for]) + order = Order.find_by(paypal_express_token: args[:for]) if order return [order] end when "paypal_payer_id" - order = Order.find_by_paypal_express_payer_id(args[:for]) + order = Order.find_by(paypal_express_payer_id: args[:for]) if order return [order] end diff --git a/db/seeds.rb b/db/seeds.rb index 6503cde74..cf38dd1d0 100644 --- a/db/seeds.rb +++ b/db/seeds.rb @@ -141,7 +141,7 @@ def create_cropbot @cropbot_user.skip_confirmation! @cropbot_user.roles << @wrangler @cropbot_user.save! - @cropbot_user.account.account_type = AccountType.find_by_name("Staff") + @cropbot_user.account.account_type = AccountType.find_by(name: "Staff") @cropbot_user.account.save end diff --git a/lib/tasks/growstuff.rake b/lib/tasks/growstuff.rake index fd0258309..cbce26684 100644 --- a/lib/tasks/growstuff.rake +++ b/lib/tasks/growstuff.rake @@ -146,7 +146,7 @@ namespace :growstuff do end puts "Making Skud a staff account..." - @skud = Member.find_by_login_name('Skud') + @skud = Member.find_by(login_name: 'Skud') if @skud @skud.account.account_type = @staff_account @skud.account.save @@ -157,7 +157,7 @@ namespace :growstuff do desc "June 2013: replace nil account_types with free accounts" task nil_account_type: :environment do - free = AccountType.find_by_name("Free") + free = AccountType.find_by(name: "Free") raise "Free account type not found: run rake growstuff:oneoff:setup_shop"\ unless free Account.all.each do |a| @@ -187,9 +187,9 @@ namespace :growstuff do desc "August 2013: set default creator on existing crops" task set_default_crop_creator: :environment do - cropbot = Member.find_by_login_name("cropbot") + cropbot = Member.find_by(login_name: "cropbot") raise "cropbot not found: create cropbot member on site or run rake db:seed" unless cropbot - cropbot.account.account_type = AccountType.find_by_name("Staff") # set this just because it's nice + cropbot.account.account_type = AccountType.find_by(name: "Staff") # set this just because it's nice cropbot.account.save Crop.find_each do |crop| unless crop.creator @@ -294,13 +294,13 @@ namespace :growstuff do require 'csv' file = "db/seeds/alternate_names_201410.csv" puts "Loading alternate names from #{file}..." - cropbot = Member.find_by_login_name("cropbot") + cropbot = Member.find_by(login_name: "cropbot") CSV.foreach(file) do |row| crop_id, crop_name, alternate_names = row if alternate_names.blank? then next end - crop = Crop.find_by_name(crop_name) + crop = Crop.find_by(name: crop_name) if crop alternate_names.split(/,\s*/).each do |an| AlternateName.where( diff --git a/spec/controllers/roles_controller_spec.rb b/spec/controllers/roles_controller_spec.rb index f62289379..5c2271bce 100644 --- a/spec/controllers/roles_controller_spec.rb +++ b/spec/controllers/roles_controller_spec.rb @@ -24,7 +24,7 @@ describe RolesController do role = Role.create! valid_attributes get :index, {} # note that admin role exists because of login_admin_member - assigns(:roles).should eq([Role.find_by_name('admin'), role]) + assigns(:roles).should eq([Role.find_by(name: 'admin'), role]) end end end diff --git a/spec/models/crop_spec.rb b/spec/models/crop_spec.rb index b497b6222..e60d56290 100644 --- a/spec/models/crop_spec.rb +++ b/spec/models/crop_spec.rb @@ -10,7 +10,7 @@ describe Crop do it 'should be fetchable from the database' do crop.save - @crop2 = Crop.find_by_name('tomato') + @crop2 = Crop.find_by(name: 'tomato') @crop2.en_wikipedia_url.should == "http://en.wikipedia.org/wiki/Tomato" @crop2.slug.should == "tomato" end diff --git a/spec/models/scientific_name_spec.rb b/spec/models/scientific_name_spec.rb index b4b498db0..673655b92 100644 --- a/spec/models/scientific_name_spec.rb +++ b/spec/models/scientific_name_spec.rb @@ -10,7 +10,7 @@ describe ScientificName do it 'should be fetchable from the database' do sn.save - @sn2 = ScientificName.find_by_scientific_name('Zea mays') + @sn2 = ScientificName.find_by(scientific_name: 'Zea mays') @sn2.crop.name.should == 'maize' end From 07c135eeb5a71804a6c6cae080283f9a6583f119 Mon Sep 17 00:00:00 2001 From: Brenda Wallace Date: Sat, 26 Nov 2016 17:20:13 +1300 Subject: [PATCH 175/268] before_filter is now before_action --- .rubocop_todo.yml | 27 ------------------- app/controllers/account_types_controller.rb | 2 +- app/controllers/accounts_controller.rb | 2 +- app/controllers/alternate_names_controller.rb | 2 +- app/controllers/application_controller.rb | 4 +-- app/controllers/authentications_controller.rb | 2 +- app/controllers/comments_controller.rb | 2 +- app/controllers/crops_controller.rb | 2 +- app/controllers/follows_controller.rb | 2 +- app/controllers/gardens_controller.rb | 2 +- app/controllers/harvests_controller.rb | 2 +- app/controllers/notifications_controller.rb | 2 +- app/controllers/order_items_controller.rb | 2 +- app/controllers/orders_controller.rb | 2 +- app/controllers/plantings_controller.rb | 2 +- app/controllers/posts_controller.rb | 2 +- app/controllers/products_controller.rb | 2 +- app/controllers/roles_controller.rb | 2 +- .../scientific_names_controller.rb | 2 +- app/controllers/seeds_controller.rb | 2 +- 20 files changed, 20 insertions(+), 47 deletions(-) diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml index ecf35d1e1..8892c96d3 100644 --- a/.rubocop_todo.yml +++ b/.rubocop_todo.yml @@ -121,33 +121,6 @@ Performance/StringReplacement: - 'app/models/seed.rb' - 'spec/rails_helper.rb' -# Offense count: 21 -# Cop supports --auto-correct. -# Configuration parameters: EnforcedStyle, SupportedStyles, Include. -# SupportedStyles: action, filter -# Include: app/controllers/**/*.rb -Rails/ActionFilter: - Exclude: - - 'app/controllers/account_types_controller.rb' - - 'app/controllers/accounts_controller.rb' - - 'app/controllers/alternate_names_controller.rb' - - 'app/controllers/application_controller.rb' - - 'app/controllers/authentications_controller.rb' - - 'app/controllers/comments_controller.rb' - - 'app/controllers/crops_controller.rb' - - 'app/controllers/follows_controller.rb' - - 'app/controllers/gardens_controller.rb' - - 'app/controllers/harvests_controller.rb' - - 'app/controllers/notifications_controller.rb' - - 'app/controllers/order_items_controller.rb' - - 'app/controllers/orders_controller.rb' - - 'app/controllers/plantings_controller.rb' - - 'app/controllers/posts_controller.rb' - - 'app/controllers/products_controller.rb' - - 'app/controllers/roles_controller.rb' - - 'app/controllers/scientific_names_controller.rb' - - 'app/controllers/seeds_controller.rb' - # Offense count: 10 # Configuration parameters: EnforcedStyle, SupportedStyles. # SupportedStyles: strict, flexible diff --git a/app/controllers/account_types_controller.rb b/app/controllers/account_types_controller.rb index 073933af4..fce71380a 100644 --- a/app/controllers/account_types_controller.rb +++ b/app/controllers/account_types_controller.rb @@ -1,5 +1,5 @@ class AccountTypesController < ApplicationController - before_filter :authenticate_member! + before_action :authenticate_member! load_and_authorize_resource # GET /account_types diff --git a/app/controllers/accounts_controller.rb b/app/controllers/accounts_controller.rb index b2daf95ed..bca64597a 100644 --- a/app/controllers/accounts_controller.rb +++ b/app/controllers/accounts_controller.rb @@ -1,5 +1,5 @@ class AccountsController < ApplicationController - before_filter :authenticate_member! + before_action :authenticate_member! load_and_authorize_resource # GET /accounts diff --git a/app/controllers/alternate_names_controller.rb b/app/controllers/alternate_names_controller.rb index a02c0d9cb..ef81497e1 100644 --- a/app/controllers/alternate_names_controller.rb +++ b/app/controllers/alternate_names_controller.rb @@ -1,5 +1,5 @@ class AlternateNamesController < ApplicationController - before_filter :authenticate_member!, except: [:index, :show] + before_action :authenticate_member!, except: [:index, :show] load_and_authorize_resource # GET /alternate_names diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index 45c657b64..8548f8e8e 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -3,8 +3,8 @@ class ApplicationController < ActionController::Base include ApplicationHelper - after_filter :store_location - before_filter :set_locale + after_action :store_location + before_action :set_locale def store_location if (request.path != "/members/sign_in" && diff --git a/app/controllers/authentications_controller.rb b/app/controllers/authentications_controller.rb index 886715373..3567ea67f 100644 --- a/app/controllers/authentications_controller.rb +++ b/app/controllers/authentications_controller.rb @@ -1,5 +1,5 @@ class AuthenticationsController < ApplicationController - before_filter :authenticate_member! + before_action :authenticate_member! load_and_authorize_resource # POST /authentications diff --git a/app/controllers/comments_controller.rb b/app/controllers/comments_controller.rb index 967a386f8..ef3225bfb 100644 --- a/app/controllers/comments_controller.rb +++ b/app/controllers/comments_controller.rb @@ -1,5 +1,5 @@ class CommentsController < ApplicationController - before_filter :authenticate_member!, except: [:index, :show] + before_action :authenticate_member!, except: [:index, :show] load_and_authorize_resource # GET /comments diff --git a/app/controllers/crops_controller.rb b/app/controllers/crops_controller.rb index dac763665..3c665e9d1 100644 --- a/app/controllers/crops_controller.rb +++ b/app/controllers/crops_controller.rb @@ -1,7 +1,7 @@ require 'will_paginate/array' class CropsController < ApplicationController - before_filter :authenticate_member!, except: [:index, :hierarchy, :search, :show] + before_action :authenticate_member!, except: [:index, :hierarchy, :search, :show] load_and_authorize_resource skip_authorize_resource only: [:hierarchy, :search] diff --git a/app/controllers/follows_controller.rb b/app/controllers/follows_controller.rb index 58a1ce795..2c4b2daab 100644 --- a/app/controllers/follows_controller.rb +++ b/app/controllers/follows_controller.rb @@ -1,5 +1,5 @@ class FollowsController < ApplicationController - before_filter :authenticate_member! + before_action :authenticate_member! load_and_authorize_resource skip_load_resource only: :create diff --git a/app/controllers/gardens_controller.rb b/app/controllers/gardens_controller.rb index 8720a693d..a83089844 100644 --- a/app/controllers/gardens_controller.rb +++ b/app/controllers/gardens_controller.rb @@ -1,5 +1,5 @@ class GardensController < ApplicationController - before_filter :authenticate_member!, except: [:index, :show] + before_action :authenticate_member!, except: [:index, :show] load_and_authorize_resource # GET /gardens diff --git a/app/controllers/harvests_controller.rb b/app/controllers/harvests_controller.rb index 948edfb63..3d36438fd 100644 --- a/app/controllers/harvests_controller.rb +++ b/app/controllers/harvests_controller.rb @@ -1,5 +1,5 @@ class HarvestsController < ApplicationController - before_filter :authenticate_member!, except: [:index, :show] + before_action :authenticate_member!, except: [:index, :show] load_and_authorize_resource # GET /harvests diff --git a/app/controllers/notifications_controller.rb b/app/controllers/notifications_controller.rb index 39f48b85d..4bdae1c90 100644 --- a/app/controllers/notifications_controller.rb +++ b/app/controllers/notifications_controller.rb @@ -1,6 +1,6 @@ class NotificationsController < ApplicationController include NotificationsHelper - before_filter :authenticate_member! + before_action :authenticate_member! load_and_authorize_resource # GET /notifications diff --git a/app/controllers/order_items_controller.rb b/app/controllers/order_items_controller.rb index 7781913d4..0eb381a89 100644 --- a/app/controllers/order_items_controller.rb +++ b/app/controllers/order_items_controller.rb @@ -1,5 +1,5 @@ class OrderItemsController < ApplicationController - before_filter :authenticate_member! + before_action :authenticate_member! load_and_authorize_resource # POST /order_items diff --git a/app/controllers/orders_controller.rb b/app/controllers/orders_controller.rb index 234c760f2..a3def3194 100644 --- a/app/controllers/orders_controller.rb +++ b/app/controllers/orders_controller.rb @@ -1,5 +1,5 @@ class OrdersController < ApplicationController - before_filter :authenticate_member! + before_action :authenticate_member! load_and_authorize_resource # GET /orders diff --git a/app/controllers/plantings_controller.rb b/app/controllers/plantings_controller.rb index 222944151..708fc448d 100644 --- a/app/controllers/plantings_controller.rb +++ b/app/controllers/plantings_controller.rb @@ -1,5 +1,5 @@ class PlantingsController < ApplicationController - before_filter :authenticate_member!, except: [:index, :show] + before_action :authenticate_member!, except: [:index, :show] load_and_authorize_resource # GET /plantings diff --git a/app/controllers/posts_controller.rb b/app/controllers/posts_controller.rb index 75a4a7d49..76befd29d 100644 --- a/app/controllers/posts_controller.rb +++ b/app/controllers/posts_controller.rb @@ -1,5 +1,5 @@ class PostsController < ApplicationController - before_filter :authenticate_member!, except: [:index, :show] + before_action :authenticate_member!, except: [:index, :show] load_and_authorize_resource # GET /posts diff --git a/app/controllers/products_controller.rb b/app/controllers/products_controller.rb index be3e923dd..cb2f96e52 100644 --- a/app/controllers/products_controller.rb +++ b/app/controllers/products_controller.rb @@ -1,5 +1,5 @@ class ProductsController < ApplicationController - before_filter :authenticate_member! + before_action :authenticate_member! load_and_authorize_resource # GET /products diff --git a/app/controllers/roles_controller.rb b/app/controllers/roles_controller.rb index 82b554467..91bcf2e52 100644 --- a/app/controllers/roles_controller.rb +++ b/app/controllers/roles_controller.rb @@ -1,5 +1,5 @@ class RolesController < ApplicationController - before_filter :authenticate_member! + before_action :authenticate_member! load_and_authorize_resource # GET /roles diff --git a/app/controllers/scientific_names_controller.rb b/app/controllers/scientific_names_controller.rb index 1bbfcd4c6..20c8dae0b 100644 --- a/app/controllers/scientific_names_controller.rb +++ b/app/controllers/scientific_names_controller.rb @@ -1,5 +1,5 @@ class ScientificNamesController < ApplicationController - before_filter :authenticate_member!, except: [:index, :show] + before_action :authenticate_member!, except: [:index, :show] load_and_authorize_resource # GET /scientific_names diff --git a/app/controllers/seeds_controller.rb b/app/controllers/seeds_controller.rb index 45b14cb16..5d9a775e7 100644 --- a/app/controllers/seeds_controller.rb +++ b/app/controllers/seeds_controller.rb @@ -1,5 +1,5 @@ class SeedsController < ApplicationController - before_filter :authenticate_member!, except: [:index, :show] + before_action :authenticate_member!, except: [:index, :show] load_and_authorize_resource # GET /seeds From 8196d94a73e9a8ccc886ef92cf9874111f8a6e19 Mon Sep 17 00:00:00 2001 From: Brenda Wallace Date: Sat, 26 Nov 2016 17:23:31 +1300 Subject: [PATCH 176/268] Don't enforce http pos args until rails 5 --- .rubocop_todo.yml | 22 ---------------------- 1 file changed, 22 deletions(-) diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml index 8892c96d3..c650b322b 100644 --- a/.rubocop_todo.yml +++ b/.rubocop_todo.yml @@ -159,28 +159,6 @@ Rails/HasAndBelongsToMany: - 'app/models/product.rb' - 'app/models/role.rb' -# Offense count: 89 -# Cop supports --auto-correct. -# Configuration parameters: Include. -# Include: spec/**/*, test/**/* -Rails/HttpPositionalArguments: - Exclude: - - 'spec/controllers/admin/orders_controller_spec.rb' - - 'spec/controllers/comments_controller_spec.rb' - - 'spec/controllers/crops_controller_spec.rb' - - 'spec/controllers/harvests_controller_spec.rb' - - 'spec/controllers/member_controller_spec.rb' - - 'spec/controllers/notifications_controller_spec.rb' - - 'spec/controllers/order_items_controller_spec.rb' - - 'spec/controllers/orders_controller_spec.rb' - - 'spec/controllers/places_controller_spec.rb' - - 'spec/controllers/plantings_controller_spec.rb' - - 'spec/controllers/posts_controller_spec.rb' - - 'spec/controllers/roles_controller_spec.rb' - - 'spec/controllers/scientific_names_controller_spec.rb' - - 'spec/controllers/seeds_controller_spec.rb' - - 'spec/controllers/shop_controller_spec.rb' - # Offense count: 15 # Configuration parameters: Include. # Include: app/**/*.rb, config/**/*.rb, db/**/*.rb, lib/**/*.rb From b541fe8221d5823a5db2ea7aa5fa74cde368aa5f Mon Sep 17 00:00:00 2001 From: Brenda Wallace Date: Sat, 26 Nov 2016 17:24:41 +1300 Subject: [PATCH 177/268] puts allowed in some files --- .rubocop.yml | 7 +++++++ .rubocop_todo.yml | 8 -------- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/.rubocop.yml b/.rubocop.yml index 2631b0f0d..d2bb99356 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -66,3 +66,10 @@ Style/Documentation: Style/FrozenStringLiteralComment: Enabled: false + +# Configuration parameters: Include. +# Include: app/**/*.rb, config/**/*.rb, db/**/*.rb, lib/**/*.rb +Rails/Output: + Exclude: + - 'config/unicorn.rb' + - 'db/seeds.rb' \ No newline at end of file diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml index c650b322b..6bf2490c9 100644 --- a/.rubocop_todo.yml +++ b/.rubocop_todo.yml @@ -159,14 +159,6 @@ Rails/HasAndBelongsToMany: - 'app/models/product.rb' - 'app/models/role.rb' -# Offense count: 15 -# Configuration parameters: Include. -# Include: app/**/*.rb, config/**/*.rb, db/**/*.rb, lib/**/*.rb -Rails/Output: - Exclude: - - 'config/unicorn.rb' - - 'db/seeds.rb' - # Offense count: 3 Rails/OutputSafety: Exclude: From d60dcfbddd21dded43cf891863888dfc69bb1e43 Mon Sep 17 00:00:00 2001 From: Brenda Wallace Date: Sat, 26 Nov 2016 17:26:04 +1300 Subject: [PATCH 178/268] Use request.referer instead of request.referrer --- .rubocop_todo.yml | 8 -------- app/controllers/application_controller.rb | 2 +- 2 files changed, 1 insertion(+), 9 deletions(-) diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml index 6bf2490c9..a5fcfe3b4 100644 --- a/.rubocop_todo.yml +++ b/.rubocop_todo.yml @@ -173,14 +173,6 @@ Rails/PluralizationGrammar: - 'spec/features/plantings/planting_a_crop_spec.rb' - 'spec/models/member_spec.rb' -# Offense count: 1 -# Cop supports --auto-correct. -# Configuration parameters: EnforcedStyle, SupportedStyles. -# SupportedStyles: referer, referrer -Rails/RequestReferer: - Exclude: - - 'app/controllers/application_controller.rb' - # Offense count: 9 # Configuration parameters: EnforcedStyle, SupportedStyles. # SupportedStyles: strict, flexible diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index 8548f8e8e..468f767c6 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -23,7 +23,7 @@ class ApplicationController < ActionController::Base end def after_sign_out_path_for(resource_or_scope) - request.referrer + request.referer end # tweak CanCan defaults because we don't have a "current_user" method From 1fd723301256002678de401fdd63e1872192809f Mon Sep 17 00:00:00 2001 From: Brenda Wallace Date: Sat, 26 Nov 2016 17:27:13 +1300 Subject: [PATCH 179/268] Plualisation fixups --- .rubocop_todo.yml | 7 ------- 1 file changed, 7 deletions(-) diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml index a5fcfe3b4..487f78c23 100644 --- a/.rubocop_todo.yml +++ b/.rubocop_todo.yml @@ -166,13 +166,6 @@ Rails/OutputSafety: - 'app/helpers/auto_suggest_helper.rb' - 'app/helpers/gardens_helper.rb' -# Offense count: 2 -# Cop supports --auto-correct. -Rails/PluralizationGrammar: - Exclude: - - 'spec/features/plantings/planting_a_crop_spec.rb' - - 'spec/models/member_spec.rb' - # Offense count: 9 # Configuration parameters: EnforcedStyle, SupportedStyles. # SupportedStyles: strict, flexible From 8c7fcd9d49119ceab1b62c3e5e53204c14d20326 Mon Sep 17 00:00:00 2001 From: Brenda Wallace Date: Sat, 26 Nov 2016 19:27:04 +1300 Subject: [PATCH 180/268] Fixed all useless assignments --- .rubocop_todo.yml | 204 ------------------ app/controllers/crops_controller.rb | 4 +- app/models/crop.rb | 2 - app/models/member.rb | 21 +- config.rb | 2 +- config/compass.rb | 1 + config/setup_load_paths.rb | 2 - db/seeds.rb | 2 +- lib/tasks/growstuff.rake | 6 +- .../admin/orders_controller_spec.rb | 1 - .../plantings/planting_a_crop_spec.rb | 2 +- spec/features/signin_spec.rb | 2 +- spec/features/unsubscribing_spec.rb | 2 +- spec/helpers/gardens_helper_spec.rb | 11 +- spec/helpers/notifications_helper_spec.rb | 2 - spec/helpers/seeds_helper_spec.rb | 1 - spec/models/crop_spec.rb | 44 ++-- spec/models/garden_spec.rb | 2 +- spec/models/member_spec.rb | 15 +- spec/support/controller_macros.rb | 2 +- 20 files changed, 54 insertions(+), 274 deletions(-) diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml index 487f78c23..c39277dd4 100644 --- a/.rubocop_todo.yml +++ b/.rubocop_todo.yml @@ -82,28 +82,6 @@ Lint/UnusedMethodArgument: - 'app/validators/approved_validator.rb' - 'spec/views/plantings/show.html.haml_spec.rb' -# Offense count: 52 -Lint/UselessAssignment: - Exclude: - - 'app/controllers/crops_controller.rb' - - 'app/models/crop.rb' - - 'app/models/member.rb' - - 'config.rb' - - 'config/compass.rb' - - 'config/setup_load_paths.rb' - - 'db/seeds.rb' - - 'lib/tasks/growstuff.rake' - - 'spec/controllers/admin/orders_controller_spec.rb' - - 'spec/features/signin_spec.rb' - - 'spec/features/unsubscribing_spec.rb' - - 'spec/helpers/gardens_helper_spec.rb' - - 'spec/helpers/notifications_helper_spec.rb' - - 'spec/helpers/seeds_helper_spec.rb' - - 'spec/models/crop_spec.rb' - - 'spec/models/garden_spec.rb' - - 'spec/models/member_spec.rb' - - 'spec/support/controller_macros.rb' - # Offense count: 5 Lint/Void: Exclude: @@ -319,188 +297,6 @@ Style/DefWithParentheses: Exclude: - 'spec/views/posts/_single.html.haml_spec.rb' -# Offense count: 178 -Style/Documentation: - Exclude: - - 'spec/**/*' - - 'test/**/*' - - 'app/controllers/account_types_controller.rb' - - 'app/controllers/accounts_controller.rb' - - 'app/controllers/admin/orders_controller.rb' - - 'app/controllers/admin_controller.rb' - - 'app/controllers/alternate_names_controller.rb' - - 'app/controllers/application_controller.rb' - - 'app/controllers/authentications_controller.rb' - - 'app/controllers/comments_controller.rb' - - 'app/controllers/crops_controller.rb' - - 'app/controllers/follows_controller.rb' - - 'app/controllers/forums_controller.rb' - - 'app/controllers/gardens_controller.rb' - - 'app/controllers/harvests_controller.rb' - - 'app/controllers/home_controller.rb' - - 'app/controllers/members_controller.rb' - - 'app/controllers/notifications_controller.rb' - - 'app/controllers/order_items_controller.rb' - - 'app/controllers/orders_controller.rb' - - 'app/controllers/pages_controller.rb' - - 'app/controllers/passwords_controller.rb' - - 'app/controllers/photos_controller.rb' - - 'app/controllers/places_controller.rb' - - 'app/controllers/plant_parts_controller.rb' - - 'app/controllers/plantings_controller.rb' - - 'app/controllers/posts_controller.rb' - - 'app/controllers/products_controller.rb' - - 'app/controllers/registrations_controller.rb' - - 'app/controllers/robots_controller.rb' - - 'app/controllers/roles_controller.rb' - - 'app/controllers/scientific_names_controller.rb' - - 'app/controllers/seeds_controller.rb' - - 'app/controllers/sessions_controller.rb' - - 'app/controllers/shop_controller.rb' - - 'app/helpers/application_helper.rb' - - 'app/helpers/auto_suggest_helper.rb' - - 'app/helpers/crops_helper.rb' - - 'app/helpers/gardens_helper.rb' - - 'app/helpers/harvests_helper.rb' - - 'app/helpers/notifications_helper.rb' - - 'app/helpers/plantings_helper.rb' - - 'app/helpers/seeds_helper.rb' - - 'app/mailers/notifier.rb' - - 'app/models/ability.rb' - - 'app/models/account.rb' - - 'app/models/account_type.rb' - - 'app/models/alternate_name.rb' - - 'app/models/authentication.rb' - - 'app/models/comment.rb' - - 'app/models/crop.rb' - - 'app/models/follow.rb' - - 'app/models/forum.rb' - - 'app/models/garden.rb' - - 'app/models/harvest.rb' - - 'app/models/member.rb' - - 'app/models/notification.rb' - - 'app/models/order.rb' - - 'app/models/order_item.rb' - - 'app/models/photo.rb' - - 'app/models/plant_part.rb' - - 'app/models/planting.rb' - - 'app/models/post.rb' - - 'app/models/product.rb' - - 'app/models/role.rb' - - 'app/models/scientific_name.rb' - - 'app/models/seed.rb' - - 'app/validators/approved_validator.rb' - - 'config/application.rb' - - 'config/initializers/comfortable_mexican_sofa.rb' - - 'db/migrate/20120903092956_devise_create_users.rb' - - 'db/migrate/20120903112806_add_username_to_users.rb' - - 'db/migrate/20121001212604_create_crops.rb' - - 'db/migrate/20121003190731_require_system_name_for_crops.rb' - - 'db/migrate/20121027035231_add_slug_to_crops.rb' - - 'db/migrate/20121105032913_create_gardens.rb' - - 'db/migrate/20121106101718_add_slug_to_users.rb' - - 'db/migrate/20121107012827_create_scientific_names.rb' - - 'db/migrate/20121108105440_create_updates.rb' - - 'db/migrate/20121109130033_add_creation_index_to_updates.rb' - - 'db/migrate/20121203034745_add_tos_agreement_to_users.rb' - - 'db/migrate/20121214224227_add_slug_to_updates.rb' - - 'db/migrate/20121219022554_create_plantings.rb' - - 'db/migrate/20130113045802_rename_updates_to_posts.rb' - - 'db/migrate/20130113060852_rename_users_to_members.rb' - - 'db/migrate/20130113081521_rename_post_member_to_author.rb' - - 'db/migrate/20130113095802_rename_garden_member_to_owner.rb' - - 'db/migrate/20130118031942_add_description_to_gardens.rb' - - 'db/migrate/20130118043431_add_slug_to_plantings.rb' - - 'db/migrate/20130206033956_create_comments.rb' - - 'db/migrate/20130206051328_add_show_email_to_member.rb' - - 'db/migrate/20130208034248_require_fields_for_comments.rb' - - 'db/migrate/20130212001748_add_geo_to_members.rb' - - 'db/migrate/20130212123628_create_notifications.rb' - - 'db/migrate/20130213014511_create_forums.rb' - - 'db/migrate/20130213015708_add_forum_to_posts.rb' - - 'db/migrate/20130214024117_create_roles.rb' - - 'db/migrate/20130214034838_add_members_roles_table.rb' - - 'db/migrate/20130215131921_rename_notification_fields.rb' - - 'db/migrate/20130220044605_add_slug_to_forums.rb' - - 'db/migrate/20130220044642_add_slug_to_roles.rb' - - 'db/migrate/20130222060730_default_read_to_false.rb' - - 'db/migrate/20130326092227_change_planted_at_to_date.rb' - - 'db/migrate/20130327120024_add_send_email_to_member.rb' - - 'db/migrate/20130329045744_add_sunniness_to_planting.rb' - - 'db/migrate/20130404174459_create_authentications.rb' - - 'db/migrate/20130409103549_make_post_subject_non_null.rb' - - 'db/migrate/20130409162140_add_name_to_authentications.rb' - - 'db/migrate/20130507105357_create_products.rb' - - 'db/migrate/20130507110411_create_orders.rb' - - 'db/migrate/20130507113915_add_orders_products_table.rb' - - 'db/migrate/20130508050711_add_completed_to_order.rb' - - 'db/migrate/20130508104506_create_photos.rb' - - 'db/migrate/20130509123711_add_metadata_to_photos.rb' - - 'db/migrate/20130514124515_add_parent_to_crop.rb' - - 'db/migrate/20130515033842_create_order_items.rb' - - 'db/migrate/20130515054017_change_order_member_id_to_integer.rb' - - 'db/migrate/20130515122301_change_prices_to_integers.rb' - - 'db/migrate/20130517015920_create_account_details.rb' - - 'db/migrate/20130517051922_create_account_types.rb' - - 'db/migrate/20130517234458_require_account_type_name.rb' - - 'db/migrate/20130518000339_add_columns_to_product.rb' - - 'db/migrate/20130518002942_rename_account_detail_to_account.rb' - - 'db/migrate/20130529032813_add_express_token_to_orders.rb' - - 'db/migrate/20130531110729_add_photos_plantings_table.rb' - - 'db/migrate/20130601011725_change_flickr_photo_id_to_string.rb' - - 'db/migrate/20130606230333_change_product_description_to_text.rb' - - 'db/migrate/20130606233733_add_recommended_price_to_product.rb' - - 'db/migrate/20130705104238_add_planted_from_to_planting.rb' - - 'db/migrate/20130715110134_create_seeds.rb' - - 'db/migrate/20130718005600_change_use_by_to_plant_before_on_seed.rb' - - 'db/migrate/20130718011247_add_trading_to_seeds.rb' - - 'db/migrate/20130722050836_remove_tradable_from_seeds.rb' - - 'db/migrate/20130723103128_set_default_tradable_to_on_seed.rb' - - 'db/migrate/20130723110702_add_slug_to_seed.rb' - - 'db/migrate/20130809012511_add_bio_to_members.rb' - - 'db/migrate/20130819004549_add_planting_count_to_crop.rb' - - 'db/migrate/20130821011352_add_creator_to_crops.rb' - - 'db/migrate/20130821073736_add_creator_to_scientific_name.rb' - - 'db/migrate/20130826012139_add_owner_to_planting.rb' - - 'db/migrate/20130826023159_add_plantings_count_to_member.rb' - - 'db/migrate/20130827105823_add_newsletter_to_member.rb' - - 'db/migrate/20130913015118_add_referral_code_to_order.rb' - - 'db/migrate/20130917053547_create_harvests.rb' - - 'db/migrate/20130917060257_change_harvest_notes_to_description.rb' - - 'db/migrate/20130917071545_change_harvest_units_to_unit.rb' - - 'db/migrate/20130917075803_add_slug_to_harvests.rb' - - 'db/migrate/20130925050304_add_weight_to_harvests.rb' - - 'db/migrate/20131018101204_rename_system_name_to_name.rb' - - 'db/migrate/20131025104228_add_fields_to_gardens.rb' - - 'db/migrate/20131029053113_add_plant_part_to_harvests.rb' - - 'db/migrate/20131030230908_create_plant_parts.rb' - - 'db/migrate/20131030231202_change_plant_part_to_plant_part_id.rb' - - 'db/migrate/20131031000655_add_slug_to_plant_part.rb' - - 'db/migrate/20140718075753_default_plantings_count_to_zero.rb' - - 'db/migrate/20140829230600_add_finished_to_planting.rb' - - 'db/migrate/20140905001730_add_harvests_photos_table.rb' - - 'db/migrate/20140928044231_add_crops_posts_table.rb' - - 'db/migrate/20140928085713_add_send_planting_reminder_to_member.rb' - - 'db/migrate/20141002022459_create_index_harvest_photos.rb' - - 'db/migrate/20141018111015_create_alternate_names.rb' - - 'db/migrate/20141111130849_create_follows.rb' - - 'db/migrate/20141119130555_change_follows_member_id_to_follower_id.rb' - - 'db/migrate/20150124110540_add_properties_to_seeds.rb' - - 'db/migrate/20150127043022_add_gardens_photos_table.rb' - - 'db/migrate/20150129034206_add_si_weight_to_harvest.rb' - - 'db/migrate/20150130224814_add_requester_to_crops.rb' - - 'db/migrate/20150201052245_create_cms.rb' - - 'db/migrate/20150201053200_add_approval_status_to_crops.rb' - - 'db/migrate/20150201062506_add_reason_for_rejection_to_crops.rb' - - 'db/migrate/20150201064502_add_request_notes_to_crops.rb' - - 'db/migrate/20150209105410_add_rejection_notes_to_crops.rb' - - 'db/migrate/20150625224805_add_days_before_maturity_to_plantings.rb' - - 'db/migrate/20150824145414_add_member_preferred_image.rb' - - 'lib/actions/oauth_signup_action.rb' - - 'lib/geocodable.rb' - - 'lib/haml/filters/escaped_markdown.rb' - - 'lib/haml/filters/growstuff_markdown.rb' - # Offense count: 10 # Cop supports --auto-correct. Style/EachForSimpleLoop: diff --git a/app/controllers/crops_controller.rb b/app/controllers/crops_controller.rb index 3c665e9d1..7589b8734 100644 --- a/app/controllers/crops_controller.rb +++ b/app/controllers/crops_controller.rb @@ -172,14 +172,14 @@ class CropsController < ApplicationController end params[:alt_name].each do |index, value| - alt_name = @crop.alternate_names.create(name: value, creator_id: current_member.id) + @crop.alternate_names.create(name: value, creator_id: current_member.id) end @crop.scientific_names.each do |sci_name| sci_name.destroy end params[:sci_name].each do |index, value| - sci_name = @crop.scientific_names.create(scientific_name: value, creator_id: current_member.id) + @crop.scientific_names.create(scientific_name: value, creator_id: current_member.id) end end diff --git a/app/models/crop.rb b/app/models/crop.rb index 7bc50c400..614b25b03 100644 --- a/app/models/crop.rb +++ b/app/models/crop.rb @@ -292,7 +292,6 @@ class Crop < ActiveRecord::Base # rubocop:disable Metrics/ClassLength end def add_alternate_names_from_csv(alternate_names) - names_to_add = [] if !alternate_names.blank? # i.e. we actually passed something in, which isn't a given cropbot = Member.find_by(login_name: 'cropbot') raise "cropbot account not found: run rake db:seed" unless cropbot @@ -309,7 +308,6 @@ class Crop < ActiveRecord::Base # rubocop:disable Metrics/ClassLength ) end end - end end diff --git a/app/models/member.rb b/app/models/member.rb index 331328988..ea14ccd9b 100644 --- a/app/models/member.rb +++ b/app/models/member.rb @@ -159,7 +159,6 @@ class Member < ActiveRecord::Base # Returns a [[page of photos], total] pair. # Total is needed for pagination. def flickr_photos(page_num = 1, set = nil) - result = false result = if set flickr.photosets.getPhotos( photoset_id: set, @@ -237,21 +236,21 @@ class Member < ActiveRecord::Base def newsletter_subscribe(testing = false) return true if (Rails.env.test? && !testing) gb = Gibbon::API.new - res = gb.lists.subscribe({ - id: Growstuff::Application.config.newsletter_list_id, - email: { email: email }, - merge_vars: { login_name: login_name }, - double_optin: false # they already confirmed their email with us - }) + gb.lists.subscribe({ + id: Growstuff::Application.config.newsletter_list_id, + email: { email: email }, + merge_vars: { login_name: login_name }, + double_optin: false # they already confirmed their email with us + }) end def newsletter_unsubscribe(testing = false) return true if (Rails.env.test? && !testing) gb = Gibbon::API.new - res = gb.lists.unsubscribe({ - id: Growstuff::Application.config.newsletter_list_id, - email: { email: email } - }) + gb.lists.unsubscribe({ + id: Growstuff::Application.config.newsletter_list_id, + email: { email: email } + }) end def already_following?(member) diff --git a/config.rb b/config.rb index bb4bb0a7d..f816551c1 100644 --- a/config.rb +++ b/config.rb @@ -1,5 +1,5 @@ # Require any additional compass plugins here. - +# rubocop:disable Lint/UselessAssignment # Set this to the root of your project when deployed: http_path = "/" css_dir = "app/assets/stylesheets" diff --git a/config/compass.rb b/config/compass.rb index 2b22d5d7c..306cdd02c 100644 --- a/config/compass.rb +++ b/config/compass.rb @@ -1,2 +1,3 @@ # Require any additional compass plugins here. +# rubocop:disable Lint/UselessAssignment project_type = :rails diff --git a/config/setup_load_paths.rb b/config/setup_load_paths.rb index 7c6e7e133..c1a0f95fd 100644 --- a/config/setup_load_paths.rb +++ b/config/setup_load_paths.rb @@ -1,7 +1,5 @@ if ENV['MY_RUBY_HOME'] && ENV['MY_RUBY_HOME'].include?('rvm') begin - rvm_path = File.dirname(File.dirname(ENV['MY_RUBY_HOME'])) - rvm_lib_path = File.join(rvm_path, 'lib') require 'rvm' RVM.use_from_path! File.dirname(File.dirname(__FILE__)) rescue LoadError diff --git a/db/seeds.rb b/db/seeds.rb index cf38dd1d0..467fd39f2 100644 --- a/db/seeds.rb +++ b/db/seeds.rb @@ -87,7 +87,7 @@ def load_test_users suburb_file.pos = 0 if suburb_file.eof? row = CSV.parse(suburb_file.readline) - suburb, country, state, latitude, longitude = row[0] + suburb, _country, _state, latitude, longitude = row[0] # Using 'update_column' method instead of 'update' so that # it avoids accessing Geocoding service for faster processing @user.gardens.first.update_columns(location: suburb, latitude: latitude, longitude: longitude) diff --git a/lib/tasks/growstuff.rake b/lib/tasks/growstuff.rake index cbce26684..de4c34bc5 100644 --- a/lib/tasks/growstuff.rake +++ b/lib/tasks/growstuff.rake @@ -296,10 +296,8 @@ namespace :growstuff do puts "Loading alternate names from #{file}..." cropbot = Member.find_by(login_name: "cropbot") CSV.foreach(file) do |row| - crop_id, crop_name, alternate_names = row - if alternate_names.blank? then - next - end + _crop_id, crop_name, alternate_names = row + next if alternate_names.blank? crop = Crop.find_by(name: crop_name) if crop alternate_names.split(/,\s*/).each do |an| diff --git a/spec/controllers/admin/orders_controller_spec.rb b/spec/controllers/admin/orders_controller_spec.rb index 4c407c34d..07fe22170 100644 --- a/spec/controllers/admin/orders_controller_spec.rb +++ b/spec/controllers/admin/orders_controller_spec.rb @@ -23,7 +23,6 @@ describe Admin::OrdersController do end it "sets an error message if nothing found" do - order = FactoryGirl.create(:order) get :search, { search_by: 'order_id', search_text: 'foo' } flash[:alert].should match /Couldn't find order with/ end diff --git a/spec/features/plantings/planting_a_crop_spec.rb b/spec/features/plantings/planting_a_crop_spec.rb index 2494e7e41..affd691cb 100644 --- a/spec/features/plantings/planting_a_crop_spec.rb +++ b/spec/features/plantings/planting_a_crop_spec.rb @@ -59,7 +59,7 @@ feature "Planting a crop", :js do @a_past_date = 15.days.ago.strftime("%Y-%m-%d") @right_now = Date.today.strftime("%Y-%m-%d") - @a_future_date = 1.years.from_now.strftime("%Y-%m-%d") + @a_future_date = 1.year.from_now.strftime("%Y-%m-%d") end it "should show that it is not planted yet" do diff --git a/spec/features/signin_spec.rb b/spec/features/signin_spec.rb index 41aa1ecd1..7bc08147c 100644 --- a/spec/features/signin_spec.rb +++ b/spec/features/signin_spec.rb @@ -66,7 +66,7 @@ feature "signin", js: true do # Ordinarily done by database_cleaner Member.where(login_name: 'tdawg').delete_all - member = create :member, login_name: 'tdawg', email: 'example.oauth.facebook@example.com' + create :member, login_name: 'tdawg', email: 'example.oauth.facebook@example.com' # Start the test visit root_path diff --git a/spec/features/unsubscribing_spec.rb b/spec/features/unsubscribing_spec.rb index ba231d1d8..d5da11160 100644 --- a/spec/features/unsubscribing_spec.rb +++ b/spec/features/unsubscribing_spec.rb @@ -52,7 +52,7 @@ feature "unsubscribe" do # visit /members/unsubscribe/somestring ie.parameter to the URL is a random string visit unsubscribe_member_url("type=send_planting_reminder&member_id=#{member.id}") expect(page).to have_content "We're sorry, there was an error" - updated_member = Member.find(member.id) # reload the member + Member.find(member.id) # reload the member expect(member.send_planting_reminder).to eq(true) expect(member.send_notification_email).to eq(true) end diff --git a/spec/helpers/gardens_helper_spec.rb b/spec/helpers/gardens_helper_spec.rb index c561c32d1..82a729774 100644 --- a/spec/helpers/gardens_helper_spec.rb +++ b/spec/helpers/gardens_helper_spec.rb @@ -23,7 +23,6 @@ describe GardensHelper do description: 'a' * 130 ) result = helper.display_garden_description(garden) - link = link_to("Read more", garden_path(garden)) expect(result).to eq 'a' * 130 end @@ -38,17 +37,13 @@ describe GardensHelper do describe "garden plantings" do it "is missing" do - garden = FactoryGirl.create(:garden) - plantings = nil - result = helper.display_garden_plantings(plantings) + result = helper.display_garden_plantings(nil) expect(result).to eq "None" end it "has 1 planting" do - garden = FactoryGirl.create(:garden) - plantings = [] crop = FactoryGirl.create(:crop) - plantings << FactoryGirl.create(:planting, quantity: 10, crop: crop) + plantings = [FactoryGirl.create(:planting, quantity: 10, crop: crop)] result = helper.display_garden_plantings(plantings) output = "
  • " @@ -59,7 +54,6 @@ describe GardensHelper do end it "has 2 plantings" do - garden = FactoryGirl.create(:garden) plantings = [] crop1 = FactoryGirl.create(:crop) @@ -82,7 +76,6 @@ describe GardensHelper do end it "has 3 plantings" do - garden = FactoryGirl.create(:garden) plantings = [] crop1 = FactoryGirl.create(:crop) diff --git a/spec/helpers/notifications_helper_spec.rb b/spec/helpers/notifications_helper_spec.rb index d79ea409d..152791034 100644 --- a/spec/helpers/notifications_helper_spec.rb +++ b/spec/helpers/notifications_helper_spec.rb @@ -6,8 +6,6 @@ describe NotificationsHelper do it "replies to PMs with PMs" do notification = FactoryGirl.create(:notification, recipient_id: member.id, post_id: nil) - subject = "Re: " + notification.subject - link = helper.reply_link(notification) link.should_not be_nil link.should eq reply_notification_url(notification) diff --git a/spec/helpers/seeds_helper_spec.rb b/spec/helpers/seeds_helper_spec.rb index c86dc2637..a0eeb49f5 100644 --- a/spec/helpers/seeds_helper_spec.rb +++ b/spec/helpers/seeds_helper_spec.rb @@ -23,7 +23,6 @@ describe SeedsHelper do description: 'a' * 130 ) result = helper.display_seed_description(seed) - link = link_to("Read more", seed_path(seed)) expect(result).to eq 'a' * 130 end diff --git a/spec/models/crop_spec.rb b/spec/models/crop_spec.rb index e60d56290..a7bf1037c 100644 --- a/spec/models/crop_spec.rb +++ b/spec/models/crop_spec.rb @@ -157,25 +157,25 @@ describe Crop do let(:crop) { FactoryGirl.create(:tomato) } it 'returns a hash of sunniness values' do - planting1 = FactoryGirl.create(:sunny_planting, crop: crop) - planting2 = FactoryGirl.create(:sunny_planting, crop: crop) - planting3 = FactoryGirl.create(:semi_shady_planting, crop: crop) - planting4 = FactoryGirl.create(:shady_planting, crop: crop) + FactoryGirl.create(:sunny_planting, crop: crop) + FactoryGirl.create(:sunny_planting, crop: crop) + FactoryGirl.create(:semi_shady_planting, crop: crop) + FactoryGirl.create(:shady_planting, crop: crop) crop.sunniness.should be_an_instance_of Hash end it 'counts each sunniness value' do - planting1 = FactoryGirl.create(:sunny_planting, crop: crop) - planting2 = FactoryGirl.create(:sunny_planting, crop: crop) - planting3 = FactoryGirl.create(:semi_shady_planting, crop: crop) - planting4 = FactoryGirl.create(:shady_planting, crop: crop) + FactoryGirl.create(:sunny_planting, crop: crop) + FactoryGirl.create(:sunny_planting, crop: crop) + FactoryGirl.create(:semi_shady_planting, crop: crop) + FactoryGirl.create(:shady_planting, crop: crop) crop.sunniness.should == { 'sun' => 2, 'shade' => 1, 'semi-shade' => 1 } end it 'ignores unused sunniness values' do - planting1 = FactoryGirl.create(:sunny_planting, crop: crop) - planting2 = FactoryGirl.create(:sunny_planting, crop: crop) - planting3 = FactoryGirl.create(:semi_shady_planting, crop: crop) + FactoryGirl.create(:sunny_planting, crop: crop) + FactoryGirl.create(:sunny_planting, crop: crop) + FactoryGirl.create(:semi_shady_planting, crop: crop) crop.sunniness.should == { 'sun' => 2, 'semi-shade' => 1 } end end @@ -184,25 +184,25 @@ describe Crop do let(:crop) { FactoryGirl.create(:tomato) } it 'returns a hash of sunniness values' do - planting1 = FactoryGirl.create(:seed_planting, crop: crop) - planting2 = FactoryGirl.create(:seed_planting, crop: crop) - planting3 = FactoryGirl.create(:seedling_planting, crop: crop) - planting4 = FactoryGirl.create(:cutting_planting, crop: crop) + FactoryGirl.create(:seed_planting, crop: crop) + FactoryGirl.create(:seed_planting, crop: crop) + FactoryGirl.create(:seedling_planting, crop: crop) + FactoryGirl.create(:cutting_planting, crop: crop) crop.planted_from.should be_an_instance_of Hash end it 'counts each planted_from value' do - planting1 = FactoryGirl.create(:seed_planting, crop: crop) - planting2 = FactoryGirl.create(:seed_planting, crop: crop) - planting3 = FactoryGirl.create(:seedling_planting, crop: crop) - planting4 = FactoryGirl.create(:cutting_planting, crop: crop) + FactoryGirl.create(:seed_planting, crop: crop) + FactoryGirl.create(:seed_planting, crop: crop) + FactoryGirl.create(:seedling_planting, crop: crop) + FactoryGirl.create(:cutting_planting, crop: crop) crop.planted_from.should == { 'seed' => 2, 'seedling' => 1, 'cutting' => 1 } end it 'ignores unused planted_from values' do - planting1 = FactoryGirl.create(:seed_planting, crop: crop) - planting2 = FactoryGirl.create(:seed_planting, crop: crop) - planting3 = FactoryGirl.create(:seedling_planting, crop: crop) + FactoryGirl.create(:seed_planting, crop: crop) + FactoryGirl.create(:seed_planting, crop: crop) + FactoryGirl.create(:seedling_planting, crop: crop) crop.planted_from.should == { 'seed' => 2, 'seedling' => 1 } end end diff --git a/spec/models/garden_spec.rb b/spec/models/garden_spec.rb index b56ac2056..cd0b25b35 100644 --- a/spec/models/garden_spec.rb +++ b/spec/models/garden_spec.rb @@ -75,7 +75,7 @@ describe Garden do context 'ordering' do it "should be sorted alphabetically" do - z = FactoryGirl.create(:garden_z) + FactoryGirl.create(:garden_z) a = FactoryGirl.create(:garden_a) Garden.first.should == a end diff --git a/spec/models/member_spec.rb b/spec/models/member_spec.rb index cc6281fc4..19e0a9568 100644 --- a/spec/models/member_spec.rb +++ b/spec/models/member_spec.rb @@ -126,17 +126,18 @@ describe 'member' do context 'case sensitivity' do it 'preserves case of login name' do - member = FactoryGirl.create(:member, login_name: "BOB") - check = Member.find('bob') - check.login_name.should eq 'BOB' + FactoryGirl.create(:member, login_name: "BOB") + Member.find('bob').login_name.should eq 'BOB' end end context 'ordering' do + before do + FactoryGirl.create(:member, login_name: "Zoe") + FactoryGirl.create(:member, login_name: "Anna") + end it "should be sorted by name" do - z = FactoryGirl.create(:member, login_name: "Zoe") - a = FactoryGirl.create(:member, login_name: "Anna") - Member.first.should == a + expect(Member.first.login_name).to eq("Anna") end end @@ -273,7 +274,7 @@ describe 'member' do @member1.updated_at = 3.days.ago @member2.updated_at = 2.days.ago - @member3.updated_at = 1.days.ago + @member3.updated_at = 1.day.ago Member.interesting.should eq [@member3, @member2, @member1] end diff --git a/spec/support/controller_macros.rb b/spec/support/controller_macros.rb index 393d7221b..1bf679afb 100644 --- a/spec/support/controller_macros.rb +++ b/spec/support/controller_macros.rb @@ -1,7 +1,7 @@ # Taken unashamedly from https://github.com/plataformatec/devise/wiki/How-To%3a-Controllers-and-Views-tests-with-Rails-3-%28and-rspec%29 module ControllerMacros def login_member(member_factory = :member) - let(:member) { member = FactoryGirl.create(member_factory || :member) } + let(:member) { FactoryGirl.create(member_factory || :member) } before(:each) do @request.env["devise.mapping"] = Devise.mappings[:member] sign_in member From 38fbc52a6f03f9c0b6b1b40ee83bd096758943d1 Mon Sep 17 00:00:00 2001 From: Brenda Wallace Date: Sun, 27 Nov 2016 10:17:01 +1300 Subject: [PATCH 181/268] String interp doesn't need .to_s --- .rubocop_todo.yml | 6 ------ spec/views/seeds/index.rss.haml_spec.rb | 2 +- 2 files changed, 1 insertion(+), 7 deletions(-) diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml index 7f137a1b9..737bc1082 100644 --- a/.rubocop_todo.yml +++ b/.rubocop_todo.yml @@ -73,12 +73,6 @@ Lint/ParenthesesAsGroupedExpression: - 'spec/models/member_spec.rb' - 'spec/views/plantings/show.html.haml_spec.rb' -# Offense count: 1 -# Cop supports --auto-correct. -Lint/StringConversionInInterpolation: - Exclude: - - 'spec/views/seeds/index.rss.haml_spec.rb' - # Offense count: 15 # Cop supports --auto-correct. # Configuration parameters: IgnoreEmptyBlocks, AllowUnusedKeywordArguments. diff --git a/spec/views/seeds/index.rss.haml_spec.rb b/spec/views/seeds/index.rss.haml_spec.rb index 5e1ceb62f..72f56fa0a 100644 --- a/spec/views/seeds/index.rss.haml_spec.rb +++ b/spec/views/seeds/index.rss.haml_spec.rb @@ -42,7 +42,7 @@ describe 'seeds/index.rss.haml' do end it 'shows the plant_before date' do - rendered.should have_content "Plant before: #{@seed.plant_before.to_s}" + rendered.should have_content "Plant before: #{@seed.plant_before}" end it 'mentions that one seed is tradable' do From 702bbeb7243e5f0012d18ab6957a4c6b50cb5eee Mon Sep 17 00:00:00 2001 From: Brenda Wallace Date: Sun, 27 Nov 2016 10:21:11 +1300 Subject: [PATCH 182/268] "[Member]'s garden" link to garden, not member --- app/views/gardens/_thumbnail.html.haml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/gardens/_thumbnail.html.haml b/app/views/gardens/_thumbnail.html.haml index 8c00d25ec..bc08be246 100644 --- a/app/views/gardens/_thumbnail.html.haml +++ b/app/views/gardens/_thumbnail.html.haml @@ -1,7 +1,7 @@ .panel.panel-success .panel-heading %h3.panel-title - = link_to "#{garden.owner.login_name}'s garden", garden.owner + = link_to "#{garden.owner.login_name}'s garden", garden - if can? :edit, garden %a.pull-right{:href => edit_garden_path(garden), :role => "button", :id => "edit_garden_glyphicon"} %span.glyphicon.glyphicon-pencil{:title => "Edit"} From 9cb58ab0c98ded57b7de6bdebb0ad6b24015b3a3 Mon Sep 17 00:00:00 2001 From: Brenda Wallace Date: Sun, 27 Nov 2016 13:08:53 +1300 Subject: [PATCH 183/268] Wrapped the phantomjs downloading in travis.yml --- .travis.yml | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index 0fc8e1e54..5d24c9f89 100644 --- a/.travis.yml +++ b/.travis.yml @@ -14,9 +14,14 @@ rvm: - 2.3.1 before_install: - export PATH=$PWD/travis_phantomjs/phantomjs-2.1.1-linux-x86_64/bin:$PATH - - if [ $(phantomjs --version) != '2.1.1' ]; then rm -rf $PWD/travis_phantomjs; mkdir -p $PWD/travis_phantomjs; fi - - if [ $(phantomjs --version) != '2.1.1' ]; then wget https://assets.membergetmember.co/software/phantomjs-2.1.1-linux-x86_64.tar.bz2 -O $PWD/travis_phantomjs/phantomjs-2.1.1-linux-x86_64.tar.bz2; fi - - if [ $(phantomjs --version) != '2.1.1' ]; then tar -xvf $PWD/travis_phantomjs/phantomjs-2.1.1-linux-x86_64.tar.bz2 -C $PWD/travis_phantomjs; fi + - > + if [ $(phantomjs --version) != '2.1.1' ]; then + PHANTOM_URL=https://assets.membergetmember.co/software/phantomjs-2.1.1-linux-x86_64.tar.bz2; + rm -rf $PWD/travis_phantomjs; + mkdir -p $PWD/travis_phantomjs; + wget $PHANTOM_URL -O $PWD/travis_phantomjs/phantomjs-2.1.1-linux-x86_64.tar.bz2; + tar -xvf $PWD/travis_phantomjs/phantomjs-2.1.1-linux-x86_64.tar.bz2 -C $PWD/travis_phantomjs; + fi - phantomjs --version before_script: - psql -c 'create database growstuff_test;' -U postgres From 7fcd3cba8d1471b4c3a7a50ad35eac63590764ae Mon Sep 17 00:00:00 2001 From: Brenda Wallace Date: Sun, 27 Nov 2016 13:22:10 +1300 Subject: [PATCH 184/268] Changed phantomjs url to project official --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 5d24c9f89..a13ca40d9 100644 --- a/.travis.yml +++ b/.travis.yml @@ -16,7 +16,7 @@ before_install: - export PATH=$PWD/travis_phantomjs/phantomjs-2.1.1-linux-x86_64/bin:$PATH - > if [ $(phantomjs --version) != '2.1.1' ]; then - PHANTOM_URL=https://assets.membergetmember.co/software/phantomjs-2.1.1-linux-x86_64.tar.bz2; + PHANTOM_URL=https://bitbucket.org/ariya/phantomjs/downloads/phantomjs-2.1.1-linux-x86_64.tar.bz2; rm -rf $PWD/travis_phantomjs; mkdir -p $PWD/travis_phantomjs; wget $PHANTOM_URL -O $PWD/travis_phantomjs/phantomjs-2.1.1-linux-x86_64.tar.bz2; From 167417a7119ecae2de75161a4ed184c0bcf991c3 Mon Sep 17 00:00:00 2001 From: Brenda Wallace Date: Sun, 27 Nov 2016 13:24:02 +1300 Subject: [PATCH 185/268] Indent travis.yml correctly --- .travis.yml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/.travis.yml b/.travis.yml index a13ca40d9..f3397e9c7 100644 --- a/.travis.yml +++ b/.travis.yml @@ -11,7 +11,7 @@ env: global: secure: "Z5TpM2jEX4UCvNePnk/LwltQX48U2u9BRc+Iypr1x9QW2o228QJhPIOH39a8RMUrepGnkQIq9q3ZRUn98RfrJz1yThtlNFL3NmzdQ57gKgjGwfpa0e4Dwj/ZJqV2D84tDGjvdVYLP7zzaYZxQcwk/cgNpzKf/jq97HLNP7CYuf4=" rvm: -- 2.3.1 + - 2.3.1 before_install: - export PATH=$PWD/travis_phantomjs/phantomjs-2.1.1-linux-x86_64/bin:$PATH - > @@ -24,13 +24,13 @@ before_install: fi - phantomjs --version before_script: -- psql -c 'create database growstuff_test;' -U postgres + - psql -c 'create database growstuff_test;' -U postgres script: -- bundle exec rubocop --display-cop-names --rails -- script/gemfile_check -- bundle exec script/check_contributors_md -- bundle exec rake db:migrate --trace -- bundle exec rspec spec/ + - bundle exec rubocop --display-cop-names --rails + - script/gemfile_check + - bundle exec script/check_contributors_md + - bundle exec rake db:migrate --trace + - bundle exec rspec spec/ services: - elasticsearch before_deploy: From c76fb15cfd2a8a205117b6bbe723faa9cf03330d Mon Sep 17 00:00:00 2001 From: Brenda Wallace Date: Sun, 27 Nov 2016 13:24:21 +1300 Subject: [PATCH 186/268] Add yamllint settings --- .yamllint | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 .yamllint diff --git a/.yamllint b/.yamllint new file mode 100644 index 000000000..06876caa2 --- /dev/null +++ b/.yamllint @@ -0,0 +1,7 @@ +extends: relaxed + +rules: + # 80 chars should be enough, but don't fail if a line is longer + line-length: + max: 150 + level: warning From f52b828abe6c897fb8a94e9bd370b63d39756ca3 Mon Sep 17 00:00:00 2001 From: Brenda Wallace Date: Sun, 27 Nov 2016 13:27:45 +1300 Subject: [PATCH 187/268] Use rake to create database --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index f3397e9c7..5bc80442c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -24,7 +24,7 @@ before_install: fi - phantomjs --version before_script: - - psql -c 'create database growstuff_test;' -U postgres + - bundle exec rake db:create db:migrate db:test:prepare script: - bundle exec rubocop --display-cop-names --rails - script/gemfile_check From 10c20c7f91bdab3ca43c7cf25be86f28c6e357ff Mon Sep 17 00:00:00 2001 From: Brenda Wallace Date: Sun, 27 Nov 2016 14:32:07 +1300 Subject: [PATCH 188/268] Narrow-ed regex on wikipedia url and more tests --- app/models/crop.rb | 2 +- spec/models/crop_spec.rb | 42 +++++++++++++++++++++++++++++++++++----- 2 files changed, 38 insertions(+), 6 deletions(-) diff --git a/app/models/crop.rb b/app/models/crop.rb index 7de010b1e..865965b40 100644 --- a/app/models/crop.rb +++ b/app/models/crop.rb @@ -42,7 +42,7 @@ class Crop < ActiveRecord::Base # rubocop:disable Metrics/ClassLength ## Wikipedia urls are only necessary when approving a crop validates :en_wikipedia_url, format: { - with: /\Ahttps?:\/\/en\.wikipedia\.org\/wiki/, + with: /\Ahttps?:\/\/en\.wikipedia\.org\/wiki\/[[:alnum:]%_]+\z/, message: 'is not a valid English Wikipedia URL' }, if: :approved? diff --git a/spec/models/crop_spec.rb b/spec/models/crop_spec.rb index 6ff1bd47b..375abc500 100644 --- a/spec/models/crop_spec.rb +++ b/spec/models/crop_spec.rb @@ -85,11 +85,43 @@ describe Crop do @crop.plantings.size.should eq 1 end - it 'validates en_wikipedia_url' do - @crop = FactoryGirl.build(:tomato, en_wikipedia_url: 'this is not valid') - @crop.should_not be_valid - @crop = FactoryGirl.build(:tomato, en_wikipedia_url: 'http://en.wikipedia.org/wiki/SomePage') - @crop.should be_valid + context "wikipedia url" do + subject { FactoryGirl.build(:tomato, en_wikipedia_url: wikipedia_url) } + + context 'not a url' do + let(:wikipedia_url) { 'this is not valid' } + it { expect(subject).not_to be_valid } + end + + context 'http url' do + let(:wikipedia_url) { 'http://en.wikipedia.org/wiki/SomePage' } + it { expect(subject).to be_valid } + end + + context 'with ssl' do + let(:wikipedia_url) { 'https://en.wikipedia.org/wiki/SomePage' } + it { expect(subject).to be_valid } + end + + context 'with utf8 macrons' do + let(:wikipedia_url) { 'https://en.wikipedia.org/wiki/Māori' } + it { expect(subject).to be_valid } + end + + context 'urlencoded' do + let(:wikipedia_url) { 'https://en.wikipedia.org/wiki/M%C4%81ori' } + it { expect(subject).to be_valid } + end + + context 'with new lines in url' do + let(:wikipedia_url) { 'http://en.wikipedia.org/wiki/SomePage\n\nBrendaRocks' } + it { expect(subject).not_to be_valid } + end + + context "with script tags in url" do + let(:wikipedia_url) { 'http://en.wikipedia.org/wiki/SomePage' } + it { expect(subject).not_to be_valid } + end end context 'varieties' do From 9cce0e39f6e66446a078b3790a7135529cf6e57b Mon Sep 17 00:00:00 2001 From: Brenda Wallace Date: Sun, 27 Nov 2016 14:52:07 +1300 Subject: [PATCH 189/268] Limit garden names to one line --- app/models/garden.rb | 2 +- spec/models/garden_spec.rb | 15 +++++++++++++++ 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/app/models/garden.rb b/app/models/garden.rb index 448d7d60e..332200f04 100644 --- a/app/models/garden.rb +++ b/app/models/garden.rb @@ -33,7 +33,7 @@ class Garden < ActiveRecord::Base validates :name, format: { - with: /\S/ + with: /\A\w+[\w ]+\z/ }, length: { maximum: 255 } diff --git a/spec/models/garden_spec.rb b/spec/models/garden_spec.rb index 866e9bd7e..bfb53f1eb 100644 --- a/spec/models/garden_spec.rb +++ b/spec/models/garden_spec.rb @@ -23,11 +23,26 @@ describe Garden do garden.should_not be_valid end + it "allows numbers" do + garden = FactoryGirl.build(:garden, name: "100 vines of 2 kamo-kamo") + garden.should_not be_valid + end + + it "allows macrons" do + garden = FactoryGirl.build(:garden, name: "Kūmara and pūha patch") + garden.should_not be_valid + end + it "doesn't allow a name with only spaces" do garden = FactoryGirl.build(:garden, name: " ") garden.should_not be_valid end + it "doesn't allow a new lines in garden names" do + garden = FactoryGirl.build(:garden, name: "My garden\nI am a 1337 hacker") + garden.should_not be_valid + end + it "should have an owner" do garden.owner.should be_an_instance_of Member end From 7a90c020fc196b5e3e09f8499c77de86379490c0 Mon Sep 17 00:00:00 2001 From: Daniel O'Connor Date: Mon, 28 Nov 2016 10:28:07 +1000 Subject: [PATCH 190/268] bundle update thor tins term-ansicolor --- Gemfile.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index 9455fd3c3..1903be636 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -451,14 +451,14 @@ GEM actionpack (>= 4.0) activesupport (>= 4.0) sprockets (>= 3.0.0) - term-ansicolor (1.3.2) + term-ansicolor (1.4.0) tins (~> 1.0) terminal-table (1.6.0) - thor (0.19.1) + thor (0.19.3) thread (0.2.2) thread_safe (0.3.5) tilt (2.0.5) - tins (1.12.0) + tins (1.13.0) tzinfo (1.2.2) thread_safe (~> 0.1) uglifier (2.7.2) From 9bd1484a95c6ff574c9397842c6c0008cc2632cf Mon Sep 17 00:00:00 2001 From: Daniel O'Connor Date: Mon, 28 Nov 2016 10:29:09 +1000 Subject: [PATCH 191/268] bundle update ruby_parser rb-fsevent redis --- Gemfile.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index 1903be636..d59a10ad2 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -371,10 +371,10 @@ GEM rainbow (2.1.0) raindrops (0.17.0) rake (11.2.2) - rb-fsevent (0.9.7) + rb-fsevent (0.9.8) rb-inotify (0.9.7) ffi (>= 0.5.0) - redis (3.3.1) + redis (3.3.2) responders (2.3.0) railties (>= 4.2.0, < 5.1) rspec (3.5.0) @@ -411,7 +411,7 @@ GEM ruby-progressbar (1.8.1) ruby-units (2.0.1) ruby_dep (1.4.0) - ruby_parser (3.8.2) + ruby_parser (3.8.3) sexp_processor (~> 4.1) rubyzip (1.2.0) sass (3.4.22) From eb1013f925865da503df27a1d322e113e1e78084 Mon Sep 17 00:00:00 2001 From: Daniel O'Connor Date: Mon, 28 Nov 2016 10:30:02 +1000 Subject: [PATCH 192/268] bundle update jwt kramdown excon --- Gemfile.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index d59a10ad2..a4568c537 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -161,7 +161,7 @@ GEM faraday multi_json erubis (2.7.0) - excon (0.51.0) + excon (0.54.0) execjs (2.7.0) factory_girl (4.7.0) activesupport (>= 3.0.0) @@ -243,12 +243,12 @@ GEM railties (>= 3.2) sprockets-rails json (1.8.3) - jwt (1.5.4) + jwt (1.5.6) kaminari (0.17.0) actionpack (>= 3.0.0) activesupport (>= 3.0.0) kgio (2.10.0) - kramdown (1.12.0) + kramdown (1.13.1) launchy (2.4.3) addressable (~> 2.3) leaflet-markercluster-rails (0.7.0) From 9c116f5887333b764916afcfb0ff1f2999dfc713 Mon Sep 17 00:00:00 2001 From: Daniel O'Connor Date: Mon, 28 Nov 2016 10:31:24 +1000 Subject: [PATCH 193/268] bundle update rspec-rails coveralls capybara-screenshot --- Gemfile.lock | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index a4568c537..00b802487 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -85,7 +85,7 @@ GEM capybara-email (2.5.0) capybara (~> 2.4) mail - capybara-screenshot (1.0.13) + capybara-screenshot (1.0.14) capybara (>= 1.0, < 3) launchy childprocess (0.5.9) @@ -124,10 +124,10 @@ GEM sass-rails (>= 4.0.3) concurrent-ruby (1.0.2) connection_pool (2.2.0) - coveralls (0.8.15) + coveralls (0.8.16) json (>= 1.8, < 3) simplecov (~> 0.12.0) - term-ansicolor (~> 1.3) + term-ansicolor (~> 1.3.0) thor (~> 0.19.1) tins (>= 1.6.0, < 2) csv_shaper (1.3.0) @@ -272,7 +272,7 @@ GEM mime-types-data (3.2016.0521) mimemagic (0.3.2) mini_portile2 (2.1.0) - minitest (5.9.0) + minitest (5.9.1) multi_json (1.11.3) multi_xml (0.5.5) multipart-post (2.0.0) @@ -370,7 +370,7 @@ GEM thor (>= 0.18.1, < 2.0) rainbow (2.1.0) raindrops (0.17.0) - rake (11.2.2) + rake (11.3.0) rb-fsevent (0.9.8) rb-inotify (0.9.7) ffi (>= 0.5.0) @@ -385,7 +385,7 @@ GEM activemodel (>= 3.0) activesupport (>= 3.0) rspec-mocks (>= 2.99, < 4.0) - rspec-core (3.5.2) + rspec-core (3.5.4) rspec-support (~> 3.5.0) rspec-expectations (3.5.0) diff-lcs (>= 1.2.0, < 2.0) @@ -393,7 +393,7 @@ GEM rspec-mocks (3.5.0) diff-lcs (>= 1.2.0, < 2.0) rspec-support (~> 3.5.0) - rspec-rails (3.5.1) + rspec-rails (3.5.2) actionpack (>= 3.0) activesupport (>= 3.0) railties (>= 3.0) @@ -451,7 +451,7 @@ GEM actionpack (>= 4.0) activesupport (>= 4.0) sprockets (>= 3.0.0) - term-ansicolor (1.4.0) + term-ansicolor (1.3.2) tins (~> 1.0) terminal-table (1.6.0) thor (0.19.3) From 89c29ea73c289b23182f47498ccfa3e3e52ca054 Mon Sep 17 00:00:00 2001 From: Daniel O'Connor Date: Mon, 28 Nov 2016 10:32:43 +1000 Subject: [PATCH 194/268] bundle update pg --- Gemfile.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gemfile.lock b/Gemfile.lock index 00b802487..559a61146 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -316,7 +316,7 @@ GEM mimemagic (~> 0.3.0) parser (2.3.1.2) ast (~> 2.2) - pg (0.18.4) + pg (0.19.0) plupload-rails (1.2.1) rails (>= 3.1) poltergeist (1.11.0) From 0fb9ea7a1136c5ae32a74ee67b7052ae383bb271 Mon Sep 17 00:00:00 2001 From: Daniel O'Connor Date: Mon, 28 Nov 2016 10:37:36 +1000 Subject: [PATCH 195/268] bundle update newrelic_rpm byebug --- Gemfile.lock | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index 559a61146..49bffe861 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -73,7 +73,7 @@ GEM sass (>= 3.3.4) bootstrap_form (2.5.0) builder (3.2.2) - byebug (9.0.5) + byebug (9.0.6) cancancan (1.15.0) capybara (2.10.1) addressable @@ -277,7 +277,7 @@ GEM multi_xml (0.5.5) multipart-post (2.0.0) nenv (0.3.0) - newrelic_rpm (3.16.1.320) + newrelic_rpm (3.17.1.326) nokogiri (1.6.8.1) mini_portile2 (~> 2.1.0) notiffany (0.1.1) From c08c038df148332f086af7d0926796627bed63a8 Mon Sep 17 00:00:00 2001 From: Daniel O'Connor Date: Mon, 28 Nov 2016 10:40:32 +1000 Subject: [PATCH 196/268] bundle update active_utils --- Gemfile.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gemfile.lock b/Gemfile.lock index 49bffe861..ac9fde044 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -24,7 +24,7 @@ GEM actionpack active_merchant-paypal-bogus-gateway (0.1.0) activemerchant - active_utils (3.2.2) + active_utils (3.2.3) activesupport (>= 3.2, < 5.1.0) i18n activejob (4.2.7.1) From bd46c37f07feaeac337414f3f2c0614f8c18d113 Mon Sep 17 00:00:00 2001 From: Daniel O'Connor Date: Mon, 28 Nov 2016 10:42:03 +1000 Subject: [PATCH 197/268] bundle update activemerchant --- Gemfile.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gemfile.lock b/Gemfile.lock index ac9fde044..cc66b8c32 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -30,7 +30,7 @@ GEM activejob (4.2.7.1) activesupport (= 4.2.7.1) globalid (>= 0.3.0) - activemerchant (1.60.0) + activemerchant (1.61.0) activesupport (>= 3.2.14, < 5.1) builder (>= 2.1.2, < 4.0.0) i18n (>= 0.6.9) From 330bc912c1ef9941d73cc5c8a9c07eb6f1c38137 Mon Sep 17 00:00:00 2001 From: Daniel O'Connor Date: Mon, 28 Nov 2016 10:43:05 +1000 Subject: [PATCH 198/268] bundle update bootstrap_form --- Gemfile.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gemfile.lock b/Gemfile.lock index cc66b8c32..4e207d409 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -71,7 +71,7 @@ GEM bootstrap-sass (3.3.7) autoprefixer-rails (>= 5.2.1) sass (>= 3.3.4) - bootstrap_form (2.5.0) + bootstrap_form (2.5.2) builder (3.2.2) byebug (9.0.6) cancancan (1.15.0) From 5c2b14376e4bc57857752c0e820408194213bc86 Mon Sep 17 00:00:00 2001 From: Daniel O'Connor Date: Mon, 28 Nov 2016 10:43:46 +1000 Subject: [PATCH 199/268] bundle update terminal-table --- Gemfile.lock | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Gemfile.lock b/Gemfile.lock index 4e207d409..292cfb4dd 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -453,7 +453,8 @@ GEM sprockets (>= 3.0.0) term-ansicolor (1.3.2) tins (~> 1.0) - terminal-table (1.6.0) + terminal-table (1.7.3) + unicode-display_width (~> 1.1.1) thor (0.19.3) thread (0.2.2) thread_safe (0.3.5) From 9963502026cc483ce582d530074c4a088645a4b0 Mon Sep 17 00:00:00 2001 From: Daniel O'Connor Date: Mon, 28 Nov 2016 13:55:01 +1000 Subject: [PATCH 200/268] bundle update i18n-tasks --- Gemfile.lock | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index 292cfb4dd..618de9759 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -223,7 +223,7 @@ GEM httparty (0.14.0) multi_xml (>= 0.5.2) i18n (0.7.0) - i18n-tasks (0.9.5) + i18n-tasks (0.9.6) activesupport (>= 4.0.2) ast (>= 2.1.0) easy_translate (>= 0.5.0) @@ -314,7 +314,7 @@ GEM cocaine (~> 0.5.5) mime-types mimemagic (~> 0.3.0) - parser (2.3.1.2) + parser (2.3.2.0) ast (~> 2.2) pg (0.19.0) plupload-rails (1.2.1) From 96b1e78962a6af0c6d5f99b20af083b163609fff Mon Sep 17 00:00:00 2001 From: Mackenzie Morgan Date: Mon, 28 Nov 2016 11:02:32 -0500 Subject: [PATCH 201/268] dedup the add from csv code (Fixes: #1082) --- app/models/crop.rb | 48 ++++++++++++++++++++++------------------------ 1 file changed, 23 insertions(+), 25 deletions(-) diff --git a/app/models/crop.rb b/app/models/crop.rb index ceec55c36..86dbd52f7 100644 --- a/app/models/crop.rb +++ b/app/models/crop.rb @@ -263,43 +263,24 @@ class Crop < ActiveRecord::Base logger.warn("Warning: no scientific name (not even on parent crop) for #{self}") end + cropbot = Member.find_by_login_name('cropbot') + if names_to_add.size > 0 - cropbot = Member.find_by_login_name('cropbot') raise "cropbot account not found: run rake db:seed" unless cropbot - names_to_add.each do |n| - if self.scientific_names.exists?(scientific_name: n) - logger.warn("Warning: skipping duplicate scientific name #{n} for #{self}") - else - - self.scientific_names.create( - scientific_name: n, - creator_id: cropbot.id - ) - end - end + add_names_to_list(names_to_add, 'scientific', 'scientific_name') end end def add_alternate_names_from_csv(alternate_names) + cropbot = Member.find_by_login_name('cropbot') + names_to_add = [] if ! alternate_names.blank? # i.e. we actually passed something in, which isn't a given - cropbot = Member.find_by_login_name('cropbot') raise "cropbot account not found: run rake db:seed" unless cropbot names_to_add = alternate_names.split(%r{,\s*}) - - names_to_add.each do |n| - if self.alternate_names.exists?(name: n) - logger.warn("Warning: skipping duplicate alternate name #{n} for #{self}") - else - self.alternate_names.create( - name: n, - creator_id: cropbot.id - ) - end - end - + add_names_to_list(names_to_add, 'alternate', 'name') end end @@ -352,6 +333,23 @@ class Crop < ActiveRecord::Base end end + private + + def add_names_to_list(names_to_add, list_name, col_name) + cropbot = Member.find_by_login_name('cropbot') + names_to_add.each do |n| + if self.send("#{list_name}_names").exists?(["#{col_name} LIKE ?", n]) + logger.warn("Warning: skipping duplicate #{list_name} name #{n} for #{self}") + else + create_hash = { + creator_id: "#{cropbot.id}" + } + create_hash["#{col_name}"] = n + self.send("#{list_name}_names").create(create_hash) + end + end + end + # Custom validations def approval_status_cannot_be_changed_again From 502862128fabff1b9fac592f0be4e8069a050107 Mon Sep 17 00:00:00 2001 From: Mackenzie Morgan Date: Mon, 28 Nov 2016 19:20:35 -0500 Subject: [PATCH 202/268] break out if/else into discrete blocks --- app/models/crop.rb | 99 +++++++++++++++++++++++++--------------------- 1 file changed, 54 insertions(+), 45 deletions(-) diff --git a/app/models/crop.rb b/app/models/crop.rb index 86dbd52f7..4ca02bcdf 100644 --- a/app/models/crop.rb +++ b/app/models/crop.rb @@ -50,44 +50,46 @@ class Crop < ActiveRecord::Base #################################### # Elastic search configuration - include Elasticsearch::Model - include Elasticsearch::Model::Callbacks - # In order to avoid clashing between different environments, - # use Rails.env as a part of index name (eg. development_growstuff) - index_name [Rails.env, "growstuff"].join('_') - settings index: { number_of_shards: 1 }, - analysis: { - tokenizer: { - gs_edgeNGram_tokenizer: { - type: "edgeNGram", # edgeNGram: NGram match from the start of a token - min_gram: 3, - max_gram: 10, - # token_chars: Elasticsearch will split on characters - # that don’t belong to any of these classes - token_chars: [ "letter", "digit" ] - } - }, - analyzer: { - gs_edgeNGram_analyzer: { - tokenizer: "gs_edgeNGram_tokenizer", - filter: ["lowercase"] - } - }, - } do - mappings dynamic: 'false' do - indexes :id, type: 'long' - indexes :name, type: 'string', analyzer: 'gs_edgeNGram_analyzer' - indexes :approval_status, type: 'string' - indexes :scientific_names do - indexes :scientific_name, - type: 'string', - analyzer: 'gs_edgeNGram_analyzer', - # Disabling field-length norm (norm). If the norm option is turned on(by default), - # higher weigh would be given for shorter fields, which in our case is irrelevant. - norms: { enabled: false } - end - indexes :alternate_names do + if ENV["GROWSTUFF_ELASTICSEARCH"] == "true" + include Elasticsearch::Model + include Elasticsearch::Model::Callbacks + # In order to avoid clashing between different environments, + # use Rails.env as a part of index name (eg. development_growstuff) + index_name [Rails.env, "growstuff"].join('_') + settings index: { number_of_shards: 1 }, + analysis: { + tokenizer: { + gs_edgeNGram_tokenizer: { + type: "edgeNGram", # edgeNGram: NGram match from the start of a token + min_gram: 3, + max_gram: 10, + # token_chars: Elasticsearch will split on characters + # that don’t belong to any of these classes + token_chars: [ "letter", "digit" ] + } + }, + analyzer: { + gs_edgeNGram_analyzer: { + tokenizer: "gs_edgeNGram_tokenizer", + filter: ["lowercase"] + } + }, + } do + mappings dynamic: 'false' do + indexes :id, type: 'long' indexes :name, type: 'string', analyzer: 'gs_edgeNGram_analyzer' + indexes :approval_status, type: 'string' + indexes :scientific_names do + indexes :scientific_name, + type: 'string', + analyzer: 'gs_edgeNGram_analyzer', + # Disabling field-length norm (norm). If the norm option is turned on(by default), + # higher weigh would be given for shorter fields, which in our case is irrelevant. + norms: { enabled: false } + end + indexes :alternate_names do + indexes :name, type: 'string', analyzer: 'gs_edgeNGram_analyzer' + end end end end @@ -297,7 +299,7 @@ class Crop < ActiveRecord::Base if ENV['GROWSTUFF_ELASTICSEARCH'] == "true" search_str = query.nil? ? "" : query.downcase response = __elasticsearch__.search( { - # Finds documents which match any field, but uses the _score from + # Finds documents which match any field, but uses the _score from # the best field insead of adding up _score from each field. query: { multi_match: { @@ -336,20 +338,27 @@ class Crop < ActiveRecord::Base private def add_names_to_list(names_to_add, list_name, col_name) - cropbot = Member.find_by_login_name('cropbot') names_to_add.each do |n| - if self.send("#{list_name}_names").exists?(["#{col_name} LIKE ?", n]) + if name_already_exists(list_name, col_name, n) logger.warn("Warning: skipping duplicate #{list_name} name #{n} for #{self}") else - create_hash = { - creator_id: "#{cropbot.id}" - } - create_hash["#{col_name}"] = n - self.send("#{list_name}_names").create(create_hash) + create_crop_in_list(list_name, col_name, n) end end end + def create_crop_in_list(list_name, col_name, name) + cropbot = Member.find_by_login_name('cropbot') + create_hash = {} + create_hash['creator_id'] = "#{cropbot.id}" + create_hash["#{col_name}"] = name + self.send("#{list_name}_names").create(create_hash) + end + + def name_already_exists(list_name, col_name, name) + self.send("#{list_name}_names").exists?(["#{col_name} LIKE ?", name]) + end + # Custom validations def approval_status_cannot_be_changed_again From b94cb2abd68217c88b927b5fffa2c0132b382ad9 Mon Sep 17 00:00:00 2001 From: Mackenzie Morgan Date: Mon, 28 Nov 2016 19:57:34 -0500 Subject: [PATCH 203/268] deduplicate sunniness and planted_from functions (Fixes: #1085) --- app/models/crop.rb | 26 ++++++++++++-------------- 1 file changed, 12 insertions(+), 14 deletions(-) diff --git a/app/models/crop.rb b/app/models/crop.rb index 30d7530d4..89863eb2c 100644 --- a/app/models/crop.rb +++ b/app/models/crop.rb @@ -152,13 +152,7 @@ class Crop < ActiveRecord::Base # rubocop:disable Metrics/ClassLength # key: sunniness (eg. 'sun') # value: count of how many times it's been used by plantings def sunniness - sunniness = Hash.new(0) - plantings.each do |p| - if !p.sunniness.blank? - sunniness[p.sunniness] += 1 - end - end - return sunniness + count_uses_of_property 'sunniness' end # crop.planted_from @@ -166,13 +160,7 @@ class Crop < ActiveRecord::Base # rubocop:disable Metrics/ClassLength # key: propagation method (eg. 'seed') # value: count of how many times it's been used by plantings def planted_from - planted_from = Hash.new(0) - plantings.each do |p| - if !p.planted_from.blank? - planted_from[p.planted_from] += 1 - end - end - return planted_from + count_uses_of_property 'planted_from' end # crop.popular_plant_parts @@ -368,6 +356,16 @@ class Crop < ActiveRecord::Base # rubocop:disable Metrics/ClassLength self.send("#{list_name}_names").exists?(["#{col_name} LIKE ?", name]) end + def count_uses_of_property(col_name) + data = Hash.new(0) + plantings.each do |p| + if !p.send("#{col_name}").blank? + data[p.send("#{col_name}")] += 1 + end + end + data + end + # Custom validations def approval_status_cannot_be_changed_again From e1a2b168c945379bea6ae2a4a8eca2129e0c09c6 Mon Sep 17 00:00:00 2001 From: Mackenzie Morgan Date: Mon, 28 Nov 2016 21:57:51 -0500 Subject: [PATCH 204/268] rename scientific_names.scientific_name to scientific_names.name this mirrors alternate_names.name and allows making code more DRY --- app/controllers/crops_controller.rb | 30 ++++--- .../scientific_names_controller.rb | 2 +- app/models/crop.rb | 33 ++++---- app/views/crops/_form.html.haml | 2 +- app/views/crops/_popover.html.haml | 2 +- app/views/crops/_scientific_names.html.haml | 2 +- app/views/crops/_thumbnail.html.haml | 2 +- app/views/crops/wrangle.html.haml | 2 +- app/views/scientific_names/_form.html.haml | 4 +- app/views/scientific_names/index.html.haml | 2 +- app/views/scientific_names/show.html.haml | 4 +- .../20161129021533_rename_scientific_name.rb | 9 +++ db/schema.rb | 80 +++++++++---------- .../scientific_names_controller_spec.rb | 2 +- spec/factories/scientific_name.rb | 6 +- spec/models/crop_spec.rb | 6 +- 16 files changed, 102 insertions(+), 86 deletions(-) create mode 100644 db/migrate/20161129021533_rename_scientific_name.rb diff --git a/app/controllers/crops_controller.rb b/app/controllers/crops_controller.rb index abf2102ae..e80701871 100644 --- a/app/controllers/crops_controller.rb +++ b/app/controllers/crops_controller.rb @@ -137,10 +137,10 @@ class CropsController < ApplicationController respond_to do |format| if @crop.save params[:alt_name].each do |index, value| - @crop.alternate_names.create(name: value, creator_id: current_member.id) + create_name('alternate', value) end params[:sci_name].each do |index, value| - @crop.scientific_names.create(scientific_name: value, creator_id: current_member.id) + create_name('scientific', value) end unless current_member.has_role? :crop_wrangler Role.crop_wranglers.each do |w| @@ -169,19 +169,15 @@ class CropsController < ApplicationController respond_to do |format| if @crop.update(crop_params) if !params[:alt_name].nil? - @crop.alternate_names.each do |alt_name| - alt_name.destroy - end - + destroy_names('alternate') params[:alt_name].each do |index, value| - alt_name = @crop.alternate_names.create(name: value, creator_id: current_member.id) - end - - @crop.scientific_names.each do |sci_name| - sci_name.destroy + create_name('alternate', value) end + end + if !params[:sci_name].nil? + destroy_names('scientific') params[:sci_name].each do |index, value| - sci_name = @crop.scientific_names.create(scientific_name: value, creator_id: current_member.id) + create_name('scientific', value) end end @@ -214,6 +210,16 @@ class CropsController < ApplicationController private + def destroy_names(name_type) + @crop.send("#{name_type}_names").each do |alt_name| + alt_name.destroy + end + end + + def create_name(name_type, value) + @crop.send("#{name_type}_names").create(name: value, creator_id: current_member.id) + end + def crop_params params.require(:crop).permit(:en_wikipedia_url, :name, diff --git a/app/controllers/scientific_names_controller.rb b/app/controllers/scientific_names_controller.rb index cc7723b0b..b343436e6 100644 --- a/app/controllers/scientific_names_controller.rb +++ b/app/controllers/scientific_names_controller.rb @@ -92,6 +92,6 @@ class ScientificNamesController < ApplicationController private def scientific_name_params - params.require(:scientific_name).permit(:crop_id, :scientific_name, :creator_id) + params.require(:scientific_name).permit(:crop_id, :name, :creator_id) end end diff --git a/app/models/crop.rb b/app/models/crop.rb index 89863eb2c..a6fa3f596 100644 --- a/app/models/crop.rb +++ b/app/models/crop.rb @@ -89,7 +89,7 @@ class Crop < ActiveRecord::Base # rubocop:disable Metrics/ClassLength indexes :name, type: 'string', analyzer: 'gs_edgeNGram_analyzer' indexes :approval_status, type: 'string' indexes :scientific_names do - indexes :scientific_name, + indexes :name, type: 'string', analyzer: 'gs_edgeNGram_analyzer', # Disabling field-length norm (norm). If the norm option is turned on(by default), @@ -107,7 +107,7 @@ class Crop < ActiveRecord::Base # rubocop:disable Metrics/ClassLength self.as_json( only: [:id, :name, :approval_status], include: { - scientific_names: { only: :scientific_name }, + scientific_names: { only: :name }, alternate_names: { only: :name } }) end @@ -128,9 +128,9 @@ class Crop < ActiveRecord::Base # rubocop:disable Metrics/ClassLength def default_scientific_name if scientific_names.size > 0 - return scientific_names.first.scientific_name + scientific_names.first.name else - return nil + nil end end @@ -257,7 +257,7 @@ class Crop < ActiveRecord::Base # rubocop:disable Metrics/ClassLength if ! scientific_names.blank? # i.e. we actually passed something in, which isn't a given names_to_add = scientific_names.split(%r{,\s*}) elsif parent && parent.scientific_names.size > 0 # pick up from parent - names_to_add = parent.scientific_names.map{|s| s.scientific_name} + names_to_add = parent.scientific_names.map{|s| s.name} else logger.warn("Warning: no scientific name (not even on parent crop) for #{self}") end @@ -267,7 +267,7 @@ class Crop < ActiveRecord::Base # rubocop:disable Metrics/ClassLength if names_to_add.size > 0 raise "cropbot account not found: run rake db:seed" unless cropbot - add_names_to_list(names_to_add, 'scientific', 'scientific_name') + add_names_to_list(names_to_add, 'scientific') end end @@ -279,7 +279,7 @@ class Crop < ActiveRecord::Base # rubocop:disable Metrics/ClassLength raise "cropbot account not found: run rake db:seed" unless cropbot names_to_add = alternate_names.split(%r{,\s*}) - add_names_to_list(names_to_add, 'alternate', 'name') + add_names_to_list(names_to_add, 'alternate') end end @@ -334,26 +334,27 @@ class Crop < ActiveRecord::Base # rubocop:disable Metrics/ClassLength private - def add_names_to_list(names_to_add, list_name, col_name) + def add_names_to_list(names_to_add, list_name) names_to_add.each do |n| - if name_already_exists(list_name, col_name, n) + if name_already_exists(list_name, n) logger.warn("Warning: skipping duplicate #{list_name} name #{n} for #{self}") else - create_crop_in_list(list_name, col_name, n) + create_crop_in_list(list_name, n) end end end - def create_crop_in_list(list_name, col_name, name) + def create_crop_in_list(list_name, name) cropbot = Member.find_by_login_name('cropbot') - create_hash = {} - create_hash['creator_id'] = "#{cropbot.id}" - create_hash["#{col_name}"] = name + create_hash = { + creator_id: "#{cropbot.id}", + name: name + } self.send("#{list_name}_names").create(create_hash) end - def name_already_exists(list_name, col_name, name) - self.send("#{list_name}_names").exists?(["#{col_name} LIKE ?", name]) + def name_already_exists(list_name, name) + self.send("#{list_name}_names").exists?(name: name) end def count_uses_of_property(col_name) diff --git a/app/views/crops/_form.html.haml b/app/views/crops/_form.html.haml index 830a84238..c6fe06b06 100644 --- a/app/views/crops/_form.html.haml +++ b/app/views/crops/_form.html.haml @@ -55,7 +55,7 @@ .col-md-2 = label_tag :scientific_names, "Scientific name #{index+1}:", :class => 'control-label' .col-md-8 - = text_field_tag "sci_name[#{index+1}]", sci.scientific_name, :id => "sci_name[#{index+1}]", :class => 'form-control' + = text_field_tag "sci_name[#{index+1}]", sci.name, :id => "sci_name[#{index+1}]", :class => 'form-control' %span.help-block Scientific name of crop. .col-md-2 diff --git a/app/views/crops/_popover.html.haml b/app/views/crops/_popover.html.haml index 625e55297..f1d0f8937 100644 --- a/app/views/crops/_popover.html.haml +++ b/app/views/crops/_popover.html.haml @@ -2,7 +2,7 @@ %small - if crop.scientific_names.size > 0 %i - = crop.scientific_names.first.scientific_name + = crop.scientific_names.first.name %br/ Planted = pluralize(crop.plantings.size, "time") diff --git a/app/views/crops/_scientific_names.html.haml b/app/views/crops/_scientific_names.html.haml index ee845e543..37510ed71 100644 --- a/app/views/crops/_scientific_names.html.haml +++ b/app/views/crops/_scientific_names.html.haml @@ -6,7 +6,7 @@ %ul - crop.scientific_names.each do |sn| %li - = sn.scientific_name + = sn.name - if can? :edit, sn = link_to 'Edit', edit_scientific_name_path(sn), { :class => 'btn btn-default btn-xs' } - if can? :destroy, sn diff --git a/app/views/crops/_thumbnail.html.haml b/app/views/crops/_thumbnail.html.haml index 32cbbce9a..a6315503d 100644 --- a/app/views/crops/_thumbnail.html.haml +++ b/app/views/crops/_thumbnail.html.haml @@ -8,7 +8,7 @@ = link_to crop.name, crop - if crop.scientific_names.size > 0 .scientificname - = crop.scientific_names.first.scientific_name + = crop.scientific_names.first.name .plantingcount Planted = pluralize(crop.plantings.size, "time") diff --git a/app/views/crops/wrangle.html.haml b/app/views/crops/wrangle.html.haml index 6b983a7e1..c84e4f676 100644 --- a/app/views/crops/wrangle.html.haml +++ b/app/views/crops/wrangle.html.haml @@ -54,7 +54,7 @@ %td= link_to c.en_wikipedia_url, c.en_wikipedia_url %td - c.scientific_names.each do |s| - = link_to s.scientific_name, s + = link_to s.name, s %br/ %td= c.requester.present? ? (link_to c.requester, c.requester) : "N/A" - unless @approval_status == "pending" diff --git a/app/views/scientific_names/_form.html.haml b/app/views/scientific_names/_form.html.haml index c29d371bf..a908c3e65 100644 --- a/app/views/scientific_names/_form.html.haml +++ b/app/views/scientific_names/_form.html.haml @@ -17,9 +17,9 @@ .col-md-8 = collection_select(:scientific_name, :crop_id, Crop.all, :id, :name, { :selected => @scientific_name.crop_id || @crop.id }, :class => 'form-control') .form-group - = f.label :scientific_name, :class => 'control-label col-md-2' + = f.label :name, :class => 'control-label col-md-2' .col-md-8 - = f.text_field :scientific_name, :class => 'form-control' + = f.text_field :name, :class => 'form-control' .form-group .form-actions.col-md-offset-2.col-md-8 = f.submit 'Save', :class => 'btn btn-primary' diff --git a/app/views/scientific_names/index.html.haml b/app/views/scientific_names/index.html.haml index e0752b156..235760960 100644 --- a/app/views/scientific_names/index.html.haml +++ b/app/views/scientific_names/index.html.haml @@ -12,7 +12,7 @@ - @scientific_names.each do |scientific_name| %tr - %td= link_to scientific_name.scientific_name, scientific_name + %td= link_to scientific_name.name, scientific_name %td= scientific_name.crop_id %td= link_to 'Show', scientific_name %td diff --git a/app/views/scientific_names/show.html.haml b/app/views/scientific_names/show.html.haml index bcf71c4ca..4ae435def 100644 --- a/app/views/scientific_names/show.html.haml +++ b/app/views/scientific_names/show.html.haml @@ -2,7 +2,7 @@ - @scientific_name.crop.photos.each do |photo| = tag("meta", property: "og:image", content: photo.fullsize_url) - = tag("meta", property: "og:title", content: @scientific_name.scientific_name) + = tag("meta", property: "og:title", content: @scientific_name.name) = tag("meta", property: "og:type", content: "website") = tag("meta", property: "og:url", content: request.original_url) = tag("meta", property: "og:site_name", content: ENV['GROWSTUFF_SITE_NAME']) @@ -13,7 +13,7 @@ %p %b Scientific name: - = @scientific_name.scientific_name + = @scientific_name.name %p %b Crop: = link_to @scientific_name.crop, @scientific_name.crop diff --git a/db/migrate/20161129021533_rename_scientific_name.rb b/db/migrate/20161129021533_rename_scientific_name.rb new file mode 100644 index 000000000..e2ff2ea0e --- /dev/null +++ b/db/migrate/20161129021533_rename_scientific_name.rb @@ -0,0 +1,9 @@ +class RenameScientificName < ActiveRecord::Migration + def self.up + rename_column :scientific_names, :scientific_name, :name + end + + def self.down + rename_column :scientific_names, :name, :scientific_name + end +end diff --git a/db/schema.rb b/db/schema.rb index 67e96bd37..6596b2428 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -11,12 +11,12 @@ # # It's strongly recommended that you check this file into your version control system. -ActiveRecord::Schema.define(version: 20150824145414) do +ActiveRecord::Schema.define(version: 20161129021533) do # These are extensions that must be enabled in order to support this database enable_extension "plpgsql" - create_table "account_types", force: true do |t| + create_table "account_types", force: :cascade do |t| t.string "name", null: false t.boolean "is_paid" t.boolean "is_permanent_paid" @@ -24,7 +24,7 @@ ActiveRecord::Schema.define(version: 20150824145414) do t.datetime "updated_at" end - create_table "accounts", force: true do |t| + create_table "accounts", force: :cascade do |t| t.integer "member_id", null: false t.integer "account_type_id" t.datetime "paid_until" @@ -32,7 +32,7 @@ ActiveRecord::Schema.define(version: 20150824145414) do t.datetime "updated_at" end - create_table "alternate_names", force: true do |t| + create_table "alternate_names", force: :cascade do |t| t.string "name", null: false t.integer "crop_id", null: false t.integer "creator_id", null: false @@ -40,7 +40,7 @@ ActiveRecord::Schema.define(version: 20150824145414) do t.datetime "updated_at" end - create_table "authentications", force: true do |t| + create_table "authentications", force: :cascade do |t| t.integer "member_id", null: false t.string "provider", null: false t.string "uid" @@ -53,7 +53,7 @@ ActiveRecord::Schema.define(version: 20150824145414) do add_index "authentications", ["member_id"], name: "index_authentications_on_member_id", using: :btree - create_table "comfy_cms_blocks", force: true do |t| + create_table "comfy_cms_blocks", force: :cascade do |t| t.string "identifier", null: false t.text "content" t.integer "blockable_id" @@ -65,7 +65,7 @@ ActiveRecord::Schema.define(version: 20150824145414) do add_index "comfy_cms_blocks", ["blockable_id", "blockable_type"], name: "index_comfy_cms_blocks_on_blockable_id_and_blockable_type", using: :btree add_index "comfy_cms_blocks", ["identifier"], name: "index_comfy_cms_blocks_on_identifier", using: :btree - create_table "comfy_cms_categories", force: true do |t| + create_table "comfy_cms_categories", force: :cascade do |t| t.integer "site_id", null: false t.string "label", null: false t.string "categorized_type", null: false @@ -73,7 +73,7 @@ ActiveRecord::Schema.define(version: 20150824145414) do add_index "comfy_cms_categories", ["site_id", "categorized_type", "label"], name: "index_cms_categories_on_site_id_and_cat_type_and_label", unique: true, using: :btree - create_table "comfy_cms_categorizations", force: true do |t| + create_table "comfy_cms_categorizations", force: :cascade do |t| t.integer "category_id", null: false t.string "categorized_type", null: false t.integer "categorized_id", null: false @@ -81,7 +81,7 @@ ActiveRecord::Schema.define(version: 20150824145414) do add_index "comfy_cms_categorizations", ["category_id", "categorized_type", "categorized_id"], name: "index_cms_categorizations_on_cat_id_and_catd_type_and_catd_id", unique: true, using: :btree - create_table "comfy_cms_files", force: true do |t| + create_table "comfy_cms_files", force: :cascade do |t| t.integer "site_id", null: false t.integer "block_id" t.string "label", null: false @@ -99,7 +99,7 @@ ActiveRecord::Schema.define(version: 20150824145414) do add_index "comfy_cms_files", ["site_id", "label"], name: "index_comfy_cms_files_on_site_id_and_label", using: :btree add_index "comfy_cms_files", ["site_id", "position"], name: "index_comfy_cms_files_on_site_id_and_position", using: :btree - create_table "comfy_cms_layouts", force: true do |t| + create_table "comfy_cms_layouts", force: :cascade do |t| t.integer "site_id", null: false t.integer "parent_id" t.string "app_layout" @@ -117,7 +117,7 @@ ActiveRecord::Schema.define(version: 20150824145414) do add_index "comfy_cms_layouts", ["parent_id", "position"], name: "index_comfy_cms_layouts_on_parent_id_and_position", using: :btree add_index "comfy_cms_layouts", ["site_id", "identifier"], name: "index_comfy_cms_layouts_on_site_id_and_identifier", unique: true, using: :btree - create_table "comfy_cms_pages", force: true do |t| + create_table "comfy_cms_pages", force: :cascade do |t| t.integer "site_id", null: false t.integer "layout_id" t.integer "parent_id" @@ -137,7 +137,7 @@ ActiveRecord::Schema.define(version: 20150824145414) do add_index "comfy_cms_pages", ["parent_id", "position"], name: "index_comfy_cms_pages_on_parent_id_and_position", using: :btree add_index "comfy_cms_pages", ["site_id", "full_path"], name: "index_comfy_cms_pages_on_site_id_and_full_path", using: :btree - create_table "comfy_cms_revisions", force: true do |t| + create_table "comfy_cms_revisions", force: :cascade do |t| t.string "record_type", null: false t.integer "record_id", null: false t.text "data" @@ -146,7 +146,7 @@ ActiveRecord::Schema.define(version: 20150824145414) do add_index "comfy_cms_revisions", ["record_type", "record_id", "created_at"], name: "index_cms_revisions_on_rtype_and_rid_and_created_at", using: :btree - create_table "comfy_cms_sites", force: true do |t| + create_table "comfy_cms_sites", force: :cascade do |t| t.string "label", null: false t.string "identifier", null: false t.string "hostname", null: false @@ -158,7 +158,7 @@ ActiveRecord::Schema.define(version: 20150824145414) do add_index "comfy_cms_sites", ["hostname"], name: "index_comfy_cms_sites_on_hostname", using: :btree add_index "comfy_cms_sites", ["is_mirrored"], name: "index_comfy_cms_sites_on_is_mirrored", using: :btree - create_table "comfy_cms_snippets", force: true do |t| + create_table "comfy_cms_snippets", force: :cascade do |t| t.integer "site_id", null: false t.string "label", null: false t.string "identifier", null: false @@ -172,7 +172,7 @@ ActiveRecord::Schema.define(version: 20150824145414) do add_index "comfy_cms_snippets", ["site_id", "identifier"], name: "index_comfy_cms_snippets_on_site_id_and_identifier", unique: true, using: :btree add_index "comfy_cms_snippets", ["site_id", "position"], name: "index_comfy_cms_snippets_on_site_id_and_position", using: :btree - create_table "comments", force: true do |t| + create_table "comments", force: :cascade do |t| t.integer "post_id", null: false t.integer "author_id", null: false t.text "body", null: false @@ -180,7 +180,7 @@ ActiveRecord::Schema.define(version: 20150824145414) do t.datetime "updated_at" end - create_table "crops", force: true do |t| + create_table "crops", force: :cascade do |t| t.string "name", null: false t.string "en_wikipedia_url" t.datetime "created_at" @@ -200,7 +200,7 @@ ActiveRecord::Schema.define(version: 20150824145414) do add_index "crops", ["requester_id"], name: "index_crops_on_requester_id", using: :btree add_index "crops", ["slug"], name: "index_crops_on_slug", unique: true, using: :btree - create_table "crops_posts", id: false, force: true do |t| + create_table "crops_posts", id: false, force: :cascade do |t| t.integer "crop_id" t.integer "post_id" end @@ -208,14 +208,14 @@ ActiveRecord::Schema.define(version: 20150824145414) do add_index "crops_posts", ["crop_id", "post_id"], name: "index_crops_posts_on_crop_id_and_post_id", using: :btree add_index "crops_posts", ["crop_id"], name: "index_crops_posts_on_crop_id", using: :btree - create_table "follows", force: true do |t| + create_table "follows", force: :cascade do |t| t.integer "follower_id" t.integer "followed_id" t.datetime "created_at" t.datetime "updated_at" end - create_table "forums", force: true do |t| + create_table "forums", force: :cascade do |t| t.string "name", null: false t.text "description", null: false t.integer "owner_id", null: false @@ -226,7 +226,7 @@ ActiveRecord::Schema.define(version: 20150824145414) do add_index "forums", ["slug"], name: "index_forums_on_slug", unique: true, using: :btree - create_table "gardens", force: true do |t| + create_table "gardens", force: :cascade do |t| t.string "name", null: false t.integer "owner_id" t.string "slug", null: false @@ -244,14 +244,14 @@ ActiveRecord::Schema.define(version: 20150824145414) do add_index "gardens", ["owner_id"], name: "index_gardens_on_owner_id", using: :btree add_index "gardens", ["slug"], name: "index_gardens_on_slug", unique: true, using: :btree - create_table "gardens_photos", id: false, force: true do |t| + create_table "gardens_photos", id: false, force: :cascade do |t| t.integer "photo_id" t.integer "garden_id" end add_index "gardens_photos", ["garden_id", "photo_id"], name: "index_gardens_photos_on_garden_id_and_photo_id", using: :btree - create_table "harvests", force: true do |t| + create_table "harvests", force: :cascade do |t| t.integer "crop_id", null: false t.integer "owner_id", null: false t.date "harvested_at" @@ -267,14 +267,14 @@ ActiveRecord::Schema.define(version: 20150824145414) do t.float "si_weight" end - create_table "harvests_photos", id: false, force: true do |t| + create_table "harvests_photos", id: false, force: :cascade do |t| t.integer "photo_id" t.integer "harvest_id" end add_index "harvests_photos", ["harvest_id", "photo_id"], name: "index_harvests_photos_on_harvest_id_and_photo_id", using: :btree - create_table "members", force: true do |t| + create_table "members", force: :cascade do |t| t.string "email", default: "", null: false t.string "encrypted_password", default: "", null: false t.string "reset_password_token" @@ -315,12 +315,12 @@ ActiveRecord::Schema.define(version: 20150824145414) do add_index "members", ["slug"], name: "index_members_on_slug", unique: true, using: :btree add_index "members", ["unlock_token"], name: "index_members_on_unlock_token", unique: true, using: :btree - create_table "members_roles", id: false, force: true do |t| + create_table "members_roles", id: false, force: :cascade do |t| t.integer "member_id" t.integer "role_id" end - create_table "notifications", force: true do |t| + create_table "notifications", force: :cascade do |t| t.integer "sender_id" t.integer "recipient_id", null: false t.string "subject" @@ -331,7 +331,7 @@ ActiveRecord::Schema.define(version: 20150824145414) do t.datetime "updated_at" end - create_table "order_items", force: true do |t| + create_table "order_items", force: :cascade do |t| t.integer "order_id" t.integer "product_id" t.integer "price" @@ -340,7 +340,7 @@ ActiveRecord::Schema.define(version: 20150824145414) do t.datetime "updated_at" end - create_table "orders", force: true do |t| + create_table "orders", force: :cascade do |t| t.datetime "created_at" t.datetime "updated_at" t.datetime "completed_at" @@ -350,12 +350,12 @@ ActiveRecord::Schema.define(version: 20150824145414) do t.string "referral_code" end - create_table "orders_products", id: false, force: true do |t| + create_table "orders_products", id: false, force: :cascade do |t| t.integer "order_id" t.integer "product_id" end - create_table "photos", force: true do |t| + create_table "photos", force: :cascade do |t| t.integer "owner_id", null: false t.string "thumbnail_url", null: false t.string "fullsize_url", null: false @@ -368,19 +368,19 @@ ActiveRecord::Schema.define(version: 20150824145414) do t.string "flickr_photo_id" end - create_table "photos_plantings", id: false, force: true do |t| + create_table "photos_plantings", id: false, force: :cascade do |t| t.integer "photo_id" t.integer "planting_id" end - create_table "plant_parts", force: true do |t| + create_table "plant_parts", force: :cascade do |t| t.string "name" t.datetime "created_at" t.datetime "updated_at" t.string "slug" end - create_table "plantings", force: true do |t| + create_table "plantings", force: :cascade do |t| t.integer "garden_id", null: false t.integer "crop_id", null: false t.date "planted_at" @@ -399,7 +399,7 @@ ActiveRecord::Schema.define(version: 20150824145414) do add_index "plantings", ["slug"], name: "index_plantings_on_slug", unique: true, using: :btree - create_table "posts", force: true do |t| + create_table "posts", force: :cascade do |t| t.integer "author_id", null: false t.string "subject", null: false t.text "body", null: false @@ -412,7 +412,7 @@ ActiveRecord::Schema.define(version: 20150824145414) do add_index "posts", ["created_at", "author_id"], name: "index_posts_on_created_at_and_author_id", using: :btree add_index "posts", ["slug"], name: "index_posts_on_slug", unique: true, using: :btree - create_table "products", force: true do |t| + create_table "products", force: :cascade do |t| t.string "name", null: false t.text "description", null: false t.integer "min_price", null: false @@ -423,7 +423,7 @@ ActiveRecord::Schema.define(version: 20150824145414) do t.integer "recommended_price" end - create_table "roles", force: true do |t| + create_table "roles", force: :cascade do |t| t.string "name", null: false t.text "description" t.datetime "created_at" @@ -433,15 +433,15 @@ ActiveRecord::Schema.define(version: 20150824145414) do add_index "roles", ["slug"], name: "index_roles_on_slug", unique: true, using: :btree - create_table "scientific_names", force: true do |t| - t.string "scientific_name", null: false - t.integer "crop_id", null: false + create_table "scientific_names", force: :cascade do |t| + t.string "name", null: false + t.integer "crop_id", null: false t.datetime "created_at" t.datetime "updated_at" t.integer "creator_id" end - create_table "seeds", force: true do |t| + create_table "seeds", force: :cascade do |t| t.integer "owner_id", null: false t.integer "crop_id", null: false t.text "description" diff --git a/spec/controllers/scientific_names_controller_spec.rb b/spec/controllers/scientific_names_controller_spec.rb index ec8ff53cd..1c492cc9d 100644 --- a/spec/controllers/scientific_names_controller_spec.rb +++ b/spec/controllers/scientific_names_controller_spec.rb @@ -25,7 +25,7 @@ describe ScientificNamesController do end def valid_attributes - { scientific_name: 'Solanum lycopersicum', crop_id: @crop.id } + { name: 'Solanum lycopersicum', crop_id: @crop.id } end describe "GET new" do diff --git a/spec/factories/scientific_name.rb b/spec/factories/scientific_name.rb index 43d9ad74a..e1d1c8c36 100644 --- a/spec/factories/scientific_name.rb +++ b/spec/factories/scientific_name.rb @@ -1,17 +1,17 @@ FactoryGirl.define do factory :scientific_name do association :crop, factory: :crop - scientific_name "Beanus Magicus" + name "Beanus Magicus" creator factory :zea_mays do association :crop, factory: :maize - scientific_name "Zea mays" + name "Zea mays" end factory :solanum_lycopersicum do association :crop, factory: :tomato - scientific_name "Solanum lycopersicum" + name "Solanum lycopersicum" end end diff --git a/spec/models/crop_spec.rb b/spec/models/crop_spec.rb index 375abc500..2b2cfdaea 100644 --- a/spec/models/crop_spec.rb +++ b/spec/models/crop_spec.rb @@ -489,8 +489,8 @@ describe Crop do expect(tomato.scientific_names.size).to eq 0 tomato.add_scientific_names_from_csv("Foo, Bar") expect(tomato.scientific_names.size).to eq 2 - expect(tomato.scientific_names[0].scientific_name).to eq "Foo" - expect(tomato.scientific_names[1].scientific_name).to eq "Bar" + expect(tomato.scientific_names[0].name).to eq "Foo" + expect(tomato.scientific_names[1].name).to eq "Bar" end it "loads multiple scientific names with variant spacing" do @@ -564,7 +564,7 @@ describe Crop do loaded = Crop.last expect(loaded.name).to eq "tomato" expect(loaded.scientific_names.size).to eq 1 - expect(loaded.scientific_names.last.scientific_name).to eq "Solanum lycopersicum" + expect(loaded.scientific_names.last.name).to eq "Solanum lycopersicum" end it "loads a crop with an alternate name" do From 66c8ce78bc5510f0182443cbfca0ed2913ed79e3 Mon Sep 17 00:00:00 2001 From: Mackenzie Morgan Date: Mon, 28 Nov 2016 22:04:32 -0500 Subject: [PATCH 205/268] further DRY up crops controller --- app/controllers/crops_controller.rb | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/app/controllers/crops_controller.rb b/app/controllers/crops_controller.rb index e80701871..a738024f9 100644 --- a/app/controllers/crops_controller.rb +++ b/app/controllers/crops_controller.rb @@ -168,18 +168,8 @@ class CropsController < ApplicationController respond_to do |format| if @crop.update(crop_params) - if !params[:alt_name].nil? - destroy_names('alternate') - params[:alt_name].each do |index, value| - create_name('alternate', value) - end - end - if !params[:sci_name].nil? - destroy_names('scientific') - params[:sci_name].each do |index, value| - create_name('scientific', value) - end - end + recreate_names('alt_name', 'alternate') + recreate_names('sci_name', 'scientific') if previous_status == "pending" requester = @crop.requester @@ -210,6 +200,15 @@ class CropsController < ApplicationController private + def recreate_names(param_name, name_type) + if params[param_name].present? + destroy_names(name_type) + params[param_name].each do |index, value| + create_name(name_type, value) + end + end + end + def destroy_names(name_type) @crop.send("#{name_type}_names").each do |alt_name| alt_name.destroy From e1e9a5218602a865e7b54777505f58a9f7c7a22a Mon Sep 17 00:00:00 2001 From: Mackenzie Morgan Date: Mon, 28 Nov 2016 22:08:14 -0500 Subject: [PATCH 206/268] use a guard clause --- app/controllers/crops_controller.rb | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/app/controllers/crops_controller.rb b/app/controllers/crops_controller.rb index a738024f9..784073ed8 100644 --- a/app/controllers/crops_controller.rb +++ b/app/controllers/crops_controller.rb @@ -201,11 +201,10 @@ class CropsController < ApplicationController private def recreate_names(param_name, name_type) - if params[param_name].present? - destroy_names(name_type) - params[param_name].each do |index, value| - create_name(name_type, value) - end + return unless params[param_name].present? + destroy_names(name_type) + params[param_name].each do |index, value| + create_name(name_type, value) end end From a382caab4882701713998df1d7bb050e9de427ed Mon Sep 17 00:00:00 2001 From: Mackenzie Morgan Date: Mon, 28 Nov 2016 22:08:41 -0500 Subject: [PATCH 207/268] clear up redundant else and unneeded returns --- app/models/crop.rb | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/app/models/crop.rb b/app/models/crop.rb index a6fa3f596..008d7f826 100644 --- a/app/models/crop.rb +++ b/app/models/crop.rb @@ -123,14 +123,12 @@ class Crop < ActiveRecord::Base # rubocop:disable Metrics/ClassLength # End Elasticsearch section def to_s - return name + name end def default_scientific_name if scientific_names.size > 0 scientific_names.first.name - else - nil end end @@ -139,11 +137,11 @@ class Crop < ActiveRecord::Base # rubocop:disable Metrics/ClassLength # later we can choose a default photo based on different criteria, # eg. popularity def default_photo - return photos.first if photos.any? + photos.first if photos.any? # Crop has no photos? Look for the most recent harvest with a photo. harvest_with_photo = Harvest.where(crop_id: id).joins(:photos).order('harvests.id DESC').limit(1).first - return harvest_with_photo.photos.first if harvest_with_photo + harvest_with_photo.photos.first if harvest_with_photo end # crop.sunniness From fe860aa1abfe9111c621f1fce92ecce6d31bd2f6 Mon Sep 17 00:00:00 2001 From: Mackenzie Morgan Date: Mon, 28 Nov 2016 22:33:00 -0500 Subject: [PATCH 208/268] clean up some tests --- spec/features/scientific_name_spec.rb | 10 +++++----- spec/models/crop_spec.rb | 2 +- spec/models/scientific_name_spec.rb | 2 +- spec/views/scientific_names/edit.html.haml_spec.rb | 2 +- spec/views/scientific_names/new.html.haml_spec.rb | 2 +- 5 files changed, 9 insertions(+), 9 deletions(-) diff --git a/spec/features/scientific_name_spec.rb b/spec/features/scientific_name_spec.rb index c5b621e10..4a34cfe0a 100644 --- a/spec/features/scientific_name_spec.rb +++ b/spec/features/scientific_name_spec.rb @@ -7,13 +7,13 @@ feature "Scientific names", js: true do scenario "Display scientific names on crop page" do visit crop_path(zea_mays.crop) expect(page.status_code).to equal 200 - expect(page).to have_content zea_mays.scientific_name + expect(page).to have_content zea_mays.name end scenario "Index page for scientific names" do visit scientific_names_path expect(page.status_code).to equal 200 - expect(page).to have_content zea_mays.scientific_name + expect(page).to have_content zea_mays.name end context "User is a crop wrangler" do @@ -28,7 +28,7 @@ feature "Scientific names", js: true do visit crop_path(crop) expect(page.status_code).to equal 200 expect(page).to have_content "CROP WRANGLER" - expect(page).to have_content zea_mays.scientific_name + expect(page).to have_content zea_mays.name expect(page).to have_link "Edit", href: edit_scientific_name_path(zea_mays) within('.scientific_names') { click_on "Edit" } expect(page.status_code).to equal 200 @@ -45,7 +45,7 @@ feature "Scientific names", js: true do href: scientific_name_path(zea_mays) within('.scientific_names') { click_on "Delete" } expect(page.status_code).to equal 200 - expect(page).to_not have_content zea_mays.scientific_name + expect(page).to_not have_content zea_mays.name expect(page).to have_content 'Scientific name was successfully deleted' end @@ -56,7 +56,7 @@ feature "Scientific names", js: true do within('.scientific_names') { click_on "Add" } expect(page.status_code).to equal 200 expect(page).to have_css "option[value='#{crop.id}'][selected=selected]" - fill_in 'Scientific name', with: "Zea mirabila" + fill_in 'name', with: "Zea mirabila" click_on "Save" expect(page.status_code).to equal 200 expect(page).to have_content "Zea mirabila" diff --git a/spec/models/crop_spec.rb b/spec/models/crop_spec.rb index 2b2cfdaea..1171697ae 100644 --- a/spec/models/crop_spec.rb +++ b/spec/models/crop_spec.rb @@ -74,7 +74,7 @@ describe Crop do @crop.default_scientific_name.should eq nil @sn = FactoryGirl.create(:solanum_lycopersicum, crop: @crop) @crop.reload - @crop.default_scientific_name.should eq @sn.scientific_name + @crop.default_scientific_name.should eq @sn.name end it 'counts plantings' do diff --git a/spec/models/scientific_name_spec.rb b/spec/models/scientific_name_spec.rb index e506acccf..43de4ef32 100644 --- a/spec/models/scientific_name_spec.rb +++ b/spec/models/scientific_name_spec.rb @@ -11,7 +11,7 @@ describe ScientificName do it 'should be fetchable from the database' do sn.save - @sn2 = ScientificName.find_by_scientific_name('Zea mays') + @sn2 = ScientificName.find_by_name('Zea mays') @sn2.crop.name.should == 'maize' end diff --git a/spec/views/scientific_names/edit.html.haml_spec.rb b/spec/views/scientific_names/edit.html.haml_spec.rb index 8d63f80d7..db04906d1 100644 --- a/spec/views/scientific_names/edit.html.haml_spec.rb +++ b/spec/views/scientific_names/edit.html.haml_spec.rb @@ -34,7 +34,7 @@ describe "scientific_names/edit" do it "renders the edit scientific_name form" do assert_select "form", action: scientific_names_path(@scientific_name), method: "post" do - assert_select "input#scientific_name_scientific_name", name: "scientific_name[scientific_name]" + assert_select "input#scientific_name_name", name: "scientific_name[scientific_name]" assert_select "select#scientific_name_crop_id", name: "scientific_name[crop_id]" end end diff --git a/spec/views/scientific_names/new.html.haml_spec.rb b/spec/views/scientific_names/new.html.haml_spec.rb index 4fbf196e0..a4383b6cc 100644 --- a/spec/views/scientific_names/new.html.haml_spec.rb +++ b/spec/views/scientific_names/new.html.haml_spec.rb @@ -33,7 +33,7 @@ describe "scientific_names/new" do render # Run the generator again with the --webrat flag if you want to use webrat matchers assert_select "form", action: scientific_names_path, method: "post" do - assert_select "input#scientific_name_scientific_name", name: "scientific_name[scientific_name]" + assert_select "input#scientific_name_name", name: "scientific_name[scientific_name]" assert_select "select#scientific_name_crop_id", name: "scientific_name[crop_id]" end end From 2129b6480d34c9e43fa3d87ba96836fd78bb4cc4 Mon Sep 17 00:00:00 2001 From: Mackenzie Morgan Date: Mon, 28 Nov 2016 22:42:11 -0500 Subject: [PATCH 209/268] ...that was a guard clause. oops --- app/models/crop.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/models/crop.rb b/app/models/crop.rb index 008d7f826..67694b8d0 100644 --- a/app/models/crop.rb +++ b/app/models/crop.rb @@ -137,7 +137,7 @@ class Crop < ActiveRecord::Base # rubocop:disable Metrics/ClassLength # later we can choose a default photo based on different criteria, # eg. popularity def default_photo - photos.first if photos.any? + return photos.first if photos.any? # Crop has no photos? Look for the most recent harvest with a photo. harvest_with_photo = Harvest.where(crop_id: id).joins(:photos).order('harvests.id DESC').limit(1).first From 69980d9ec61945f73768f538e3eef907a4b9b740 Mon Sep 17 00:00:00 2001 From: Mackenzie Morgan Date: Mon, 28 Nov 2016 22:50:53 -0500 Subject: [PATCH 210/268] tests --- spec/features/scientific_name_spec.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/spec/features/scientific_name_spec.rb b/spec/features/scientific_name_spec.rb index 4a34cfe0a..852f2c997 100644 --- a/spec/features/scientific_name_spec.rb +++ b/spec/features/scientific_name_spec.rb @@ -33,7 +33,7 @@ feature "Scientific names", js: true do within('.scientific_names') { click_on "Edit" } expect(page.status_code).to equal 200 expect(page).to have_css "option[value='#{crop.id}'][selected=selected]" - fill_in 'Scientific name', with: "Zea mirabila" + fill_in 'Name', with: "Zea mirabila" click_on "Save" expect(page).to have_content "Zea mirabila" expect(page).to have_content 'Scientific name was successfully updated' @@ -56,7 +56,7 @@ feature "Scientific names", js: true do within('.scientific_names') { click_on "Add" } expect(page.status_code).to equal 200 expect(page).to have_css "option[value='#{crop.id}'][selected=selected]" - fill_in 'name', with: "Zea mirabila" + fill_in 'Name', with: "Zea mirabila" click_on "Save" expect(page.status_code).to equal 200 expect(page).to have_content "Zea mirabila" From 0d8cbc5bf28321d8ef5ce2d3101a2ab66a0a1df6 Mon Sep 17 00:00:00 2001 From: Miles Gould Date: Tue, 29 Nov 2016 10:44:04 +0000 Subject: [PATCH 211/268] Fix comment-style weirdness We had an inline comment that had been split over two lines; whitespace fixes made this look very weird. --- spec/factories/comments.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/spec/factories/comments.rb b/spec/factories/comments.rb index eb9f43e9c..85dca1b4c 100644 --- a/spec/factories/comments.rb +++ b/spec/factories/comments.rb @@ -2,7 +2,7 @@ FactoryGirl.define do factory :comment do post author - sequence(:body) { |n| "OMG LOL #{n}" } # because our commenters are more - # polite than YouTube's + sequence(:body) { |n| "OMG LOL #{n}" } + # because our commenters are more polite than YouTube's end end From 915030e5833f5c033abd2a78cea3b3558304bc6d Mon Sep 17 00:00:00 2001 From: Mackenzie Morgan Date: Tue, 29 Nov 2016 09:40:59 -0500 Subject: [PATCH 212/268] whitespace --- app/models/crop.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/models/crop.rb b/app/models/crop.rb index 60fd79f42..07932b1b6 100644 --- a/app/models/crop.rb +++ b/app/models/crop.rb @@ -254,7 +254,7 @@ class Crop < ActiveRecord::Base # rubocop:disable Metrics/ClassLength if !scientific_names.blank? # i.e. we actually passed something in, which isn't a given names_to_add = scientific_names.split(%r{,\s*}) elsif parent && parent.scientific_names.size > 0 # pick up from parent - names_to_add = parent.scientific_names.map{|s| s.name} + names_to_add = parent.scientific_names.map { |s| s.name } else logger.warn("Warning: no scientific name (not even on parent crop) for #{self}") end From 9dc02cd3d8e6fd250a87661a7c426f4f0e0cc42c Mon Sep 17 00:00:00 2001 From: Mackenzie Morgan Date: Tue, 29 Nov 2016 12:10:48 -0500 Subject: [PATCH 213/268] make changes from code review --- app/controllers/crops_controller.rb | 11 ++++++----- app/controllers/notifications_controller.rb | 2 +- app/controllers/orders_controller.rb | 2 +- app/models/notification.rb | 4 +--- app/models/order.rb | 4 +--- 5 files changed, 10 insertions(+), 13 deletions(-) diff --git a/app/controllers/crops_controller.rb b/app/controllers/crops_controller.rb index dac763665..c77522b8f 100644 --- a/app/controllers/crops_controller.rb +++ b/app/controllers/crops_controller.rb @@ -10,14 +10,11 @@ class CropsController < ApplicationController def index @sort = params[:sort] if @sort == 'alpha' - # alphabetical order @crops = Crop.includes(:scientific_names, { plantings: :photos }) - @paginated_crops = @crops.approved.paginate(page: params[:page]) else - # default to sorting by popularity - @crops = Crop.popular.includes(:scientific_names, { plantings: :photos }) - @paginated_crops = @crops.approved.paginate(page: params[:page]) + @crops = popular_crops end + @paginated_crops = @crops.approved.paginate(page: params[:page]) respond_to do |format| format.html @@ -212,6 +209,10 @@ class CropsController < ApplicationController private + def popular_crops + Crop.popular.includes(:scientific_names, { plantings: :photos }) + end + def crop_params params.require(:crop).permit(:en_wikipedia_url, :name, diff --git a/app/controllers/notifications_controller.rb b/app/controllers/notifications_controller.rb index 0f8d38d19..5794a45cc 100644 --- a/app/controllers/notifications_controller.rb +++ b/app/controllers/notifications_controller.rb @@ -5,7 +5,7 @@ class NotificationsController < ApplicationController # GET /notifications def index - @notifications = Notification.find_by_recipient(current_member).page(params[:page]) + @notifications = Notification.by_recipient(current_member).page(params[:page]) respond_to do |format| format.html # index.html.erb diff --git a/app/controllers/orders_controller.rb b/app/controllers/orders_controller.rb index b0d744268..3e0e97806 100644 --- a/app/controllers/orders_controller.rb +++ b/app/controllers/orders_controller.rb @@ -4,7 +4,7 @@ class OrdersController < ApplicationController # GET /orders def index - @orders = Order.by_member_id(current_member.id) + @orders = Order.by_member(current_member) respond_to do |format| format.html # index.html.erb diff --git a/app/models/notification.rb b/app/models/notification.rb index 4be21e668..329ff17e5 100644 --- a/app/models/notification.rb +++ b/app/models/notification.rb @@ -7,13 +7,11 @@ class Notification < ActiveRecord::Base default_scope { order('created_at DESC') } scope :unread, -> { where(read: false) } + scope :by_recipient, ->(recipient) {where(recipient_id: recipient)} before_create :replace_blank_subject after_create :send_email - def self.find_by_recipient(recipient) - where(recipient_id: recipient) - end def self.unread_count self.unread.size diff --git a/app/models/order.rb b/app/models/order.rb index df074c5a9..85a3c526d 100644 --- a/app/models/order.rb +++ b/app/models/order.rb @@ -12,9 +12,7 @@ class Order < ActiveRecord::Base before_save :standardize_referral_code - def self.by_member_id(member_id) - where(member_id: member_id) - end + scope :by_member, ->(member) { where(member: member) } # total price of an order def total From 99c8db72d6fee271e41213b632f4d9e6dff769ff Mon Sep 17 00:00:00 2001 From: Mackenzie Morgan Date: Tue, 29 Nov 2016 12:14:16 -0500 Subject: [PATCH 214/268] syntax --- app/controllers/crops_controller.rb | 2 ++ app/models/notification.rb | 3 +-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/app/controllers/crops_controller.rb b/app/controllers/crops_controller.rb index 27fd6a23b..d3a7c1b9b 100644 --- a/app/controllers/crops_controller.rb +++ b/app/controllers/crops_controller.rb @@ -197,6 +197,8 @@ class CropsController < ApplicationController def popular_crops Crop.popular.includes(:scientific_names, { plantings: :photos }) + end + def recreate_names(param_name, name_type) return unless params[param_name].present? destroy_names(name_type) diff --git a/app/models/notification.rb b/app/models/notification.rb index 329ff17e5..f19de9b34 100644 --- a/app/models/notification.rb +++ b/app/models/notification.rb @@ -7,12 +7,11 @@ class Notification < ActiveRecord::Base default_scope { order('created_at DESC') } scope :unread, -> { where(read: false) } - scope :by_recipient, ->(recipient) {where(recipient_id: recipient)} + scope :by_recipient, ->(recipient) { where(recipient_id: recipient) } before_create :replace_blank_subject after_create :send_email - def self.unread_count self.unread.size end From 4857fd8d2e86b80df59c957eafb631ec78f2032f Mon Sep 17 00:00:00 2001 From: Mackenzie Morgan Date: Tue, 29 Nov 2016 12:20:17 -0500 Subject: [PATCH 215/268] return from conditional --- app/controllers/crops_controller.rb | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/app/controllers/crops_controller.rb b/app/controllers/crops_controller.rb index d3a7c1b9b..f357e24fb 100644 --- a/app/controllers/crops_controller.rb +++ b/app/controllers/crops_controller.rb @@ -9,11 +9,11 @@ class CropsController < ApplicationController # GET /crops.json def index @sort = params[:sort] - if @sort == 'alpha' - @crops = Crop.includes(:scientific_names, { plantings: :photos }) - else - @crops = popular_crops - end + @crops = if @sort == 'alpha' + Crop.includes(:scientific_names, { plantings: :photos }) + else + popular_crops + end @paginated_crops = @crops.approved.paginate(page: params[:page]) respond_to do |format| From 72877aebaf30adfddc801441dac457f5117c3ccf Mon Sep 17 00:00:00 2001 From: Mackenzie Morgan Date: Tue, 29 Nov 2016 13:41:05 -0500 Subject: [PATCH 216/268] update test for renamed scope --- spec/models/order_spec.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spec/models/order_spec.rb b/spec/models/order_spec.rb index 30e6cf261..1f8bf88bf 100644 --- a/spec/models/order_spec.rb +++ b/spec/models/order_spec.rb @@ -17,7 +17,7 @@ describe Order do end it "only returns orders belonging to member" do - Order.by_member_id(@member1.id).should eq [@order1] + Order.by_member(@member1).should eq [@order1] end end From 9aa4fa8031af3373cc9a2f05410574a9d577646d Mon Sep 17 00:00:00 2001 From: Brenda Wallace Date: Wed, 30 Nov 2016 10:25:23 +1300 Subject: [PATCH 217/268] Fixes for two calls to deprecated methods --- .rubocop_todo.yml | 7 ------- app/controllers/robots_controller.rb | 2 +- config/boot.rb | 2 +- 3 files changed, 2 insertions(+), 9 deletions(-) diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml index 93b7ab7c0..2fdd20f71 100644 --- a/.rubocop_todo.yml +++ b/.rubocop_todo.yml @@ -32,13 +32,6 @@ Lint/AssignmentInCondition: Exclude: - 'app/models/member.rb' -# Offense count: 2 -# Cop supports --auto-correct. -Lint/DeprecatedClassMethods: - Exclude: - - 'app/controllers/robots_controller.rb' - - 'config/boot.rb' - # Offense count: 1 Lint/HandleExceptions: Exclude: diff --git a/app/controllers/robots_controller.rb b/app/controllers/robots_controller.rb index d74ffe20f..eb846d23d 100644 --- a/app/controllers/robots_controller.rb +++ b/app/controllers/robots_controller.rb @@ -3,7 +3,7 @@ class RobotsController < ApplicationController def robots filename = "config/robots.#{subdomain}.txt" if subdomain && subdomain != 'www' - file_to_render = File.exists?(filename.to_s) ? filename : DEFAULT_FILENAME + file_to_render = File.exist?(filename.to_s) ? filename : DEFAULT_FILENAME render file: file_to_render, layout: false, content_type: 'text/plain' end diff --git a/config/boot.rb b/config/boot.rb index 4489e5868..f2830ae31 100644 --- a/config/boot.rb +++ b/config/boot.rb @@ -3,4 +3,4 @@ require 'rubygems' # Set up gems listed in the Gemfile. ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__) -require 'bundler/setup' if File.exists?(ENV['BUNDLE_GEMFILE']) +require 'bundler/setup' if File.exist?(ENV['BUNDLE_GEMFILE']) From b6136d6a201c10dc863b43e12edc6bf191d9cac8 Mon Sep 17 00:00:00 2001 From: Brenda Wallace Date: Wed, 30 Nov 2016 10:38:00 +1300 Subject: [PATCH 218/268] Removed ignores for rails findby --- .rubocop_todo.yml | 9 --------- 1 file changed, 9 deletions(-) diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml index dd53f3874..9d0b083c2 100644 --- a/.rubocop_todo.yml +++ b/.rubocop_todo.yml @@ -107,15 +107,6 @@ Rails/Date: - 'spec/features/plantings/planting_a_crop_spec.rb' - 'spec/features/shared_examples/append_date.rb' -# Offense count: 7 -# Cop supports --auto-correct. -# Configuration parameters: Include. -# Include: app/models/**/*.rb -Rails/FindBy: - Exclude: - - 'app/models/member.rb' - - 'app/models/post.rb' - # Offense count: 11 # Configuration parameters: Include. # Include: app/models/**/*.rb From a2e86b3e5e5e8e1ef1f54903cc1341411d85f076 Mon Sep 17 00:00:00 2001 From: Brenda Wallace Date: Wed, 30 Nov 2016 12:21:27 +1300 Subject: [PATCH 219/268] Rails dynamic finds fixed --- app/models/crop.rb | 6 +++--- spec/models/scientific_name_spec.rb | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/app/models/crop.rb b/app/models/crop.rb index c40ad47d9..db44bbbff 100644 --- a/app/models/crop.rb +++ b/app/models/crop.rb @@ -259,7 +259,7 @@ class Crop < ActiveRecord::Base # rubocop:disable Metrics/ClassLength logger.warn("Warning: no scientific name (not even on parent crop) for #{self}") end - cropbot = Member.find_by_login_name('cropbot') + cropbot = Member.find_by(login_name: 'cropbot') if names_to_add.size > 0 raise "cropbot account not found: run rake db:seed" unless cropbot @@ -269,7 +269,7 @@ class Crop < ActiveRecord::Base # rubocop:disable Metrics/ClassLength end def add_alternate_names_from_csv(alternate_names) - cropbot = Member.find_by_login_name('cropbot') + cropbot = Member.find_by(login_name: 'cropbot') if !alternate_names.blank? # i.e. we actually passed something in, which isn't a given raise "cropbot account not found: run rake db:seed" unless cropbot @@ -343,7 +343,7 @@ class Crop < ActiveRecord::Base # rubocop:disable Metrics/ClassLength end def create_crop_in_list(list_name, name) - cropbot = Member.find_by_login_name('cropbot') + cropbot = Member.find_by(login_name: 'cropbot') create_hash = { creator_id: "#{cropbot.id}", name: name diff --git a/spec/models/scientific_name_spec.rb b/spec/models/scientific_name_spec.rb index 3be2f36ac..b7648cb36 100644 --- a/spec/models/scientific_name_spec.rb +++ b/spec/models/scientific_name_spec.rb @@ -10,7 +10,7 @@ describe ScientificName do it 'should be fetchable from the database' do sn.save - @sn2 = ScientificName.find_by_name('Zea mays') + @sn2 = ScientificName.find_by(name: 'Zea mays') @sn2.crop.name.should == 'maize' end From 900e7361c6e3c5ba51d69ce70ad86725e51e25ee Mon Sep 17 00:00:00 2001 From: Brenda Wallace Date: Wed, 30 Nov 2016 09:00:10 +1300 Subject: [PATCH 220/268] Check we have a planted_at ts before doing maths with it --- app/helpers/plantings_helper.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/helpers/plantings_helper.rb b/app/helpers/plantings_helper.rb index fb6e2e7dc..898a0272f 100644 --- a/app/helpers/plantings_helper.rb +++ b/app/helpers/plantings_helper.rb @@ -5,7 +5,7 @@ module PlantingsHelper 0 elsif !planting.finished_at.nil? ((p = planting.finished_at - DateTime.now).to_i) <= 0 ? 0 : p.to_i - elsif planting.days_before_maturity.nil? + elsif planting.planted_at.nil? || planting.days_before_maturity.nil? "unknown" else ((p = (planting.planted_at + planting.days_before_maturity) - DateTime.now).to_i <= 0) ? 0 : p.to_i From 77b7969fc98d39b0f930f29489e00c0897dbcadc Mon Sep 17 00:00:00 2001 From: Mackenzie Morgan Date: Wed, 30 Nov 2016 00:46:58 -0500 Subject: [PATCH 221/268] DRY up photo & model interaction * move stuff in models into a concern * create combined collection for all models that have photos --- app/models/concerns/photo_capable.rb | 18 ++++++++++++++++++ app/models/garden.rb | 14 ++------------ app/models/harvest.rb | 13 ++----------- app/models/photo.rb | 24 ++++++++++++++---------- app/models/planting.rb | 12 +----------- spec/models/photo_spec.rb | 2 ++ 6 files changed, 39 insertions(+), 44 deletions(-) create mode 100644 app/models/concerns/photo_capable.rb diff --git a/app/models/concerns/photo_capable.rb b/app/models/concerns/photo_capable.rb new file mode 100644 index 000000000..f2f53aa42 --- /dev/null +++ b/app/models/concerns/photo_capable.rb @@ -0,0 +1,18 @@ +module PhotoCapable + extend ActiveSupport::Concern + + included do + has_and_belongs_to_many :photos + + before_destroy :remove_from_list + end + + def remove_from_list + photolist = self.photos.to_a # save a temp copy of the photo list + self.photos.clear # clear relationship b/w object and photo + + photolist.each do |photo| + photo.destroy_if_unused + end + end +end diff --git a/app/models/garden.rb b/app/models/garden.rb index ec4aea94f..9f58ac0ab 100644 --- a/app/models/garden.rb +++ b/app/models/garden.rb @@ -1,23 +1,13 @@ class Garden < ActiveRecord::Base - include Geocodable extend FriendlyId + include Geocodable + include PhotoCapable friendly_id :garden_slug, use: [:slugged, :finders] belongs_to :owner, class_name: 'Member', foreign_key: 'owner_id' has_many :plantings, -> { order(created_at: :desc) }, dependent: :destroy has_many :crops, through: :plantings - has_and_belongs_to_many :photos - - before_destroy do |garden| - photolist = garden.photos.to_a # save a temp copy of the photo list - garden.photos.clear # clear relationship b/w garden and photo - - photolist.each do |photo| - photo.destroy_if_unused - end - end - # set up geocoding geocoded_by :location after_validation :geocode diff --git a/app/models/harvest.rb b/app/models/harvest.rb index 04f4608f2..1afdf473d 100644 --- a/app/models/harvest.rb +++ b/app/models/harvest.rb @@ -1,22 +1,13 @@ class Harvest < ActiveRecord::Base - include ActionView::Helpers::NumberHelper extend FriendlyId + include ActionView::Helpers::NumberHelper + include PhotoCapable friendly_id :harvest_slug, use: [:slugged, :finders] belongs_to :crop belongs_to :owner, class_name: 'Member' belongs_to :plant_part - has_and_belongs_to_many :photos - - before_destroy do |harvest| - photolist = harvest.photos.to_a # save a temp copy of the photo list - harvest.photos.clear # clear relationship b/w harvest and photo - - photolist.each do |photo| - photo.destroy_if_unused - end - end default_scope { order('created_at DESC') } diff --git a/app/models/photo.rb b/app/models/photo.rb index 6d7fdbcba..bd41b5c39 100644 --- a/app/models/photo.rb +++ b/app/models/photo.rb @@ -1,22 +1,26 @@ class Photo < ActiveRecord::Base + ON_MODELS = %w(plantings harvests gardens) belongs_to :owner, class_name: 'Member' - has_and_belongs_to_many :plantings - has_and_belongs_to_many :harvests - has_and_belongs_to_many :gardens - before_destroy do |photo| - photo.plantings.clear - photo.harvests.clear - photo.gardens.clear + ON_MODELS.each do |relation| + has_and_belongs_to_many relation.to_sym end + before_destroy { relationships.clear } + default_scope { order("created_at desc") } + def relationships + associations = [] + ON_MODELS.each do |association_name, _reflection| + associations << self.send("#{association_name}").to_a + end + associations.flatten! + end + # remove photos that aren't used by anything def destroy_if_unused - unless plantings.size > 0 or harvests.size > 0 or gardens.size > 0 - self.destroy - end + self.destroy unless relationships.size > 0 end # This is split into a side-effect free method and a side-effecting method diff --git a/app/models/planting.rb b/app/models/planting.rb index 8dc339687..6e869be33 100644 --- a/app/models/planting.rb +++ b/app/models/planting.rb @@ -1,22 +1,12 @@ class Planting < ActiveRecord::Base extend FriendlyId + include PhotoCapable friendly_id :planting_slug, use: [:slugged, :finders] belongs_to :garden belongs_to :owner, class_name: 'Member', counter_cache: true belongs_to :crop, counter_cache: true - has_and_belongs_to_many :photos - - before_destroy do |planting| - photolist = planting.photos.to_a # save a temp copy of the photo list - planting.photos.clear # clear relationship b/w planting and photo - - photolist.each do |photo| - photo.destroy_if_unused - end - end - default_scope { order("created_at desc") } scope :finished, -> { where(finished: true) } scope :current, -> { where(finished: false) } diff --git a/spec/models/photo_spec.rb b/spec/models/photo_spec.rb index 5ec32bf73..b1f4f2759 100644 --- a/spec/models/photo_spec.rb +++ b/spec/models/photo_spec.rb @@ -85,11 +85,13 @@ describe Photo do planting.destroy # photo is still used by harvest and garden photo.reload + expect(photo.plantings.size).to eq 0 expect(photo.harvests.size).to eq 1 harvest.destroy garden.destroy # photo is now no longer used by anything + photo.reload expect(photo.plantings.size).to eq 0 expect(photo.harvests.size).to eq 0 From 77c64d59258b7692231a7bf21b63570be9bf5359 Mon Sep 17 00:00:00 2001 From: Miles Gould Date: Tue, 29 Nov 2016 13:51:04 +0000 Subject: [PATCH 222/268] Test PlantingHelper.display_days_before_maturity This ensures that #1079 is fixed. --- spec/helpers/plantings_helper_spec.rb | 63 +++++++++++++++++++++++++++ 1 file changed, 63 insertions(+) diff --git a/spec/helpers/plantings_helper_spec.rb b/spec/helpers/plantings_helper_spec.rb index 9485af81d..48a1ea5ad 100644 --- a/spec/helpers/plantings_helper_spec.rb +++ b/spec/helpers/plantings_helper_spec.rb @@ -1,6 +1,69 @@ require 'rails_helper' describe PlantingsHelper do + describe "display_days_before_maturity" do + it "handles nil planted_at, nil finished_at, non-nil days_until_maturity" do + planting = FactoryGirl.build(:planting, + quantity: 5, + planted_at: nil, + finished_at: nil, + days_before_maturity: 17 + ) + result = helper.display_days_before_maturity(planting) + expect(result).to eq "unknown" + end + + it "handles non-nil planted_at and d_b_m, nil finished_at" do + planting = FactoryGirl.build(:planting, + quantity: 5, + planted_at: Date.current, + finished_at: nil, + days_before_maturity: 17 + ) + result = helper.display_days_before_maturity(planting) + expect(result).to eq 16 + end + + it "handles completed plantings" do + planting = FactoryGirl.build(:planting, finished: true) + result = helper.display_days_before_maturity(planting) + expect(result).to eq 0 + end + + it "handles plantings that should have finished" do + planting = FactoryGirl.build(:planting, + quantity: 5, + planted_at: Date.new(0, 1, 1), + finished_at: nil, + days_before_maturity: 17 + ) + result = helper.display_days_before_maturity(planting) + expect(result).to eq 0 + end + + it "handles nil d_b_m and nil finished_at" do + planting = FactoryGirl.build(:planting, + quantity: 5, + planted_at: Date.new(2012, 5, 12), + finished_at: nil, + days_before_maturity: nil + ) + result = helper.display_days_before_maturity(planting) + expect(result).to eq "unknown" + end + + it "handles finished_at dates in the future" do + planting = FactoryGirl.build(:planting, + quantity: 5, + planted_at: Date.current, + finished_at: Date.current + 5, + days_before_maturity: nil + ) + result = helper.display_days_before_maturity(planting) + expect(result).to eq 4 + end + end + describe "display_planting" do let!(:member) { FactoryGirl.build(:member, login_name: 'crop_lady') } From b0b864a5d41278e6695c003a5114425f7ca25d2d Mon Sep 17 00:00:00 2001 From: Miles Gould Date: Tue, 29 Nov 2016 13:53:26 +0000 Subject: [PATCH 223/268] Fix off-by-one bug in display_days_before_maturity We were counting from DateTime.now rather than Date.current, causing us to under-count by a day. --- app/helpers/plantings_helper.rb | 4 ++-- spec/helpers/plantings_helper_spec.rb | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/app/helpers/plantings_helper.rb b/app/helpers/plantings_helper.rb index a9cfebf61..964b8fb76 100644 --- a/app/helpers/plantings_helper.rb +++ b/app/helpers/plantings_helper.rb @@ -3,11 +3,11 @@ module PlantingsHelper if planting.finished? 0 elsif !planting.finished_at.nil? - ((p = planting.finished_at - DateTime.now).to_i) <= 0 ? 0 : p.to_i + ((p = planting.finished_at - Date.current).to_i) <= 0 ? 0 : p.to_i elsif planting.planted_at.nil? || planting.days_before_maturity.nil? "unknown" else - ((p = (planting.planted_at + planting.days_before_maturity) - DateTime.now).to_i <= 0) ? 0 : p.to_i + ((p = (planting.planted_at + planting.days_before_maturity) - Date.current).to_i <= 0) ? 0 : p.to_i end end diff --git a/spec/helpers/plantings_helper_spec.rb b/spec/helpers/plantings_helper_spec.rb index 48a1ea5ad..2370bf53a 100644 --- a/spec/helpers/plantings_helper_spec.rb +++ b/spec/helpers/plantings_helper_spec.rb @@ -21,7 +21,7 @@ describe PlantingsHelper do days_before_maturity: 17 ) result = helper.display_days_before_maturity(planting) - expect(result).to eq 16 + expect(result).to eq 17 end it "handles completed plantings" do @@ -60,7 +60,7 @@ describe PlantingsHelper do days_before_maturity: nil ) result = helper.display_days_before_maturity(planting) - expect(result).to eq 4 + expect(result).to eq 5 end end From 9400225f65b283a6bf1ff4bca5dc1a9dcb87e8a3 Mon Sep 17 00:00:00 2001 From: Miles Gould Date: Wed, 30 Nov 2016 09:56:31 +0000 Subject: [PATCH 224/268] Return a string from display_days_before_maturity Sometimes we were returning a string, and sometimes we were returning an integer. We're only ever displaying the result, and this seems a little more consistent. --- app/helpers/plantings_helper.rb | 6 +++--- spec/helpers/plantings_helper_spec.rb | 10 +++++----- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/app/helpers/plantings_helper.rb b/app/helpers/plantings_helper.rb index 964b8fb76..f4d8d45be 100644 --- a/app/helpers/plantings_helper.rb +++ b/app/helpers/plantings_helper.rb @@ -1,13 +1,13 @@ module PlantingsHelper def display_days_before_maturity(planting) if planting.finished? - 0 + "0" elsif !planting.finished_at.nil? - ((p = planting.finished_at - Date.current).to_i) <= 0 ? 0 : p.to_i + ((p = planting.finished_at - Date.current).to_i) <= 0 ? "0" : p.to_i.to_s elsif planting.planted_at.nil? || planting.days_before_maturity.nil? "unknown" else - ((p = (planting.planted_at + planting.days_before_maturity) - Date.current).to_i <= 0) ? 0 : p.to_i + ((p = (planting.planted_at + planting.days_before_maturity) - Date.current).to_i <= 0) ? "0" : p.to_i.to_s end end diff --git a/spec/helpers/plantings_helper_spec.rb b/spec/helpers/plantings_helper_spec.rb index 2370bf53a..e776501b4 100644 --- a/spec/helpers/plantings_helper_spec.rb +++ b/spec/helpers/plantings_helper_spec.rb @@ -21,13 +21,13 @@ describe PlantingsHelper do days_before_maturity: 17 ) result = helper.display_days_before_maturity(planting) - expect(result).to eq 17 + expect(result).to eq "17" end it "handles completed plantings" do planting = FactoryGirl.build(:planting, finished: true) result = helper.display_days_before_maturity(planting) - expect(result).to eq 0 + expect(result).to eq "0" end it "handles plantings that should have finished" do @@ -35,10 +35,10 @@ describe PlantingsHelper do quantity: 5, planted_at: Date.new(0, 1, 1), finished_at: nil, - days_before_maturity: 17 + days_before_maturity: "17" ) result = helper.display_days_before_maturity(planting) - expect(result).to eq 0 + expect(result).to eq "0" end it "handles nil d_b_m and nil finished_at" do @@ -60,7 +60,7 @@ describe PlantingsHelper do days_before_maturity: nil ) result = helper.display_days_before_maturity(planting) - expect(result).to eq 5 + expect(result).to eq "5" end end From 184154893607123c7829127b4a2e7e3e42abde21 Mon Sep 17 00:00:00 2001 From: Miles Gould Date: Wed, 30 Nov 2016 11:01:25 +0000 Subject: [PATCH 225/268] Precompile assets in test According to https://github.com/teampoltergeist/poltergeist/issues/677#issuecomment-222919584, a possible cause of the "Request failed to reach server" problem (#901) is that assets are being compiled on-demand, causing enough of a slowdown for PhantomJS to think the connection has failed. This turns off lazy asset compilation in the test environment and precompiles assets before testing on Travis. We should also turn off lazy asset compilation in production - see http://stackoverflow.com/questions/8821864/config-assets-compile-true-in-rails-production-why-not Our Heroku deployments already run `rake assets:precompile`. --- .travis.yml | 1 + config/environments/test.rb | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/.travis.yml b/.travis.yml index 3aefec912..5f2219acd 100644 --- a/.travis.yml +++ b/.travis.yml @@ -25,6 +25,7 @@ before_install: - phantomjs --version before_script: - bundle exec rake db:create db:migrate db:test:prepare + - bundle exec rake assets:precompile script: - bundle exec rubocop --display-cop-names --rails - script/gemfile_check diff --git a/config/environments/test.rb b/config/environments/test.rb index 35836c90b..dd3a3816c 100644 --- a/config/environments/test.rb +++ b/config/environments/test.rb @@ -6,6 +6,10 @@ Growstuff::Application.configure do # preloads Rails for running tests, you may have to set it to true. config.eager_load = false + # Do not compile assets on-demand. On-demand compilation slows down the test + # suite and causes random test failures. + config.assets.compile = false + # The test environment is used exclusively to run your application's # test suite. You never need to work with it otherwise. Remember that # your test database is "scratch space" for the test suite and is wiped From 6be96406254ce678c9da0255b3854e607264f44a Mon Sep 17 00:00:00 2001 From: Miles Gould Date: Wed, 30 Nov 2016 11:35:35 +0000 Subject: [PATCH 226/268] Run tests with `rake` when DB does not yet exist Previously, `rake spec` ran the tests whether or not the `growstuff_test` database existed or not, but `rake` crashed unless it had already been created. The problem was that `rake` was trying to load the environment, which required the presence of a DB; `rake spec` was running this with the `dev` environment, so succeeded if `growstuff_dev` existed, but `rake` was running everything with the `test` environment, so would fail if `growstuff_test` did not exist. This patch adds `db:create` to the dependencies of the `spec` task, forcing an unadorned `rake` to create all necessary databases first. --- lib/tasks/testing.rake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/tasks/testing.rake b/lib/tasks/testing.rake index a7908d590..b41172efb 100644 --- a/lib/tasks/testing.rake +++ b/lib/tasks/testing.rake @@ -2,7 +2,7 @@ require 'rake' begin require 'rspec/core/rake_task' task(:spec).clear - RSpec::Core::RakeTask.new(spec: 'db:test:prepare') do |t| + RSpec::Core::RakeTask.new(spec: ['db:create', 'db:test:prepare']) do |t| t.verbose = false end rescue LoadError From aa7ca71e5df3c25d98b03032cb68a8a8d0380716 Mon Sep 17 00:00:00 2001 From: Mackenzie Morgan Date: Wed, 30 Nov 2016 09:47:48 -0500 Subject: [PATCH 227/268] rubocop --- app/models/concerns/photo_capable.rb | 8 +++----- app/models/harvest.rb | 1 - app/models/photo.rb | 4 ++-- 3 files changed, 5 insertions(+), 8 deletions(-) diff --git a/app/models/concerns/photo_capable.rb b/app/models/concerns/photo_capable.rb index f2f53aa42..4ee0d2756 100644 --- a/app/models/concerns/photo_capable.rb +++ b/app/models/concerns/photo_capable.rb @@ -8,11 +8,9 @@ module PhotoCapable end def remove_from_list - photolist = self.photos.to_a # save a temp copy of the photo list - self.photos.clear # clear relationship b/w object and photo + photolist = photos.to_a # save a temp copy of the photo list + photos.clear # clear relationship b/w object and photo - photolist.each do |photo| - photo.destroy_if_unused - end + photolist.each(&:destroy_if_unused) end end diff --git a/app/models/harvest.rb b/app/models/harvest.rb index 1afdf473d..e7304802a 100644 --- a/app/models/harvest.rb +++ b/app/models/harvest.rb @@ -8,7 +8,6 @@ class Harvest < ActiveRecord::Base belongs_to :owner, class_name: 'Member' belongs_to :plant_part - default_scope { order('created_at DESC') } validates :crop, approved: true diff --git a/app/models/photo.rb b/app/models/photo.rb index bd41b5c39..eef1d4e94 100644 --- a/app/models/photo.rb +++ b/app/models/photo.rb @@ -1,5 +1,5 @@ class Photo < ActiveRecord::Base - ON_MODELS = %w(plantings harvests gardens) + ON_MODELS = %w(plantings harvests gardens).freeze belongs_to :owner, class_name: 'Member' ON_MODELS.each do |relation| @@ -13,7 +13,7 @@ class Photo < ActiveRecord::Base def relationships associations = [] ON_MODELS.each do |association_name, _reflection| - associations << self.send("#{association_name}").to_a + associations << self.send(association_name.to_s).to_a end associations.flatten! end From 6321d1ac41ddf329e495bcb8c38803c5093b927b Mon Sep 17 00:00:00 2001 From: Brenda Wallace Date: Thu, 1 Dec 2016 10:17:22 +1300 Subject: [PATCH 228/268] current order, use rails' findby --- app/models/member.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/models/member.rb b/app/models/member.rb index 018860365..da3c50271 100644 --- a/app/models/member.rb +++ b/app/models/member.rb @@ -107,7 +107,7 @@ class Member < ActiveRecord::Base end def current_order - orders.where(completed_at: nil).first + orders.find_by(completed_at: nil) end # when purchasing a product that gives you a paid account, this method From cef1bb10567d02e1e008ed0a8b1914d3988620c0 Mon Sep 17 00:00:00 2001 From: Mackenzie Morgan Date: Wed, 30 Nov 2016 16:29:02 -0500 Subject: [PATCH 229/268] ignore has_and_belongs_to_many --- app/models/concerns/photo_capable.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/models/concerns/photo_capable.rb b/app/models/concerns/photo_capable.rb index 4ee0d2756..7c5207a72 100644 --- a/app/models/concerns/photo_capable.rb +++ b/app/models/concerns/photo_capable.rb @@ -2,7 +2,7 @@ module PhotoCapable extend ActiveSupport::Concern included do - has_and_belongs_to_many :photos + has_and_belongs_to_many :photos # rubocop:disable Rails/HasAndBelongsToMany before_destroy :remove_from_list end From cd0e287dbad1c37d1d8dbec86206006ca3137cf6 Mon Sep 17 00:00:00 2001 From: Brenda Wallace Date: Thu, 1 Dec 2016 12:50:16 +1300 Subject: [PATCH 230/268] removed member look up that wasn't used in spec --- spec/features/unsubscribing_spec.rb | 1 - 1 file changed, 1 deletion(-) diff --git a/spec/features/unsubscribing_spec.rb b/spec/features/unsubscribing_spec.rb index d5da11160..8244d207a 100644 --- a/spec/features/unsubscribing_spec.rb +++ b/spec/features/unsubscribing_spec.rb @@ -52,7 +52,6 @@ feature "unsubscribe" do # visit /members/unsubscribe/somestring ie.parameter to the URL is a random string visit unsubscribe_member_url("type=send_planting_reminder&member_id=#{member.id}") expect(page).to have_content "We're sorry, there was an error" - Member.find(member.id) # reload the member expect(member.send_planting_reminder).to eq(true) expect(member.send_notification_email).to eq(true) end From e06d110861d32b2843262df1b7d175fcaac41a85 Mon Sep 17 00:00:00 2001 From: Brenda Wallace Date: Thu, 1 Dec 2016 13:30:00 +1300 Subject: [PATCH 231/268] Turn on rails:true in rubocop so we don't need to pass --rails --- .rubocop.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.rubocop.yml b/.rubocop.yml index d2bb99356..44a1e816c 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -8,6 +8,9 @@ AllCops: - 'db/schema.rb' - 'vendor/**/*' +Rails: + Enabled: true + Style/FileName: Exclude: - 'Gemfile' From 31bbf42ad0f652d6bb9203f1ee7badf03803da93 Mon Sep 17 00:00:00 2001 From: Mackenzie Morgan Date: Thu, 1 Dec 2016 00:19:33 -0500 Subject: [PATCH 232/268] define valid models for photos in a constants file remove all hardcoded model names from photo.rb and photos_controller.rb --- app/constants/photo_models.rb | 37 ++++++++++++++++++++++++++++ app/controllers/photos_controller.rb | 35 ++++++-------------------- app/models/photo.rb | 12 ++++----- 3 files changed, 50 insertions(+), 34 deletions(-) create mode 100644 app/constants/photo_models.rb diff --git a/app/constants/photo_models.rb b/app/constants/photo_models.rb new file mode 100644 index 000000000..bc9fc24fd --- /dev/null +++ b/app/constants/photo_models.rb @@ -0,0 +1,37 @@ +module Growstuff + module Constants + class PhotoModels + PLANTING = { type: 'planting', class: 'Planting', relation: 'plantings' }.freeze + HARVEST = { type: 'harvest', class: 'Harvest', relation: 'harvests' }.freeze + GARDEN = { type: 'garden', class: 'Garden', relation: 'gardens' }.freeze + + ALL = [PLANTING, HARVEST, GARDEN].freeze + + def self.types + ALL.map do |model| + model[:type] + end + end + + def self.relations + ALL.map do |model| + model[:relation] + end + end + + def self.get_relation(object, type) + relation = ALL.select do |model| + model[:type] == type + end[0][:relation] + object.send(relation) + end + + def self.get_item(type) + class_name = ALL.select do |model| + model[:type] == type + end[0][:class] + class_name.constantize + end + end + end +end diff --git a/app/controllers/photos_controller.rb b/app/controllers/photos_controller.rb index ba2d24cee..95674534d 100644 --- a/app/controllers/photos_controller.rb +++ b/app/controllers/photos_controller.rb @@ -113,36 +113,17 @@ class PhotosController < ApplicationController @photo end - def which_collection? - case params[:type] - when "garden" then @photo.gardens - when "harvest" then @photo.harvests - when "planting" then @photo.plantings - else raise "Invalid type" - end - end - def add_photo_to_collection - collection = which_collection? + raise "Missing or invalid type provided" unless Growstuff::Constants::PhotoModels::types.include?(params[:type]) + raise "No item id provided" unless item_id? + collection = Growstuff::Constants::PhotoModels::get_relation(@photo, params[:type]) - unless collection && item_id? - flash[:alert] = "Missing or invalid type or id parameter" - return - end + item_class = Growstuff::Constants::PhotoModels::get_item(params[:type]) + item = item_class.find_by!(id: params[:id], owner_id: current_member.id) + raise "Could not find this item owned by you" unless item - item = find_item_for_photo! collection << item unless collection.include?(item) - rescue - flash[:alert] = "Could not find this item owned by you" - end - - def find_item_for_photo! - item_class = case params[:type] - when "garden" then Garden - when "harvest" then Harvest - when "planting" then Planting - else raise "Invalid type" - end - item_class.find_by!(id: params[:id], owner_id: current_member.id) + rescue => e + flash[:alert] = e.message end end diff --git a/app/models/photo.rb b/app/models/photo.rb index eef1d4e94..51489572f 100644 --- a/app/models/photo.rb +++ b/app/models/photo.rb @@ -1,26 +1,24 @@ class Photo < ActiveRecord::Base - ON_MODELS = %w(plantings harvests gardens).freeze belongs_to :owner, class_name: 'Member' - ON_MODELS.each do |relation| + Growstuff::Constants::PhotoModels::relations.each do |relation| has_and_belongs_to_many relation.to_sym end - before_destroy { relationships.clear } + before_destroy { all_associations.clear } default_scope { order("created_at desc") } - def relationships + def all_associations associations = [] - ON_MODELS.each do |association_name, _reflection| + Growstuff::Constants::PhotoModels::relations.each do |association_name| associations << self.send(association_name.to_s).to_a end associations.flatten! end - # remove photos that aren't used by anything def destroy_if_unused - self.destroy unless relationships.size > 0 + self.destroy unless all_associations.size > 0 end # This is split into a side-effect free method and a side-effecting method From 7b2be73c88547ffc5e381190617530e8eec57780 Mon Sep 17 00:00:00 2001 From: Mackenzie Morgan Date: Thu, 1 Dec 2016 00:22:52 -0500 Subject: [PATCH 233/268] code climate --- app/controllers/photos_controller.rb | 6 +++--- app/models/photo.rb | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/app/controllers/photos_controller.rb b/app/controllers/photos_controller.rb index 95674534d..07274b97b 100644 --- a/app/controllers/photos_controller.rb +++ b/app/controllers/photos_controller.rb @@ -114,11 +114,11 @@ class PhotosController < ApplicationController end def add_photo_to_collection - raise "Missing or invalid type provided" unless Growstuff::Constants::PhotoModels::types.include?(params[:type]) + raise "Missing or invalid type provided" unless Growstuff::Constants::PhotoModels.types.include?(params[:type]) raise "No item id provided" unless item_id? - collection = Growstuff::Constants::PhotoModels::get_relation(@photo, params[:type]) + collection = Growstuff::Constants::PhotoModels.get_relation(@photo, params[:type]) - item_class = Growstuff::Constants::PhotoModels::get_item(params[:type]) + item_class = Growstuff::Constants::PhotoModels.get_item(params[:type]) item = item_class.find_by!(id: params[:id], owner_id: current_member.id) raise "Could not find this item owned by you" unless item diff --git a/app/models/photo.rb b/app/models/photo.rb index 51489572f..d1b0cd51c 100644 --- a/app/models/photo.rb +++ b/app/models/photo.rb @@ -1,7 +1,7 @@ class Photo < ActiveRecord::Base belongs_to :owner, class_name: 'Member' - Growstuff::Constants::PhotoModels::relations.each do |relation| + Growstuff::Constants::PhotoModels.relations.each do |relation| has_and_belongs_to_many relation.to_sym end @@ -11,7 +11,7 @@ class Photo < ActiveRecord::Base def all_associations associations = [] - Growstuff::Constants::PhotoModels::relations.each do |association_name| + Growstuff::Constants::PhotoModels.relations.each do |association_name| associations << self.send(association_name.to_s).to_a end associations.flatten! From ae26e3f9364b15242791ebe3c03757a11edfd38e Mon Sep 17 00:00:00 2001 From: Brenda Wallace Date: Thu, 1 Dec 2016 20:14:24 +1300 Subject: [PATCH 234/268] Moved login_name_or_email query to own method --- app/models/member.rb | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/app/models/member.rb b/app/models/member.rb index 3a542c8d0..045eb26aa 100644 --- a/app/models/member.rb +++ b/app/models/member.rb @@ -92,7 +92,7 @@ class Member < ActiveRecord::Base def self.find_first_by_auth_conditions(warden_conditions) conditions = warden_conditions.dup if login = conditions.delete(:login) - where(conditions).where(["lower(login_name) = :value OR lower(email) = :value", { value: login.downcase }]).first + where(conditions).login_name_or_email(login).first else where(conditions).first end @@ -196,6 +196,10 @@ class Member < ActiveRecord::Base return false end + def Member.login_name_or_email(login) + where(["lower(login_name) = :value OR lower(email) = :value", { value: login.downcase }]) + end + def Member.interesting howmany = 12 # max number to find interesting_members = [] From 37adbe5f4807d6a712d7d0c8c57dfceb783b77ee Mon Sep 17 00:00:00 2001 From: Brenda Wallace Date: Thu, 1 Dec 2016 20:16:45 +1300 Subject: [PATCH 235/268] Moved case-insensitve login look up to method --- app/models/member.rb | 4 ++++ lib/haml/filters/growstuff_markdown.rb | 4 ++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/app/models/member.rb b/app/models/member.rb index 045eb26aa..2e746de3f 100644 --- a/app/models/member.rb +++ b/app/models/member.rb @@ -200,6 +200,10 @@ class Member < ActiveRecord::Base where(["lower(login_name) = :value OR lower(email) = :value", { value: login.downcase }]) end + def Member.case_insensitive_login_name(login) + where(["lower(login_name) = :value", { value: login.downcase }]) + end + def Member.interesting howmany = 12 # max number to find interesting_members = [] diff --git a/lib/haml/filters/growstuff_markdown.rb b/lib/haml/filters/growstuff_markdown.rb index ebd3ecebe..28e6b2543 100644 --- a/lib/haml/filters/growstuff_markdown.rb +++ b/lib/haml/filters/growstuff_markdown.rb @@ -26,7 +26,7 @@ module Haml::Filters expanded = expanded.gsub(MEMBER_REGEX) do |m| member_str = $1 # find member case-insensitively - member = Member.where('lower(login_name) = ?', member_str.downcase).first + member = Member.case_insensitive_login_name(member_str).first if member url = Rails.application.routes.url_helpers.member_url(member, only_path: true) "[#{member_str}](#{url})" @@ -39,7 +39,7 @@ module Haml::Filters expanded = expanded.gsub(MEMBER_AT_REGEX) do |m| member_str = $1 # find member case-insensitively - member = Member.where('lower(login_name) = ?', member_str[1..-1].downcase).first + member = Member.case_insensitive_login_name(member_str[1..-1]).first if member url = Rails.application.routes.url_helpers.member_url(member, only_path: true) "[#{member_str}](#{url})" From cba02ae05c2b76ae9ae2e44ee0b70b57beaaf023 Mon Sep 17 00:00:00 2001 From: Brenda Wallace Date: Thu, 1 Dec 2016 20:18:57 +1300 Subject: [PATCH 236/268] Convert where.first to find_by --- app/models/member.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/models/member.rb b/app/models/member.rb index 2e746de3f..e0c42d78d 100644 --- a/app/models/member.rb +++ b/app/models/member.rb @@ -266,6 +266,6 @@ class Member < ActiveRecord::Base end def get_follow(member) - self.follows.where(followed_id: member.id).first if already_following?(member) + self.follows.find_by(followed_id: member.id) if already_following?(member) end end From dc504fe36347a9e704a287a8845990cf444617c5 Mon Sep 17 00:00:00 2001 From: Brenda Wallace Date: Thu, 1 Dec 2016 21:29:00 +1300 Subject: [PATCH 237/268] use Member.case_insensitive_login_name --- app/models/post.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/models/post.rb b/app/models/post.rb index ed4bcad73..8a071d166 100644 --- a/app/models/post.rb +++ b/app/models/post.rb @@ -15,12 +15,12 @@ class Post < ActiveRecord::Base sender = self.author.id self.body.scan(Haml::Filters::GrowstuffMarkdown::MEMBER_REGEX) do |m| # find member case-insensitively and add to list of recipients - member = Member.where('lower(login_name) = ?', $1.downcase).first + member = Member.case_insensitive_login_name($1).first recipients << member if member && !recipients.include?(member) end self.body.scan(Haml::Filters::GrowstuffMarkdown::MEMBER_AT_REGEX) do |m| # find member case-insensitively and add to list of recipients - member = Member.where('lower(login_name) = ?', $1[1..-1].downcase).first + member = Member.case_insensitive_login_name($1[1..-1]).first recipients << member if member && !recipients.include?(member) end # don't send notifications to yourself From aba06c1fafeb0477a6a5e6763e2c1468418f0d91 Mon Sep 17 00:00:00 2001 From: Brenda Wallace Date: Thu, 1 Dec 2016 21:29:28 +1300 Subject: [PATCH 238/268] Case insensitive crop look up --- app/models/crop.rb | 4 ++++ app/models/post.rb | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/app/models/crop.rb b/app/models/crop.rb index db44bbbff..2e9da34a0 100644 --- a/app/models/crop.rb +++ b/app/models/crop.rb @@ -330,6 +330,10 @@ class Crop < ActiveRecord::Base # rubocop:disable Metrics/ClassLength end end + def Crop.case_insensitive_name(name) + where(["lower(name) = :value", { value: name.downcase }]) + end + private def add_names_to_list(names_to_add, list_name) diff --git a/app/models/post.rb b/app/models/post.rb index 8a071d166..bca9bb696 100644 --- a/app/models/post.rb +++ b/app/models/post.rb @@ -75,7 +75,7 @@ class Post < ActiveRecord::Base # look for crops mentioned in the post. eg. [tomato](crop) self.body.scan(Haml::Filters::GrowstuffMarkdown::CROP_REGEX) do |m| # find crop case-insensitively - crop = Crop.where('lower(name) = ?', $1.downcase).first + crop = Crop.case_insensitive_name($1).first # create association self.crops << crop if crop && !self.crops.include?(crop) end From d2fb96b3d7b080c3a1bb252d74ac2c90fe490143 Mon Sep 17 00:00:00 2001 From: Brenda Wallace Date: Thu, 1 Dec 2016 22:14:50 +1300 Subject: [PATCH 239/268] change where.first -> find_by --- app/models/member.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/models/member.rb b/app/models/member.rb index e0c42d78d..d79a6994f 100644 --- a/app/models/member.rb +++ b/app/models/member.rb @@ -94,7 +94,7 @@ class Member < ActiveRecord::Base if login = conditions.delete(:login) where(conditions).login_name_or_email(login).first else - where(conditions).first + find_by(conditions) end end From 3d845f47b9d375a02f542f1194bc0767d078c31f Mon Sep 17 00:00:00 2001 From: Cesy Avon Date: Thu, 1 Dec 2016 09:42:55 +0000 Subject: [PATCH 240/268] Update rails --- Gemfile | 2 +- Gemfile.lock | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Gemfile b/Gemfile index e752f553a..93999e0ab 100644 --- a/Gemfile +++ b/Gemfile @@ -3,7 +3,7 @@ source 'https://rubygems.org' ruby '2.3.1' -gem 'rails', '~> 4.2.1' +gem 'rails', '~> 4.2.7' gem 'bundler', '>=1.1.5' diff --git a/Gemfile.lock b/Gemfile.lock index 618de9759..f7aaaf9c8 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -544,7 +544,7 @@ DEPENDENCIES poltergeist pry quiet_assets - rails (~> 4.2.1) + rails (~> 4.2.7) rails_12factor rake (>= 10.0.0) rspec-activemodel-mocks From 54628e6d8c8bab66a939a69c77099f7273165c3f Mon Sep 17 00:00:00 2001 From: Mackenzie Morgan Date: Thu, 1 Dec 2016 12:24:26 -0500 Subject: [PATCH 241/268] expand wikipedia regex to include punctuation, because some have - or () in name (Fixes: #1104) --- app/models/crop.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/models/crop.rb b/app/models/crop.rb index 07932b1b6..dbf81f29f 100644 --- a/app/models/crop.rb +++ b/app/models/crop.rb @@ -42,7 +42,7 @@ class Crop < ActiveRecord::Base # rubocop:disable Metrics/ClassLength ## Wikipedia urls are only necessary when approving a crop validates :en_wikipedia_url, format: { - with: /\Ahttps?:\/\/en\.wikipedia\.org\/wiki\/[[:alnum:]%_]+\z/, + with: /\Ahttps?:\/\/en\.wikipedia\.org\/wiki\/[[:alnum:][:punct:]]+\z/, message: 'is not a valid English Wikipedia URL' }, if: :approved? From b38945d62f6a92d78347c25013736d91f589af3a Mon Sep 17 00:00:00 2001 From: Mackenzie Morgan Date: Thu, 1 Dec 2016 12:53:45 -0500 Subject: [PATCH 242/268] add require_relative to photo_capable concern for constants starts #1107 --- app/models/concerns/photo_capable.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/app/models/concerns/photo_capable.rb b/app/models/concerns/photo_capable.rb index 7c5207a72..61c92c98d 100644 --- a/app/models/concerns/photo_capable.rb +++ b/app/models/concerns/photo_capable.rb @@ -1,3 +1,4 @@ +require_relative '../../constants/photo_models.rb' module PhotoCapable extend ActiveSupport::Concern From 637b46ef1088a9dd49b3b11c8cff16fafc9d3c09 Mon Sep 17 00:00:00 2001 From: Mackenzie Morgan Date: Thu, 1 Dec 2016 12:54:55 -0500 Subject: [PATCH 243/268] add photos to seeds Fixes #495 --- app/constants/photo_models.rb | 3 ++- app/models/seed.rb | 1 + db/schema.rb | 15 ++++++++++++++- 3 files changed, 17 insertions(+), 2 deletions(-) diff --git a/app/constants/photo_models.rb b/app/constants/photo_models.rb index bc9fc24fd..8f79933e4 100644 --- a/app/constants/photo_models.rb +++ b/app/constants/photo_models.rb @@ -4,8 +4,9 @@ module Growstuff PLANTING = { type: 'planting', class: 'Planting', relation: 'plantings' }.freeze HARVEST = { type: 'harvest', class: 'Harvest', relation: 'harvests' }.freeze GARDEN = { type: 'garden', class: 'Garden', relation: 'gardens' }.freeze + SEED = { type: 'seed', class: 'Seed', relation: 'seeds' }.freeze - ALL = [PLANTING, HARVEST, GARDEN].freeze + ALL = [PLANTING, HARVEST, GARDEN, SEED].freeze def self.types ALL.map do |model| diff --git a/app/models/seed.rb b/app/models/seed.rb index 4c8a1c1c7..02a36fe3a 100644 --- a/app/models/seed.rb +++ b/app/models/seed.rb @@ -1,5 +1,6 @@ class Seed < ActiveRecord::Base extend FriendlyId + include PhotoCapable friendly_id :seed_slug, use: [:slugged, :finders] belongs_to :crop diff --git a/db/schema.rb b/db/schema.rb index 6596b2428..4901b8499 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -11,7 +11,7 @@ # # It's strongly recommended that you check this file into your version control system. -ActiveRecord::Schema.define(version: 20161129021533) do +ActiveRecord::Schema.define(version: 20161201154922) do # These are extensions that must be enabled in order to support this database enable_extension "plpgsql" @@ -355,6 +355,14 @@ ActiveRecord::Schema.define(version: 20161129021533) do t.integer "product_id" end + create_table "photo_mappings", force: :cascade do |t| + t.integer "photo_id" + t.integer "object_id" + t.string "object_type" + end + + add_index "photo_mappings", ["object_id", "photo_id"], name: "index_photo_mappings_on_object_id_and_photo_id", using: :btree + create_table "photos", force: :cascade do |t| t.integer "owner_id", null: false t.string "thumbnail_url", null: false @@ -373,6 +381,11 @@ ActiveRecord::Schema.define(version: 20161129021533) do t.integer "planting_id" end + create_table "photos_seeds", id: false, force: :cascade do |t| + t.integer "photo_id" + t.integer "seed_id" + end + create_table "plant_parts", force: :cascade do |t| t.string "name" t.datetime "created_at" From a3c8bc0586f68b0457dc2acc5d7c7822b0f4b5bf Mon Sep 17 00:00:00 2001 From: Mackenzie Morgan Date: Thu, 1 Dec 2016 13:23:52 -0500 Subject: [PATCH 244/268] include the migration --- db/migrate/20161201154922_add_photos_seeds_table.rb | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 db/migrate/20161201154922_add_photos_seeds_table.rb diff --git a/db/migrate/20161201154922_add_photos_seeds_table.rb b/db/migrate/20161201154922_add_photos_seeds_table.rb new file mode 100644 index 000000000..12605ae4c --- /dev/null +++ b/db/migrate/20161201154922_add_photos_seeds_table.rb @@ -0,0 +1,8 @@ +class AddPhotosSeedsTable < ActiveRecord::Migration + def change + create_table :photos_seeds, id: false do |t| + t.integer :photo_id + t.integer :seed_id + end + end +end From 2fb34bea182b8e7592c617f9ee208d7a87cc6091 Mon Sep 17 00:00:00 2001 From: Mackenzie Morgan Date: Thu, 1 Dec 2016 13:39:43 -0500 Subject: [PATCH 245/268] narrow the regex back down hyphen must be the LAST thing in the character class --- app/models/crop.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/models/crop.rb b/app/models/crop.rb index dbf81f29f..71fd2205d 100644 --- a/app/models/crop.rb +++ b/app/models/crop.rb @@ -42,7 +42,7 @@ class Crop < ActiveRecord::Base # rubocop:disable Metrics/ClassLength ## Wikipedia urls are only necessary when approving a crop validates :en_wikipedia_url, format: { - with: /\Ahttps?:\/\/en\.wikipedia\.org\/wiki\/[[:alnum:][:punct:]]+\z/, + with: /\Ahttps?:\/\/en\.wikipedia\.org\/wiki\/[[:alnum:]%_()-]+\z/, message: 'is not a valid English Wikipedia URL' }, if: :approved? From ceac906a3f2787346512a56a2699baaa31fbf1eb Mon Sep 17 00:00:00 2001 From: Mackenzie Morgan Date: Thu, 1 Dec 2016 14:00:18 -0500 Subject: [PATCH 246/268] ignore the minified bootstrap accessibility file for code climate checks --- .codeclimate.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.codeclimate.yml b/.codeclimate.yml index 3a369a376..e1c13452a 100644 --- a/.codeclimate.yml +++ b/.codeclimate.yml @@ -38,3 +38,4 @@ exclude_paths: - db/ - spec/ - public/ +- app/assets/stylesheets/bootstrap-accessibility.css From 03cb4a8deea4c09712f94afa6efca156b4c71357 Mon Sep 17 00:00:00 2001 From: Brenda Wallace Date: Fri, 2 Dec 2016 00:23:46 +0000 Subject: [PATCH 247/268] use find_or_initialize_by --- app/controllers/alternate_names_controller.rb | 2 +- app/controllers/harvests_controller.rb | 2 +- app/controllers/scientific_names_controller.rb | 2 +- app/controllers/seeds_controller.rb | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/app/controllers/alternate_names_controller.rb b/app/controllers/alternate_names_controller.rb index ef81497e1..b8467bb34 100644 --- a/app/controllers/alternate_names_controller.rb +++ b/app/controllers/alternate_names_controller.rb @@ -17,7 +17,7 @@ class AlternateNamesController < ApplicationController # GET /alternate_names/new.json def new @alternate_name = AlternateName.new - @crop = Crop.find_by(id: params[:crop_id]) || Crop.new + @crop = Crop.find_or_initialize_by(id: params[:crop_id]) respond_to do |format| format.html # new.html.haml diff --git a/app/controllers/harvests_controller.rb b/app/controllers/harvests_controller.rb index 3d36438fd..aa80c21c7 100644 --- a/app/controllers/harvests_controller.rb +++ b/app/controllers/harvests_controller.rb @@ -32,7 +32,7 @@ class HarvestsController < ApplicationController @harvest = Harvest.new('harvested_at' => Date.today) # using find_by_id here because it returns nil, unlike find - @crop = Crop.find_by(id: params[:crop_id]) || Crop.new + @crop = Crop.find_or_initialize_by(id: params[:crop_id]) respond_to do |format| format.html # new.html.erb diff --git a/app/controllers/scientific_names_controller.rb b/app/controllers/scientific_names_controller.rb index 35dbb4e8a..0fd0eccac 100644 --- a/app/controllers/scientific_names_controller.rb +++ b/app/controllers/scientific_names_controller.rb @@ -28,7 +28,7 @@ class ScientificNamesController < ApplicationController # GET /scientific_names/new.json def new @scientific_name = ScientificName.new - @crop = Crop.find_by(id: params[:crop_id]) || Crop.new + @crop = Crop.find_or_initialize_by(id: params[:crop_id]) respond_to do |format| format.html # new.html.haml diff --git a/app/controllers/seeds_controller.rb b/app/controllers/seeds_controller.rb index 5d9a775e7..01fdc7beb 100644 --- a/app/controllers/seeds_controller.rb +++ b/app/controllers/seeds_controller.rb @@ -49,7 +49,7 @@ class SeedsController < ApplicationController @seed = Seed.new # using find_by_id here because it returns nil, unlike find - @crop = Crop.find_by(id: params[:crop_id]) || Crop.new + @crop = Crop.find_or_initialize_by(id: params[:crop_id]) respond_to do |format| format.html # new.html.erb From 81f2fa5fa4a7a4ee53c883855470498c70558af5 Mon Sep 17 00:00:00 2001 From: Jim Stallings Date: Sat, 19 Sep 2015 16:24:01 -0400 Subject: [PATCH 248/268] GS-658: sort locale keys, add rake task for it --- config/locales/en.yml | 3 +++ config/locales/ja.yml | 1 + lib/tasks/i18n.rake | 6 ++++++ 3 files changed, 10 insertions(+) create mode 100644 lib/tasks/i18n.rake diff --git a/config/locales/en.yml b/config/locales/en.yml index bb9058e53..2c73ad544 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -44,6 +44,9 @@ en: gardens: form: location_helper: If you have a location set in your profile, it will be used when you create a new garden. + forums: + index: + title: Forums harvests: index: title: diff --git a/config/locales/ja.yml b/config/locales/ja.yml index fa240b7c3..2a51c32c5 100644 --- a/config/locales/ja.yml +++ b/config/locales/ja.yml @@ -1,3 +1,4 @@ +--- ja: home: blurb: diff --git a/lib/tasks/i18n.rake b/lib/tasks/i18n.rake new file mode 100644 index 000000000..447f0a5d3 --- /dev/null +++ b/lib/tasks/i18n.rake @@ -0,0 +1,6 @@ +namespace :i18n do + desc "sort all locale keys" + task normalize: :environment do + `i18n-tasks normalize` + end +end From fe6e269c64e5cdc6cb6efd142f49c2098d820c90 Mon Sep 17 00:00:00 2001 From: Jim Stallings Date: Sat, 19 Sep 2015 17:45:31 -0400 Subject: [PATCH 249/268] GS-658 - i18n automation POC --- Gemfile | 1 + Gemfile.lock | 1 + app/views/layouts/_header.html.haml | 14 ++-- .../layouts/_header.html.i18n-extractor.haml | 78 +++++++++++++++++++ config/locales/en.yml | 32 ++++++-- lib/tasks/i18n.rake | 16 +++- 6 files changed, 127 insertions(+), 15 deletions(-) create mode 100644 app/views/layouts/_header.html.i18n-extractor.haml diff --git a/Gemfile b/Gemfile index 93999e0ab..a91ccba45 100644 --- a/Gemfile +++ b/Gemfile @@ -113,6 +113,7 @@ group :development, :test do gem 'poltergeist' # for headless JS testing gem 'i18n-tasks' # adds tests for finding missing and unused translations gem 'selenium-webdriver' + gem 'haml-i18n-extractor' gem "active_merchant-paypal-bogus-gateway" gem 'rubocop', require: false end diff --git a/Gemfile.lock b/Gemfile.lock index f7aaaf9c8..2701ee162 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -524,6 +524,7 @@ DEPENDENCIES guard guard-rspec haml + haml-i18n-extractor haml-rails heroku-api i18n-tasks diff --git a/app/views/layouts/_header.html.haml b/app/views/layouts/_header.html.haml index 5b66c20dc..803d542f5 100644 --- a/app/views/layouts/_header.html.haml +++ b/app/views/layouts/_header.html.haml @@ -4,7 +4,7 @@ .container .navbar-header %button.navbar-toggle(data-target="#navbar-collapse" data-toggle="collapse") - %span.sr-only Toggle Navigation + %span.sr-only= t('.toggle_navigation') %span.icon-bar %span.icon-bar %span.icon-bar @@ -28,7 +28,7 @@ %ul.nav.navbar-nav.navbar-right %li.dropdown< %a.dropdown-toggle{'data-toggle' => 'dropdown', :href => crops_path} - Crops + = t('.crops') %b.caret %ul.dropdown-menu %li= link_to t('.browse_crops'), crops_path @@ -37,7 +37,7 @@ %li= link_to t('.harvests'), harvests_path %li.dropdown< %a.dropdown-toggle{'data-toggle' => 'dropdown', :href => members_path} - Community + = t('.community') %b.caret %ul.dropdown-menu %li= link_to t('.community_map'), places_path @@ -52,7 +52,7 @@ - if current_member.notifications.unread_count > 0 = t('.your_stuff', unread_count: current_member.notifications.unread_count) - else - #{current_member.login_name} + = t('.current_memberlogin_name', :current_memberlogin_name => (current_member.login_name)) %b.caret %ul.dropdown-menu %li= link_to t('.profile'), member_path(current_member) @@ -75,11 +75,11 @@ %li= link_to t('.admin'), admin_path - %li= link_to "Sign out", destroy_member_session_path, :method => :delete + %li= link_to t('.sign_out'), destroy_member_session_path, :method => :delete - else - %li= link_to 'Sign in', new_member_session_path, :id => 'navbar-signin' - %li= link_to 'Sign up', new_member_registration_path, :id => 'navbar-signup' + %li= link_to t('.sign_in'), new_member_session_path, :id => 'navbar-signin' + %li= link_to t('.sign_up'), new_member_registration_path, :id => 'navbar-signup' - # anchor tag for accessibility link to skip the navigation menu diff --git a/app/views/layouts/_header.html.i18n-extractor.haml b/app/views/layouts/_header.html.i18n-extractor.haml new file mode 100644 index 000000000..5523e75fe --- /dev/null +++ b/app/views/layouts/_header.html.i18n-extractor.haml @@ -0,0 +1,78 @@ +.sr-only + =link_to t(".skip"), "#skipnav" +.navbar.navbar-default.navbar-fixed-top(role="navigation") + .container + .navbar-header + %button.navbar-toggle(data-target="#navbar-collapse" data-toggle="collapse") + %span.sr-only= t('.toggle_navigation') + %span.icon-bar + %span.icon-bar + %span.icon-bar + %a.navbar-brand(href=root_path) + = image_tag("growstuff-brand.png", :size => "200x50", :alt => ENV['GROWSTUFF_SITE_NAME']) + = form_tag crops_search_path, :method => :get, :id => 'navbar-search', :class => 'navbar-form pull-right' do + .input + = label_tag :term, "Search crop database:", :class => 'sr-only' + = text_field_tag 'term', nil, :class => 'search-query input-medium form-control', :placeholder => 'Search crops' + = submit_tag "Search", :class => 'btn sr-only' + + .navbar-collapse.collapse#navbar-collapse + %ul.nav.navbar-nav.pull-right + %li.dropdown< + %a.dropdown-toggle{'data-toggle' => 'dropdown', :href => crops_path} + = t('.crops') + %b.caret + %ul.dropdown-menu + %li= link_to t('.browse_crops'), crops_path + %li= link_to t('.seeds'), seeds_path + %li= link_to t('.plantings'), plantings_path + %li= link_to t('.harvests'), harvests_path + %li.dropdown< + %a.dropdown-toggle{'data-toggle' => 'dropdown', :href => members_path} + = t('.community') + %b.caret + %ul.dropdown-menu + %li= link_to t('.community_map'), places_path + %li= link_to t('.browse_members'), members_path + %li= link_to t('.posts'), posts_path + %li= link_to t('.forums'), forums_path + %li= link_to t('.support_growstuff'), shop_path + + - if member_signed_in? + %li.dropdown< + %a.dropdown-toggle{'data-toggle' => 'dropdown', :href => root_path} + - if current_member.notifications.unread_count > 0 + = t('.your_stuff', unread_count: current_member.notifications.unread_count) + - else + = t('.current_memberlogin_name', :current_memberlogin_name => (current_member.login_name)) + %b.caret + %ul.dropdown-menu + %li= link_to t('.profile'), member_path(current_member) + %li= link_to t('.gardens'), gardens_by_owner_path(:owner => current_member.slug) + %li= link_to t('.plantings'), plantings_by_owner_path(:owner => current_member.slug) + %li= link_to t('.harvest'), harvests_by_owner_path(:owner => current_member.slug) + %li= link_to t('.seeds'), seeds_by_owner_path(:owner => current_member.slug) + %li= link_to t('.posts'), posts_by_author_path(:author => current_member.slug) + %li= link_to t('.account'), orders_path + %li + - if current_member.notifications.unread_count > 0 + = link_to(t('.inbox_unread', unread_count: current_member.notifications.unread_count), notifications_path) + - else + = link_to(t('.inbox'), notifications_path) + - if current_member.has_role?(:crop_wrangler) || current_member.has_role?(:admin) + %li{:class => 'divider', :role => 'presentation'} + - if current_member.has_role?(:crop_wrangler) + %li= link_to t('.crop_wrangling'), wrangle_crops_path + - if current_member.has_role?(:admin) + %li= link_to t('.admin'), admin_path + + + %li= link_to t('.sign_out'), destroy_member_session_path, :method => :delete + + - else + %li= link_to t('.sign_in'), new_member_session_path, :id => 'navbar-signin' + %li= link_to t('.sign_up'), new_member_registration_path, :id => 'navbar-signup' + + +- # anchor tag for accessibility link to skip the navigation menu +%a{:name => 'skipnav'} diff --git a/config/locales/en.yml b/config/locales/en.yml index 2c73ad544..1acb4e35c 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -56,7 +56,9 @@ en: home: blurb: already_html: Or %{sign_in} if you already have an account - intro: "%{site_name} is a community of food gardeners. We're building an open source platform to help you learn about growing food, track what you plant and harvest, and swap seeds and produce with other gardeners near you." + intro: "%{site_name} is a community of food gardeners. We're building an open + source platform to help you learn about growing food, track what you plant + and harvest, and swap seeds and produce with other gardeners near you." perks: Join now for your free garden journal, seed sharing, forums, and more. sign_in_linktext: sign in sign_up: Sign up @@ -84,14 +86,24 @@ en: api_docs_linktext: API documentation buy_account_linktext: buying a paid account creative_commons_linktext: Creative Commons license - get_involved_body_html: We believe in collaboration, and work closely with our members and the wider food-growing community. Our team includes volunteers from all walks of life and all skill levels. To get involved, visit %{talk_link} or find more information on the %{wiki_link}. + get_involved_body_html: We believe in collaboration, and work closely with our + members and the wider food-growing community. Our team includes volunteers + from all walks of life and all skill levels. To get involved, visit %{talk_link} + or find more information on the %{wiki_link}. get_involved_title: Get Involved github_linktext: Github - open_data_body_html: We're building a database of crops, planting advice, seed sources, and other information that anyone can use for free, under a %{creative_commons_link}. You can use this data for research, to build apps, or for any purpose at all. Read more about our %{wiki_link} and %{api_docs_link}. + open_data_body_html: We're building a database of crops, planting advice, seed + sources, and other information that anyone can use for free, under a %{creative_commons_link}. + You can use this data for research, to build apps, or for any purpose at all. Read + more about our %{wiki_link} and %{api_docs_link}. open_data_title: Open Data and APIs - open_source_body_html: "%{site_name} is open source software, which means that we share this website's code for free with our community and the world. We believe that openness, sustainability, and social good go hand in hand. You can read more about %{why} or check out our code on %{github}." + open_source_body_html: "%{site_name} is open source software, which means that + we share this website's code for free with our community and the world. We + believe that openness, sustainability, and social good go hand in hand. You + can read more about %{why} or check out our code on %{github}." open_source_title: Open Source - support_body_html: Growstuff is independent, %{ad_free} and we have no outside investment. You can support our work by %{buy_account}. + support_body_html: Growstuff is independent, %{ad_free} and we have no outside + investment. You can support our work by %{buy_account}. support_title: Support Growstuff talk_linktext: Growstuff Talk why_linktext: why Growstuff is open source @@ -108,7 +120,8 @@ en: view_all: View all seeds stats: member_linktext: "%{count} members" - message_html: So far, %{member} have planted %{number_crops} %{number_plantings} in %{number_gardens}. + message_html: So far, %{member} have planted %{number_crops} %{number_plantings} + in %{number_gardens}. number_crops_linktext: "%{count} crops" number_gardens_linktext: "%{count} gardens" number_plantings_linktext: "%{count} times" @@ -132,6 +145,13 @@ en: skip: Skip navigation menu support_growstuff: Support Growstuff your_stuff: Your Stuff (%{unread_count}) + toggle_navigation: Toggle Navigation + crops: Crops + community: Community + current_memberlogin_name: '"%{current_memberlogin_name}"' + sign_out: Sign out + sign_in: Sign in + sign_up: Sign up members: index: title: "%{site_name} members" diff --git a/lib/tasks/i18n.rake b/lib/tasks/i18n.rake index 447f0a5d3..917cd73f6 100644 --- a/lib/tasks/i18n.rake +++ b/lib/tasks/i18n.rake @@ -1,6 +1,18 @@ namespace :i18n do - desc "sort all locale keys" - task normalize: :environment do + desc "sort all i18n locale keys" + task :normalize do `i18n-tasks normalize` end + + desc "translate haml strings into i18 en locale using haml-i18n-extractor" + task :extractor, [:haml_path] do |t, args| + require 'haml-i18n-extractor' + haml_path = args[:haml_path] + begin + translate = Haml::I18n::Extractor.new(haml_path) + translate.run + rescue Haml::I18n::Extractor::InvalidSyntax + puts "There was an error with #{haml_path}" + end + end end From 160c6efd04d2b2d54dc9913661869ee2991e9417 Mon Sep 17 00:00:00 2001 From: Jim Stallings Date: Sat, 26 Sep 2015 11:54:02 -0400 Subject: [PATCH 250/268] Remove example file, add documentation --- .../layouts/_header.html.i18n-extractor.haml | 78 ------------------- config/locales/README.md | 15 ++++ 2 files changed, 15 insertions(+), 78 deletions(-) delete mode 100644 app/views/layouts/_header.html.i18n-extractor.haml create mode 100644 config/locales/README.md diff --git a/app/views/layouts/_header.html.i18n-extractor.haml b/app/views/layouts/_header.html.i18n-extractor.haml deleted file mode 100644 index 5523e75fe..000000000 --- a/app/views/layouts/_header.html.i18n-extractor.haml +++ /dev/null @@ -1,78 +0,0 @@ -.sr-only - =link_to t(".skip"), "#skipnav" -.navbar.navbar-default.navbar-fixed-top(role="navigation") - .container - .navbar-header - %button.navbar-toggle(data-target="#navbar-collapse" data-toggle="collapse") - %span.sr-only= t('.toggle_navigation') - %span.icon-bar - %span.icon-bar - %span.icon-bar - %a.navbar-brand(href=root_path) - = image_tag("growstuff-brand.png", :size => "200x50", :alt => ENV['GROWSTUFF_SITE_NAME']) - = form_tag crops_search_path, :method => :get, :id => 'navbar-search', :class => 'navbar-form pull-right' do - .input - = label_tag :term, "Search crop database:", :class => 'sr-only' - = text_field_tag 'term', nil, :class => 'search-query input-medium form-control', :placeholder => 'Search crops' - = submit_tag "Search", :class => 'btn sr-only' - - .navbar-collapse.collapse#navbar-collapse - %ul.nav.navbar-nav.pull-right - %li.dropdown< - %a.dropdown-toggle{'data-toggle' => 'dropdown', :href => crops_path} - = t('.crops') - %b.caret - %ul.dropdown-menu - %li= link_to t('.browse_crops'), crops_path - %li= link_to t('.seeds'), seeds_path - %li= link_to t('.plantings'), plantings_path - %li= link_to t('.harvests'), harvests_path - %li.dropdown< - %a.dropdown-toggle{'data-toggle' => 'dropdown', :href => members_path} - = t('.community') - %b.caret - %ul.dropdown-menu - %li= link_to t('.community_map'), places_path - %li= link_to t('.browse_members'), members_path - %li= link_to t('.posts'), posts_path - %li= link_to t('.forums'), forums_path - %li= link_to t('.support_growstuff'), shop_path - - - if member_signed_in? - %li.dropdown< - %a.dropdown-toggle{'data-toggle' => 'dropdown', :href => root_path} - - if current_member.notifications.unread_count > 0 - = t('.your_stuff', unread_count: current_member.notifications.unread_count) - - else - = t('.current_memberlogin_name', :current_memberlogin_name => (current_member.login_name)) - %b.caret - %ul.dropdown-menu - %li= link_to t('.profile'), member_path(current_member) - %li= link_to t('.gardens'), gardens_by_owner_path(:owner => current_member.slug) - %li= link_to t('.plantings'), plantings_by_owner_path(:owner => current_member.slug) - %li= link_to t('.harvest'), harvests_by_owner_path(:owner => current_member.slug) - %li= link_to t('.seeds'), seeds_by_owner_path(:owner => current_member.slug) - %li= link_to t('.posts'), posts_by_author_path(:author => current_member.slug) - %li= link_to t('.account'), orders_path - %li - - if current_member.notifications.unread_count > 0 - = link_to(t('.inbox_unread', unread_count: current_member.notifications.unread_count), notifications_path) - - else - = link_to(t('.inbox'), notifications_path) - - if current_member.has_role?(:crop_wrangler) || current_member.has_role?(:admin) - %li{:class => 'divider', :role => 'presentation'} - - if current_member.has_role?(:crop_wrangler) - %li= link_to t('.crop_wrangling'), wrangle_crops_path - - if current_member.has_role?(:admin) - %li= link_to t('.admin'), admin_path - - - %li= link_to t('.sign_out'), destroy_member_session_path, :method => :delete - - - else - %li= link_to t('.sign_in'), new_member_session_path, :id => 'navbar-signin' - %li= link_to t('.sign_up'), new_member_registration_path, :id => 'navbar-signup' - - -- # anchor tag for accessibility link to skip the navigation menu -%a{:name => 'skipnav'} diff --git a/config/locales/README.md b/config/locales/README.md new file mode 100644 index 000000000..5ce22aa89 --- /dev/null +++ b/config/locales/README.md @@ -0,0 +1,15 @@ +i18n Documentation +=================== + +i18n Automation +------------- +Automate string extraction from haml into locale files using [haml-i18n-extractor](https://github.com/shaiguitar/haml-i18n-extractor) + +```rake i18n:extractor[relative_path_to_view]``` + + +####Example +```rake i18n:extractor[app/views/layouts/_header.html.haml]``` + +* Creates app/views/layouts/_header.html.i18n-extractor.haml with the expected haml changes to localize app/views/layouts/_header.html.haml. After reviewing the changes, copy app/views/layouts/_header.html.i18n-extractor.haml to app/views/layouts/_header.html.haml +* Adds new keys to locales/en.yml From e939be05f86d270fd8d26dd468de652bb16c091a Mon Sep 17 00:00:00 2001 From: Jim Stallings Date: Sat, 26 Sep 2015 11:54:51 -0400 Subject: [PATCH 251/268] Add myself to contributors --- CONTRIBUTORS.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md index f4c22eccf..67c9b0b7c 100644 --- a/CONTRIBUTORS.md +++ b/CONTRIBUTORS.md @@ -72,3 +72,4 @@ submit the change with your pull request. - Charley Lewittes / [ctlewitt](https://github.com/ctlewitt) - Kristine Nicole Polvoriza / [polveenomials](https://github.com/polveenomials) - Brenda Wallace / [br3nda](https://github.com/br3nda) +- Jim Stallings / [jestallin](https://github.com/jestallin) From aa638b8a68c8af120581d2463067c86a4ec0639c Mon Sep 17 00:00:00 2001 From: Daniel O'Connor Date: Fri, 2 Dec 2016 15:41:35 +1030 Subject: [PATCH 252/268] Missed from merge --- Gemfile.lock | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index a3886ab62..425491475 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -204,17 +204,13 @@ GEM rspec (>= 2.99.0, < 4.0) haml (4.0.7) tilt -<<<<<<< HEAD - haml-rails (0.9.0) -======= haml-i18n-extractor (0.5.9) activesupport haml highline tilt trollop (= 1.16.2) - haml-rails (0.6.0) ->>>>>>> 2f561aaa473120cceb88be3be21fcc657cc7729e + haml-rails (0.9.0) actionpack (>= 4.0.1) activesupport (>= 4.0.1) haml (>= 4.0.6, < 5.0) @@ -468,14 +464,9 @@ GEM thor (0.19.3) thread (0.2.2) thread_safe (0.3.5) -<<<<<<< HEAD tilt (2.0.5) tins (1.13.0) -======= - tilt (1.4.1) - tins (1.3.3) trollop (1.16.2) ->>>>>>> 2f561aaa473120cceb88be3be21fcc657cc7729e tzinfo (1.2.2) thread_safe (~> 0.1) uglifier (2.7.2) From fa65be40a402966b5f7d99127ed38cc050e7ce34 Mon Sep 17 00:00:00 2001 From: Daniel O'Connor Date: Fri, 2 Dec 2016 15:51:29 +1030 Subject: [PATCH 253/268] lib/tasks/i18n.rake:8:37: W: Lint/UnusedBlockArgument: Unused block argument - t. If it's necessary, use _ or _t as an argument name to indicate that it won't be used. --- lib/tasks/i18n.rake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/tasks/i18n.rake b/lib/tasks/i18n.rake index 917cd73f6..04fa8001b 100644 --- a/lib/tasks/i18n.rake +++ b/lib/tasks/i18n.rake @@ -5,7 +5,7 @@ namespace :i18n do end desc "translate haml strings into i18 en locale using haml-i18n-extractor" - task :extractor, [:haml_path] do |t, args| + task :extractor, [:haml_path] do |_t, args| require 'haml-i18n-extractor' haml_path = args[:haml_path] begin From 7aaf6ea2ece102ec3e1be827d2a6164cadef7f0c Mon Sep 17 00:00:00 2001 From: Brenda Wallace Date: Fri, 2 Dec 2016 20:21:41 +1300 Subject: [PATCH 254/268] Revert "Changed phantomjs url to project official" This reverts commit 7fcd3cba8d1471b4c3a7a50ad35eac63590764ae. --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 5f2219acd..901cab8fe 100644 --- a/.travis.yml +++ b/.travis.yml @@ -16,7 +16,7 @@ before_install: - export PATH=$PWD/travis_phantomjs/phantomjs-2.1.1-linux-x86_64/bin:$PATH - > if [ $(phantomjs --version) != '2.1.1' ]; then - PHANTOM_URL=https://bitbucket.org/ariya/phantomjs/downloads/phantomjs-2.1.1-linux-x86_64.tar.bz2; + PHANTOM_URL=https://assets.membergetmember.co/software/phantomjs-2.1.1-linux-x86_64.tar.bz2; rm -rf $PWD/travis_phantomjs; mkdir -p $PWD/travis_phantomjs; wget $PHANTOM_URL -O $PWD/travis_phantomjs/phantomjs-2.1.1-linux-x86_64.tar.bz2; From 0c2a60ecc3361ada06ac50fec7cad6525109f879 Mon Sep 17 00:00:00 2001 From: Shiny Date: Sat, 3 Dec 2016 02:06:53 +1300 Subject: [PATCH 255/268] Reduce max AbcSize to 38 (#1112) Reduce how complex methods are allowed to be, according to our code checker, so we're forced to write readable code --- .rubocop.yml | 2 +- app/models/ability.rb | 2 +- db/migrate/20150201052245_create_cms.rb | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.rubocop.yml b/.rubocop.yml index 2631b0f0d..74b45768d 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -34,7 +34,7 @@ Metrics/MethodLength: # Remove the following once the code style matches # Offense count: 59 Metrics/AbcSize: - Max: 115 + Max: 38 # Offense count: 5 # Configuration parameters: CountComments. diff --git a/app/models/ability.rb b/app/models/ability.rb index 4ce056438..9085d7962 100644 --- a/app/models/ability.rb +++ b/app/models/ability.rb @@ -1,7 +1,7 @@ class Ability include CanCan::Ability - def initialize(member) + def initialize(member) # rubocop:disable Metrics/AbcSize # See the wiki for details: https://github.com/ryanb/cancan/wiki/Defining-Abilities # everyone can do these things, even non-logged in diff --git a/db/migrate/20150201052245_create_cms.rb b/db/migrate/20150201052245_create_cms.rb index 2a187e66f..3e3101df0 100644 --- a/db/migrate/20150201052245_create_cms.rb +++ b/db/migrate/20150201052245_create_cms.rb @@ -1,5 +1,5 @@ class CreateCms < ActiveRecord::Migration - def self.up # rubocop:disable Metrics/MethodLength + def self.up # rubocop:disable Metrics/MethodLength, Metrics/AbcSize text_limit = case ActiveRecord::Base.connection.adapter_name when 'PostgreSQL' {} From c201200e9bd9fbc021824fb20c70767c60b2d48e Mon Sep 17 00:00:00 2001 From: Mackenzie Morgan Date: Fri, 2 Dec 2016 23:17:01 -0500 Subject: [PATCH 256/268] correct schema and add index for photos_seeds --- db/migrate/20161201154922_add_photos_seeds_table.rb | 1 + db/schema.rb | 10 ++-------- 2 files changed, 3 insertions(+), 8 deletions(-) diff --git a/db/migrate/20161201154922_add_photos_seeds_table.rb b/db/migrate/20161201154922_add_photos_seeds_table.rb index 12605ae4c..31693d225 100644 --- a/db/migrate/20161201154922_add_photos_seeds_table.rb +++ b/db/migrate/20161201154922_add_photos_seeds_table.rb @@ -4,5 +4,6 @@ class AddPhotosSeedsTable < ActiveRecord::Migration t.integer :photo_id t.integer :seed_id end + add_index(:photos_seeds, [:seed_id, :photo_id]) end end diff --git a/db/schema.rb b/db/schema.rb index 4901b8499..429fabf04 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -355,14 +355,6 @@ ActiveRecord::Schema.define(version: 20161201154922) do t.integer "product_id" end - create_table "photo_mappings", force: :cascade do |t| - t.integer "photo_id" - t.integer "object_id" - t.string "object_type" - end - - add_index "photo_mappings", ["object_id", "photo_id"], name: "index_photo_mappings_on_object_id_and_photo_id", using: :btree - create_table "photos", force: :cascade do |t| t.integer "owner_id", null: false t.string "thumbnail_url", null: false @@ -386,6 +378,8 @@ ActiveRecord::Schema.define(version: 20161201154922) do t.integer "seed_id" end + add_index "photos_seeds", ["seed_id", "photo_id"], name: "index_photos_seeds_on_seed_id_and_photo_id", using: :btree + create_table "plant_parts", force: :cascade do |t| t.string "name" t.datetime "created_at" From 92195d51d293f590a3d613db469619b4d0efc556 Mon Sep 17 00:00:00 2001 From: Brenda Wallace Date: Sun, 4 Dec 2016 21:21:35 +0000 Subject: [PATCH 257/268] Removed redundant returns --- .rubocop_todo.yml | 26 ------------------- app/helpers/application_helper.rb | 6 ++--- app/helpers/harvests_helper.rb | 10 +++---- app/helpers/plantings_helper.rb | 8 +++--- app/mailers/notifier.rb | 2 +- app/models/account.rb | 4 +-- app/models/crop.rb | 14 +++++----- app/models/forum.rb | 2 +- app/models/garden.rb | 4 +-- app/models/harvest.rb | 4 +-- app/models/member.rb | 20 +++++++------- app/models/order.rb | 6 ++--- app/models/photo.rb | 2 +- app/models/plant_part.rb | 4 +-- app/models/planting.rb | 8 +++--- app/models/seed.rb | 8 +++--- lib/haml/filters/escaped_markdown.rb | 2 +- lib/haml/filters/growstuff_markdown.rb | 2 +- spec/controllers/accounts_controller_spec.rb | 2 +- .../haml/filters/growstuff_markdown_spec.rb | 4 +-- spec/views/devise/shared/_links_spec.rb | 2 +- 21 files changed, 55 insertions(+), 85 deletions(-) diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml index 69c0c397d..cb0b978f6 100644 --- a/.rubocop_todo.yml +++ b/.rubocop_todo.yml @@ -612,32 +612,6 @@ Style/RedundantParentheses: - 'app/helpers/plantings_helper.rb' - 'app/models/garden.rb' -# Offense count: 62 -# Cop supports --auto-correct. -# Configuration parameters: AllowMultipleReturnValues. -Style/RedundantReturn: - Exclude: - - 'app/helpers/application_helper.rb' - - 'app/helpers/harvests_helper.rb' - - 'app/helpers/plantings_helper.rb' - - 'app/mailers/notifier.rb' - - 'app/models/account.rb' - - 'app/models/crop.rb' - - 'app/models/forum.rb' - - 'app/models/garden.rb' - - 'app/models/harvest.rb' - - 'app/models/member.rb' - - 'app/models/order.rb' - - 'app/models/photo.rb' - - 'app/models/plant_part.rb' - - 'app/models/planting.rb' - - 'app/models/seed.rb' - - 'lib/haml/filters/escaped_markdown.rb' - - 'lib/haml/filters/growstuff_markdown.rb' - - 'spec/controllers/accounts_controller_spec.rb' - - 'spec/lib/haml/filters/growstuff_markdown_spec.rb' - - 'spec/views/devise/shared/_links_spec.rb' - # Offense count: 56 # Cop supports --auto-correct. Style/RedundantSelf: diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 0aa552bdf..1262c359f 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -1,17 +1,17 @@ module ApplicationHelper def price_in_dollars(price) - return sprintf('%.2f', price / 100.0) + sprintf('%.2f', price / 100.0) end # 999 cents becomes 9.99 AUD -- for products/orders/etc def price_with_currency(price) - return sprintf('%.2f %s', price / 100.0, + sprintf('%.2f %s', price / 100.0, Growstuff::Application.config.currency) end def parse_date(str) str ||= '' # Date.parse barfs on nil - return str == '' ? nil : Date.parse(str) + str == '' ? nil : Date.parse(str) end def forex_link(price) diff --git a/app/helpers/harvests_helper.rb b/app/helpers/harvests_helper.rb index d848d919f..9573fcaf0 100644 --- a/app/helpers/harvests_helper.rb +++ b/app/helpers/harvests_helper.rb @@ -19,20 +19,16 @@ module HarvestsHelper if harvest.unit == 'individual' # just the number number_to_human(harvest.quantity, strip_insignificant_zeros: true) elsif !harvest.unit.blank? # pluralize anything else - return pluralize(number_to_human(harvest.quantity, strip_insignificant_zeros: true), harvest.unit) + pluralize(number_to_human(harvest.quantity, strip_insignificant_zeros: true), harvest.unit) else - return "#{number_to_human(harvest.quantity, strip_insignificant_zeros: true)} #{harvest.unit}" + "#{number_to_human(harvest.quantity, strip_insignificant_zeros: true)} #{harvest.unit}" end - else - return nil end end def display_weight(harvest) if !harvest.weight_quantity.blank? && harvest.weight_quantity > 0 - return "#{number_to_human(harvest.weight_quantity, strip_insignificant_zeros: true)} #{harvest.weight_unit}" - else - return nil + "#{number_to_human(harvest.weight_quantity, strip_insignificant_zeros: true)} #{harvest.weight_unit}" end end diff --git a/app/helpers/plantings_helper.rb b/app/helpers/plantings_helper.rb index f4d8d45be..15f756ace 100644 --- a/app/helpers/plantings_helper.rb +++ b/app/helpers/plantings_helper.rb @@ -31,13 +31,13 @@ module PlantingsHelper def display_planting(planting) if planting.quantity.to_i > 0 && planting.planted_from.present? - return "#{planting.owner} planted #{pluralize(planting.quantity, planting.planted_from)}." + "#{planting.owner} planted #{pluralize(planting.quantity, planting.planted_from)}." elsif planting.quantity.to_i > 0 - return "#{planting.owner} planted #{pluralize(planting.quantity, 'unit')}." + "#{planting.owner} planted #{pluralize(planting.quantity, 'unit')}." elsif planting.planted_from.present? - return "#{planting.owner} planted #{planting.planted_from.pluralize}." + "#{planting.owner} planted #{planting.planted_from.pluralize}." else - return "#{planting.owner}." + "#{planting.owner}." end end end diff --git a/app/mailers/notifier.rb b/app/mailers/notifier.rb index 281f0b6ee..69f88ba7e 100644 --- a/app/mailers/notifier.rb +++ b/app/mailers/notifier.rb @@ -8,7 +8,7 @@ class Notifier < ActionMailer::Base "not set - have you created config/application.yml?" end - return ActiveSupport::MessageVerifier.new(ENV['RAILS_SECRET_TOKEN']) + ActiveSupport::MessageVerifier.new(ENV['RAILS_SECRET_TOKEN']) end def notify(notification) diff --git a/app/models/account.rb b/app/models/account.rb index 449697e05..1dd914d62 100644 --- a/app/models/account.rb +++ b/app/models/account.rb @@ -16,9 +16,9 @@ class Account < ActiveRecord::Base def paid_until_string if account_type.is_permanent_paid - return "forever" + "forever" elsif account_type.is_paid - return paid_until.to_s + paid_until.to_s end end end diff --git a/app/models/crop.rb b/app/models/crop.rb index f803cfecf..2fc9a6ad1 100644 --- a/app/models/crop.rb +++ b/app/models/crop.rb @@ -172,7 +172,7 @@ class Crop < ActiveRecord::Base # rubocop:disable Metrics/ClassLength popular_plant_parts[h.plant_part] += 1 end end - return popular_plant_parts + popular_plant_parts end def interesting? @@ -180,7 +180,7 @@ class Crop < ActiveRecord::Base # rubocop:disable Metrics/ClassLength min_photos = 3 # needs this many photos to be interesting return false unless photos.size >= min_photos return false unless plantings_count >= min_plantings - return true + true end def pending? @@ -213,7 +213,7 @@ class Crop < ActiveRecord::Base # rubocop:disable Metrics/ClassLength next unless c.interesting? interesting_crops.push(c) end - return interesting_crops + interesting_crops end # Crop.create_from_csv(row) @@ -281,9 +281,9 @@ class Crop < ActiveRecord::Base # rubocop:disable Metrics/ClassLength def rejection_explanation if reason_for_rejection == "other" - return rejection_notes + rejection_notes else - return reason_for_rejection + reason_for_rejection end end @@ -309,7 +309,7 @@ class Crop < ActiveRecord::Base # rubocop:disable Metrics/ClassLength size: 50 } ) - return response.records.to_a + response.records.to_a else # if we don't have elasticsearch, just do a basic SQL query. # also, make sure it's an actual array not an activerecord @@ -326,7 +326,7 @@ class Crop < ActiveRecord::Base # rubocop:disable Metrics/ClassLength matches.unshift(exact_match) end - return matches + matches end end diff --git a/app/models/forum.rb b/app/models/forum.rb index 810653d7c..42bf1800e 100644 --- a/app/models/forum.rb +++ b/app/models/forum.rb @@ -6,6 +6,6 @@ class Forum < ActiveRecord::Base belongs_to :owner, class_name: "Member" def to_s - return name + name end end diff --git a/app/models/garden.rb b/app/models/garden.rb index 9f58ac0ab..8f4e73678 100644 --- a/app/models/garden.rb +++ b/app/models/garden.rb @@ -72,7 +72,7 @@ class Garden < ActiveRecord::Base end end - return unique_plantings[0..3] + unique_plantings[0..3] end def to_s @@ -91,6 +91,6 @@ class Garden < ActiveRecord::Base end def default_photo - return photos.first + photos.first end end diff --git a/app/models/harvest.rb b/app/models/harvest.rb index e7304802a..3c5b3ac96 100644 --- a/app/models/harvest.rb +++ b/app/models/harvest.rb @@ -117,10 +117,10 @@ class Harvest < ActiveRecord::Base " #{self.weight_unit}" end - return string + string end def default_photo - return photos.first || crop.default_photo + photos.first || crop.default_photo end end diff --git a/app/models/member.rb b/app/models/member.rb index d79a6994f..931a73402 100644 --- a/app/models/member.rb +++ b/app/models/member.rb @@ -99,7 +99,7 @@ class Member < ActiveRecord::Base end def to_s - return login_name + login_name end def has_role?(role_sym) @@ -128,16 +128,16 @@ class Member < ActiveRecord::Base def is_paid? if account.account_type.is_permanent_paid - return true + true elsif account.account_type.is_paid && account.paid_until >= Time.zone.now - return true + true else - return false + false end end def auth(provider) - return authentications.find_by(provider: provider) + authentications.find_by(provider: provider) end # Authenticates against Flickr and returns an object we can use for subsequent api calls @@ -152,7 +152,7 @@ class Member < ActiveRecord::Base @flickr.access_secret = flickr_auth.secret end end - return @flickr + @flickr end # Fetches a collection of photos from Flickr @@ -185,7 +185,7 @@ class Member < ActiveRecord::Base flickr.photosets.getList.each do |p| sets[p.title] = p.id end - return sets + sets end def interesting? @@ -193,7 +193,7 @@ class Member < ActiveRecord::Base # Member.confirmed.located as those are required for # interestingness, as well. return true if plantings.present? - return false + false end def Member.login_name_or_email(login) @@ -213,7 +213,7 @@ class Member < ActiveRecord::Base interesting_members.push(m) end end - return interesting_members + interesting_members end def Member.nearest_to(place) @@ -224,7 +224,7 @@ class Member < ActiveRecord::Base nearby_members = Member.located.sort_by { |x| x.distance_from([latitude, longitude]) } end end - return nearby_members + nearby_members end def update_newsletter_subscription diff --git a/app/models/order.rb b/app/models/order.rb index b363f9b71..81caa7f8e 100644 --- a/app/models/order.rb +++ b/app/models/order.rb @@ -21,7 +21,7 @@ class Order < ActiveRecord::Base subtotal = i.price * i.quantity sum += subtotal end - return sum + sum end # return items in the format ActiveMerchant/PayPal want them @@ -34,7 +34,7 @@ class Order < ActiveRecord::Base amount: i.price }) end - return items + items end # record the paypal details for reference @@ -92,6 +92,6 @@ class Order < ActiveRecord::Base return Order.where(referral_code: args[:for].upcase) end end - return [] + [] end end diff --git a/app/models/photo.rb b/app/models/photo.rb index d1b0cd51c..5785ac6f0 100644 --- a/app/models/photo.rb +++ b/app/models/photo.rb @@ -28,7 +28,7 @@ class Photo < ActiveRecord::Base info = flickr.photos.getInfo(photo_id: flickr_photo_id) licenses = flickr.photos.licenses.getInfo() license = licenses.find { |l| l.id == info.license } - return { + { title: info.title || "Untitled", license_name: license.name, license_url: license.url, diff --git a/app/models/plant_part.rb b/app/models/plant_part.rb index 16f23822a..fdf1d69e6 100644 --- a/app/models/plant_part.rb +++ b/app/models/plant_part.rb @@ -6,7 +6,7 @@ class PlantPart < ActiveRecord::Base has_many :crops, -> { uniq }, through: :harvests def to_s - return name + name end # Postgres complains if the ORDER BY clause of a SELECT DISTINCT query is @@ -18,6 +18,6 @@ class PlantPart < ActiveRecord::Base # associated to plant parts will not be sorted in the same order as crops # on the rest of the site. def crops - return super.reorder('name') + super.reorder('name') end end diff --git a/app/models/planting.rb b/app/models/planting.rb index 6e869be33..52c2d5463 100644 --- a/app/models/planting.rb +++ b/app/models/planting.rb @@ -68,7 +68,7 @@ class Planting < ActiveRecord::Base # location = garden owner + garden name, i.e. "Skud's backyard" def location - return "#{garden.owner.login_name}'s #{garden}" + "#{garden.owner.login_name}'s #{garden}" end # stringify as "beet in Skud's backyard" or similar @@ -77,11 +77,11 @@ class Planting < ActiveRecord::Base end def default_photo - return photos.first + photos.first end def interesting? - return photos.present? + photos.present? end def calculate_days_before_maturity(planting, crop) @@ -136,6 +136,6 @@ class Planting < ActiveRecord::Base interesting_plantings.push(p) end - return interesting_plantings + interesting_plantings end end diff --git a/app/models/seed.rb b/app/models/seed.rb index 02a36fe3a..6f441964a 100644 --- a/app/models/seed.rb +++ b/app/models/seed.rb @@ -66,9 +66,9 @@ class Seed < ActiveRecord::Base def tradable? if self.tradable_to == 'nowhere' - return false + false else - return true + true end end @@ -76,7 +76,7 @@ class Seed < ActiveRecord::Base # assuming we're passed something that's already known to be tradable # eg. from Seed.tradable scope return false if owner.location.blank? # don't want unspecified locations - return true + true end # Seed.interesting @@ -92,7 +92,7 @@ class Seed < ActiveRecord::Base end end - return interesting_seeds + interesting_seeds end def seed_slug diff --git a/lib/haml/filters/escaped_markdown.rb b/lib/haml/filters/escaped_markdown.rb index 1986b905d..86345b5a2 100644 --- a/lib/haml/filters/escaped_markdown.rb +++ b/lib/haml/filters/escaped_markdown.rb @@ -5,7 +5,7 @@ module Haml::Filters module EscapedMarkdown include Haml::Filters::Base def render(text) - return Haml::Helpers.html_escape Haml::Filters::GrowstuffMarkdown.render(text) + Haml::Helpers.html_escape Haml::Filters::GrowstuffMarkdown.render(text) end end diff --git a/lib/haml/filters/growstuff_markdown.rb b/lib/haml/filters/growstuff_markdown.rb index 28e6b2543..e03e8c306 100644 --- a/lib/haml/filters/growstuff_markdown.rb +++ b/lib/haml/filters/growstuff_markdown.rb @@ -50,7 +50,7 @@ module Haml::Filters expanded = expanded.gsub(MEMBER_ESCAPE_AT_REGEX, "") - return BlueCloth.new(expanded).to_html + BlueCloth.new(expanded).to_html end end diff --git a/spec/controllers/accounts_controller_spec.rb b/spec/controllers/accounts_controller_spec.rb index da21a1ba3..66375b292 100644 --- a/spec/controllers/accounts_controller_spec.rb +++ b/spec/controllers/accounts_controller_spec.rb @@ -25,6 +25,6 @@ describe AccountsController do # allowed. This method has been left here in case it's useful in # future. member = FactoryGirl.create(:member) - return member.account + member.account end end diff --git a/spec/lib/haml/filters/growstuff_markdown_spec.rb b/spec/lib/haml/filters/growstuff_markdown_spec.rb index debce3111..3ee3102f4 100644 --- a/spec/lib/haml/filters/growstuff_markdown_spec.rb +++ b/spec/lib/haml/filters/growstuff_markdown_spec.rb @@ -3,7 +3,7 @@ require 'haml/filters' require 'haml/filters/growstuff_markdown' def input_link(name) - return "[#{name}](crop)" + "[#{name}](crop)" end def output_link(crop, name = nil) @@ -16,7 +16,7 @@ def output_link(crop, name = nil) end def input_member_link(name) - return "[#{name}](member)" + "[#{name}](member)" end def output_member_link(member, name = nil) diff --git a/spec/views/devise/shared/_links_spec.rb b/spec/views/devise/shared/_links_spec.rb index c567339d6..39147113f 100644 --- a/spec/views/devise/shared/_links_spec.rb +++ b/spec/views/devise/shared/_links_spec.rb @@ -6,7 +6,7 @@ describe 'devise/shared/_links.haml', type: "view" do dm.stub(confirmable?: confirm) dm.stub(lockable?: lock) dm.stub(omniauthable?: oauth) - return dm + dm end it 'should have a sign-in link if not in sessions' do From 26e5a414cfc341e6dbda08107871b537a7093f86 Mon Sep 17 00:00:00 2001 From: Brenda Wallace Date: Sun, 4 Dec 2016 21:23:33 +0000 Subject: [PATCH 258/268] Line no longer needs wrapping --- app/helpers/application_helper.rb | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 1262c359f..f66dfe03f 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -5,8 +5,7 @@ module ApplicationHelper # 999 cents becomes 9.99 AUD -- for products/orders/etc def price_with_currency(price) - sprintf('%.2f %s', price / 100.0, - Growstuff::Application.config.currency) + sprintf('%.2f %s', price / 100.0, Growstuff::Application.config.currency) end def parse_date(str) From 91b0c1898e009db19ff54f5e4a19e1179f86157d Mon Sep 17 00:00:00 2001 From: Brenda Wallace Date: Mon, 5 Dec 2016 03:10:22 +0000 Subject: [PATCH 259/268] Simplifying display_harvest_description --- app/helpers/harvests_helper.rb | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/app/helpers/harvests_helper.rb b/app/helpers/harvests_helper.rb index 9573fcaf0..afa135b5e 100644 --- a/app/helpers/harvests_helper.rb +++ b/app/helpers/harvests_helper.rb @@ -33,10 +33,7 @@ module HarvestsHelper end def display_harvest_description(harvest) - if harvest.description.empty? - "No description provided." - else - harvest.description - end + return "No description provided." if harvest.description.empty? + harvest.description end end From 8981a222ea54665d59b7eea482e3f3c9e21d7ee0 Mon Sep 17 00:00:00 2001 From: Brenda Wallace Date: Tue, 6 Dec 2016 00:32:20 +0000 Subject: [PATCH 260/268] Simplified display_weight --- app/helpers/harvests_helper.rb | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/app/helpers/harvests_helper.rb b/app/helpers/harvests_helper.rb index afa135b5e..67f668804 100644 --- a/app/helpers/harvests_helper.rb +++ b/app/helpers/harvests_helper.rb @@ -27,9 +27,8 @@ module HarvestsHelper end def display_weight(harvest) - if !harvest.weight_quantity.blank? && harvest.weight_quantity > 0 - "#{number_to_human(harvest.weight_quantity, strip_insignificant_zeros: true)} #{harvest.weight_unit}" - end + return if harvest.weight_quantity.blank? || harvest.weight_quantity <= 0 + "#{number_to_human(harvest.weight_quantity, strip_insignificant_zeros: true)} #{harvest.weight_unit}" end def display_harvest_description(harvest) From 4c6f0fc929adc9afa87b025d3166d99a8510a502 Mon Sep 17 00:00:00 2001 From: Brenda Wallace Date: Tue, 6 Dec 2016 21:09:39 +1300 Subject: [PATCH 261/268] Fixed AmbiguousOperator --- .rubocop_todo.yml | 5 ----- spec/factories/member.rb | 4 ++-- 2 files changed, 2 insertions(+), 7 deletions(-) diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml index cb0b978f6..80feefc90 100644 --- a/.rubocop_todo.yml +++ b/.rubocop_todo.yml @@ -6,11 +6,6 @@ # Note that changes in the inspected code, or installation of new # versions of RuboCop, may require this file to be generated again. -# Offense count: 2 -Lint/AmbiguousOperator: - Exclude: - - 'spec/factories/member.rb' - # Offense count: 24 Lint/AmbiguousRegexpLiteral: Exclude: diff --git a/spec/factories/member.rb b/spec/factories/member.rb index 7fb02594b..0888edabb 100644 --- a/spec/factories/member.rb +++ b/spec/factories/member.rb @@ -49,13 +49,13 @@ FactoryGirl.define do factory :edinburgh_member do location 'Edinburgh' latitude 55.953252 - longitude -3.188267 + longitude { -3.188267 } end factory :south_pole_member do sequence(:login_name) { |n| "ScottRF#{n}" } location 'Amundsen-Scott Base, Antarctica' - latitude -90 + latitude { -90 } longitude 0 end From abc5ac5f29387915379f96832b6fafb4851d93fc Mon Sep 17 00:00:00 2001 From: Brenda Wallace Date: Tue, 6 Dec 2016 21:18:13 +1300 Subject: [PATCH 262/268] Don't use assignments in conditions --- .rubocop_todo.yml | 6 ------ app/models/member.rb | 8 +++----- 2 files changed, 3 insertions(+), 11 deletions(-) diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml index cb0b978f6..ba60a33d0 100644 --- a/.rubocop_todo.yml +++ b/.rubocop_todo.yml @@ -26,12 +26,6 @@ Lint/AmbiguousRegexpLiteral: - 'spec/views/members/show.rss.haml_spec.rb' - 'spec/views/posts/show.html.haml_spec.rb' -# Offense count: 1 -# Configuration parameters: AllowSafeAssignment. -Lint/AssignmentInCondition: - Exclude: - - 'app/models/member.rb' - # Offense count: 1 Lint/HandleExceptions: Exclude: diff --git a/app/models/member.rb b/app/models/member.rb index 931a73402..598507063 100644 --- a/app/models/member.rb +++ b/app/models/member.rb @@ -91,11 +91,9 @@ class Member < ActiveRecord::Base # allow login via either login_name or email address def self.find_first_by_auth_conditions(warden_conditions) conditions = warden_conditions.dup - if login = conditions.delete(:login) - where(conditions).login_name_or_email(login).first - else - find_by(conditions) - end + login = conditions.delete(:login) + return where(conditions).login_name_or_email(login).first if login + find_by(conditions) end def to_s From 464c570d99c2fe48939515dbc71784871bb846fc Mon Sep 17 00:00:00 2001 From: Brenda Wallace Date: Tue, 6 Dec 2016 21:23:55 +1300 Subject: [PATCH 263/268] Fixed parentheses that are interp-ed as grouped expression --- .rubocop_todo.yml | 9 --------- app/mailers/notifier.rb | 4 ++-- spec/features/harvests/browse_harvests_spec.rb | 4 ++-- spec/models/follow_spec.rb | 2 +- spec/models/member_spec.rb | 4 ++-- spec/views/plantings/show.html.haml_spec.rb | 2 +- 6 files changed, 8 insertions(+), 17 deletions(-) diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml index cb0b978f6..2b9bfe57b 100644 --- a/.rubocop_todo.yml +++ b/.rubocop_todo.yml @@ -37,15 +37,6 @@ Lint/HandleExceptions: Exclude: - 'lib/tasks/testing.rake' -# Offense count: 8 -Lint/ParenthesesAsGroupedExpression: - Exclude: - - 'app/mailers/notifier.rb' - - 'spec/features/harvests/browse_harvests_spec.rb' - - 'spec/models/follow_spec.rb' - - 'spec/models/member_spec.rb' - - 'spec/views/plantings/show.html.haml_spec.rb' - # Offense count: 15 # Cop supports --auto-correct. # Configuration parameters: IgnoreEmptyBlocks, AllowUnusedKeywordArguments. diff --git a/app/mailers/notifier.rb b/app/mailers/notifier.rb index 69f88ba7e..89a174c52 100644 --- a/app/mailers/notifier.rb +++ b/app/mailers/notifier.rb @@ -16,7 +16,7 @@ class Notifier < ActionMailer::Base @reply_link = reply_link(@notification) # Encrypting - @signed_message = verifier.generate ({ member_id: @notification.recipient.id, type: :send_notification_email }) + @signed_message = verifier.generate(member_id: @notification.recipient.id, type: :send_notification_email) mail(to: @notification.recipient.email, subject: @notification.subject) @@ -29,7 +29,7 @@ class Notifier < ActionMailer::Base @harvests = @member.harvests.first(5) # Encrypting - @signed_message = verifier.generate ({ member_id: @member.id, type: :send_planting_reminder }) + @signed_message = verifier.generate(member_id: @member.id, type: :send_planting_reminder) if @member.send_planting_reminder mail(to: @member.email, diff --git a/spec/features/harvests/browse_harvests_spec.rb b/spec/features/harvests/browse_harvests_spec.rb index d103ec3c9..2a8400c2e 100644 --- a/spec/features/harvests/browse_harvests_spec.rb +++ b/spec/features/harvests/browse_harvests_spec.rb @@ -11,7 +11,7 @@ feature "browse harvests" do feature 'blank optional fields' do let!(:harvest) { create :harvest, :no_description } - before (:each) do + before(:each) do visit harvests_path end @@ -23,7 +23,7 @@ feature "browse harvests" do feature "filled in optional fields" do let!(:harvest) { create :harvest, :long_description } - before (:each) do + before(:each) do visit harvests_path end diff --git a/spec/models/follow_spec.rb b/spec/models/follow_spec.rb index 2fd0b6b80..95b82d8a8 100644 --- a/spec/models/follow_spec.rb +++ b/spec/models/follow_spec.rb @@ -20,7 +20,7 @@ describe Follow do end context "when follow is created" do - before (:each) do + before(:each) do @follow = Follow.create(follower_id: @member1.id, followed_id: @member2.id) end diff --git a/spec/models/member_spec.rb b/spec/models/member_spec.rb index 19e0a9568..d5c9fb9b1 100644 --- a/spec/models/member_spec.rb +++ b/spec/models/member_spec.rb @@ -354,11 +354,11 @@ describe 'member' do member.update_account_after_purchase(product) # stringify to avoid millisecond problems... - member.account.paid_until.to_s.should eq (Time.zone.now + 3.months).to_s + member.account.paid_until.to_s.should eq((Time.zone.now + 3.months).to_s) # and again to make sure it works for currently paid accounts member.update_account_after_purchase(product) - member.account.paid_until.to_s.should eq (Time.zone.now + 3.months + 3.months).to_s + member.account.paid_until.to_s.should eq((Time.zone.now + 3.months + 3.months).to_s) end end diff --git a/spec/views/plantings/show.html.haml_spec.rb b/spec/views/plantings/show.html.haml_spec.rb index e89d6bb92..f6136f8f6 100644 --- a/spec/views/plantings/show.html.haml_spec.rb +++ b/spec/views/plantings/show.html.haml_spec.rb @@ -22,7 +22,7 @@ describe "plantings/show" do ) end - before (:each) do + before(:each) do @member = FactoryGirl.create(:member) controller.stub(:current_user) { @member } @p = create_planting_for(@member) From a7bafafa06a99842bd49639cd4bfa0fcf08f5428 Mon Sep 17 00:00:00 2001 From: Brenda Wallace Date: Tue, 6 Dec 2016 21:58:17 +1300 Subject: [PATCH 264/268] Yet another wikipedia url char added to regex --- app/models/crop.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/models/crop.rb b/app/models/crop.rb index 2fc9a6ad1..8d14f981c 100644 --- a/app/models/crop.rb +++ b/app/models/crop.rb @@ -42,7 +42,7 @@ class Crop < ActiveRecord::Base # rubocop:disable Metrics/ClassLength ## Wikipedia urls are only necessary when approving a crop validates :en_wikipedia_url, format: { - with: /\Ahttps?:\/\/en\.wikipedia\.org\/wiki\/[[:alnum:]%_()-]+\z/, + with: /\Ahttps?:\/\/en\.wikipedia\.org\/wiki\/[[:alnum:]%_\.()-]+\z/, message: 'is not a valid English Wikipedia URL' }, if: :approved? From 05e7a277823765af0d7fa3247d45d5071e179a19 Mon Sep 17 00:00:00 2001 From: Brenda Wallace Date: Wed, 7 Dec 2016 10:02:02 +1300 Subject: [PATCH 265/268] Call to verify options stays as a hash --- app/mailers/notifier.rb | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/app/mailers/notifier.rb b/app/mailers/notifier.rb index 89a174c52..e97fedcda 100644 --- a/app/mailers/notifier.rb +++ b/app/mailers/notifier.rb @@ -16,7 +16,8 @@ class Notifier < ActionMailer::Base @reply_link = reply_link(@notification) # Encrypting - @signed_message = verifier.generate(member_id: @notification.recipient.id, type: :send_notification_email) + message = { member_id: @notification.recipient.id, type: :send_notification_email } + @signed_message = verifier.generate(message) mail(to: @notification.recipient.email, subject: @notification.subject) @@ -29,7 +30,8 @@ class Notifier < ActionMailer::Base @harvests = @member.harvests.first(5) # Encrypting - @signed_message = verifier.generate(member_id: @member.id, type: :send_planting_reminder) + message = { member_id: @member.id, type: :send_planting_reminder } + @signed_message = verifier.generate(message) if @member.send_planting_reminder mail(to: @member.email, From e695d5646a53cfcd0748cb0e38883b63c4dcb138 Mon Sep 17 00:00:00 2001 From: Brenda Wallace Date: Wed, 7 Dec 2016 20:12:12 +1300 Subject: [PATCH 266/268] FIX Gardens query was running twice in contoller --- app/controllers/gardens_controller.rb | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/app/controllers/gardens_controller.rb b/app/controllers/gardens_controller.rb index a83089844..d836b0e85 100644 --- a/app/controllers/gardens_controller.rb +++ b/app/controllers/gardens_controller.rb @@ -5,11 +5,12 @@ class GardensController < ApplicationController # GET /gardens # GET /gardens.json def index - @gardens = Garden.paginate(page: params[:page]) @owner = Member.find_by(slug: params[:owner]) - if @owner - @gardens = @owner.gardens.paginate(page: params[:page]) - end + @gardens = if @owner + @owner.gardens.paginate(page: params[:page]) + else + Garden.paginate(page: params[:page]) + end respond_to do |format| format.html # index.html.erb From 4f465d808c63c12777ffef5e161d614e610eb424 Mon Sep 17 00:00:00 2001 From: Brenda Wallace Date: Wed, 7 Dec 2016 23:29:27 +0000 Subject: [PATCH 267/268] We don't need to load the resource again --- app/controllers/account_types_controller.rb | 6 ------ app/controllers/accounts_controller.rb | 5 ----- app/controllers/alternate_names_controller.rb | 4 ---- app/controllers/comments_controller.rb | 4 ---- app/controllers/crops_controller.rb | 4 ---- app/controllers/gardens_controller.rb | 6 ------ app/controllers/harvests_controller.rb | 4 ---- app/controllers/notifications_controller.rb | 2 -- app/controllers/orders_controller.rb | 8 -------- app/controllers/photos_controller.rb | 4 ---- app/controllers/plant_parts_controller.rb | 6 ------ app/controllers/plantings_controller.rb | 4 ---- app/controllers/posts_controller.rb | 4 ---- app/controllers/products_controller.rb | 6 ------ app/controllers/roles_controller.rb | 6 ------ app/controllers/scientific_names_controller.rb | 6 ------ app/controllers/seeds_controller.rb | 6 ------ 17 files changed, 85 deletions(-) diff --git a/app/controllers/account_types_controller.rb b/app/controllers/account_types_controller.rb index fce71380a..f1c78706b 100644 --- a/app/controllers/account_types_controller.rb +++ b/app/controllers/account_types_controller.rb @@ -13,8 +13,6 @@ class AccountTypesController < ApplicationController # GET /account_types/1 def show - @account_type = AccountType.find(params[:id]) - respond_to do |format| format.html # show.html.erb end @@ -31,7 +29,6 @@ class AccountTypesController < ApplicationController # GET /account_types/1/edit def edit - @account_type = AccountType.find(params[:id]) end # POST /account_types @@ -49,8 +46,6 @@ class AccountTypesController < ApplicationController # PUT /account_types/1 def update - @account_type = AccountType.find(params[:id]) - respond_to do |format| if @account_type.update(account_type_params) format.html { redirect_to @account_type, notice: 'Account type was successfully updated.' } @@ -62,7 +57,6 @@ class AccountTypesController < ApplicationController # DELETE /account_types/1 def destroy - @account_type = AccountType.find(params[:id]) @account_type.destroy respond_to do |format| diff --git a/app/controllers/accounts_controller.rb b/app/controllers/accounts_controller.rb index bca64597a..c7396bfce 100644 --- a/app/controllers/accounts_controller.rb +++ b/app/controllers/accounts_controller.rb @@ -13,8 +13,6 @@ class AccountsController < ApplicationController # GET /accounts/1 def show - @account = Account.find(params[:id]) - respond_to do |format| format.html # show.html.erb end @@ -22,13 +20,10 @@ class AccountsController < ApplicationController # GET /accounts/1/edit def edit - @account = Account.find(params[:id]) end # PUT /accounts/1 def update - @account = Account.find(params[:id]) - respond_to do |format| if @account.update(params[:account]) format.html { redirect_to @account, notice: 'Account detail was successfully updated.' } diff --git a/app/controllers/alternate_names_controller.rb b/app/controllers/alternate_names_controller.rb index b8467bb34..43d76fff3 100644 --- a/app/controllers/alternate_names_controller.rb +++ b/app/controllers/alternate_names_controller.rb @@ -27,7 +27,6 @@ class AlternateNamesController < ApplicationController # GET /alternate_names/1/edit def edit - @alternate_name = AlternateName.find(params[:id]) end # POST /alternate_names @@ -50,8 +49,6 @@ class AlternateNamesController < ApplicationController # PUT /alternate_names/1 # PUT /alternate_names/1.json def update - @alternate_name = AlternateName.find(params[:id]) - respond_to do |format| if @alternate_name.update(alternate_name_params) format.html { redirect_to @alternate_name.crop, notice: 'Alternate name was successfully updated.' } @@ -66,7 +63,6 @@ class AlternateNamesController < ApplicationController # DELETE /alternate_names/1 # DELETE /alternate_names/1.json def destroy - @alternate_name = AlternateName.find(params[:id]) @crop = @alternate_name.crop @alternate_name.destroy diff --git a/app/controllers/comments_controller.rb b/app/controllers/comments_controller.rb index ef3225bfb..bde0876e8 100644 --- a/app/controllers/comments_controller.rb +++ b/app/controllers/comments_controller.rb @@ -34,7 +34,6 @@ class CommentsController < ApplicationController # GET /comments/1/edit def edit - @comment = Comment.find(params[:id]) @comments = @comment.post.comments end @@ -58,8 +57,6 @@ class CommentsController < ApplicationController # PUT /comments/1 # PUT /comments/1.json def update - @comment = Comment.find(params[:id]) - # you should never be able to change the author or post when # updating params[:comment].delete("post_id") @@ -79,7 +76,6 @@ class CommentsController < ApplicationController # DELETE /comments/1 # DELETE /comments/1.json def destroy - @comment = Comment.find(params[:id]) @post = @comment.post @comment.destroy diff --git a/app/controllers/crops_controller.rb b/app/controllers/crops_controller.rb index 111b0390b..0b9d713a0 100644 --- a/app/controllers/crops_controller.rb +++ b/app/controllers/crops_controller.rb @@ -110,7 +110,6 @@ class CropsController < ApplicationController # GET /crops/1/edit def edit - @crop = Crop.find(params[:id]) @crop.alternate_names.build if @crop.alternate_names.blank? @crop.scientific_names.build if @crop.scientific_names.blank? end @@ -155,8 +154,6 @@ class CropsController < ApplicationController # PUT /crops/1 # PUT /crops/1.json def update - @crop = Crop.find(params[:id]) - previous_status = @crop.approval_status @crop.creator = current_member if previous_status == "pending" @@ -184,7 +181,6 @@ class CropsController < ApplicationController # DELETE /crops/1 # DELETE /crops/1.json def destroy - @crop = Crop.find(params[:id]) @crop.destroy respond_to do |format| diff --git a/app/controllers/gardens_controller.rb b/app/controllers/gardens_controller.rb index d836b0e85..fca489384 100644 --- a/app/controllers/gardens_controller.rb +++ b/app/controllers/gardens_controller.rb @@ -21,8 +21,6 @@ class GardensController < ApplicationController # GET /gardens/1 # GET /gardens/1.json def show - @garden = Garden.find(params[:id]) - respond_to do |format| format.html # show.html.erb format.json { render json: @garden } @@ -42,7 +40,6 @@ class GardensController < ApplicationController # GET /gardens/1/edit def edit - @garden = Garden.find(params[:id]) end # POST /gardens @@ -66,8 +63,6 @@ class GardensController < ApplicationController # PUT /gardens/1 # PUT /gardens/1.json def update - @garden = Garden.find(params[:id]) - respond_to do |format| if @garden.update(garden_params) format.html { redirect_to @garden, notice: 'Garden was successfully updated.' } @@ -82,7 +77,6 @@ class GardensController < ApplicationController # DELETE /gardens/1 # DELETE /gardens/1.json def destroy - @garden = Garden.find(params[:id]) @garden.destroy expire_fragment("homepage_stats") diff --git a/app/controllers/harvests_controller.rb b/app/controllers/harvests_controller.rb index aa80c21c7..1b924cace 100644 --- a/app/controllers/harvests_controller.rb +++ b/app/controllers/harvests_controller.rb @@ -42,7 +42,6 @@ class HarvestsController < ApplicationController # GET /harvests/1/edit def edit - @harvest = Harvest.find(params[:id]) end # POST /harvests @@ -66,8 +65,6 @@ class HarvestsController < ApplicationController # PUT /harvests/1 # PUT /harvests/1.json def update - @harvest = Harvest.find(params[:id]) - respond_to do |format| if @harvest.update(harvest_params) format.html { redirect_to @harvest, notice: 'Harvest was successfully updated.' } @@ -82,7 +79,6 @@ class HarvestsController < ApplicationController # DELETE /harvests/1 # DELETE /harvests/1.json def destroy - @harvest = Harvest.find(params[:id]) @harvest.destroy respond_to do |format| diff --git a/app/controllers/notifications_controller.rb b/app/controllers/notifications_controller.rb index dbc70f439..03b0ef8f8 100644 --- a/app/controllers/notifications_controller.rb +++ b/app/controllers/notifications_controller.rb @@ -14,7 +14,6 @@ class NotificationsController < ApplicationController # GET /notifications/1 def show - @notification = Notification.find(params[:id]) @notification.read = true @notification.save @reply_link = reply_link(@notification) @@ -54,7 +53,6 @@ class NotificationsController < ApplicationController # DELETE /notifications/1 def destroy - @notification = Notification.find(params[:id]) @notification.destroy respond_to do |format| diff --git a/app/controllers/orders_controller.rb b/app/controllers/orders_controller.rb index cfeda51a7..def0a018a 100644 --- a/app/controllers/orders_controller.rb +++ b/app/controllers/orders_controller.rb @@ -13,8 +13,6 @@ class OrdersController < ApplicationController # GET /orders/1 def show - @order = Order.find(params[:id]) - respond_to do |format| format.html # show.html.erb end @@ -31,8 +29,6 @@ class OrdersController < ApplicationController # checkout with PayPal def checkout - @order = Order.find(params[:id]) - respond_to do |format| if @order.update_attributes(referral_code: params[:referral_code]) response = EXPRESS_GATEWAY.setup_purchase( @@ -52,8 +48,6 @@ class OrdersController < ApplicationController end def complete - @order = Order.find(params[:id]) - if (params[:token] && params['PayerID']) purchase = EXPRESS_GATEWAY.purchase( @order.total, @@ -80,7 +74,6 @@ class OrdersController < ApplicationController end def cancel - @order = Order.find(params[:id]) respond_to do |format| format.html { redirect_to shop_url, notice: 'Order was cancelled.' } end @@ -88,7 +81,6 @@ class OrdersController < ApplicationController # DELETE /orders/1 def destroy - @order = Order.find(params[:id]) @order.destroy respond_to do |format| diff --git a/app/controllers/photos_controller.rb b/app/controllers/photos_controller.rb index 07274b97b..056e7f3f5 100644 --- a/app/controllers/photos_controller.rb +++ b/app/controllers/photos_controller.rb @@ -41,7 +41,6 @@ class PhotosController < ApplicationController # GET /photos/1/edit def edit - @photo = Photo.find(params[:id]) end # POST /photos @@ -64,8 +63,6 @@ class PhotosController < ApplicationController # PUT /photos/1 # PUT /photos/1.json def update - @photo = Photo.find(params[:id]) - respond_to do |format| if @photo.update(photo_params) format.html { redirect_to @photo, notice: 'Photo was successfully updated.' } @@ -80,7 +77,6 @@ class PhotosController < ApplicationController # DELETE /photos/1 # DELETE /photos/1.json def destroy - @photo = Photo.find(params[:id]) @photo.destroy flash[:alert] = "Photo successfully deleted." diff --git a/app/controllers/plant_parts_controller.rb b/app/controllers/plant_parts_controller.rb index ed67926c7..e91bf57ba 100644 --- a/app/controllers/plant_parts_controller.rb +++ b/app/controllers/plant_parts_controller.rb @@ -15,8 +15,6 @@ class PlantPartsController < ApplicationController # GET /plant_parts/1 # GET /plant_parts/1.json def show - @plant_part = PlantPart.find(params[:id]) - respond_to do |format| format.html # show.html.erb format.json { render json: @plant_part } @@ -36,7 +34,6 @@ class PlantPartsController < ApplicationController # GET /plant_parts/1/edit def edit - @plant_part = PlantPart.find(params[:id]) end # POST /plant_parts @@ -58,8 +55,6 @@ class PlantPartsController < ApplicationController # PUT /plant_parts/1 # PUT /plant_parts/1.json def update - @plant_part = PlantPart.find(params[:id]) - respond_to do |format| if @plant_part.update(plant_part_params) format.html { redirect_to @plant_part, notice: 'Plant part was successfully updated.' } @@ -74,7 +69,6 @@ class PlantPartsController < ApplicationController # DELETE /plant_parts/1 # DELETE /plant_parts/1.json def destroy - @plant_part = PlantPart.find(params[:id]) @plant_part.destroy respond_to do |format| diff --git a/app/controllers/plantings_controller.rb b/app/controllers/plantings_controller.rb index 708fc448d..00b080946 100644 --- a/app/controllers/plantings_controller.rb +++ b/app/controllers/plantings_controller.rb @@ -55,8 +55,6 @@ class PlantingsController < ApplicationController # GET /plantings/1/edit def edit - @planting = Planting.find(params[:id]) - # the following are needed to display the form but aren't used @crop = Crop.new @garden = Garden.new @@ -86,7 +84,6 @@ class PlantingsController < ApplicationController # PUT /plantings/1 # PUT /plantings/1.json def update - @planting = Planting.find(params[:id]) params[:planted_at] = parse_date(params[:planted_at]) respond_to do |format| @@ -105,7 +102,6 @@ class PlantingsController < ApplicationController # DELETE /plantings/1 # DELETE /plantings/1.json def destroy - @planting = Planting.find(params[:id]) @garden = @planting.garden @planting.destroy expire_fragment("homepage_stats") diff --git a/app/controllers/posts_controller.rb b/app/controllers/posts_controller.rb index 76befd29d..2df88beab 100644 --- a/app/controllers/posts_controller.rb +++ b/app/controllers/posts_controller.rb @@ -49,7 +49,6 @@ class PostsController < ApplicationController # GET /posts/1/edit def edit - @post = Post.find(params[:id]) end # POST /posts @@ -72,8 +71,6 @@ class PostsController < ApplicationController # PUT /posts/1 # PUT /posts/1.json def update - @post = Post.find(params[:id]) - respond_to do |format| if @post.update(post_params) format.html { redirect_to @post, notice: 'Post was successfully updated.' } @@ -88,7 +85,6 @@ class PostsController < ApplicationController # DELETE /posts/1 # DELETE /posts/1.json def destroy - @post = Post.find(params[:id]) @post.destroy respond_to do |format| diff --git a/app/controllers/products_controller.rb b/app/controllers/products_controller.rb index cb2f96e52..fa5108250 100644 --- a/app/controllers/products_controller.rb +++ b/app/controllers/products_controller.rb @@ -13,8 +13,6 @@ class ProductsController < ApplicationController # GET /products/1 def show - @product = Product.find(params[:id]) - respond_to do |format| format.html # show.html.erb end @@ -31,7 +29,6 @@ class ProductsController < ApplicationController # GET /products/1/edit def edit - @product = Product.find(params[:id]) end # POST /products @@ -49,8 +46,6 @@ class ProductsController < ApplicationController # PUT /products/1 def update - @product = Product.find(params[:id]) - respond_to do |format| if @product.update(product_params) format.html { redirect_to @product, notice: 'Product was successfully updated.' } @@ -62,7 +57,6 @@ class ProductsController < ApplicationController # DELETE /products/1 def destroy - @product = Product.find(params[:id]) @product.destroy respond_to do |format| diff --git a/app/controllers/roles_controller.rb b/app/controllers/roles_controller.rb index 91bcf2e52..5c8b6f03d 100644 --- a/app/controllers/roles_controller.rb +++ b/app/controllers/roles_controller.rb @@ -13,8 +13,6 @@ class RolesController < ApplicationController # GET /roles/1 def show - @role = Role.find(params[:id]) - respond_to do |format| format.html # show.html.erb end @@ -31,7 +29,6 @@ class RolesController < ApplicationController # GET /roles/1/edit def edit - @role = Role.find(params[:id]) end # POST /roles @@ -49,8 +46,6 @@ class RolesController < ApplicationController # PUT /roles/1 def update - @role = Role.find(params[:id]) - respond_to do |format| if @role.update(role_params) format.html { redirect_to @role, notice: 'Role was successfully updated.' } @@ -62,7 +57,6 @@ class RolesController < ApplicationController # DELETE /roles/1 def destroy - @role = Role.find(params[:id]) @role.destroy respond_to do |format| diff --git a/app/controllers/scientific_names_controller.rb b/app/controllers/scientific_names_controller.rb index 0fd0eccac..981dd5c9f 100644 --- a/app/controllers/scientific_names_controller.rb +++ b/app/controllers/scientific_names_controller.rb @@ -16,8 +16,6 @@ class ScientificNamesController < ApplicationController # GET /scientific_names/1 # GET /scientific_names/1.json def show - @scientific_name = ScientificName.find(params[:id]) - respond_to do |format| format.html # show.html.haml format.json { render json: @scientific_name } @@ -38,7 +36,6 @@ class ScientificNamesController < ApplicationController # GET /scientific_names/1/edit def edit - @scientific_name = ScientificName.find(params[:id]) end # POST /scientific_names @@ -61,8 +58,6 @@ class ScientificNamesController < ApplicationController # PUT /scientific_names/1 # PUT /scientific_names/1.json def update - @scientific_name = ScientificName.find(params[:id]) - respond_to do |format| if @scientific_name.update(scientific_name_params) format.html { redirect_to @scientific_name.crop, notice: 'Scientific name was successfully updated.' } @@ -77,7 +72,6 @@ class ScientificNamesController < ApplicationController # DELETE /scientific_names/1 # DELETE /scientific_names/1.json def destroy - @scientific_name = ScientificName.find(params[:id]) @crop = @scientific_name.crop @scientific_name.destroy diff --git a/app/controllers/seeds_controller.rb b/app/controllers/seeds_controller.rb index 01fdc7beb..85f181e45 100644 --- a/app/controllers/seeds_controller.rb +++ b/app/controllers/seeds_controller.rb @@ -35,8 +35,6 @@ class SeedsController < ApplicationController # GET /seeds/1 # GET /seeds/1.json def show - @seed = Seed.find(params[:id]) - respond_to do |format| format.html # show.html.erb format.json { render json: @seed } @@ -59,7 +57,6 @@ class SeedsController < ApplicationController # GET /seeds/1/edit def edit - @seed = Seed.find(params[:id]) end # POST /seeds @@ -82,8 +79,6 @@ class SeedsController < ApplicationController # PUT /seeds/1 # PUT /seeds/1.json def update - @seed = Seed.find(params[:id]) - respond_to do |format| if @seed.update(seed_params) format.html { redirect_to @seed, notice: 'Seed was successfully updated.' } @@ -98,7 +93,6 @@ class SeedsController < ApplicationController # DELETE /seeds/1 # DELETE /seeds/1.json def destroy - @seed = Seed.find(params[:id]) @seed.destroy respond_to do |format| From 3e43a19e58d4bb37707f99343fdd988e8bdec5f2 Mon Sep 17 00:00:00 2001 From: Daniel O'Connor Date: Fri, 9 Dec 2016 10:09:04 +1030 Subject: [PATCH 268/268] Update CONTRIBUTING.md Dead link, no archived version of it --- CONTRIBUTING.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 71e94bd6b..1197b826c 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -3,7 +3,7 @@ Thanks for contributing to Growstuff! When you create a pull request, please include the following: * Mention the issue it solves (eg. #123) -* Your code should follow our [Coding style guide](http://wiki.growstuff.org/index.php/Coding_style_guide) +* Your code should follow our [Coding style guide](https://github.com/Growstuff/growstuff/wiki/Development-process-overview#coding-practices) * Make sure you have automated tests for your work, where possible. * Add your name (and that of your pair partner, if any) to [CONTRIBUTORS.md](CONTRIBUTORS.md).