spec/reg_spec.rb in Active-0.0.14 vs spec/reg_spec.rb in Active-0.0.17
- old
+ new
@@ -6,17 +6,21 @@
require File.join(File.dirname(__FILE__), %w[ .. lib services reg_center])
include Active::Services
describe RegCenter do
before(:each) do
- @valid_id = "1802851"
+# @valid_id = "1802851"
+ @valid_id = "1877942"
# @valid_id = "1889826"
# @valid_id = "1847738"
+# <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><soap:Body><getAssetMetadataResponse xmlns="http://api.asset.services.active.com"><out xmlns="http://api.asset.services.active.com"><importSource><asset row="1" destinationID=""><isSearchable>true</isSearchable><assetId>BF304447-0052-4466-A044-68D1459C5068</assetId><assetTypeId>EA4E860A-9DCD-4DAA-A7CA-4A77AD194F65</assetTypeId><substitutionUrl>1886328</substitutionUrl><assetName>Excellence in Writing</assetName><category>Activities</category><channel>Not Specified</channel><mediaType>Recware Activities</mediaType><searchWeight>1</searchWeight><zip>92027</zip><city>Escondido</city><state>California</state><country>United States</country><startDate>2010-09-07</startDate><startTime>15:30:00</startTime><endDate>2010-09-07</endDate><endTime>15:30:00</endTime><participationCriteria>All</participationCriteria><onlineRegistrationAvailable>true</onlineRegistrationAvailable><onlineDonationAvailable>0</onlineDonationAvailable><onlineMembershipAvailable>0</onlineMembershipAvailable><avgUserRating/><userCommentText/><image1>http://www.active.com/images/events/hotrace.gif</image1><contactEmail>recreation@escondido.org</contactEmail><contactPhone>760-839-4691</contactPhone><eventResults/><location>Grove Room - East Valley Community Center</location><contactName>Escondido Community Services Department</contactName><market>San Diego</market><trackbackurl>http://www.active.com/page/Event_Details.htm?event_id=1886328&amp;assetId=BF304447-0052-4466-A044-68D1459C5068</trackbackurl><seourl>http://www.active.com/not-specified-recware-activities/escondido-ca/excellence-in-writing-2010</seourl><dma>San Diego</dma><longitude>-117.0864</longitude><latitude>33.11921</latitude></asset></importSource></out></getAssetMetadataResponse></soap:Body></soap:Envelope>
+
end
it "should set find by id" do
a = RegCenter.find_by_id(@valid_id)
- a.data["id"].should == @valid_id
+ a.data.should_not be_nil
+ a.title.should eql("Realistic Drawing (6-12 Yrs.)")
end
it "should set the asset_type_id" do
RegCenter.find_by_id(@valid_id).asset_type_id.should_not be_nil
end
it "should thorw an RegCenterError if no record is found" do
@@ -26,32 +30,37 @@
a = RegCenter.find_by_id(@valid_id)
a.data["event"].should_not be_nil
end
it "should have an address Hash" do
a = RegCenter.find_by_id(@valid_id)
- a.address.should be_an_instance_of(Hash)
+ a.address.should be_an_instance_of(HashWithIndifferentAccess)
end
it "should have a desc String" do
a = RegCenter.find_by_id(@valid_id)
a.desc.should be_an_instance_of(String)
end
it "should cleanup title" do
a = RegCenter.find_by_id(@valid_id)
a.title.should_not include("\r")
end
- it "should have a primary category" do
- a = RegCenter.find_by_id(@valid_id)
- puts a.primary_category
- a.primary_category.should_not be_nil
- end
+ # it "should have a primary category" do
+ # a = RegCenter.find_by_id(@valid_id)
+ # puts a.primary_category
+ # a.primary_category.should_not be_nil
+ # end
it "should have a title String" do
a = RegCenter.find_by_id(@valid_id)
a.title.should be_an_instance_of(String)
end
it "should have a categories array" do
a = RegCenter.find_by_id(@valid_id)
+ puts a.categories.inspect
a.categories.should be_an_instance_of(Array)
end
+ # it "should have a category" do
+ # a = RegCenter.find_by_id(@valid_id)
+ # a.category.should be_an_instance_of(String)
+ # end
it "should have a start_date DateTime" do
a = RegCenter.find_by_id(@valid_id)
puts a.start_date
a.start_date.should be_an_instance_of(DateTime)
end