Sha256: 3113129b14edc1343ff508b54ab247bc72c519029cf25cdd79ac0b9e483f3bbd

Contents?: true

Size: 1.15 KB

Versions: 5

Compression:

Stored size: 1.15 KB

Contents

# -*- encoding: utf-8 -*-
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                :integer          not null, primary key
#  library_id        :integer          not null
#  event_category_id :integer          not null
#  name              :string
#  note              :text
#  start_at          :datetime
#  end_at            :datetime
#  all_day           :boolean          default(FALSE), not null
#  deleted_at        :datetime
#  display_name      :text
#  created_at        :datetime
#  updated_at        :datetime
#  place_id          :integer
#

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
enju_event-0.2.3 spec/models/event_spec.rb
enju_event-0.2.2 spec/models/event_spec.rb
enju_event-0.2.1 spec/models/event_spec.rb
enju_event-0.2.0 spec/models/event_spec.rb
enju_event-0.2.0.beta.4 spec/models/event_spec.rb