Compare commits

..

20 Commits

Author SHA1 Message Date
Brenda Wallace
6663f3ade4 Add id and type back to photos#new 2017-11-24 19:02:54 +13:00
deppbot
451030761d Bundle Update on 2017-11-21 2017-11-24 19:02:54 +13:00
Brenda Wallace
d4e4ca6519 Move planting's add photo button to _actions.haml 2017-11-24 19:02:54 +13:00
Brenda Wallace
284f0cddcd 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
2017-11-24 19:02:54 +13:00
Logan Gingerich
4ced7ee7e9 Whitespace fix, spec fix, and spec addition 2017-11-24 19:02:54 +13:00
Logan Gingerich
b60510e016 deleted line 70 on plantings view to clean up logic 2017-11-24 19:02:54 +13:00
Logan Gingerich
e85daa405b Moved add photo button from garden show view to garden actions 2017-11-24 19:02:54 +13:00
Logan Gingerich
9ab83f7bbc Adds a more prominent add photo button to garden and planting show views 2017-11-24 19:02:54 +13:00
Brenda Wallace
329e0106bb Path remains same after sign out for our test cases 2017-11-24 19:02:54 +13:00
Brenda Wallace
4743fc7a63 Feature spec for showing item details on photo adding page 2017-11-24 19:02:54 +13:00
Brenda Wallace
c66a5b12a5 Reduced the tests of signout on photos/new 2017-11-24 19:02:54 +13:00
Brenda Wallace
f98bb32612 Shaved some yaks to remove a rescue from a controller 2017-11-24 19:02:54 +13:00
Brenda Wallace
771443ee85 Removed rescue in a controller 2017-11-24 19:02:54 +13:00
Brenda Wallace
1322ebd8e3 Use the ||= operator 2017-11-24 19:02:54 +13:00
Brenda Wallace
9e98db423e Tidy up photos logic, and test of signin/out on photos#new 2017-11-24 19:02:54 +13:00
Logan Gingerich
305702f644 Refactored and specs updated 2017-11-24 19:02:54 +13:00
Logan Gingerich
1f4f806bb0 Now displays correctly for planting, harvest or garden 2017-11-24 19:02:54 +13:00
Logan Gingerich
6a17ba547f fixes #1433 Says what item you're adding a photo to on photos#new 2017-11-24 19:02:54 +13:00
deppbot
3ffdc61428 Bundle Update on 2017-11-18 2017-11-24 19:02:54 +13:00
milesgould
bb6e9e32e6 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
2017-11-24 19:02:54 +13:00
133 changed files with 267 additions and 1573 deletions

View File

@@ -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)
@@ -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)
@@ -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)
@@ -630,6 +630,7 @@ DEPENDENCIES
will_paginate
xmlrpc
RUBY VERSION
ruby 2.4.1p111

View File

@@ -17,10 +17,10 @@ class PhotosController < ApplicationController
end
def new
@type = params[:type]
@id = params[:id]
@photo = Photo.new
@item = item_to_link_to
@type = item_type
@id = item_id
retrieve_from_flickr
respond_with @photo
end
@@ -30,9 +30,13 @@ class PhotosController < ApplicationController
end
def create
find_or_create_photo_from_flickr_photo
add_photo_to_collection
@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
@@ -48,8 +52,14 @@ class PhotosController < ApplicationController
private
def item_id?
params.key? :id
#
# Params
def item_id
params[:id]
end
def item_type
params[:type]
end
def flickr_photo_id_param
@@ -61,26 +71,32 @@ class PhotosController < ApplicationController
:license_url, :thumbnail_url, :fullsize_url, :link_url)
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
# 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 add_photo_to_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])
def collection
Growstuff::Constants::PhotoModels.get_relation(@photo, item_type)
end
item_class = Growstuff::Constants::PhotoModels.get_item(params[:type])
item = item_class.find_by!(id: params[:id], owner_id: current_member.id)
raise "Could not find this item owned by you" unless item
def photos_supported_on_type?(_type)
Growstuff::Constants::PhotoModels.types.include?(item_type)
end
collection << item unless collection.include?(item)
rescue => e
flash[:alert] = e.message
#
# 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)
photo.owner_id = current_member.id
photo.set_flickr_metadata
photo
end
def retrieve_from_flickr

View File

@@ -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

View File

@@ -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

View File

@@ -1,5 +1,9 @@
- content_for :title, "New Photo"
%h3
Choose photo for
= @item
- if @flickr_auth
%p
Connected to Flickr as

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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'
@@ -34,45 +23,38 @@ 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 }
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, {}
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(:item).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: 5
assigns(:id).should eq "5"
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(:item).should eq harvest }
it { expect(flash[:alert]).not_to be_present }
end
it "assigns a harvest id" do
get :new, type: "harvest", id: 5
assigns(:id).should eq "5"
assigns(:type).should eq "harvest"
expect(flash[:alert]).not_to be_present
end
it "assigns a garden id" do
get :new, type: "garden", id: 5
assigns(:id).should eq "5"
assigns(:type).should eq "garden"
expect(flash[:alert]).not_to be_present
end
it "assigns the current set as @current_set" do
get :new, set: 'foo'
assigns(:current_set).should eq "foo"
expect(flash[:alert]).not_to be_present
describe "garden photos" do
before { get :new, type: "garden", id: garden.id }
it { assigns(:item).should eq garden }
it { expect(flash[:alert]).not_to be_present }
end
end
@@ -99,11 +81,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
@@ -121,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
@@ -159,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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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', match: :first)
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

View File

@@ -13,17 +13,37 @@ 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
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 "/#{model}/new"
expect(page).to have_http_status(200)
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
end
end
let(:path) {}
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"
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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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
@@ -62,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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

Some files were not shown because too many files have changed in this diff Show More