Skip to content

Commit

Permalink
[FS-11] Refactor component specs to reuse includes
Browse files Browse the repository at this point in the history
  • Loading branch information
beetlegius-jt committed Jan 28, 2025
1 parent b09c99e commit b8ba606
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 8 deletions.
4 changes: 0 additions & 4 deletions spec/components/app/event_component_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,6 @@
require "rails_helper"

RSpec.describe App::EventComponent, type: :component do
include ActionView::Helpers::TagHelper
include Rails.application.routes.url_helpers
include ApplicationHelper

let(:activity) { create(:activity, duration_minutes: 60, max_capacity: 1) }
let(:starts_at) { Time.current.change(hour: 10, minute: 0, second: 0) }
let(:event) { build(:event, activity:, starts_at:) }
Expand Down
4 changes: 0 additions & 4 deletions spec/components/app/reservation_component_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,6 @@
require "rails_helper"

RSpec.describe App::ReservationComponent, type: :component do
include ActionView::Helpers::TagHelper
include Rails.application.routes.url_helpers
include ApplicationHelper

let(:activity) { create(:activity) }
let(:starts_at) { Time.current.change(hour: 10, minute: 0, second: 0) }
let(:reservation) { create(:reservation, activity:, starts_at:) }
Expand Down
3 changes: 3 additions & 0 deletions spec/support/view_component.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,7 @@

RSpec.configure do |config|
config.include ViewComponent::TestHelpers, type: :component
config.include ActionView::Helpers::TagHelper, type: :component
config.include Rails.application.routes.url_helpers, type: :component
config.include ApplicationHelper, type: :component
end

0 comments on commit b8ba606

Please sign in to comment.