VRFS-3276 : Initial tests for calendar manager
This commit is contained in:
parent
92a2524c65
commit
21fd80a188
|
|
@ -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
|
||||
|
||||
Loading…
Reference in New Issue