Skip to content

Commit

Permalink
fix: sign_in user context for testing a componenet
Browse files Browse the repository at this point in the history
  • Loading branch information
Asrani-Aman committed Nov 22, 2024
1 parent b708d83 commit 917d8d0
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions spec/components/circuit_card_component_spec.rb
Original file line number Diff line number Diff line change
@@ -1,9 +1,15 @@
# frozen_string_literal: true

require "rails_helper"

RSpec.describe CircuitCardComponent, type: :component do
let(:user) { FactoryBot.create(:user) }
let(:circuit) { create(:project) }

before do
allow_any_instance_of(ApplicationController).to receive(:current_user).and_return(user)
end

it "renders the circuit card with correct content" do
render_inline(described_class.new(circuit: circuit))

Expand Down

0 comments on commit 917d8d0

Please sign in to comment.