Sha256: 1fa29415ffcffef986aaf17cd7949a241ea5c44907319cb5bc8834a735b24428

Contents?: true

Size: 1.14 KB

Versions: 2

Compression:

Stored size: 1.14 KB

Contents

require "test_helper"

class CustomCalendarIntegrationTest < ActionDispatch::IntegrationTest
  test "renders a custom calendar" do
    get business_week_meetings_path
    assert_select "div.simple-calendar"
  end

  test "calendar renders events" do
    get business_week_meetings_path
    assert_select "div.simple-calendar" do
      assert_select "div", text: meetings(:one_day_event).name
    end
  end

  test "calendar render two day events" do
    event = meetings(:two_day_event)
    event.update(start_time: Time.current.monday, end_time: (Time.current.monday + 1.day).end_of_day)
    get business_week_meetings_path, params: {start_date: event.start_time.to_date}
    assert_select "div.simple-calendar" do
      assert_select "div", text: event.name, count: 2
    end
  end

  test "calendar render three day events" do
    event = meetings(:three_day_event)
    event.update(start_time: Time.current.monday, end_time: (Time.current.monday + 2.days).end_of_day)
    get business_week_meetings_path, params: {start_date: event.start_time.to_date}
    assert_select "div.simple-calendar" do
      assert_select "div", text: event.name, count: 3
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
simple_calendar-3.0.4 test/integrations/custom_calendar_test.rb
simple_calendar-3.0.3 test/integrations/custom_calendar_test.rb