VRFS-3276 : Initial tests for calendar manager

This commit is contained in:
Steven Miers 2015-06-26 14:15:19 -05:00
parent 92a2524c65
commit 21fd80a188
1 changed files with 29 additions and 0 deletions

View File

@ -0,0 +1,29 @@
require 'spec_helper'
describe CalendarManager do
before :all do
genre1 = FactoryGirl.create(:genre)
@creator = FactoryGirl.create(:user)
@music_session = FactoryGirl.create(:music_session, :creator => @creator, :description => "Hello Session", :genre => genre1)
@music_session.reload
@calendar_manager = JamRuby::CalendarManager.new
end
before(:each) do
end
it "can create calendar feed for user" do
ics = @calendar_manager.create_ics_feed(@creator)
puts "ICS: #{ics}"
# Basic format checking...there are some online tools that
# check a lot more, but no ruby libs that I could find:
lines = ics.split("\r\n")
lines.should have(11).items
lines.first.should eq("BEGIN:VCALENDAR")
lines.last.should eq("END:VCALENDAR")
lines[-2].should eq("END:VEVENT")
end
end