more percy specs

This commit is contained in:
Brenda Wallace
2019-07-11 12:08:15 +12:00
committed by always-be-closing[bot]
parent a7837f0d8f
commit 6383dbc19f
9 changed files with 26 additions and 5 deletions

View File

@@ -0,0 +1,16 @@
require 'rails_helper'
describe "forums", js: true do
context "as an admin user" do
let(:member) { create :admin_member }
before do
login_as member
end
it "navigating to forum admin with js" do
visit admin_path
Percy.snapshot(page, name: 'Admin page')
end
end
end

View File

@@ -14,6 +14,7 @@ describe 'Commenting on a post' do
click_button "Post comment"
expect(page).to have_content "comment was successfully created."
expect(page).to have_content "Posted by"
Percy.snapshot(page, name: 'Posting a comment')
end
context "editing a comment" do

View File

@@ -34,6 +34,7 @@ describe "Alternate names", js: true do
# expect(page.status_code).to equal 200
expect(page).to have_css "option[value='#{crop.id}'][selected=selected]"
fill_in 'Name', with: "alternative aubergine"
Percy.snapshot(page, name: 'Crop wrangler adding alternate name')
click_on "Save"
# expect(page.status_code).to equal 200
expect(page).to have_content "alternative aubergine"
@@ -77,6 +78,7 @@ describe "Alternate names", js: true do
it "Displays crop rejection message" do
visit alternate_name_path(pending_alt_name)
expect(page).to have_content "This crop was rejected for the following reason: Totally fake"
Percy.snapshot(page, name: 'Rejecting crops')
end
end
end

View File

@@ -70,6 +70,7 @@ describe "member deletion" do
visit member_path(member)
click_link 'Edit profile'
click_link 'Delete Account'
Percy.snapshot(page, name: 'Account deletion')
fill_in "current_pw_for_delete", with: "password1", match: :prefer_exact
click_button "Delete"
logout

View File

@@ -37,6 +37,9 @@ describe "Notifications", :js do
FactoryBot.create_list :notification, 34, recipient: recipient
login_as recipient
visit notifications_path
end
it do
Percy.snapshot(page, name: "notifications#index")
end

View File

@@ -256,11 +256,6 @@ rest of the garden.
end
describe '#new' do
it 'plantings#new' do
visit new_planting_path
Percy.snapshot(page, name: "#{prefix}/plantings#new")
end
it 'crops#new' do
visit new_crop_path
Percy.snapshot(page, name: "#{prefix}/crops#new")

View File

@@ -18,6 +18,7 @@ describe "new photo page" do
click_link('Add photo')
end
expect(page).to have_text planting.crop.name
Percy.snapshot(page, name: 'Add photo to planting')
end
end

View File

@@ -47,6 +47,7 @@ describe "show photo page" do
before do
garden.photos << photo
visit photo_path(photo)
Percy.snapshot(page, name: 'Show photo of a garden')
end
it { expect(page).to have_link "garden named \"#{garden.name}\" by #{garden.owner}", href: garden_path(garden) }

View File

@@ -36,6 +36,7 @@ describe "User searches" do
expect(page).to have_content "Nearby members"
expect(page).to have_content "Seeds available for trade near Philippines"
expect(page).to have_content "Recent plantings near Philippines"
Percy.snapshot(page, name: 'places map')
end
it "goes to members' index page" do