docbrown/spec/system/dashboards/user_visits_dashboard_spec.rb
ludwiczakpawel 88a3b573ea
Page headers unified (#15158)
* fix; remove the bottom 100%

* dashboard

* fixes + magic border-radius

* everything

* fix

* fix

* spec

* split PRs

* Update app/assets/stylesheets/views/listings.scss

Co-authored-by: Ridhwana <Ridhwana.Khan16@gmail.com>

Co-authored-by: Ridhwana <ridhwana.khan16@gmail.com>
2021-10-25 21:41:29 +02:00

30 lines
633 B
Ruby

require "rails_helper"
RSpec.describe "Dashboard", type: :system, js: true do
let(:user) { create(:user) }
let(:listing) { create(:listing) }
before do
sign_in user
end
context "when looking at analytics counters" do
it "shows the count of unspent credits" do
Credit.add_to(user, 2)
Credits::Buyer.call(
purchaser: user,
purchase: listing,
cost: 1,
)
Credit.counter_culture_fix_counts
user.reload
visit dashboard_path
within "main#main-content > header" do
expect(page).to have_text(/1\nCredits available/)
end
end
end
end