Sha256: ad57acd67773b457dcd66d636d778d4b560382bbe7fcbf724d0d84ff3469db5e

Contents?: true

Size: 712 Bytes

Versions: 5

Compression:

Stored size: 712 Bytes

Contents

require "spec_helper"
require "byebug"

describe ActsAsFullCalendarEvent::FullCalendarEventSerializer do
  let!(:event1) { create(:event, start_at: Date.new(2018, 1, 1), end_at: Date.new(2018, 1, 31), category_id: 1, user_id: 1) }

  it "returns correct json" do
    serializer = ActsAsFullCalendarEvent::FullCalendarEventSerializer.new(event1)

    result = serializer.serializable_hash

    expect(result).to eq({
      id: 1,
      start: Date.new(2018, 1, 1),
      end: Date.new(2018, 1, 31),
      title: "title",
      description: "description",
      color: "#FF0000",
      textColor: "#AAFFBB",
      link_url: "URL",
      link_data_target: "#modal",
      link_data_toggle: "modal"
    })
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
acts_as_full_calendar_event-1.0.7 spec/serializers/full_calendar_event_serializer_spec.rb
acts_as_full_calendar_event-1.0.6 spec/serializers/full_calendar_event_serializer_spec.rb
acts_as_full_calendar_event-1.0.5 spec/serializers/full_calendar_event_serializer_spec.rb
acts_as_full_calendar_event-1.0.4 spec/serializers/full_calendar_event_serializer_spec.rb
acts_as_full_calendar_event-1.0.3 spec/serializers/full_calendar_event_serializer_spec.rb