Sha256: 7c04e64472b8f8b64200103f8a268af5f2309170783e2572c768a10ad277d76f

Contents?: true

Size: 673 Bytes

Versions: 5

Compression:

Stored size: 673 Bytes

Contents

require "test_helper"

class MonthCalendarTest < ActionView::TestCase
  test "date_range returns a full calendar month" do
    today = Date.today
    calendar = SimpleCalendar::MonthCalendar.new(view, start_date: today)
    assert calendar.date_range.min <= today.beginning_of_month
    assert calendar.date_range.max >= today.end_of_month
  end

  test "date_range returns the days of next and previous months on the edges of the calendar" do
    calendar = SimpleCalendar::MonthCalendar.new(view, start_date: Date.new(2018, 8, 1))
    assert_equal Date.new(2018, 7, 30), calendar.date_range.first
    assert_equal Date.new(2018, 9, 2), calendar.date_range.last
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
simple_calendar-3.0.4 test/calendars/month_calendar_test.rb
simple_calendar-3.0.3 test/calendars/month_calendar_test.rb
simple_calendar-3.0.2 test/calendars/month_calendar_test.rb
simple_calendar-3.0.1 test/calendars/month_calendar_test.rb
simple_calendar-3.0.0 test/calendars/month_calendar_test.rb