Sha256: 798ee1c1dbf6b5b274d8738f260f4d3c785e6983c748ecc3227176eb3ea7e680

Contents?: true

Size: 1.77 KB

Versions: 10

Compression:

Stored size: 1.77 KB

Contents

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

describe "Ticketmaster::Provider::Bugzilla::Ticket" do

  before(:all) do 
    @klass = TicketMaster::Provider::Bugzilla::Ticket
    bug = {:id => 7039}
    Rubyzilla::Product.stub!(:bugs).and_return([bug])
    Rubyzilla::Bug.stub!(:create).and_return(bug)
  end

  before(:each) do 
    @ticketmaster = TicketMaster.new(:bugzilla, {:username => 'george.rafael@gmail.com', :password => '123456', :url =>'https://landfill.bugzilla.org/bugzilla-3.6-branch'})
    @project = @ticketmaster.project(1)
  end

  it "should be able to load all tickets" do 
    tickets = @project.tickets
    tickets.should be_an_instance_of(Array)
    tickets.first.should be_an_instance_of(@klass)
  end

  it "should be able to load all tickets from an array of id's" do 
    tickets = @project.tickets([7039])
    tickets.should be_an_instance_of(Array)
    tickets.first.should be_an_instance_of(@klass)
    tickets.first.id.should == 1
  end

  it "should be able to search tickets based on id attribute"  do
    tickets = @project.tickets(:id => 7039)
    tickets.should be_an_instance_of(Array)
    tickets.first.should be_an_instance_of(@klass)
  end

  it "should be able to search a ticket by id" do
    ticket = @project.ticket(7039)
    ticket.should be_an_instance_of(@klass)
    ticket.id.should == 7039
  end

  it "should be able to return a ticket by attributes" do
    ticket = @project.ticket(:id => 7039)
    ticket.should be_an_instance_of(@klass)
    ticket.id.should == 7039
  end

  it "should be able to create a ticket" do 
    ticket = @project.ticket!(:summary => "The program crashes", :description => "It crashes", :component => "EconomicControl", :op_sys => "Linux", :platform => "x86")
    ticket.should be_an_instance_of(@klass)
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
ticketmaster-bugzilla-0.2.8 spec/tickets_spec.rb
ticketmaster-bugzilla-0.1.8 spec/tickets_spec.rb
ticketmaster-bugzilla-0.1.7 spec/tickets_spec.rb
ticketmaster-bugzilla-0.1.6 spec/tickets_spec.rb
ticketmaster-bugzilla-0.0.6 spec/tickets_spec.rb
ticketmaster-bugzilla-0.0.5 spec/tickets_spec.rb
ticketmaster-bugzilla-0.0.4 spec/tickets_spec.rb
ticketmaster-bugzilla-0.0.3 spec/tickets_spec.rb
ticketmaster-bugzilla-0.0.2 spec/tickets_spec.rb
ticketmaster-bugzilla-0.0.1 spec/tickets_spec.rb