Sha256: 98ead4745e90e904326afce1545e4ba3ea4ffa82ab21fdfae4d50f0c95d9f0d8

Contents?: true

Size: 1.87 KB

Versions: 4

Compression:

Stored size: 1.87 KB

Contents

# Require the spec helper relative to this file
require File.join(File.dirname(__FILE__), %w[spec_helper])
require File.join(File.dirname(__FILE__), %w[custom_matchers_spec])
require File.join(File.dirname(__FILE__), %w[ .. lib services search])
require File.join(File.dirname(__FILE__), %w[ .. lib services activity])
require File.join(File.dirname(__FILE__), %w[ .. lib services reg_center])
include Active::Services

describe ActiveWorks do
  before(:each) do 
    @valid_id = "E-00072ZDN"
  end
  it "should set find by id" do
    a = ActiveWorks.find_by_id(@valid_id)
    a.data["id"].should == @valid_id
  end
  it "should set the asset_type_id" do
    ActiveWorks.find_by_id(@valid_id).asset_type_id.should_not be_nil
  end
  it "should thorw an ActiveWorksError if no record is found" do
    lambda { ActiveWorks.find_by_id( "666" ) }.should raise_error(ActiveWorksError)                         
  end
  it "should get the API metadata" do
    a = ActiveWorks.find_by_id(@valid_id)
    a.data["eventDetailDto"].should_not be_nil
  end
  it "should have an address Hash" do
    a = ActiveWorks.find_by_id(@valid_id)
    a.address.should be_an_instance_of(HashWithIndifferentAccess)
  end
  it "should have a desc" do
    a = ActiveWorks.find_by_id(@valid_id)
    a.desc.should_not == ""
    a.desc.should_not == nil
  end
  it "should cleanup desc" do
    a = ActiveWorks.find_by_id(@valid_id)
    puts a.desc
    a.desc.should_not include('\"')
  end
  it "should have a title String" do
    a = ActiveWorks.find_by_id(@valid_id)
    a.title.should be_an_instance_of(String)
  end
  it "should have a start_date DateTime" do
    a = ActiveWorks.find_by_id(@valid_id)
    puts a.start_date
    a.start_date.should be_an_instance_of(DateTime)
  end
  it "should have a start_time DateTime" do
    a = ActiveWorks.find_by_id(@valid_id)
    a.start_time.should be_an_instance_of(DateTime)
  end
  
  
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
Active-0.0.22 spec/activeworks_spec.rb
Active-0.0.21 spec/activeworks_spec.rb
Active-0.0.18 spec/activeworks_spec.rb
Active-0.0.17 spec/activeworks_spec.rb