Sha256: f5a0b3e58e72f3398c140381858dd057f7e7f4c1bc61cb30667b7c58c76fb5bf

Contents?: true

Size: 1.27 KB

Versions: 1

Compression:

Stored size: 1.27 KB

Contents

require 'rails_helper'

describe Event do
  fixtures :events

  it "should set_all_day" do
    event = events(:event_00001)
    event.all_day = true
    event.set_all_day
    event.all_day.should be_truthy
  end

  it "should set all_day and beginning_of_day" do
    event = events(:event_00008)
    event.all_day = true
    event.set_all_day
    event.start_at.should eq event.end_at.beginning_of_day
  end

  it "should export events" do
    lines = Event.export
    CSV.parse(lines, col_sep: "\t")
    expect(lines).not_to be_empty
    expect(lines.split(/\n/).size).to eq Event.all.count + 1
  end
end

# == Schema Information
#
# Table name: events
#
#  id                        :bigint           not null, primary key
#  library_id                :bigint           not null
#  event_category_id         :bigint           not null
#  name                      :string
#  note                      :text
#  start_at                  :datetime
#  end_at                    :datetime
#  all_day                   :boolean          default(FALSE), not null
#  display_name              :text
#  created_at                :datetime         not null
#  updated_at                :datetime         not null
#  place_id                  :bigint
#  display_name_translations :jsonb            not null
#

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
enju_event-0.4.0.rc.1 spec/models/event_spec.rb