docbrown/spec/system/articles/user_visits_article_stats_spec.rb
Vaidehi Joshi d2ef01ecc2
Remove Percy (#8915)
We are no longer using the Percy service, so this code is not required anymore.
Removes the percy agent, the gem, and all references to Percy.snapshot and percy: true.
2020-06-25 11:19:58 -07:00

16 lines
486 B
Ruby

require "rails_helper"
RSpec.describe "Viewing an article stats", type: :system, js: true do
let(:user) { create(:user) }
let(:article) { create(:article, user: user) }
it "shows stats for pro users by clicking on the stats button" do
path = "/#{user.username}/#{article.slug}/stats"
allow(user).to receive(:pro?).and_return(true)
sign_in user
visit path
expect(page).to have_current_path(path)
expect(page).to have_selector(".summary-stats")
end
end