Sha256: 07117e6644f900dc6b67545fdd91caf296fac7b2e60cf826c25e039f8812ca3d

Contents?: true

Size: 1.49 KB

Versions: 2

Compression:

Stored size: 1.49 KB

Contents

require File.expand_path(File.dirname(__FILE__) + '/spec_helper')

describe TicketMaster::Provider::Fogbugz::Project do
  before(:each) do
	  VCR.use_cassette('fogbugz') do 
      @ticketmaster = TicketMaster.new(:fogbugz, :email => 'rafael@hybridgroup.com', :password => '1234567', :uri => 'https://ticketrb.fogbugz.com')
    end
    @klass = TicketMaster::Provider::Fogbugz::Project
    @project_id = 2
  end
  
  it "should be able to load all projects" do
    VCR.use_cassette('all-fogbugz-projects') { @projects = @ticketmaster.projects }
    @projects.should be_an_instance_of(Array)
    @projects.first.should be_an_instance_of(@klass)
  end
  
  it "should be able to load projects from an array of ids" do
    VCR.use_cassette('load-projects-by-ids') { @projects = @ticketmaster.projects([@project_id]) }
    @projects.should be_an_instance_of(Array)
    @projects.first.should be_an_instance_of(@klass)
    @projects.first.id.should == @project_id
  end
  
  it "should be able to load all projects from attributes" do
    VCR.use_cassette('load-projects-attributes') { @projects = @ticketmaster.projects(:id => @project_id) }
    @projects.should be_an_instance_of(Array)
    @projects.first.should be_an_instance_of(@klass)
    @projects.first.id.should == @project_id
  end
  
  it "should be able to find a project by id" do
    VCR.use_cassette('load-project-by-id') { @project = @ticketmaster.project(@project_id) }
    @project.should be_an_instance_of(@klass)
    @project.id.should == @project_id
  end

end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
ticketmaster-fogbugz-0.3.0 spec/projects_spec.rb
ticketmaster-fogbugz-0.2.4 spec/projects_spec.rb