Sha256: 83a94cf440962556981936ae510964727e0128b491e673d883cfd067beabec7a

Contents?: true

Size: 843 Bytes

Versions: 6

Compression:

Stored size: 843 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',
      'archived' => '0'
    }
    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.archived.should be_false
    event.valid?.should be_true
  end

end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
osm-0.0.25 spec/osm/event_spec.rb
osm-0.0.24 spec/osm/event_spec.rb
osm-0.0.23 spec/osm/event_spec.rb
osm-0.0.22 spec/osm/event_spec.rb
osm-0.0.21 spec/osm/event_spec.rb
osm-0.0.20 spec/osm/event_spec.rb