From bb6e9e32e651d522a9317af39d77568ce0733225 Mon Sep 17 00:00:00 2001 From: milesgould Date: Fri, 17 Nov 2017 10:34:32 +0000 Subject: [PATCH 01/20] De-deprecate controller and view specs We deprecated controller and view specs on the grounds that they were brittle, and were a poorer measure of user experience than feature specs. However, feature specs have their own problems: they're much slower to run, and flakier (see #901). We also ran into a few cases where feature specs erroneously passed because they were checking for the presence of a string that occurred in the error page! Hence, we're cautiously un-deprecating controller and view specs. Fixes #1132 --- spec/controllers/account_types_controller_spec.rb | 12 ------------ spec/controllers/accounts_controller_spec.rb | 12 ------------ spec/controllers/admin/orders_controller_spec.rb | 12 ------------ spec/controllers/admin_controller_spec.rb | 12 ------------ spec/controllers/authentications_controller_spec.rb | 12 ------------ spec/controllers/comments_controller_spec.rb | 12 ------------ spec/controllers/crops_controller_spec.rb | 12 ------------ spec/controllers/forums_controller_spec.rb | 12 ------------ spec/controllers/gardens_controller_spec.rb | 12 ------------ spec/controllers/harvests_controller_spec.rb | 12 ------------ spec/controllers/home_controller_spec.rb | 12 ------------ spec/controllers/member_controller_spec.rb | 12 ------------ spec/controllers/notifications_controller_spec.rb | 12 ------------ spec/controllers/order_items_controller_spec.rb | 12 ------------ spec/controllers/orders_controller_spec.rb | 12 ------------ spec/controllers/photos_controller_spec.rb | 11 ----------- spec/controllers/places_controller_spec.rb | 12 ------------ spec/controllers/plant_parts_controller_spec.rb | 12 ------------ spec/controllers/plantings_controller_spec.rb | 12 ------------ spec/controllers/posts_controller_spec.rb | 12 ------------ spec/controllers/products_controller_spec.rb | 12 ------------ spec/controllers/registrations_controller_spec.rb | 12 ------------ spec/controllers/roles_controller_spec.rb | 12 ------------ spec/controllers/scientific_names_controller_spec.rb | 12 ------------ spec/controllers/seeds_controller_spec.rb | 12 ------------ spec/controllers/shop_controller_spec.rb | 12 ------------ spec/views/account_types/edit.html.haml_spec.rb | 12 ------------ spec/views/account_types/index.html.haml_spec.rb | 12 ------------ spec/views/account_types/new.html.haml_spec.rb | 12 ------------ spec/views/account_types/show.html.haml_spec.rb | 12 ------------ spec/views/accounts/edit.html.haml_spec.rb | 12 ------------ spec/views/accounts/index.html.haml_spec.rb | 12 ------------ spec/views/accounts/new.html.haml_spec.rb | 12 ------------ spec/views/accounts/show.html.haml_spec.rb | 12 ------------ spec/views/admin/index_spec.rb | 12 ------------ spec/views/admin/newsletter_spec.rb | 12 ------------ spec/views/admin/orders/index_spec.rb | 12 ------------ spec/views/comments/edit.html.haml_spec.rb | 12 ------------ spec/views/comments/index.html.haml_spec.rb | 12 ------------ spec/views/comments/index.rss.haml_spec.rb | 12 ------------ spec/views/comments/new.html.haml_spec.rb | 12 ------------ spec/views/comments/show.html.haml_spec.rb | 12 ------------ spec/views/crops/_grown_for.html.haml_spec.rb | 12 ------------ spec/views/crops/_planting_advice.html.haml_spec.rb | 12 ------------ spec/views/crops/_popover.html.haml_spec.rb | 12 ------------ spec/views/crops/edit.html.haml_spec.rb | 12 ------------ spec/views/crops/hierarchy.html.haml_spec.rb | 12 ------------ spec/views/crops/index.html.haml_spec.rb | 12 ------------ spec/views/crops/index.rss.haml_spec.rb | 12 ------------ spec/views/crops/new.html.haml_spec.rb | 12 ------------ spec/views/crops/wrangle.html.haml_spec.rb | 12 ------------ .../devise/mailer/confirmation_instructions_spec.rb | 12 ------------ .../mailer/reset_password_instructions_spec.rb | 12 ------------ spec/views/devise/mailer/unlock_instructions_spec.rb | 12 ------------ spec/views/devise/registrations/edit_spec.rb | 12 ------------ spec/views/devise/registrations/new_spec.rb | 12 ------------ spec/views/devise/sessions/new_spec.rb | 12 ------------ spec/views/devise/unlocks/new_spec.rb | 12 ------------ spec/views/forums/edit.html.haml_spec.rb | 12 ------------ spec/views/forums/index.html.haml_spec.rb | 12 ------------ spec/views/forums/new.html.haml_spec.rb | 12 ------------ spec/views/forums/show.html.haml_spec.rb | 12 ------------ spec/views/gardens/edit.html.haml_spec.rb | 12 ------------ spec/views/gardens/new.html.haml_spec.rb | 12 ------------ spec/views/gardens/show.html.haml_spec.rb | 12 ------------ spec/views/harvests/edit.html.haml_spec.rb | 12 ------------ spec/views/harvests/index.html.haml_spec.rb | 12 ------------ spec/views/harvests/new.html.haml_spec.rb | 12 ------------ spec/views/harvests/show.html.haml_spec.rb | 12 ------------ spec/views/home/_blurb.html.haml_spec.rb | 12 ------------ spec/views/home/_crops.html.haml_spec.rb | 12 ------------ spec/views/home/_members.html.haml_spec.rb | 12 ------------ spec/views/home/_seeds.html.haml_spec.rb | 12 ------------ spec/views/home/_stats.html.haml_spec.rb | 12 ------------ spec/views/home/index_spec.rb | 12 ------------ spec/views/layouts/_header_spec.rb | 12 ------------ spec/views/layouts/_meta_spec.rb | 12 ------------ spec/views/layouts/application_spec.rb | 12 ------------ spec/views/notifications/index.html.haml_spec.rb | 12 ------------ spec/views/notifications/new.html.haml_spec.rb | 12 ------------ spec/views/notifications/show.html.haml_spec.rb | 12 ------------ spec/views/notifier/notify.html.haml_spec.rb | 12 ------------ spec/views/orders/index.html.haml_spec.rb | 12 ------------ spec/views/orders/show.html.haml_spec.rb | 12 ------------ spec/views/photos/edit.html.haml_spec.rb | 12 ------------ spec/views/photos/index.html.haml_spec.rb | 12 ------------ spec/views/photos/new.html.haml_spec.rb | 12 ------------ spec/views/photos/show.html.haml_spec.rb | 12 ------------ spec/views/places/_map_attribution.html.haml_spec.rb | 12 ------------ spec/views/places/index.html.haml_spec.rb | 12 ------------ spec/views/places/show.html.haml_spec.rb | 12 ------------ spec/views/plant_parts/edit.html.haml_spec.rb | 12 ------------ spec/views/plant_parts/index.html.haml_spec.rb | 12 ------------ spec/views/plant_parts/new.html.haml_spec.rb | 12 ------------ spec/views/plant_parts/show.html.haml_spec.rb | 12 ------------ spec/views/plantings/_form.html.haml_spec.rb | 12 ------------ spec/views/plantings/edit.html.haml_spec.rb | 12 ------------ spec/views/plantings/index.html.haml_spec.rb | 12 ------------ spec/views/plantings/index.rss.haml_spec.rb | 12 ------------ spec/views/plantings/new.html.haml_spec.rb | 12 ------------ spec/views/plantings/show.html.haml_spec.rb | 12 ------------ spec/views/posts/_single.html.haml_spec.rb | 12 ------------ spec/views/posts/edit.html.haml_spec.rb | 12 ------------ spec/views/posts/index.html.haml_spec.rb | 12 ------------ spec/views/posts/index.rss.haml_spec.rb | 12 ------------ spec/views/posts/new.html.haml_spec.rb | 12 ------------ spec/views/posts/show.rss.haml_spec.rb | 12 ------------ spec/views/products/edit.html.haml_spec.rb | 12 ------------ spec/views/products/index.html.haml_spec.rb | 12 ------------ spec/views/products/new.html.haml_spec.rb | 12 ------------ spec/views/products/show.html.haml_spec.rb | 12 ------------ spec/views/roles/edit.html.haml_spec.rb | 12 ------------ spec/views/roles/index.html.haml_spec.rb | 12 ------------ spec/views/roles/new.html.haml_spec.rb | 12 ------------ spec/views/roles/show.html.haml_spec.rb | 12 ------------ spec/views/scientific_names/edit.html.haml_spec.rb | 12 ------------ spec/views/scientific_names/index.html.haml_spec.rb | 12 ------------ spec/views/scientific_names/new.html.haml_spec.rb | 12 ------------ spec/views/scientific_names/show.html.haml_spec.rb | 12 ------------ spec/views/seeds/edit.html.haml_spec.rb | 12 ------------ spec/views/seeds/index.rss.haml_spec.rb | 12 ------------ spec/views/seeds/new.html.haml_spec.rb | 12 ------------ spec/views/seeds/show.html.haml_spec.rb | 12 ------------ spec/views/shop/index_spec.rb | 12 ------------ 124 files changed, 1487 deletions(-) diff --git a/spec/controllers/account_types_controller_spec.rb b/spec/controllers/account_types_controller_spec.rb index 633311b6e..3a7559f63 100644 --- a/spec/controllers/account_types_controller_spec.rb +++ b/spec/controllers/account_types_controller_spec.rb @@ -1,15 +1,3 @@ -## 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. -## -## If you submit a pull request containing new view or controller tests, it will not be -## merged. - require 'rails_helper' describe AccountTypesController do diff --git a/spec/controllers/accounts_controller_spec.rb b/spec/controllers/accounts_controller_spec.rb index d159f4114..2b4222f1d 100644 --- a/spec/controllers/accounts_controller_spec.rb +++ b/spec/controllers/accounts_controller_spec.rb @@ -1,15 +1,3 @@ -## 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. -## -## If you submit a pull request containing new view or controller tests, it will not be -## merged. - require 'rails_helper' describe AccountsController do diff --git a/spec/controllers/admin/orders_controller_spec.rb b/spec/controllers/admin/orders_controller_spec.rb index a81875427..fb475b34c 100644 --- a/spec/controllers/admin/orders_controller_spec.rb +++ b/spec/controllers/admin/orders_controller_spec.rb @@ -1,15 +1,3 @@ -## 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. -## -## If you submit a pull request containing new view or controller tests, it will not be -## merged. - require 'rails_helper' describe Admin::OrdersController do diff --git a/spec/controllers/admin_controller_spec.rb b/spec/controllers/admin_controller_spec.rb index 6e97245d1..9f134bbab 100644 --- a/spec/controllers/admin_controller_spec.rb +++ b/spec/controllers/admin_controller_spec.rb @@ -1,15 +1,3 @@ -## 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. -## -## If you submit a pull request containing new view or controller tests, it will not be -## merged. - require 'rails_helper' describe AdminController do diff --git a/spec/controllers/authentications_controller_spec.rb b/spec/controllers/authentications_controller_spec.rb index fe7eaa61f..8b61bbddc 100644 --- a/spec/controllers/authentications_controller_spec.rb +++ b/spec/controllers/authentications_controller_spec.rb @@ -1,15 +1,3 @@ -## 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. -## -## If you submit a pull request containing new view or controller tests, it will not be -## merged. - require 'rails_helper' describe AuthenticationsController do diff --git a/spec/controllers/comments_controller_spec.rb b/spec/controllers/comments_controller_spec.rb index e65a24544..23210a875 100644 --- a/spec/controllers/comments_controller_spec.rb +++ b/spec/controllers/comments_controller_spec.rb @@ -1,15 +1,3 @@ -## 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. -## -## If you submit a pull request containing new view or controller tests, it will not be -## merged. - require 'rails_helper' describe CommentsController do diff --git a/spec/controllers/crops_controller_spec.rb b/spec/controllers/crops_controller_spec.rb index 9a0a1dcdc..1f9e06d43 100644 --- a/spec/controllers/crops_controller_spec.rb +++ b/spec/controllers/crops_controller_spec.rb @@ -1,15 +1,3 @@ -## 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. -## -## If you submit a pull request containing new view or controller tests, it will not be -## merged. - require 'rails_helper' describe CropsController do diff --git a/spec/controllers/forums_controller_spec.rb b/spec/controllers/forums_controller_spec.rb index f320204e2..5c59473cb 100644 --- a/spec/controllers/forums_controller_spec.rb +++ b/spec/controllers/forums_controller_spec.rb @@ -1,15 +1,3 @@ -## 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. -## -## If you submit a pull request containing new view or controller tests, it will not be -## merged. - require 'rails_helper' describe ForumsController do diff --git a/spec/controllers/gardens_controller_spec.rb b/spec/controllers/gardens_controller_spec.rb index 5fef6e210..b0ccae0b8 100644 --- a/spec/controllers/gardens_controller_spec.rb +++ b/spec/controllers/gardens_controller_spec.rb @@ -1,15 +1,3 @@ -## 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. -## -## If you submit a pull request containing new view or controller tests, it will not be -## merged. - require 'rails_helper' RSpec.describe GardensController, type: :controller do diff --git a/spec/controllers/harvests_controller_spec.rb b/spec/controllers/harvests_controller_spec.rb index c0dea9f2e..8a2edb56b 100644 --- a/spec/controllers/harvests_controller_spec.rb +++ b/spec/controllers/harvests_controller_spec.rb @@ -1,15 +1,3 @@ -## 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. -## -## If you submit a pull request containing new view or controller tests, it will not be -## merged. - require 'rails_helper' describe HarvestsController do diff --git a/spec/controllers/home_controller_spec.rb b/spec/controllers/home_controller_spec.rb index eb71e1f4a..cb12b2bb4 100644 --- a/spec/controllers/home_controller_spec.rb +++ b/spec/controllers/home_controller_spec.rb @@ -1,15 +1,3 @@ -## 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. -## -## If you submit a pull request containing new view or controller tests, it will not be -## merged. - require 'rails_helper' describe HomeController do diff --git a/spec/controllers/member_controller_spec.rb b/spec/controllers/member_controller_spec.rb index 866507f5f..b04bcd799 100644 --- a/spec/controllers/member_controller_spec.rb +++ b/spec/controllers/member_controller_spec.rb @@ -1,15 +1,3 @@ -## 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. -## -## If you submit a pull request containing new view or controller tests, it will not be -## merged. - require 'rails_helper' describe MembersController do diff --git a/spec/controllers/notifications_controller_spec.rb b/spec/controllers/notifications_controller_spec.rb index 0619a6707..fd6f40aa1 100644 --- a/spec/controllers/notifications_controller_spec.rb +++ b/spec/controllers/notifications_controller_spec.rb @@ -1,15 +1,3 @@ -## 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. -## -## If you submit a pull request containing new view or controller tests, it will not be -## merged. - require 'rails_helper' describe NotificationsController do diff --git a/spec/controllers/order_items_controller_spec.rb b/spec/controllers/order_items_controller_spec.rb index 0c1b50706..1da3c3b8d 100644 --- a/spec/controllers/order_items_controller_spec.rb +++ b/spec/controllers/order_items_controller_spec.rb @@ -1,15 +1,3 @@ -## 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. -## -## If you submit a pull request containing new view or controller tests, it will not be -## merged. - require 'rails_helper' describe OrderItemsController do diff --git a/spec/controllers/orders_controller_spec.rb b/spec/controllers/orders_controller_spec.rb index d02fc6e27..3c6631d8c 100644 --- a/spec/controllers/orders_controller_spec.rb +++ b/spec/controllers/orders_controller_spec.rb @@ -1,15 +1,3 @@ -## 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. -## -## If you submit a pull request containing new view or controller tests, it will not be -## merged. - require 'rails_helper' describe OrdersController do diff --git a/spec/controllers/photos_controller_spec.rb b/spec/controllers/photos_controller_spec.rb index 7c935422c..8f4fab28e 100644 --- a/spec/controllers/photos_controller_spec.rb +++ b/spec/controllers/photos_controller_spec.rb @@ -1,15 +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. -## 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 -## merged. require 'rails_helper' diff --git a/spec/controllers/places_controller_spec.rb b/spec/controllers/places_controller_spec.rb index 79c1dc623..8b6cb0a31 100644 --- a/spec/controllers/places_controller_spec.rb +++ b/spec/controllers/places_controller_spec.rb @@ -1,15 +1,3 @@ -## 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. -## -## If you submit a pull request containing new view or controller tests, it will not be -## merged. - require 'rails_helper' describe PlacesController do diff --git a/spec/controllers/plant_parts_controller_spec.rb b/spec/controllers/plant_parts_controller_spec.rb index 239422efa..c6e11f315 100644 --- a/spec/controllers/plant_parts_controller_spec.rb +++ b/spec/controllers/plant_parts_controller_spec.rb @@ -1,15 +1,3 @@ -## 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. -## -## If you submit a pull request containing new view or controller tests, it will not be -## merged. - require 'rails_helper' describe PlantPartsController do diff --git a/spec/controllers/plantings_controller_spec.rb b/spec/controllers/plantings_controller_spec.rb index e9ce41369..1bacacc8c 100644 --- a/spec/controllers/plantings_controller_spec.rb +++ b/spec/controllers/plantings_controller_spec.rb @@ -1,15 +1,3 @@ -## 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. -## -## If you submit a pull request containing new view or controller tests, it will not be -## merged. - require 'rails_helper' describe PlantingsController do diff --git a/spec/controllers/posts_controller_spec.rb b/spec/controllers/posts_controller_spec.rb index 4cd61d242..cbfe8b46c 100644 --- a/spec/controllers/posts_controller_spec.rb +++ b/spec/controllers/posts_controller_spec.rb @@ -1,15 +1,3 @@ -## 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. -## -## If you submit a pull request containing new view or controller tests, it will not be -## merged. - require 'rails_helper' describe PostsController do diff --git a/spec/controllers/products_controller_spec.rb b/spec/controllers/products_controller_spec.rb index 63c17aa66..173ef9ba4 100644 --- a/spec/controllers/products_controller_spec.rb +++ b/spec/controllers/products_controller_spec.rb @@ -1,15 +1,3 @@ -## 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. -## -## If you submit a pull request containing new view or controller tests, it will not be -## merged. - require 'rails_helper' describe ProductsController do diff --git a/spec/controllers/registrations_controller_spec.rb b/spec/controllers/registrations_controller_spec.rb index c69144fd6..015bbb705 100644 --- a/spec/controllers/registrations_controller_spec.rb +++ b/spec/controllers/registrations_controller_spec.rb @@ -1,15 +1,3 @@ -## 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. -## -## If you submit a pull request containing new view or controller tests, it will not be -## merged. - require 'rails_helper' describe RegistrationsController do diff --git a/spec/controllers/roles_controller_spec.rb b/spec/controllers/roles_controller_spec.rb index 5c2271bce..9bf0ea1b5 100644 --- a/spec/controllers/roles_controller_spec.rb +++ b/spec/controllers/roles_controller_spec.rb @@ -1,15 +1,3 @@ -## 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. -## -## If you submit a pull request containing new view or controller tests, it will not be -## merged. - require 'rails_helper' describe RolesController do diff --git a/spec/controllers/scientific_names_controller_spec.rb b/spec/controllers/scientific_names_controller_spec.rb index 64b1e97fe..412f53224 100644 --- a/spec/controllers/scientific_names_controller_spec.rb +++ b/spec/controllers/scientific_names_controller_spec.rb @@ -1,15 +1,3 @@ -## 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. -## -## If you submit a pull request containing new view or controller tests, it will not be -## merged. - require 'rails_helper' describe ScientificNamesController do diff --git a/spec/controllers/seeds_controller_spec.rb b/spec/controllers/seeds_controller_spec.rb index 9ae6af1e2..c2fd699eb 100644 --- a/spec/controllers/seeds_controller_spec.rb +++ b/spec/controllers/seeds_controller_spec.rb @@ -1,15 +1,3 @@ -## 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. -## -## 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 4a438ea76..6298b7e76 100644 --- a/spec/controllers/shop_controller_spec.rb +++ b/spec/controllers/shop_controller_spec.rb @@ -1,15 +1,3 @@ -## 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. -## -## If you submit a pull request containing new view or controller tests, it will not be -## merged. - require 'rails_helper' describe ShopController do diff --git a/spec/views/account_types/edit.html.haml_spec.rb b/spec/views/account_types/edit.html.haml_spec.rb index 09bcc35ce..1bd22be03 100644 --- a/spec/views/account_types/edit.html.haml_spec.rb +++ b/spec/views/account_types/edit.html.haml_spec.rb @@ -1,15 +1,3 @@ -## 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. -## -## 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 b5aa55b17..56020fc35 100644 --- a/spec/views/account_types/index.html.haml_spec.rb +++ b/spec/views/account_types/index.html.haml_spec.rb @@ -1,15 +1,3 @@ -## 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. -## -## 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 3efc39b05..027a1b7c1 100644 --- a/spec/views/account_types/new.html.haml_spec.rb +++ b/spec/views/account_types/new.html.haml_spec.rb @@ -1,15 +1,3 @@ -## 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. -## -## 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 828639f00..a31d4bc33 100644 --- a/spec/views/account_types/show.html.haml_spec.rb +++ b/spec/views/account_types/show.html.haml_spec.rb @@ -1,15 +1,3 @@ -## 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. -## -## 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 96b29ef75..bc5c3b5a3 100644 --- a/spec/views/accounts/edit.html.haml_spec.rb +++ b/spec/views/accounts/edit.html.haml_spec.rb @@ -1,15 +1,3 @@ -## 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. -## -## 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 5d23d9d76..4ec76151e 100644 --- a/spec/views/accounts/index.html.haml_spec.rb +++ b/spec/views/accounts/index.html.haml_spec.rb @@ -1,15 +1,3 @@ -## 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. -## -## 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 6ba4da067..77f6ff20f 100644 --- a/spec/views/accounts/new.html.haml_spec.rb +++ b/spec/views/accounts/new.html.haml_spec.rb @@ -1,15 +1,3 @@ -## 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. -## -## 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 71be40505..d96fbbd96 100644 --- a/spec/views/accounts/show.html.haml_spec.rb +++ b/spec/views/accounts/show.html.haml_spec.rb @@ -1,15 +1,3 @@ -## 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. -## -## 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 1c5f9bd20..beb0eacbd 100644 --- a/spec/views/admin/index_spec.rb +++ b/spec/views/admin/index_spec.rb @@ -1,15 +1,3 @@ -## 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. -## -## 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 901e3a12a..384833034 100644 --- a/spec/views/admin/newsletter_spec.rb +++ b/spec/views/admin/newsletter_spec.rb @@ -1,15 +1,3 @@ -## 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. -## -## 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 c819f0268..8d80dc3ef 100644 --- a/spec/views/admin/orders/index_spec.rb +++ b/spec/views/admin/orders/index_spec.rb @@ -1,15 +1,3 @@ -## 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. -## -## 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 e562ca027..2ef7d480f 100644 --- a/spec/views/comments/edit.html.haml_spec.rb +++ b/spec/views/comments/edit.html.haml_spec.rb @@ -1,15 +1,3 @@ -## 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. -## -## 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 1bf0e734f..91ed15a88 100644 --- a/spec/views/comments/index.html.haml_spec.rb +++ b/spec/views/comments/index.html.haml_spec.rb @@ -1,15 +1,3 @@ -## 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. -## -## 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 c3b6fdd32..672658bac 100644 --- a/spec/views/comments/index.rss.haml_spec.rb +++ b/spec/views/comments/index.rss.haml_spec.rb @@ -1,15 +1,3 @@ -## 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. -## -## 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 diff --git a/spec/views/comments/new.html.haml_spec.rb b/spec/views/comments/new.html.haml_spec.rb index 074b5bfe5..e0533ea5b 100644 --- a/spec/views/comments/new.html.haml_spec.rb +++ b/spec/views/comments/new.html.haml_spec.rb @@ -1,15 +1,3 @@ -## 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. -## -## If you submit a pull request containing new view or controller tests, it will not be -## merged. - require 'rails_helper' describe "comments/new" do diff --git a/spec/views/comments/show.html.haml_spec.rb b/spec/views/comments/show.html.haml_spec.rb index baf02cbbb..6315b4f69 100644 --- a/spec/views/comments/show.html.haml_spec.rb +++ b/spec/views/comments/show.html.haml_spec.rb @@ -1,15 +1,3 @@ -## 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. -## -## 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 183445346..c378c296c 100644 --- a/spec/views/crops/_grown_for.html.haml_spec.rb +++ b/spec/views/crops/_grown_for.html.haml_spec.rb @@ -1,15 +1,3 @@ -## 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. -## -## 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 2e6bf9e93..c7a4719b5 100644 --- a/spec/views/crops/_planting_advice.html.haml_spec.rb +++ b/spec/views/crops/_planting_advice.html.haml_spec.rb @@ -1,15 +1,3 @@ -## 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. -## -## 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 diff --git a/spec/views/crops/_popover.html.haml_spec.rb b/spec/views/crops/_popover.html.haml_spec.rb index 35d508fd8..dde4a893f 100644 --- a/spec/views/crops/_popover.html.haml_spec.rb +++ b/spec/views/crops/_popover.html.haml_spec.rb @@ -1,15 +1,3 @@ -## 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. -## -## If you submit a pull request containing new view or controller tests, it will not be -## merged. - require 'rails_helper' describe "crops/_popover" do diff --git a/spec/views/crops/edit.html.haml_spec.rb b/spec/views/crops/edit.html.haml_spec.rb index 03f333bf2..eed85528d 100644 --- a/spec/views/crops/edit.html.haml_spec.rb +++ b/spec/views/crops/edit.html.haml_spec.rb @@ -1,15 +1,3 @@ -## 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. -## -## If you submit a pull request containing new view or controller tests, it will not be -## merged. - require 'rails_helper' describe "crops/edit" do diff --git a/spec/views/crops/hierarchy.html.haml_spec.rb b/spec/views/crops/hierarchy.html.haml_spec.rb index c711b2174..833bb2b98 100644 --- a/spec/views/crops/hierarchy.html.haml_spec.rb +++ b/spec/views/crops/hierarchy.html.haml_spec.rb @@ -1,15 +1,3 @@ -## 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. -## -## 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 421e33e00..9f2985035 100644 --- a/spec/views/crops/index.html.haml_spec.rb +++ b/spec/views/crops/index.html.haml_spec.rb @@ -1,15 +1,3 @@ -## 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. -## -## 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 623fb296e..72a8bbdff 100644 --- a/spec/views/crops/index.rss.haml_spec.rb +++ b/spec/views/crops/index.rss.haml_spec.rb @@ -1,15 +1,3 @@ -## 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. -## -## 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 diff --git a/spec/views/crops/new.html.haml_spec.rb b/spec/views/crops/new.html.haml_spec.rb index a1208352a..5ce7eefdc 100644 --- a/spec/views/crops/new.html.haml_spec.rb +++ b/spec/views/crops/new.html.haml_spec.rb @@ -1,15 +1,3 @@ -## 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. -## -## If you submit a pull request containing new view or controller tests, it will not be -## merged. - require 'rails_helper' describe "crops/new" do diff --git a/spec/views/crops/wrangle.html.haml_spec.rb b/spec/views/crops/wrangle.html.haml_spec.rb index 6550026f6..085060570 100644 --- a/spec/views/crops/wrangle.html.haml_spec.rb +++ b/spec/views/crops/wrangle.html.haml_spec.rb @@ -1,15 +1,3 @@ -## 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. -## -## If you submit a pull request containing new view or controller tests, it will not be -## merged. - require 'rails_helper' describe "crops/wrangle" do diff --git a/spec/views/devise/mailer/confirmation_instructions_spec.rb b/spec/views/devise/mailer/confirmation_instructions_spec.rb index 01e0d7230..d2cce98c4 100644 --- a/spec/views/devise/mailer/confirmation_instructions_spec.rb +++ b/spec/views/devise/mailer/confirmation_instructions_spec.rb @@ -1,15 +1,3 @@ -## 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. -## -## 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 diff --git a/spec/views/devise/mailer/reset_password_instructions_spec.rb b/spec/views/devise/mailer/reset_password_instructions_spec.rb index 7d0cdfe6a..fc2ad1bbe 100644 --- a/spec/views/devise/mailer/reset_password_instructions_spec.rb +++ b/spec/views/devise/mailer/reset_password_instructions_spec.rb @@ -1,15 +1,3 @@ -## 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. -## -## 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 diff --git a/spec/views/devise/mailer/unlock_instructions_spec.rb b/spec/views/devise/mailer/unlock_instructions_spec.rb index 693fe97b0..633545cf3 100644 --- a/spec/views/devise/mailer/unlock_instructions_spec.rb +++ b/spec/views/devise/mailer/unlock_instructions_spec.rb @@ -1,15 +1,3 @@ -## 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. -## -## 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 7c69a8d3e..3d9dae906 100644 --- a/spec/views/devise/registrations/edit_spec.rb +++ b/spec/views/devise/registrations/edit_spec.rb @@ -1,15 +1,3 @@ -## 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. -## -## 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 diff --git a/spec/views/devise/registrations/new_spec.rb b/spec/views/devise/registrations/new_spec.rb index be00abae9..48805b806 100644 --- a/spec/views/devise/registrations/new_spec.rb +++ b/spec/views/devise/registrations/new_spec.rb @@ -1,15 +1,3 @@ -## 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. -## -## 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 diff --git a/spec/views/devise/sessions/new_spec.rb b/spec/views/devise/sessions/new_spec.rb index 93b14b9c3..dfe91af2a 100644 --- a/spec/views/devise/sessions/new_spec.rb +++ b/spec/views/devise/sessions/new_spec.rb @@ -1,15 +1,3 @@ -## 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. -## -## 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 diff --git a/spec/views/devise/unlocks/new_spec.rb b/spec/views/devise/unlocks/new_spec.rb index c53968a8d..60d056d72 100644 --- a/spec/views/devise/unlocks/new_spec.rb +++ b/spec/views/devise/unlocks/new_spec.rb @@ -1,15 +1,3 @@ -## 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. -## -## 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 diff --git a/spec/views/forums/edit.html.haml_spec.rb b/spec/views/forums/edit.html.haml_spec.rb index d7d426a8e..44151170a 100644 --- a/spec/views/forums/edit.html.haml_spec.rb +++ b/spec/views/forums/edit.html.haml_spec.rb @@ -1,15 +1,3 @@ -## 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. -## -## 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 cf8377858..02b265e85 100644 --- a/spec/views/forums/index.html.haml_spec.rb +++ b/spec/views/forums/index.html.haml_spec.rb @@ -1,15 +1,3 @@ -## 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. -## -## If you submit a pull request containing new view or controller tests, it will not be -## merged. - require 'rails_helper' describe "forums/index" do diff --git a/spec/views/forums/new.html.haml_spec.rb b/spec/views/forums/new.html.haml_spec.rb index 8c95c7c1f..72cd7ae45 100644 --- a/spec/views/forums/new.html.haml_spec.rb +++ b/spec/views/forums/new.html.haml_spec.rb @@ -1,15 +1,3 @@ -## 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. -## -## 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 5b6bae8fa..08892df58 100644 --- a/spec/views/forums/show.html.haml_spec.rb +++ b/spec/views/forums/show.html.haml_spec.rb @@ -1,15 +1,3 @@ -## 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. -## -## 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 1928f6d8b..1326f1544 100644 --- a/spec/views/gardens/edit.html.haml_spec.rb +++ b/spec/views/gardens/edit.html.haml_spec.rb @@ -1,15 +1,3 @@ -## 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. -## -## If you submit a pull request containing new view or controller tests, it will not be -## merged. - require 'rails_helper' describe "gardens/edit" do diff --git a/spec/views/gardens/new.html.haml_spec.rb b/spec/views/gardens/new.html.haml_spec.rb index 97eab872e..7346997dc 100644 --- a/spec/views/gardens/new.html.haml_spec.rb +++ b/spec/views/gardens/new.html.haml_spec.rb @@ -1,15 +1,3 @@ -## 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. -## -## 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 b22ee0452..015333ae0 100644 --- a/spec/views/gardens/show.html.haml_spec.rb +++ b/spec/views/gardens/show.html.haml_spec.rb @@ -1,15 +1,3 @@ -## 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. -## -## If you submit a pull request containing new view or controller tests, it will not be -## merged. - require 'rails_helper' describe "gardens/show" do diff --git a/spec/views/harvests/edit.html.haml_spec.rb b/spec/views/harvests/edit.html.haml_spec.rb index a475a6300..1193b4284 100644 --- a/spec/views/harvests/edit.html.haml_spec.rb +++ b/spec/views/harvests/edit.html.haml_spec.rb @@ -1,15 +1,3 @@ -## 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. -## -## 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 db9ce915f..fe205cda6 100644 --- a/spec/views/harvests/index.html.haml_spec.rb +++ b/spec/views/harvests/index.html.haml_spec.rb @@ -1,15 +1,3 @@ -## 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. -## -## If you submit a pull request containing new view or controller tests, it will not be -## merged. - require 'rails_helper' describe "harvests/index" do diff --git a/spec/views/harvests/new.html.haml_spec.rb b/spec/views/harvests/new.html.haml_spec.rb index 4b792a4c6..d79055a38 100644 --- a/spec/views/harvests/new.html.haml_spec.rb +++ b/spec/views/harvests/new.html.haml_spec.rb @@ -1,15 +1,3 @@ -## 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. -## -## 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 b13d53ed6..5e2f167af 100644 --- a/spec/views/harvests/show.html.haml_spec.rb +++ b/spec/views/harvests/show.html.haml_spec.rb @@ -1,15 +1,3 @@ -## 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. -## -## If you submit a pull request containing new view or controller tests, it will not be -## merged. - require 'rails_helper' describe "harvests/show" do diff --git a/spec/views/home/_blurb.html.haml_spec.rb b/spec/views/home/_blurb.html.haml_spec.rb index 710fcd4d4..47244a445 100644 --- a/spec/views/home/_blurb.html.haml_spec.rb +++ b/spec/views/home/_blurb.html.haml_spec.rb @@ -1,15 +1,3 @@ -## 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. -## -## 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 diff --git a/spec/views/home/_crops.html.haml_spec.rb b/spec/views/home/_crops.html.haml_spec.rb index ecbb74227..cc91976b8 100644 --- a/spec/views/home/_crops.html.haml_spec.rb +++ b/spec/views/home/_crops.html.haml_spec.rb @@ -1,15 +1,3 @@ -## 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. -## -## 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 f131d5b67..76aa434b6 100644 --- a/spec/views/home/_members.html.haml_spec.rb +++ b/spec/views/home/_members.html.haml_spec.rb @@ -1,15 +1,3 @@ -## 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. -## -## 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 diff --git a/spec/views/home/_seeds.html.haml_spec.rb b/spec/views/home/_seeds.html.haml_spec.rb index 4a128f1f6..7b8d6156c 100644 --- a/spec/views/home/_seeds.html.haml_spec.rb +++ b/spec/views/home/_seeds.html.haml_spec.rb @@ -1,15 +1,3 @@ -## 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. -## -## 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 6bfc3e6fe..a9979190c 100644 --- a/spec/views/home/_stats.html.haml_spec.rb +++ b/spec/views/home/_stats.html.haml_spec.rb @@ -1,15 +1,3 @@ -## 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. -## -## 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 190ee7b9f..5e11882fd 100644 --- a/spec/views/home/index_spec.rb +++ b/spec/views/home/index_spec.rb @@ -1,15 +1,3 @@ -## 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. -## -## 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 diff --git a/spec/views/layouts/_header_spec.rb b/spec/views/layouts/_header_spec.rb index badecf8f7..5060fc30d 100644 --- a/spec/views/layouts/_header_spec.rb +++ b/spec/views/layouts/_header_spec.rb @@ -1,15 +1,3 @@ -## 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. -## -## 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 diff --git a/spec/views/layouts/_meta_spec.rb b/spec/views/layouts/_meta_spec.rb index 805f0298d..151c6fe19 100644 --- a/spec/views/layouts/_meta_spec.rb +++ b/spec/views/layouts/_meta_spec.rb @@ -1,15 +1,3 @@ -## 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. -## -## 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 diff --git a/spec/views/layouts/application_spec.rb b/spec/views/layouts/application_spec.rb index b773cce58..f094ae2c2 100644 --- a/spec/views/layouts/application_spec.rb +++ b/spec/views/layouts/application_spec.rb @@ -1,15 +1,3 @@ -## 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. -## -## 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 diff --git a/spec/views/notifications/index.html.haml_spec.rb b/spec/views/notifications/index.html.haml_spec.rb index ee52b7319..2c8195069 100644 --- a/spec/views/notifications/index.html.haml_spec.rb +++ b/spec/views/notifications/index.html.haml_spec.rb @@ -1,15 +1,3 @@ -## 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. -## -## If you submit a pull request containing new view or controller tests, it will not be -## merged. - require 'rails_helper' describe "notifications/index" do diff --git a/spec/views/notifications/new.html.haml_spec.rb b/spec/views/notifications/new.html.haml_spec.rb index 2830966e1..a7f030f47 100644 --- a/spec/views/notifications/new.html.haml_spec.rb +++ b/spec/views/notifications/new.html.haml_spec.rb @@ -1,15 +1,3 @@ -## 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. -## -## If you submit a pull request containing new view or controller tests, it will not be -## merged. - require 'rails_helper' describe "notifications/new" do diff --git a/spec/views/notifications/show.html.haml_spec.rb b/spec/views/notifications/show.html.haml_spec.rb index 7cf7838c9..14db0448c 100644 --- a/spec/views/notifications/show.html.haml_spec.rb +++ b/spec/views/notifications/show.html.haml_spec.rb @@ -1,15 +1,3 @@ -## 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. -## -## If you submit a pull request containing new view or controller tests, it will not be -## merged. - require 'rails_helper' describe "notifications/show" do diff --git a/spec/views/notifier/notify.html.haml_spec.rb b/spec/views/notifier/notify.html.haml_spec.rb index 66e81b158..913ea10d2 100644 --- a/spec/views/notifier/notify.html.haml_spec.rb +++ b/spec/views/notifier/notify.html.haml_spec.rb @@ -1,15 +1,3 @@ -## 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. -## -## 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 diff --git a/spec/views/orders/index.html.haml_spec.rb b/spec/views/orders/index.html.haml_spec.rb index 6053de32f..c95f204e2 100644 --- a/spec/views/orders/index.html.haml_spec.rb +++ b/spec/views/orders/index.html.haml_spec.rb @@ -1,15 +1,3 @@ -## 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. -## -## 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 32289bfc9..a9f662de9 100644 --- a/spec/views/orders/show.html.haml_spec.rb +++ b/spec/views/orders/show.html.haml_spec.rb @@ -1,15 +1,3 @@ -## 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. -## -## If you submit a pull request containing new view or controller tests, it will not be -## merged. - require 'rails_helper' describe "orders/show" do diff --git a/spec/views/photos/edit.html.haml_spec.rb b/spec/views/photos/edit.html.haml_spec.rb index f1f2eacc5..a52b51a79 100644 --- a/spec/views/photos/edit.html.haml_spec.rb +++ b/spec/views/photos/edit.html.haml_spec.rb @@ -1,15 +1,3 @@ -## 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. -## -## If you submit a pull request containing new view or controller tests, it will not be -## merged. - require 'rails_helper' describe "photos/edit" do diff --git a/spec/views/photos/index.html.haml_spec.rb b/spec/views/photos/index.html.haml_spec.rb index 4e1674765..b603de1e6 100644 --- a/spec/views/photos/index.html.haml_spec.rb +++ b/spec/views/photos/index.html.haml_spec.rb @@ -1,15 +1,3 @@ -## 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. -## -## 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 2dcb51bfc..e4f24f9e4 100644 --- a/spec/views/photos/new.html.haml_spec.rb +++ b/spec/views/photos/new.html.haml_spec.rb @@ -1,15 +1,3 @@ -## 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. -## -## If you submit a pull request containing new view or controller tests, it will not be -## merged. - require 'rails_helper' describe "photos/new" do diff --git a/spec/views/photos/show.html.haml_spec.rb b/spec/views/photos/show.html.haml_spec.rb index 5ca8c31e1..cecb0008b 100644 --- a/spec/views/photos/show.html.haml_spec.rb +++ b/spec/views/photos/show.html.haml_spec.rb @@ -1,15 +1,3 @@ -## 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. -## -## If you submit a pull request containing new view or controller tests, it will not be -## merged. - require 'rails_helper' describe "photos/show" do diff --git a/spec/views/places/_map_attribution.html.haml_spec.rb b/spec/views/places/_map_attribution.html.haml_spec.rb index efc101bc1..7082290c8 100644 --- a/spec/views/places/_map_attribution.html.haml_spec.rb +++ b/spec/views/places/_map_attribution.html.haml_spec.rb @@ -1,15 +1,3 @@ -## 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. -## -## 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 44299c286..f3a3661ae 100644 --- a/spec/views/places/index.html.haml_spec.rb +++ b/spec/views/places/index.html.haml_spec.rb @@ -1,15 +1,3 @@ -## 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. -## -## 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 c5e4cca10..635d06ab9 100644 --- a/spec/views/places/show.html.haml_spec.rb +++ b/spec/views/places/show.html.haml_spec.rb @@ -1,15 +1,3 @@ -## 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. -## -## If you submit a pull request containing new view or controller tests, it will not be -## merged. - require 'rails_helper' describe "places/show" do diff --git a/spec/views/plant_parts/edit.html.haml_spec.rb b/spec/views/plant_parts/edit.html.haml_spec.rb index e871b49d3..683dd6ab0 100644 --- a/spec/views/plant_parts/edit.html.haml_spec.rb +++ b/spec/views/plant_parts/edit.html.haml_spec.rb @@ -1,15 +1,3 @@ -## 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. -## -## 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 73dec883e..65ecf2d63 100644 --- a/spec/views/plant_parts/index.html.haml_spec.rb +++ b/spec/views/plant_parts/index.html.haml_spec.rb @@ -1,15 +1,3 @@ -## 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. -## -## 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 diff --git a/spec/views/plant_parts/new.html.haml_spec.rb b/spec/views/plant_parts/new.html.haml_spec.rb index 31218ee71..b1b3f12ae 100644 --- a/spec/views/plant_parts/new.html.haml_spec.rb +++ b/spec/views/plant_parts/new.html.haml_spec.rb @@ -1,15 +1,3 @@ -## 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. -## -## 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 bffd0f394..b367a723b 100644 --- a/spec/views/plant_parts/show.html.haml_spec.rb +++ b/spec/views/plant_parts/show.html.haml_spec.rb @@ -1,15 +1,3 @@ -## 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. -## -## 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 926150f73..692b53173 100644 --- a/spec/views/plantings/_form.html.haml_spec.rb +++ b/spec/views/plantings/_form.html.haml_spec.rb @@ -1,15 +1,3 @@ -## 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. -## -## If you submit a pull request containing new view or controller tests, it will not be -## merged. - require 'rails_helper' describe "plantings/_form" do diff --git a/spec/views/plantings/edit.html.haml_spec.rb b/spec/views/plantings/edit.html.haml_spec.rb index fc7ff7f30..b83af0028 100644 --- a/spec/views/plantings/edit.html.haml_spec.rb +++ b/spec/views/plantings/edit.html.haml_spec.rb @@ -1,15 +1,3 @@ -## 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. -## -## If you submit a pull request containing new view or controller tests, it will not be -## merged. - require 'rails_helper' describe "plantings/edit" do diff --git a/spec/views/plantings/index.html.haml_spec.rb b/spec/views/plantings/index.html.haml_spec.rb index 10de32f81..f682d62e9 100644 --- a/spec/views/plantings/index.html.haml_spec.rb +++ b/spec/views/plantings/index.html.haml_spec.rb @@ -1,15 +1,3 @@ -## 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. -## -## 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 1d15ad5cc..c4a394561 100644 --- a/spec/views/plantings/index.rss.haml_spec.rb +++ b/spec/views/plantings/index.rss.haml_spec.rb @@ -1,15 +1,3 @@ -## 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. -## -## 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 db1da2826..6667a05ee 100644 --- a/spec/views/plantings/new.html.haml_spec.rb +++ b/spec/views/plantings/new.html.haml_spec.rb @@ -1,15 +1,3 @@ -## 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. -## -## If you submit a pull request containing new view or controller tests, it will not be -## merged. - require 'rails_helper' describe "plantings/new" do diff --git a/spec/views/plantings/show.html.haml_spec.rb b/spec/views/plantings/show.html.haml_spec.rb index b68ceb6c1..c20f7e909 100644 --- a/spec/views/plantings/show.html.haml_spec.rb +++ b/spec/views/plantings/show.html.haml_spec.rb @@ -1,15 +1,3 @@ -## 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. -## -## 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 833970b29..a153995c5 100644 --- a/spec/views/posts/_single.html.haml_spec.rb +++ b/spec/views/posts/_single.html.haml_spec.rb @@ -1,15 +1,3 @@ -## 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. -## -## If you submit a pull request containing new view or controller tests, it will not be -## merged. - require 'rails_helper' describe "posts/_single" do diff --git a/spec/views/posts/edit.html.haml_spec.rb b/spec/views/posts/edit.html.haml_spec.rb index 8bee4298b..48d64a267 100644 --- a/spec/views/posts/edit.html.haml_spec.rb +++ b/spec/views/posts/edit.html.haml_spec.rb @@ -1,15 +1,3 @@ -## 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. -## -## If you submit a pull request containing new view or controller tests, it will not be -## merged. - require 'rails_helper' describe "posts/edit" do diff --git a/spec/views/posts/index.html.haml_spec.rb b/spec/views/posts/index.html.haml_spec.rb index 17aab3d47..eeebac8b6 100644 --- a/spec/views/posts/index.html.haml_spec.rb +++ b/spec/views/posts/index.html.haml_spec.rb @@ -1,15 +1,3 @@ -## 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. -## -## 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 a47b80b48..3d4ec11f2 100644 --- a/spec/views/posts/index.rss.haml_spec.rb +++ b/spec/views/posts/index.rss.haml_spec.rb @@ -1,15 +1,3 @@ -## 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. -## -## 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 diff --git a/spec/views/posts/new.html.haml_spec.rb b/spec/views/posts/new.html.haml_spec.rb index 0c788716e..fa344e55b 100644 --- a/spec/views/posts/new.html.haml_spec.rb +++ b/spec/views/posts/new.html.haml_spec.rb @@ -1,15 +1,3 @@ -## 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. -## -## If you submit a pull request containing new view or controller tests, it will not be -## merged. - require 'rails_helper' describe "posts/new" do diff --git a/spec/views/posts/show.rss.haml_spec.rb b/spec/views/posts/show.rss.haml_spec.rb index 97625fa2c..c22c4196f 100644 --- a/spec/views/posts/show.rss.haml_spec.rb +++ b/spec/views/posts/show.rss.haml_spec.rb @@ -1,15 +1,3 @@ -## 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. -## -## 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 diff --git a/spec/views/products/edit.html.haml_spec.rb b/spec/views/products/edit.html.haml_spec.rb index e0d8ebbda..3d60c9e95 100644 --- a/spec/views/products/edit.html.haml_spec.rb +++ b/spec/views/products/edit.html.haml_spec.rb @@ -1,15 +1,3 @@ -## 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. -## -## 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 cbde70cf1..90e08e2a3 100644 --- a/spec/views/products/index.html.haml_spec.rb +++ b/spec/views/products/index.html.haml_spec.rb @@ -1,15 +1,3 @@ -## 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. -## -## 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 d75741775..336c6bac1 100644 --- a/spec/views/products/new.html.haml_spec.rb +++ b/spec/views/products/new.html.haml_spec.rb @@ -1,15 +1,3 @@ -## 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. -## -## 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 ee529cc71..315d9caae 100644 --- a/spec/views/products/show.html.haml_spec.rb +++ b/spec/views/products/show.html.haml_spec.rb @@ -1,15 +1,3 @@ -## 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. -## -## 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 9135b8639..a86f67ceb 100644 --- a/spec/views/roles/edit.html.haml_spec.rb +++ b/spec/views/roles/edit.html.haml_spec.rb @@ -1,15 +1,3 @@ -## 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. -## -## 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 54fe35337..e4b28e9ba 100644 --- a/spec/views/roles/index.html.haml_spec.rb +++ b/spec/views/roles/index.html.haml_spec.rb @@ -1,15 +1,3 @@ -## 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. -## -## 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 a56fce052..1cdce8c41 100644 --- a/spec/views/roles/new.html.haml_spec.rb +++ b/spec/views/roles/new.html.haml_spec.rb @@ -1,15 +1,3 @@ -## 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. -## -## 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 03df232ec..56f1cc4fb 100644 --- a/spec/views/roles/show.html.haml_spec.rb +++ b/spec/views/roles/show.html.haml_spec.rb @@ -1,15 +1,3 @@ -## 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. -## -## 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 abd9b4c62..ecaa2056f 100644 --- a/spec/views/scientific_names/edit.html.haml_spec.rb +++ b/spec/views/scientific_names/edit.html.haml_spec.rb @@ -1,15 +1,3 @@ -## 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. -## -## 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 diff --git a/spec/views/scientific_names/index.html.haml_spec.rb b/spec/views/scientific_names/index.html.haml_spec.rb index 248ca5be9..4d63ac9e1 100644 --- a/spec/views/scientific_names/index.html.haml_spec.rb +++ b/spec/views/scientific_names/index.html.haml_spec.rb @@ -1,15 +1,3 @@ -## 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. -## -## 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 f820007a7..0cf5a4205 100644 --- a/spec/views/scientific_names/new.html.haml_spec.rb +++ b/spec/views/scientific_names/new.html.haml_spec.rb @@ -1,15 +1,3 @@ -## 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. -## -## 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 diff --git a/spec/views/scientific_names/show.html.haml_spec.rb b/spec/views/scientific_names/show.html.haml_spec.rb index a12082fa4..b728df2b3 100644 --- a/spec/views/scientific_names/show.html.haml_spec.rb +++ b/spec/views/scientific_names/show.html.haml_spec.rb @@ -1,15 +1,3 @@ -## 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. -## -## 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 diff --git a/spec/views/seeds/edit.html.haml_spec.rb b/spec/views/seeds/edit.html.haml_spec.rb index 6822bf961..f450d7065 100644 --- a/spec/views/seeds/edit.html.haml_spec.rb +++ b/spec/views/seeds/edit.html.haml_spec.rb @@ -1,15 +1,3 @@ -## 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. -## -## 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 7e2b3df88..4df8e526c 100644 --- a/spec/views/seeds/index.rss.haml_spec.rb +++ b/spec/views/seeds/index.rss.haml_spec.rb @@ -1,15 +1,3 @@ -## 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. -## -## 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 diff --git a/spec/views/seeds/new.html.haml_spec.rb b/spec/views/seeds/new.html.haml_spec.rb index a05da5b23..5c5cf3ae4 100644 --- a/spec/views/seeds/new.html.haml_spec.rb +++ b/spec/views/seeds/new.html.haml_spec.rb @@ -1,15 +1,3 @@ -## 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. -## -## If you submit a pull request containing new view or controller tests, it will not be -## merged. - require 'rails_helper' describe "seeds/new" do diff --git a/spec/views/seeds/show.html.haml_spec.rb b/spec/views/seeds/show.html.haml_spec.rb index 654d27b0f..975f2baa1 100644 --- a/spec/views/seeds/show.html.haml_spec.rb +++ b/spec/views/seeds/show.html.haml_spec.rb @@ -1,15 +1,3 @@ -## 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. -## -## If you submit a pull request containing new view or controller tests, it will not be -## merged. - require 'rails_helper' describe "seeds/show" do diff --git a/spec/views/shop/index_spec.rb b/spec/views/shop/index_spec.rb index e809782bc..3bd0061d7 100644 --- a/spec/views/shop/index_spec.rb +++ b/spec/views/shop/index_spec.rb @@ -1,15 +1,3 @@ -## 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. -## -## 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 From 3ffdc61428d52bb65e94ee5a92482c022a5262c5 Mon Sep 17 00:00:00 2001 From: deppbot Date: Sat, 18 Nov 2017 08:10:02 +0800 Subject: [PATCH 02/20] Bundle Update on 2017-11-18 --- Gemfile.lock | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Gemfile.lock b/Gemfile.lock index 5e1f4564c..6cdced74a 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -423,7 +423,7 @@ GEM thor (>= 0.18.1, < 2.0) rainbow (2.1.0) raindrops (0.19.0) - rake (12.2.1) + rake (12.3.0) rb-fsevent (0.10.2) rb-inotify (0.9.10) ffi (>= 0.5.0, < 2) @@ -630,6 +630,7 @@ DEPENDENCIES will_paginate xmlrpc + RUBY VERSION ruby 2.4.1p111 From 6a17ba547ff9b2a5ce3ec3a3dc82927600eb8ac2 Mon Sep 17 00:00:00 2001 From: Logan Gingerich Date: Mon, 6 Nov 2017 07:40:15 -0700 Subject: [PATCH 03/20] fixes #1433 Says what item you're adding a photo to on photos#new --- app/controllers/photos_controller.rb | 3 ++- app/views/photos/new.html.haml | 4 ++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/app/controllers/photos_controller.rb b/app/controllers/photos_controller.rb index 0dd3a275d..e0de2ff65 100644 --- a/app/controllers/photos_controller.rb +++ b/app/controllers/photos_controller.rb @@ -19,8 +19,9 @@ class PhotosController < ApplicationController def new @type = params[:type] @id = params[:id] - @photo = Photo.new + planting = Planting.find @id + @crop_name = Crop.find(planting.crop_id).name.capitalize retrieve_from_flickr respond_with @photo end diff --git a/app/views/photos/new.html.haml b/app/views/photos/new.html.haml index 4bb2013f2..6ff5df91a 100644 --- a/app/views/photos/new.html.haml +++ b/app/views/photos/new.html.haml @@ -1,5 +1,9 @@ - content_for :title, "New Photo" +%h3 + Choose photo for + = @crop_name + - if @flickr_auth %p Connected to Flickr as From 1f4f806bb0ad73a8be63ab4e67236e88618835cc Mon Sep 17 00:00:00 2001 From: Logan Gingerich Date: Mon, 6 Nov 2017 13:10:12 -0700 Subject: [PATCH 04/20] Now displays correctly for planting, harvest or garden --- app/controllers/photos_controller.rb | 5 +++-- app/views/photos/new.html.haml | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/app/controllers/photos_controller.rb b/app/controllers/photos_controller.rb index e0de2ff65..b18811090 100644 --- a/app/controllers/photos_controller.rb +++ b/app/controllers/photos_controller.rb @@ -19,9 +19,10 @@ class PhotosController < ApplicationController def new @type = params[:type] @id = params[:id] + @photo = Photo.new - planting = Planting.find @id - @crop_name = Crop.find(planting.crop_id).name.capitalize + item_class = Growstuff::Constants::PhotoModels.get_item(params[:type]) + @item = item_class.find_by!(id: params[:id], owner_id: current_member.id) retrieve_from_flickr respond_with @photo end diff --git a/app/views/photos/new.html.haml b/app/views/photos/new.html.haml index 6ff5df91a..31023b694 100644 --- a/app/views/photos/new.html.haml +++ b/app/views/photos/new.html.haml @@ -2,7 +2,7 @@ %h3 Choose photo for - = @crop_name + = @item - if @flickr_auth %p From 305702f644cf455f9ff3b9c0cf265f150756248d Mon Sep 17 00:00:00 2001 From: Logan Gingerich Date: Thu, 9 Nov 2017 10:27:57 -0700 Subject: [PATCH 05/20] Refactored and specs updated --- app/controllers/photos_controller.rb | 15 +++++++++------ spec/controllers/photos_controller_spec.rb | 20 ++++++++++++-------- 2 files changed, 21 insertions(+), 14 deletions(-) diff --git a/app/controllers/photos_controller.rb b/app/controllers/photos_controller.rb index b18811090..0e1a11410 100644 --- a/app/controllers/photos_controller.rb +++ b/app/controllers/photos_controller.rb @@ -21,8 +21,7 @@ class PhotosController < ApplicationController @id = params[:id] @photo = Photo.new - item_class = Growstuff::Constants::PhotoModels.get_item(params[:type]) - @item = item_class.find_by!(id: params[:id], owner_id: current_member.id) + find_item_name retrieve_from_flickr respond_with @photo end @@ -76,15 +75,19 @@ class PhotosController < ApplicationController raise "No item id provided" unless item_id? collection = Growstuff::Constants::PhotoModels.get_relation(@photo, 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 + find_item_name + raise "Could not find this item owned by you" unless @item - collection << item unless collection.include?(item) + collection << @item unless collection.include?(@item) rescue => e flash[:alert] = e.message end + def find_item_name + item_class = Growstuff::Constants::PhotoModels.get_item(params[:type]) + @item = item_class.find_by!(id: params[:id], owner_id: current_member.id) + end + def retrieve_from_flickr @flickr_auth = current_member.auth('flickr') @current_set = params[:set] diff --git a/spec/controllers/photos_controller_spec.rb b/spec/controllers/photos_controller_spec.rb index 8f4fab28e..bc9d1dbad 100644 --- a/spec/controllers/photos_controller_spec.rb +++ b/spec/controllers/photos_controller_spec.rb @@ -29,37 +29,41 @@ describe PhotosController do @member.stub(:flickr_photos) { [[], 0] } @member.stub(:flickr_sets) { { "foo" => "bar" } } controller.stub(:current_member) { @member } + @tomato = FactoryBot.create(:tomato) + @planting1 = FactoryBot.create(:planting, crop: @tomato, owner: @member) + @garden1 = FactoryBot.create(:garden, owner: @member) + @harvest1 = FactoryBot.create(:harvest, owner: @member) end it "assigns the flickr auth as @flickr_auth" do @auth = FactoryBot.create(:flickr_authentication, member: @member) - get :new, {} + get :new, type: "planting", id: @planting1.id assigns(:flickr_auth).should be_an_instance_of(Authentication) end it "assigns a planting id" do - get :new, type: "planting", id: 5 - assigns(:id).should eq "5" + get :new, type: "planting", id: @planting1.id + assigns(:id).should eq @planting1.id.to_s 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" + get :new, type: "harvest", id: @harvest1.id + assigns(:id).should eq @harvest1.id.to_s 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" + get :new, type: "garden", id: @garden1.id + assigns(:id).should eq @garden1.id.to_s 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' + get :new, type: "planting", id: @planting1.id, set: 'foo' assigns(:current_set).should eq "foo" expect(flash[:alert]).not_to be_present end From 9e98db423ed6fcdf8aded55ee806990056715104 Mon Sep 17 00:00:00 2001 From: Brenda Wallace Date: Sat, 18 Nov 2017 15:44:45 +1300 Subject: [PATCH 06/20] Tidy up photos logic, and test of signin/out on photos#new --- app/controllers/photos_controller.rb | 45 +++++++------ spec/controllers/photos_controller_spec.rb | 76 ++++++++++------------ spec/features/signout_spec.rb | 20 ++++-- 3 files changed, 74 insertions(+), 67 deletions(-) diff --git a/app/controllers/photos_controller.rb b/app/controllers/photos_controller.rb index 0e1a11410..4dfc3c602 100644 --- a/app/controllers/photos_controller.rb +++ b/app/controllers/photos_controller.rb @@ -17,11 +17,12 @@ class PhotosController < ApplicationController end def new - @type = params[:type] @id = params[:id] + @type = params[:type] + redirect_to photos_path if @type.nil? @photo = Photo.new - find_item_name + @item = item_to_link_to retrieve_from_flickr respond_with @photo end @@ -31,9 +32,14 @@ class PhotosController < ApplicationController end def create - find_or_create_photo_from_flickr_photo - add_photo_to_collection - @photo.save if @photo.present? + @photo = find_or_create_photo_from_flickr_photo + @item = item_to_link_to + raise "Could not find this item owned by you" unless @item + collection << @item unless collection.include?(@item) + @photo.save! if @photo.present? + rescue => e + flash[:alert] = e.message + ensure respond_with @photo end @@ -50,6 +56,10 @@ class PhotosController < ApplicationController private def item_id? + item_id.present? + end + + def item_id params.key? :id end @@ -63,29 +73,22 @@ class PhotosController < ApplicationController end 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 + 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 add_photo_to_collection + def 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]) - - find_item_name - raise "Could not find this item owned by you" unless @item - - collection << @item unless collection.include?(@item) - rescue => e - flash[:alert] = e.message + Growstuff::Constants::PhotoModels.get_relation(@photo, params[:type]) end - def find_item_name + def item_to_link_to item_class = Growstuff::Constants::PhotoModels.get_item(params[:type]) - @item = item_class.find_by!(id: params[:id], owner_id: current_member.id) + item_class.find_by!(id: params[:id], owner_id: current_member.id) end def retrieve_from_flickr diff --git a/spec/controllers/photos_controller_spec.rb b/spec/controllers/photos_controller_spec.rb index bc9d1dbad..8788ee09f 100644 --- a/spec/controllers/photos_controller_spec.rb +++ b/spec/controllers/photos_controller_spec.rb @@ -23,49 +23,41 @@ describe PhotosController do end describe "GET new" do + let(:tomato) { FactoryBot.create(:tomato) } + let(:planting) { FactoryBot.create(:planting, crop: tomato, owner: member) } + let(:garden) { FactoryBot.create(:garden, owner: member) } + let(:harvest) { FactoryBot.create(:harvest, owner: member) } + let(:member) { FactoryBot.create(:member) } + let!(:auth) { FactoryBot.create(:flickr_authentication, member: member) } + before(:each) do - @member = FactoryBot.create(:member) - sign_in @member - @member.stub(:flickr_photos) { [[], 0] } - @member.stub(:flickr_sets) { { "foo" => "bar" } } - controller.stub(:current_member) { @member } - @tomato = FactoryBot.create(:tomato) - @planting1 = FactoryBot.create(:planting, crop: @tomato, owner: @member) - @garden1 = FactoryBot.create(:garden, owner: @member) - @harvest1 = FactoryBot.create(:harvest, owner: @member) + sign_in member + member.stub(:flickr_photos) { [[], 0] } + member.stub(:flickr_sets) { { "foo" => "bar" } } + controller.stub(:current_member) { member } end - it "assigns the flickr auth as @flickr_auth" do - @auth = FactoryBot.create(:flickr_authentication, member: @member) - get :new, type: "planting", id: @planting1.id - assigns(:flickr_auth).should be_an_instance_of(Authentication) + describe "planting photos" do + before(:each) { get :new, type: "planting", id: planting.id } + it { assigns(:flickr_auth).should be_an_instance_of(Authentication) } + it { assigns(:id).should eq planting.id.to_s } + it { assigns(:type).should eq "planting" } + it { expect(flash[:alert]).not_to be_present } + it { expect(flash[:alert]).not_to be_present } end - it "assigns a planting id" do - get :new, type: "planting", id: @planting1.id - assigns(:id).should eq @planting1.id.to_s - assigns(:type).should eq "planting" - expect(flash[:alert]).not_to be_present + describe "harvest photos" do + before { get :new, type: "harvest", id: harvest.id } + it { assigns(:id).should eq harvest.id.to_s } + it { assigns(:type).should eq "harvest" } + it { expect(flash[:alert]).not_to be_present } end - it "assigns a harvest id" do - get :new, type: "harvest", id: @harvest1.id - assigns(:id).should eq @harvest1.id.to_s - assigns(:type).should eq "harvest" - expect(flash[:alert]).not_to be_present - end - - it "assigns a garden id" do - get :new, type: "garden", id: @garden1.id - assigns(:id).should eq @garden1.id.to_s - assigns(:type).should eq "garden" - expect(flash[:alert]).not_to be_present - end - - it "assigns the current set as @current_set" do - get :new, type: "planting", id: @planting1.id, set: 'foo' - assigns(:current_set).should eq "foo" - expect(flash[:alert]).not_to be_present + describe "garden photos" do + before { get :new, type: "garden", id: garden.id } + it { assigns(:id).should eq garden.id.to_s } + it { assigns(:type).should eq "garden" } + it { expect(flash[:alert]).not_to be_present } end end @@ -92,11 +84,13 @@ describe PhotosController do Photo.last.plantings.first.should eq planting end - it "doesn't attach a photo to a planting twice" do - 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 + describe "doesn't attach a photo to a planting twice" do + before do + 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 + end + it { expect(flash[:alert]).not_to be_present } + it { expect(Photo.last.plantings.size).to eq 1 } end it "attaches the photo to a harvest" do diff --git a/spec/features/signout_spec.rb b/spec/features/signout_spec.rb index 433286078..575f11678 100644 --- a/spec/features/signout_spec.rb +++ b/spec/features/signout_spec.rb @@ -13,17 +13,27 @@ feature "signout" do expect(current_path).to eq crops_path end - scenario "after signout, redirect to signin page if page needs authentication" do - models = %w[plantings harvests posts photos gardens seeds] - models.each do |model| - visit "/#{model}/new" + shared_examples "sign-in redirects" do |path| + scenario "after signout, redirect to signin page if page needs authentication" do + visit path expect(current_path).to eq new_member_session_path fill_in 'Login', with: member.login_name fill_in 'Password', with: member.password click_button 'Sign in' - expect(current_path).to eq "/#{model}/new" + expect(current_path).to eq path click_link 'Sign out' expect(current_path).to eq new_member_session_path end end + + let(:path) {} + describe 'most models' do + let(:garden) { FactoryBot.create :garden, owner: member } + include_examples "sign-in redirects", "/plantings/new" + include_examples "sign-in redirects", "/harvests/new" + include_examples "sign-in redirects", "/posts/new" + include_examples "sign-in redirects", "/gardens/new" + include_examples "sign-in redirects", "/seeds/new" + include_examples "sign-in redirects", "/photos/new?type=garden&id=1" + end end From 1322ebd8e37c68a9803b77225e38728751c09fb0 Mon Sep 17 00:00:00 2001 From: Brenda Wallace Date: Sat, 18 Nov 2017 16:50:56 +1300 Subject: [PATCH 07/20] Use the ||= operator --- 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 4dfc3c602..3703557d2 100644 --- a/app/controllers/photos_controller.rb +++ b/app/controllers/photos_controller.rb @@ -74,7 +74,7 @@ class PhotosController < ApplicationController 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 ||= Photo.new(photo_params) photo.owner_id = current_member.id photo.set_flickr_metadata photo From 771443ee855d9d866445e7fc332dbaa714edb312 Mon Sep 17 00:00:00 2001 From: Brenda Wallace Date: Sat, 18 Nov 2017 16:51:25 +1300 Subject: [PATCH 08/20] Removed rescue in a controller --- app/controllers/photos_controller.rb | 3 --- 1 file changed, 3 deletions(-) diff --git a/app/controllers/photos_controller.rb b/app/controllers/photos_controller.rb index 3703557d2..5c8dedfd1 100644 --- a/app/controllers/photos_controller.rb +++ b/app/controllers/photos_controller.rb @@ -37,9 +37,6 @@ class PhotosController < ApplicationController raise "Could not find this item owned by you" unless @item collection << @item unless collection.include?(@item) @photo.save! if @photo.present? - rescue => e - flash[:alert] = e.message - ensure respond_with @photo end From f98bb32612144eb92ed7c5b8eaabedddd6233d33 Mon Sep 17 00:00:00 2001 From: Brenda Wallace Date: Sat, 18 Nov 2017 17:14:29 +1300 Subject: [PATCH 09/20] Shaved some yaks to remove a rescue from a controller --- app/controllers/photos_controller.rb | 57 +++++++++++++--------- spec/controllers/photos_controller_spec.rb | 29 +++++------ 2 files changed, 48 insertions(+), 38 deletions(-) diff --git a/app/controllers/photos_controller.rb b/app/controllers/photos_controller.rb index 5c8dedfd1..2c707f726 100644 --- a/app/controllers/photos_controller.rb +++ b/app/controllers/photos_controller.rb @@ -17,10 +17,6 @@ class PhotosController < ApplicationController end def new - @id = params[:id] - @type = params[:type] - redirect_to photos_path if @type.nil? - @photo = Photo.new @item = item_to_link_to retrieve_from_flickr @@ -32,11 +28,13 @@ class PhotosController < ApplicationController end def create - @photo = find_or_create_photo_from_flickr_photo - @item = item_to_link_to - raise "Could not find this item owned by you" unless @item - collection << @item unless collection.include?(@item) - @photo.save! if @photo.present? + ActiveRecord::Base.transaction do + @photo = find_or_create_photo_from_flickr_photo + @item = item_to_link_to + raise "Could not find this #{type} owned by you" unless @item + collection << @item unless collection.include?(@item) + @photo.save! if @photo.present? + end respond_with @photo end @@ -52,12 +50,14 @@ class PhotosController < ApplicationController private - def item_id? - item_id.present? + # + # Params + def item_id + params[:id] end - def item_id - params.key? :id + def item_type + params[:type] end def flickr_photo_id_param @@ -69,6 +69,26 @@ class PhotosController < ApplicationController :license_url, :thumbnail_url, :fullsize_url, :link_url) end + # Item with photos attached + # + def item_to_link_to + raise "No item id provided" if item_id.nil? + raise "No item type provided" if item_type.nil? + raise "Missing or invalid type provided" unless photos_supported_on_type?(item_type) + item_class = Growstuff::Constants::PhotoModels.get_item(item_type) + item_class.find_by!(id: params[:id], owner_id: current_member.id) + end + + def collection + Growstuff::Constants::PhotoModels.get_relation(@photo, item_type) + end + + def photos_supported_on_type?(_type) + Growstuff::Constants::PhotoModels.types.include?(item_type) + end + + # + # Flickr retrieval def find_or_create_photo_from_flickr_photo photo = Photo.find_by(flickr_photo_id: flickr_photo_id_param) photo ||= Photo.new(photo_params) @@ -77,17 +97,6 @@ class PhotosController < ApplicationController photo end - def collection - raise "Missing or invalid type provided" unless Growstuff::Constants::PhotoModels.types.include?(params[:type]) - raise "No item id provided" unless item_id? - Growstuff::Constants::PhotoModels.get_relation(@photo, params[:type]) - end - - def item_to_link_to - item_class = Growstuff::Constants::PhotoModels.get_item(params[:type]) - item_class.find_by!(id: params[:id], owner_id: current_member.id) - end - def retrieve_from_flickr @flickr_auth = current_member.auth('flickr') @current_set = params[:set] diff --git a/spec/controllers/photos_controller_spec.rb b/spec/controllers/photos_controller_spec.rb index 8788ee09f..3c4f9dacb 100644 --- a/spec/controllers/photos_controller_spec.rb +++ b/spec/controllers/photos_controller_spec.rb @@ -40,23 +40,20 @@ describe PhotosController do describe "planting photos" do before(:each) { get :new, type: "planting", id: planting.id } it { assigns(:flickr_auth).should be_an_instance_of(Authentication) } - it { assigns(:id).should eq planting.id.to_s } - it { assigns(:type).should eq "planting" } + it { assigns(:item).should eq planting } it { expect(flash[:alert]).not_to be_present } it { expect(flash[:alert]).not_to be_present } end describe "harvest photos" do before { get :new, type: "harvest", id: harvest.id } - it { assigns(:id).should eq harvest.id.to_s } - it { assigns(:type).should eq "harvest" } + it { assigns(:item).should eq harvest } it { expect(flash[:alert]).not_to be_present } end describe "garden photos" do before { get :new, type: "garden", id: garden.id } - it { assigns(:id).should eq garden.id.to_s } - it { assigns(:type).should eq "garden" } + it { assigns(:item).should eq garden } it { expect(flash[:alert]).not_to be_present } end end @@ -108,18 +105,20 @@ describe PhotosController do it "doesn't attach photo to a comment" do comment = FactoryBot.create(:comment) - post :create, photo: { flickr_photo_id: photo.flickr_photo_id }, type: "comment", id: comment.id - expect(flash[:alert]).to be_present + expect do + post :create, photo: { flickr_photo_id: photo.flickr_photo_id }, type: "comment", id: comment.id + end.to raise_error end end describe "for the second time" do + let(:planting) { FactoryBot.create :planting, owner: member } it "does not add a photo twice" do expect do - post :create, photo: { flickr_photo_id: 1 } + post :create, photo: { flickr_photo_id: 1 }, id: planting.id, type: 'planting' end.to change(Photo, :count).by(1) expect do - post :create, photo: { flickr_photo_id: 1 } + post :create, photo: { flickr_photo_id: 1 }, id: planting.id, type: 'planting' end.to change(Photo, :count).by(0) end end @@ -146,16 +145,18 @@ describe PhotosController do it "does not create the planting/photo link" do # members will be auto-created, and different another_planting = FactoryBot.create(:planting) - post :create, photo: { flickr_photo_id: photo.flickr_photo_id }, type: "planting", id: another_planting.id - expect(flash[:alert]).to be_present + expect do + post :create, photo: { flickr_photo_id: photo.flickr_photo_id }, type: "planting", id: another_planting.id + end.to raise_error(ActiveRecord::RecordNotFound) 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 another_harvest = FactoryBot.create(:harvest) - post :create, photo: { flickr_photo_id: photo.flickr_photo_id }, type: "harvest", id: another_harvest.id - expect(flash[:alert]).to be_present + expect do + post :create, photo: { flickr_photo_id: photo.flickr_photo_id }, type: "harvest", id: another_harvest.id + end.to raise_error(ActiveRecord::RecordNotFound) Photo.last.harvests.first.should_not eq another_harvest end end From c66a5b12a581a0e7e3c183e28635b397d751b4bd Mon Sep 17 00:00:00 2001 From: Brenda Wallace Date: Sat, 18 Nov 2017 21:52:29 +1300 Subject: [PATCH 10/20] Reduced the tests of signout on photos/new --- spec/features/signout_spec.rb | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/spec/features/signout_spec.rb b/spec/features/signout_spec.rb index 575f11678..107795cc1 100644 --- a/spec/features/signout_spec.rb +++ b/spec/features/signout_spec.rb @@ -17,23 +17,34 @@ feature "signout" do scenario "after signout, redirect to signin page if page needs authentication" do visit path expect(current_path).to eq new_member_session_path + expect(page).to have_http_status(200) fill_in 'Login', with: member.login_name fill_in 'Password', with: member.password click_button 'Sign in' - expect(current_path).to eq path + expect(page).to have_http_status(200) + # path has params removed after signin + expect(current_path).to eq path.split('?')[0] click_link 'Sign out' + expect(page).to have_http_status(200) expect(current_path).to eq new_member_session_path end end let(:path) {} - describe 'most models' do - let(:garden) { FactoryBot.create :garden, owner: member } + describe 'after signout, redirect to signin page if page needs authentication' do include_examples "sign-in redirects", "/plantings/new" include_examples "sign-in redirects", "/harvests/new" include_examples "sign-in redirects", "/posts/new" include_examples "sign-in redirects", "/gardens/new" include_examples "sign-in redirects", "/seeds/new" - include_examples "sign-in redirects", "/photos/new?type=garden&id=1" + end + + scenario 'photos' do + garden = FactoryBot.create :garden, owner: member + visit "/photos/new?id=#{garden.id}&type=garden" + expect(current_path).to eq new_member_session_path + expect(page).to have_http_status(200) + # photos/new needs id&type params, + # but these are stripped after signing in end end From 4743fc7a6341ccee59e7031cce7a131e41072141 Mon Sep 17 00:00:00 2001 From: Brenda Wallace Date: Sat, 18 Nov 2017 22:12:03 +1300 Subject: [PATCH 11/20] Feature spec for showing item details on photo adding page --- app/views/gardens/show.html.haml | 4 +- spec/features/photos/new_photo_spec.rb | 51 ++++++++++++++++++++++++++ 2 files changed, 53 insertions(+), 2 deletions(-) create mode 100644 spec/features/photos/new_photo_spec.rb diff --git a/app/views/gardens/show.html.haml b/app/views/gardens/show.html.haml index 70f062468..ef5b41cfb 100644 --- a/app/views/gardens/show.html.haml +++ b/app/views/gardens/show.html.haml @@ -91,8 +91,8 @@ %p = link_to new_photo_path(type: "garden", id: @garden.id), class: 'btn btn-primary' do - %span.glyphicon.glyphicon-camera{ title: "Add Photo" } - Add Photo + %span.glyphicon.glyphicon-camera{ title: "Add photo" } + Add photo - if @garden.photos.size.positive? %h3= localize_plural(@garden.photos, Photo) .row diff --git a/spec/features/photos/new_photo_spec.rb b/spec/features/photos/new_photo_spec.rb new file mode 100644 index 000000000..0f0c8af2c --- /dev/null +++ b/spec/features/photos/new_photo_spec.rb @@ -0,0 +1,51 @@ +require 'rails_helper' + +feature "new photo page" do + let(:photo) { FactoryBot.create :photo } + + context "signed in member" do + let(:member) { FactoryBot.create :member } + + background { login_as member } + + context "viewing a planting" do + let(:planting) { FactoryBot.create :planting, owner: member } + + scenario "add photo" do + visit planting_path(planting) + click_link "Add photo" + expect(page).to have_text planting.crop.name + end + end + + context "viewing a harvest" do + let(:harvest) { FactoryBot.create :harvest, owner: member } + + scenario "add photo" do + visit harvest_path(harvest) + click_link "Add photo" + expect(page).to have_text harvest.crop.name + end + end + + context "viewing a garden" do + let(:garden) { FactoryBot.create :garden, owner: member } + + scenario "add photo" do + visit garden_path(garden) + click_link "Add photo" + expect(page).to have_text garden.name + end + end + + pending "viewing a seed" do + let(:seed) { FactoryBot.create :seed, owner: member } + + scenario "add photo" do + visit seed_path(seed) + click_link "Add photo" + expect(page).to have_text seed.to_s + end + end + end +end From 329e0106bba7f95a2401e243d9b02be769b2c2ef Mon Sep 17 00:00:00 2001 From: Brenda Wallace Date: Sat, 18 Nov 2017 22:14:43 +1300 Subject: [PATCH 12/20] Path remains same after sign out for our test cases --- spec/features/signout_spec.rb | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/spec/features/signout_spec.rb b/spec/features/signout_spec.rb index 107795cc1..a6402df2c 100644 --- a/spec/features/signout_spec.rb +++ b/spec/features/signout_spec.rb @@ -22,8 +22,7 @@ feature "signout" do fill_in 'Password', with: member.password click_button 'Sign in' expect(page).to have_http_status(200) - # path has params removed after signin - expect(current_path).to eq path.split('?')[0] + expect(current_path).to eq path click_link 'Sign out' expect(page).to have_http_status(200) expect(current_path).to eq new_member_session_path From 9ab83f7bbc052b5b0be60c948fb913d118e5e7dd Mon Sep 17 00:00:00 2001 From: Logan Gingerich Date: Wed, 15 Nov 2017 09:24:14 -0700 Subject: [PATCH 13/20] Adds a more prominent add photo button to garden and planting show views --- app/views/gardens/show.html.haml | 6 ++++++ app/views/plantings/show.html.haml | 3 +++ 2 files changed, 9 insertions(+) diff --git a/app/views/gardens/show.html.haml b/app/views/gardens/show.html.haml index ef5b41cfb..cdfedeb13 100644 --- a/app/views/gardens/show.html.haml +++ b/app/views/gardens/show.html.haml @@ -12,6 +12,12 @@ .row .col-md-9 %p.btn-group= render 'gardens/actions', garden: @garden + - if can?(:edit, @garden) && can?(:create, Photo) + %p + = link_to new_photo_path(type: "garden", id: @garden.id), + class: 'btn btn-primary' do + %span.glyphicon.glyphicon-camera{ title: "Add Photo" } + Add Photo - unless @garden.active .alert.alert-warning diff --git a/app/views/plantings/show.html.haml b/app/views/plantings/show.html.haml index 099571218..b0208f34a 100644 --- a/app/views/plantings/show.html.haml +++ b/app/views/plantings/show.html.haml @@ -67,6 +67,9 @@ %p= render 'plantings/progress', planting: @planting, show_explanation: true = render 'plantings/actions', planting: @planting + - if !@planting.photos.empty? || (can?(:edit, @planting) && can?(:create, Photo)) + - if can?(:create, Photo) && can?(:edit, @planting) + = link_to "Add photo", new_photo_path(type: "planting", id: @planting.id), class: 'btn btn-primary btn-xs' .col-md-6 = render partial: "crops/index_card", locals: { crop: @planting.crop } From e85daa405baa232db0650a66f6f8b9aee1d5446c Mon Sep 17 00:00:00 2001 From: Logan Gingerich Date: Thu, 16 Nov 2017 09:36:22 -0700 Subject: [PATCH 14/20] Moved add photo button from garden show view to garden actions --- app/views/gardens/_actions.html.haml | 5 +++++ app/views/gardens/show.html.haml | 6 ------ 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/app/views/gardens/_actions.html.haml b/app/views/gardens/_actions.html.haml index 4d262f97c..5aec0ba35 100644 --- a/app/views/gardens/_actions.html.haml +++ b/app/views/gardens/_actions.html.haml @@ -21,3 +21,8 @@ class: 'btn btn-default', id: 'delete_garden_link' do %span.glyphicon.glyphicon-trash{ title: "Delete" } Delete + - if can?(:edit, @garden) && can?(:create, Photo) + = link_to new_photo_path(type: "garden", id: @garden.id), + class: 'btn btn-primary' do + %span.glyphicon.glyphicon-camera{ title: "Add Photo" } + Add Photo diff --git a/app/views/gardens/show.html.haml b/app/views/gardens/show.html.haml index cdfedeb13..ef5b41cfb 100644 --- a/app/views/gardens/show.html.haml +++ b/app/views/gardens/show.html.haml @@ -12,12 +12,6 @@ .row .col-md-9 %p.btn-group= render 'gardens/actions', garden: @garden - - if can?(:edit, @garden) && can?(:create, Photo) - %p - = link_to new_photo_path(type: "garden", id: @garden.id), - class: 'btn btn-primary' do - %span.glyphicon.glyphicon-camera{ title: "Add Photo" } - Add Photo - unless @garden.active .alert.alert-warning From b60510e016fff9083e7db58af077e20ad71a7c34 Mon Sep 17 00:00:00 2001 From: Logan Gingerich Date: Sat, 18 Nov 2017 09:30:43 -0700 Subject: [PATCH 15/20] deleted line 70 on plantings view to clean up logic --- app/views/plantings/show.html.haml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/app/views/plantings/show.html.haml b/app/views/plantings/show.html.haml index b0208f34a..ebddd779e 100644 --- a/app/views/plantings/show.html.haml +++ b/app/views/plantings/show.html.haml @@ -67,9 +67,8 @@ %p= render 'plantings/progress', planting: @planting, show_explanation: true = render 'plantings/actions', planting: @planting - - if !@planting.photos.empty? || (can?(:edit, @planting) && can?(:create, Photo)) - - if can?(:create, Photo) && can?(:edit, @planting) - = link_to "Add photo", new_photo_path(type: "planting", id: @planting.id), class: 'btn btn-primary btn-xs' + - if can?(:create, Photo) && can?(:edit, @planting) + = link_to "Add photo", new_photo_path(type: "planting", id: @planting.id), class: 'btn btn-primary btn-xs' .col-md-6 = render partial: "crops/index_card", locals: { crop: @planting.crop } From 4ced7ee7e904f18b3ff04c41b1c6bc197e63fda2 Mon Sep 17 00:00:00 2001 From: Logan Gingerich Date: Sat, 18 Nov 2017 09:57:23 -0700 Subject: [PATCH 16/20] Whitespace fix, spec fix, and spec addition --- app/views/gardens/_actions.html.haml | 2 +- spec/features/photos/new_photo_spec.rb | 2 +- spec/views/gardens/show.html.haml_spec.rb | 4 ++++ 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/app/views/gardens/_actions.html.haml b/app/views/gardens/_actions.html.haml index 5aec0ba35..a6f85a2e4 100644 --- a/app/views/gardens/_actions.html.haml +++ b/app/views/gardens/_actions.html.haml @@ -23,6 +23,6 @@ Delete - if can?(:edit, @garden) && can?(:create, Photo) = link_to new_photo_path(type: "garden", id: @garden.id), - class: 'btn btn-primary' do + class: 'btn btn-primary' do %span.glyphicon.glyphicon-camera{ title: "Add Photo" } Add Photo diff --git a/spec/features/photos/new_photo_spec.rb b/spec/features/photos/new_photo_spec.rb index 0f0c8af2c..1c13b2793 100644 --- a/spec/features/photos/new_photo_spec.rb +++ b/spec/features/photos/new_photo_spec.rb @@ -13,7 +13,7 @@ feature "new photo page" do scenario "add photo" do visit planting_path(planting) - click_link "Add photo" + click_link('Add photo', match: :first) expect(page).to have_text planting.crop.name end end diff --git a/spec/views/gardens/show.html.haml_spec.rb b/spec/views/gardens/show.html.haml_spec.rb index 015333ae0..7130e2e4f 100644 --- a/spec/views/gardens/show.html.haml_spec.rb +++ b/spec/views/gardens/show.html.haml_spec.rb @@ -50,6 +50,10 @@ describe "gardens/show" do rendered.should have_content "Plant something" end + it "shows an 'add photo' button" do + rendered.should have_content "Add photo" + end + it "links to the right crop in the planting link" do assert_select("a[href='#{new_planting_path}?garden_id=#{@garden.id}']") end From 284f0cddcd530ee82c1d1bdc56ead30636a1053c Mon Sep 17 00:00:00 2001 From: Brenda Wallace Date: Sun, 19 Nov 2017 16:31:17 +1300 Subject: [PATCH 17/20] Fix gardens actions, and add specs A bug slipped into all garden display pages - and there were no tests that caught it. This adds feature specs for gardens#index, which would have detected the un-initialised variable in haml --- app/views/gardens/_actions.html.haml | 4 +- spec/features/gardens/gardens_index_spec.rb | 70 +++++++++++++++++++++ 2 files changed, 72 insertions(+), 2 deletions(-) create mode 100644 spec/features/gardens/gardens_index_spec.rb diff --git a/app/views/gardens/_actions.html.haml b/app/views/gardens/_actions.html.haml index a6f85a2e4..ecf434911 100644 --- a/app/views/gardens/_actions.html.haml +++ b/app/views/gardens/_actions.html.haml @@ -21,8 +21,8 @@ class: 'btn btn-default', id: 'delete_garden_link' do %span.glyphicon.glyphicon-trash{ title: "Delete" } Delete - - if can?(:edit, @garden) && can?(:create, Photo) - = link_to new_photo_path(type: "garden", id: @garden.id), + - if can?(:edit, garden) && can?(:create, Photo) + = link_to new_photo_path(type: "garden", id: garden.id), class: 'btn btn-primary' do %span.glyphicon.glyphicon-camera{ title: "Add Photo" } Add Photo diff --git a/spec/features/gardens/gardens_index_spec.rb b/spec/features/gardens/gardens_index_spec.rb new file mode 100644 index 000000000..39161d5c8 --- /dev/null +++ b/spec/features/gardens/gardens_index_spec.rb @@ -0,0 +1,70 @@ +require 'rails_helper' +require 'custom_matchers' + +feature "Gardens#index", :js do + context "Logged in as member" do + let(:member) { FactoryBot.create :member } + + background { login_as member } + + context "with 10 gardens" do + before do + FactoryBot.create_list :garden, 10, owner: member + visit gardens_path(member: member) + end + + it "displays each of the gardens" do + member.gardens.each do |garden| + expect(page).to have_text garden.name + end + end + it "links to each garden" do + member.gardens.each do |garden| + expect(page).to have_link(garden.name, href: garden_path(garden)) + end + end + end + + context "with inactive gardens" do + let!(:active_garden) { FactoryBot.create :garden, name: "My active garden", owner: member } + let!(:inactive_garden) { FactoryBot.create :inactive_garden, name: "retired garden", owner: member } + + before { visit gardens_path(member: member) } + + it "show active garden" do + expect(page).to have_text active_garden.name + end + it "should not show inactive garden" do + expect(page).not_to have_text inactive_garden.name + end + it "links to active garden" do + expect(page).to have_link(active_garden.name, href: garden_path(active_garden)) + end + it "does not link to inactive gardens" do + expect(page).not_to have_link(inactive_garden.name, href: garden_path(inactive_garden)) + end + end + + context 'with plantings' do + let(:maize) { FactoryBot.create(:maize) } + let(:tomato) { FactoryBot.create(:tomato) } + + let!(:planting) do + FactoryBot.create :planting, owner: member, crop: maize, garden: member.gardens.first + end + let!(:finished_planting) do + FactoryBot.create :finished_planting, owner: member, crop: tomato, garden: member.gardens.first + end + + before do + visit gardens_path(member: member) + end + it "shows planting in garden" do + expect(page).to have_link(planting.crop.name, href: planting_path(planting)) + end + it "does not show finished planting" do + expect(page).not_to have_text(finished_planting.crop.name) + end + end + end +end From d4e4ca65195ac2f0926f9265f5e96319f256b84f Mon Sep 17 00:00:00 2001 From: Brenda Wallace Date: Sun, 19 Nov 2017 16:53:10 +1300 Subject: [PATCH 18/20] Move planting's add photo button to _actions.haml --- app/views/plantings/_actions.html.haml | 25 ++++++++++++++++++------- app/views/plantings/show.html.haml | 2 -- 2 files changed, 18 insertions(+), 9 deletions(-) diff --git a/app/views/plantings/_actions.html.haml b/app/views/plantings/_actions.html.haml index 74ebbd504..d72f6243b 100644 --- a/app/views/plantings/_actions.html.haml +++ b/app/views/plantings/_actions.html.haml @@ -1,16 +1,27 @@ - if can?(:edit, planting) || can?(:destroy, planting) - if can? :edit, planting = link_to edit_planting_path(planting), class: 'btn btn-default btn-xs' do - %span.glyphicon.glyphicon-pencil{ title: "Edit garden" } + %span.glyphicon.glyphicon-pencil{ title: "Edit" } Edit - if can? :destroy, planting = link_to planting, method: :delete, - data: { confirm: 'Are you sure?' }, - class: 'btn btn-default btn-xs' do + data: { confirm: 'Are you sure?' }, class: 'btn btn-default btn-xs' do %span.glyphicon.glyphicon-trash{ title: "Delete" } Delete + - unless planting.finished - = link_to "Mark as finished", planting_path(planting, planting: { finished: 1 }), - method: :put, class: 'btn btn-default btn-xs append-date' - - if can? :create, Harvest - = link_to 'Harvest', new_planting_harvest_path(planting), class: 'btn btn-default btn-xs' + = link_to planting_path(planting, planting: { finished: 1 }), + method: :put, class: 'btn btn-default btn-xs append-date' do + + %span.glyphicon.glyphicon-ok{ title: "Finished" } + Mark as finished + + - if can?(:create, Harvest) + = link_to new_planting_harvest_path(planting), class: 'btn btn-default btn-xs' do + %span.glyphicon.glyphicon-leaf{ title: "Harvest" } + Harvest + + - if can?(:edit, planting) && can?(:create, Photo) + = link_to new_photo_path(id: planting.id, type: 'planting'), class: 'btn btn-default btn-xs' do + %span.glyphicon.glyphicon-camera{ title: "Add photo" } + Add photo diff --git a/app/views/plantings/show.html.haml b/app/views/plantings/show.html.haml index ebddd779e..099571218 100644 --- a/app/views/plantings/show.html.haml +++ b/app/views/plantings/show.html.haml @@ -67,8 +67,6 @@ %p= render 'plantings/progress', planting: @planting, show_explanation: true = render 'plantings/actions', planting: @planting - - if can?(:create, Photo) && can?(:edit, @planting) - = link_to "Add photo", new_photo_path(type: "planting", id: @planting.id), class: 'btn btn-primary btn-xs' .col-md-6 = render partial: "crops/index_card", locals: { crop: @planting.crop } From 451030761de573c7f4cb06260d9e8d032e73967b Mon Sep 17 00:00:00 2001 From: deppbot Date: Tue, 21 Nov 2017 12:11:33 +0800 Subject: [PATCH 19/20] Bundle Update on 2017-11-21 --- Gemfile.lock | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index 6cdced74a..ed43b2add 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -85,7 +85,7 @@ GEM uniform_notifier (~> 1.10.0) byebug (9.1.0) cancancan (2.1.1) - capybara (2.16.0) + capybara (2.16.1) addressable mini_mime (>= 0.1.3) nokogiri (>= 1.3.3) @@ -447,7 +447,7 @@ GEM rspec-mocks (3.7.0) diff-lcs (>= 1.2.0, < 2.0) rspec-support (~> 3.7.0) - rspec-rails (3.7.1) + rspec-rails (3.7.2) actionpack (>= 3.0) activesupport (>= 3.0) railties (>= 3.0) From 6663f3ade40a47cbd84d06d1eb8b9916acc6856e Mon Sep 17 00:00:00 2001 From: Brenda Wallace Date: Tue, 21 Nov 2017 10:09:53 +1300 Subject: [PATCH 20/20] Add id and type back to photos#new --- app/controllers/photos_controller.rb | 2 ++ 1 file changed, 2 insertions(+) diff --git a/app/controllers/photos_controller.rb b/app/controllers/photos_controller.rb index 2c707f726..80d481f60 100644 --- a/app/controllers/photos_controller.rb +++ b/app/controllers/photos_controller.rb @@ -19,6 +19,8 @@ class PhotosController < ApplicationController def new @photo = Photo.new @item = item_to_link_to + @type = item_type + @id = item_id retrieve_from_flickr respond_with @photo end