mirror of
https://github.com/Growstuff/growstuff.git
synced 2026-10-09 14:44:14 -04:00
Test for linkback of photos to harvest/garden/planting
This commit is contained in:
1 parent
36a9514add
commit
9bcd2d0aa6
1 file changed
+48
@@ -0,0 +1,48 @@
|
||||
require 'rails_helper'
|
||||
|
||||
feature "show photo page" do
|
||||
|
||||
let (:photo) { FactoryGirl.create(:photo) }
|
||||
|
||||
context "signed in member" do
|
||||
let (:member) { FactoryGirl.create(:member) }
|
||||
|
||||
background do
|
||||
login_as(member)
|
||||
end
|
||||
|
||||
context "linked to planting" do
|
||||
let (:planting) { FactoryGirl.create(:planting) }
|
||||
|
||||
scenario "shows linkback to planting" do
|
||||
planting.photos << photo
|
||||
visit photo_path(photo)
|
||||
expect(page).to have_link planting, :href => planting_path(planting)
|
||||
end
|
||||
end
|
||||
|
||||
context "linked to harvest" do
|
||||
let (:harvest) { FactoryGirl.create(:harvest) }
|
||||
|
||||
scenario "shows linkback to harvest" do
|
||||
harvest.photos << photo
|
||||
visit photo_path(photo)
|
||||
expect(page).to have_link harvest, :href => harvest_path(harvest)
|
||||
end
|
||||
end
|
||||
|
||||
context "linked to garden" do
|
||||
let (:garden) { FactoryGirl.create(:garden) }
|
||||
|
||||
scenario "shows linkback to garden" do
|
||||
garden.photos << photo
|
||||
visit photo_path(photo)
|
||||
expect(page).to have_link garden, :href => garden_path(garden)
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
Reference in new issue
Block a user