mirror of
https://github.com/Growstuff/growstuff.git
synced 2026-04-05 07:35:32 -04:00
Swap percy over (#2986)
* Swap percy over * Swap require over * Change API * Update package.json
This commit is contained in:
3
Gemfile
3
Gemfile
@@ -175,7 +175,6 @@ end
|
||||
|
||||
group :test do
|
||||
gem 'codeclimate-test-reporter', require: false
|
||||
gem 'percy-capybara'
|
||||
gem 'rails-controller-testing'
|
||||
gem 'selenium-webdriver'
|
||||
gem 'timecop'
|
||||
@@ -185,3 +184,5 @@ end
|
||||
group :travis do
|
||||
gem 'platform-api'
|
||||
end
|
||||
|
||||
gem "percy-capybara", "~> 5.0.0"
|
||||
|
||||
@@ -389,7 +389,8 @@ GEM
|
||||
parallel (1.20.1)
|
||||
parser (2.7.2.0)
|
||||
ast (~> 2.4.1)
|
||||
percy-capybara (4.3.3)
|
||||
percy-capybara (5.0.0)
|
||||
capybara (>= 3)
|
||||
pg (1.3.4)
|
||||
platform-api (3.3.0)
|
||||
heroics (~> 0.1.1)
|
||||
@@ -678,7 +679,7 @@ DEPENDENCIES
|
||||
omniauth-facebook
|
||||
omniauth-flickr (>= 0.0.15)
|
||||
omniauth-twitter
|
||||
percy-capybara
|
||||
percy-capybara (~> 5.0.0)
|
||||
pg
|
||||
platform-api
|
||||
puma
|
||||
|
||||
@@ -4,7 +4,6 @@
|
||||
"description": "Growstuff Linters",
|
||||
"main": "index.js",
|
||||
"dependencies": {
|
||||
"@percy/agent": "^0.28.7",
|
||||
"mdbootstrap": "^4.20.0"
|
||||
},
|
||||
"engines": {
|
||||
@@ -12,6 +11,7 @@
|
||||
"yarn": ">=0.25.2"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@percy/cli": "^1.0.0-beta.76",
|
||||
"@coffeelint/cli": "^3.0.0",
|
||||
"csslint": "^1.0.5",
|
||||
"eslint": "^4.14.0",
|
||||
|
||||
@@ -7,7 +7,7 @@ describe "forums", js: true do
|
||||
include_context 'signed in admin'
|
||||
it "navigating to forum admin with js" do
|
||||
visit admin_path
|
||||
Percy.snapshot(page, name: 'Admin page')
|
||||
page.percy_snapshot(page, name: 'Admin page')
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -14,7 +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')
|
||||
page.percy_snapshot(page, name: 'Posting a comment')
|
||||
end
|
||||
|
||||
context "editing a comment" do
|
||||
|
||||
@@ -18,7 +18,7 @@ describe "Conversations", :js do
|
||||
click_link 'Inbox'
|
||||
end
|
||||
it { expect(page).to have_content 'something i want to say' }
|
||||
it { Percy.snapshot(page, name: 'conversations#index') }
|
||||
it { page.percy_snapshot(page, name: 'conversations#index') }
|
||||
|
||||
describe 'deleting' do
|
||||
before do
|
||||
|
||||
@@ -21,7 +21,7 @@ describe "Conversations", :js do
|
||||
|
||||
it { expect(page).to have_content 'this is the body' }
|
||||
it { expect(page).to have_link sender.login_name }
|
||||
it { Percy.snapshot(page, name: 'conversations#show') }
|
||||
it { page.percy_snapshot(page, name: 'conversations#show') }
|
||||
|
||||
describe 'Replying to the conversation' do
|
||||
before do
|
||||
|
||||
@@ -33,7 +33,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')
|
||||
page.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,7 +77,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')
|
||||
page.percy_snapshot(page, name: 'Rejecting crops')
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -71,7 +71,7 @@ describe "member deletion" do
|
||||
visit member_path(member)
|
||||
click_link 'Edit profile'
|
||||
click_link 'Delete Account'
|
||||
Percy.snapshot(page, name: 'Account deletion')
|
||||
page.percy_snapshot(page, name: 'Account deletion')
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
@@ -102,7 +102,7 @@ rest of the garden.
|
||||
describe 'home' do
|
||||
it 'loads homepage' do
|
||||
visit root_path
|
||||
Percy.snapshot(page, name: "#{prefix}/homepage")
|
||||
page.percy_snapshot(page, name: "#{prefix}/homepage")
|
||||
end
|
||||
end
|
||||
|
||||
@@ -122,31 +122,31 @@ rest of the garden.
|
||||
|
||||
visit crop_path(tomato)
|
||||
expect(page).to have_text 'tomato'
|
||||
Percy.snapshot(page, name: "#{prefix}/crops#show")
|
||||
page.percy_snapshot(page, name: "#{prefix}/crops#show")
|
||||
end
|
||||
it 'loads crops#index' do
|
||||
visit crops_path
|
||||
Percy.snapshot(page, name: "#{prefix}/crops#index")
|
||||
page.percy_snapshot(page, name: "#{prefix}/crops#index")
|
||||
end
|
||||
end
|
||||
|
||||
describe 'plantings' do
|
||||
it 'loads plantings#index' do
|
||||
visit plantings_path
|
||||
Percy.snapshot(page, name: "#{prefix}/plantings#index")
|
||||
page.percy_snapshot(page, name: "#{prefix}/plantings#index")
|
||||
end
|
||||
|
||||
it 'load another member plantings#show' do
|
||||
planting = FactoryBot.create :planting, crop: tomato, owner: someone_else, garden: someone_else.gardens.first
|
||||
visit planting_path(planting)
|
||||
Percy.snapshot(page, name: "#{prefix}/plantings#show")
|
||||
page.percy_snapshot(page, name: "#{prefix}/plantings#show")
|
||||
end
|
||||
end
|
||||
|
||||
describe 'gardens' do
|
||||
it 'loads gardens#index' do
|
||||
visit gardens_path
|
||||
Percy.snapshot(page, name: "#{prefix}/gardens#index")
|
||||
page.percy_snapshot(page, name: "#{prefix}/gardens#index")
|
||||
end
|
||||
|
||||
it 'gardens#show' do
|
||||
@@ -161,14 +161,14 @@ rest of the garden.
|
||||
tomato_planting = FactoryBot.create :planting, garden: garden, owner: member, crop: tomato
|
||||
tomato_photo.plantings << tomato_planting
|
||||
visit garden_path(garden)
|
||||
Percy.snapshot(page, name: "#{prefix}/gardens#show")
|
||||
page.percy_snapshot(page, name: "#{prefix}/gardens#show")
|
||||
end
|
||||
end
|
||||
|
||||
describe 'members' do
|
||||
it 'loads members#index' do
|
||||
visit members_path
|
||||
Percy.snapshot(page, name: "#{prefix}/members#index")
|
||||
page.percy_snapshot(page, name: "#{prefix}/members#index")
|
||||
end
|
||||
|
||||
it 'loads another members#show' do
|
||||
@@ -178,7 +178,7 @@ rest of the garden.
|
||||
FactoryBot.create :harvest, owner: someone_else, created_at: 1.day.ago, crop: tomato
|
||||
|
||||
visit member_path(someone_else)
|
||||
Percy.snapshot(page, name: "#{prefix}/members#show")
|
||||
page.percy_snapshot(page, name: "#{prefix}/members#show")
|
||||
end
|
||||
end
|
||||
|
||||
@@ -187,7 +187,7 @@ rest of the garden.
|
||||
FactoryBot.create :comment, post: post
|
||||
FactoryBot.create :comment, post: post
|
||||
visit post_path(post)
|
||||
Percy.snapshot(page, name: "#{prefix}/posts#show")
|
||||
page.percy_snapshot(page, name: "#{prefix}/posts#show")
|
||||
end
|
||||
it 'loads posts#index' do
|
||||
Member.all.limit(5).each do |member|
|
||||
@@ -197,7 +197,7 @@ rest of the garden.
|
||||
FactoryBot.create_list :comment, rand(1..5), post: post
|
||||
end
|
||||
visit posts_path
|
||||
Percy.snapshot(page, name: "#{prefix}/posts#index")
|
||||
page.percy_snapshot(page, name: "#{prefix}/posts#index")
|
||||
end
|
||||
end
|
||||
|
||||
@@ -205,7 +205,7 @@ rest of the garden.
|
||||
it 'loads photos#show' do
|
||||
tomato_photo.plantings << FactoryBot.create(:planting, owner: member, crop: tomato)
|
||||
visit photo_path(tomato_photo)
|
||||
Percy.snapshot(page, name: "#{prefix}/photos#show")
|
||||
page.percy_snapshot(page, name: "#{prefix}/photos#show")
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -217,22 +217,22 @@ rest of the garden.
|
||||
it 'loads sign in page' do
|
||||
visit crops_path # some random page
|
||||
click_link 'Sign in'
|
||||
Percy.snapshot(page, name: "sign-in")
|
||||
page.percy_snapshot(page, name: "sign-in")
|
||||
end
|
||||
|
||||
it 'loads sign up page' do
|
||||
visit crops_path # some random page
|
||||
click_link 'Sign up'
|
||||
Percy.snapshot(page, name: "sign-up")
|
||||
page.percy_snapshot(page, name: "sign-up")
|
||||
end
|
||||
|
||||
it 'loads forgot password' do
|
||||
visit new_member_password_path
|
||||
Percy.snapshot(page, name: "forgot-password")
|
||||
page.percy_snapshot(page, name: "forgot-password")
|
||||
end
|
||||
it 'loads new confirmation' do
|
||||
visit new_member_confirmation_path
|
||||
Percy.snapshot(page, name: "new-confimation")
|
||||
page.percy_snapshot(page, name: "new-confimation")
|
||||
end
|
||||
end
|
||||
|
||||
@@ -244,55 +244,55 @@ rest of the garden.
|
||||
it 'load my plantings#show' do
|
||||
planting = FactoryBot.create :planting, crop: tomato, owner: member, garden: member.gardens.first
|
||||
visit planting_path(planting)
|
||||
Percy.snapshot(page, name: "#{prefix}/self/plantings#show")
|
||||
page.percy_snapshot(page, name: "#{prefix}/self/plantings#show")
|
||||
end
|
||||
|
||||
it 'load my members#show' do
|
||||
visit member_path(member)
|
||||
Percy.snapshot(page, name: "#{prefix}/self/members#show")
|
||||
page.percy_snapshot(page, name: "#{prefix}/self/members#show")
|
||||
end
|
||||
|
||||
it 'load my gardens#show' do
|
||||
garden = FactoryBot.create :garden, name: 'paradise', owner: member
|
||||
visit garden_path(garden)
|
||||
Percy.snapshot(page, name: "#{prefix}/self/gardens#show")
|
||||
page.percy_snapshot(page, name: "#{prefix}/self/gardens#show")
|
||||
end
|
||||
|
||||
describe '#new' do
|
||||
it 'crops#new' do
|
||||
visit new_crop_path
|
||||
Percy.snapshot(page, name: "#{prefix}/crops#new")
|
||||
page.percy_snapshot(page, name: "#{prefix}/crops#new")
|
||||
end
|
||||
|
||||
it 'gardens#new' do
|
||||
visit new_garden_path
|
||||
Percy.snapshot(page, name: "#{prefix}/gardens#new")
|
||||
page.percy_snapshot(page, name: "#{prefix}/gardens#new")
|
||||
end
|
||||
|
||||
it 'harvests#new' do
|
||||
visit new_harvest_path
|
||||
Percy.snapshot(page, name: "#{prefix}/harvests#new")
|
||||
page.percy_snapshot(page, name: "#{prefix}/harvests#new")
|
||||
fill_in(id: 'crop', with: 'tom')
|
||||
Percy.snapshot(page, name: "#{prefix}/harvests#new-autosuggest")
|
||||
page.percy_snapshot(page, name: "#{prefix}/harvests#new-autosuggest")
|
||||
end
|
||||
|
||||
it 'plantings#new' do
|
||||
visit new_planting_path
|
||||
Percy.snapshot(page, name: "#{prefix}/plantings#new")
|
||||
page.percy_snapshot(page, name: "#{prefix}/plantings#new")
|
||||
fill_in(id: 'crop', with: 'tom')
|
||||
Percy.snapshot(page, name: "#{prefix}/plantings#new-autosuggest")
|
||||
page.percy_snapshot(page, name: "#{prefix}/plantings#new-autosuggest")
|
||||
end
|
||||
|
||||
it 'seeds#new' do
|
||||
visit new_seed_path
|
||||
Percy.snapshot(page, name: "#{prefix}/seeds#new")
|
||||
page.percy_snapshot(page, name: "#{prefix}/seeds#new")
|
||||
fill_in(id: 'crop', with: 'tom')
|
||||
Percy.snapshot(page, name: "#{prefix}/seeds#new-autosuggest")
|
||||
page.percy_snapshot(page, name: "#{prefix}/seeds#new-autosuggest")
|
||||
end
|
||||
|
||||
it 'posts#new' do
|
||||
visit new_post_path
|
||||
Percy.snapshot(page, name: "#{prefix}/posts#new")
|
||||
page.percy_snapshot(page, name: "#{prefix}/posts#new")
|
||||
end
|
||||
end
|
||||
|
||||
@@ -300,29 +300,29 @@ rest of the garden.
|
||||
it 'loads gardens#edit' do
|
||||
garden = FactoryBot.create :garden, owner: member
|
||||
visit edit_garden_path(garden)
|
||||
Percy.snapshot(page, name: "#{prefix}/gardens#edit")
|
||||
page.percy_snapshot(page, name: "#{prefix}/gardens#edit")
|
||||
end
|
||||
|
||||
it 'loads harvests#edit' do
|
||||
harvest = FactoryBot.create :harvest, owner: member
|
||||
visit edit_harvest_path(harvest)
|
||||
Percy.snapshot(page, name: "#{prefix}/harvests#edit")
|
||||
page.percy_snapshot(page, name: "#{prefix}/harvests#edit")
|
||||
end
|
||||
|
||||
it 'loads planting#edit' do
|
||||
planting = FactoryBot.create :planting, owner: member
|
||||
visit edit_planting_path(planting)
|
||||
Percy.snapshot(page, name: "#{prefix}/plantings#edit")
|
||||
page.percy_snapshot(page, name: "#{prefix}/plantings#edit")
|
||||
end
|
||||
|
||||
it 'loads posts#edit' do
|
||||
visit edit_post_path(post)
|
||||
Percy.snapshot(page, name: "#{prefix}/posts#edit")
|
||||
page.percy_snapshot(page, name: "#{prefix}/posts#edit")
|
||||
end
|
||||
|
||||
it 'comments#new' do
|
||||
visit new_comment_path(post_id: post.id)
|
||||
Percy.snapshot(page, name: "comments#new")
|
||||
page.percy_snapshot(page, name: "comments#new")
|
||||
end
|
||||
end
|
||||
|
||||
@@ -331,11 +331,11 @@ rest of the garden.
|
||||
member.update! login_name: 'percy'
|
||||
visit root_path
|
||||
click_on 'Crops'
|
||||
Percy.snapshot(page, name: "#{prefix}/crops-menu")
|
||||
page.percy_snapshot(page, name: "#{prefix}/crops-menu")
|
||||
click_on 'Community'
|
||||
Percy.snapshot(page, name: "#{prefix}/community-menu")
|
||||
page.percy_snapshot(page, name: "#{prefix}/community-menu")
|
||||
click_on 'percy', class: 'nav-link'
|
||||
Percy.snapshot(page, name: "#{prefix}/member-menu")
|
||||
page.percy_snapshot(page, name: "#{prefix}/member-menu")
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -346,11 +346,11 @@ rest of the garden.
|
||||
|
||||
it 'crop wrangling page' do
|
||||
visit wrangle_crops_path
|
||||
Percy.snapshot(page, name: 'crops wrangle')
|
||||
page.percy_snapshot(page, name: 'crops wrangle')
|
||||
click_link 'Pending approval'
|
||||
Percy.snapshot(page, name: 'crops pending approval')
|
||||
page.percy_snapshot(page, name: 'crops pending approval')
|
||||
click_link 'candy'
|
||||
Percy.snapshot(page, name: 'editing pending crop')
|
||||
page.percy_snapshot(page, name: 'editing pending crop')
|
||||
end
|
||||
end
|
||||
|
||||
@@ -358,36 +358,36 @@ rest of the garden.
|
||||
include_context 'signed in admin'
|
||||
before { visit admin_path }
|
||||
it 'admin page' do
|
||||
Percy.snapshot(page, name: 'Admin')
|
||||
page.percy_snapshot(page, name: 'Admin')
|
||||
end
|
||||
it 'Roles' do
|
||||
click_link 'Roles'
|
||||
Percy.snapshot(page, name: 'Admin Roles')
|
||||
page.percy_snapshot(page, name: 'Admin Roles')
|
||||
end
|
||||
it 'CMS' do
|
||||
click_link 'CMS'
|
||||
Percy.snapshot(page, name: 'CMS')
|
||||
page.percy_snapshot(page, name: 'CMS')
|
||||
end
|
||||
it 'Garden Types' do
|
||||
click_link 'Garden Types'
|
||||
Percy.snapshot(page, name: 'Admin Garden type')
|
||||
page.percy_snapshot(page, name: 'Admin Garden type')
|
||||
end
|
||||
it 'Alternate names' do
|
||||
click_link 'Alternate names'
|
||||
Percy.snapshot(page, name: 'Admin Alternate names')
|
||||
page.percy_snapshot(page, name: 'Admin Alternate names')
|
||||
end
|
||||
it 'Scientific names' do
|
||||
click_link 'Scientific names'
|
||||
Percy.snapshot(page, name: 'Admin Scientific names')
|
||||
page.percy_snapshot(page, name: 'Admin Scientific names')
|
||||
end
|
||||
it 'Members' do
|
||||
click_link 'Members'
|
||||
Percy.snapshot(page, name: 'Admin Members')
|
||||
page.percy_snapshot(page, name: 'Admin Members')
|
||||
end
|
||||
end
|
||||
|
||||
it 'api docs' do
|
||||
visit '/api-docs'
|
||||
Percy.snapshot(page, name: 'api docs')
|
||||
page.percy_snapshot(page, name: 'api docs')
|
||||
end
|
||||
end
|
||||
|
||||
@@ -15,7 +15,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')
|
||||
page.percy_snapshot(page, name: 'Add photo to planting')
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
@@ -46,7 +46,7 @@ describe "show photo page" do
|
||||
before do
|
||||
garden.photos << photo
|
||||
visit photo_path(photo)
|
||||
Percy.snapshot(page, name: 'Show photo of a garden')
|
||||
page.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) }
|
||||
|
||||
@@ -39,7 +39,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')
|
||||
page.percy_snapshot(page, name: 'places map')
|
||||
end
|
||||
|
||||
it "goes to members' index page" do
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
#
|
||||
# See http://rubydoc.info/gems/rspec-core/RSpec/Core/Configuration
|
||||
require 'simplecov'
|
||||
require 'percy'
|
||||
require 'percy/capybara'
|
||||
|
||||
SimpleCov.start
|
||||
|
||||
|
||||
Reference in New Issue
Block a user