Sha256: 0e8b007a692e32046bb45c785ce71dc9cf8940b3d5afac4af7756c158b2c7991

Contents?: true

Size: 783 Bytes

Versions: 2

Compression:

Stored size: 783 Bytes

Contents

# encoding: utf-8
require 'spec_helper'
require 'date'

describe "Event" do

  it "Create from API data" do
    data = {
      'eventid' => 1,
      'sectionid' => 2,
      'name' => 'Event name',
      'startdate' => '2001-01-02',
      'starttime' => '12:00:00',
      'enddate' => '1970-01-01',
      'endtime' => '',
      'cost' => 'Free',
      'location' => 'Somewhere',
      'notes' => 'None'
    }
    event = Osm::Event.from_api(data)

    event.id.should == 1
    event.section_id.should == 2
    event.name.should == 'Event name'
    event.start.should == DateTime.new(2001, 1, 2, 12, 0, 0)
    event.finish.should == nil
    event.cost.should == 'Free'
    event.location.should == 'Somewhere'
    event.notes.should == 'None'
    event.valid?.should be_true
  end

end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
osm-0.0.19 spec/osm/event_spec.rb
osm-0.0.18 spec/osm/event_spec.rb