Sha256: 69c976fa6cd7b6a2b211c78f2c93688a59a5a34aeede24de4c38352ed5e856d2

Contents?: true

Size: 1.18 KB

Versions: 5

Compression:

Stored size: 1.18 KB

Contents

require 'helper'

class TestProject < Test::Unit::TestCase
  CREDENTIALS = {:email => 'rafael@hybridgroup.com', :password => '123456', :uri => 'https://clutchapp.fogbugz.com'}

  def setup
    @klass = TicketMaster::Provider::Fogbugz::Project
    @tm = TicketMaster.new(:fogbugz, CREDENTIALS)
  end
  
  should "be able to load all projects" do 
    projects = @tm.projects
    assert_equal true, projects.instance_of?(Array)
    assert_equal true, projects.first.instance_of?(@klass)
  end

  should "be able to load a group of projects based on array of id's" do 
    projects = @tm.projects([1,2])
    assert_equal true, projects.instance_of?(Array)
    assert_equal true, projects.first.instance_of?(@klass)
    assert_equal 2, projects.first.id
  end

  should "be able to load tickets based on attributes" do 
    projects = @tm.projects(:id => 1)
    assert_equal true, projects.instance_of?(Array)
    assert_equal true, projects.first.instance_of?(@klass)
    assert_equal "Sample Project", projects.first.name
  end

  should "be able to load a single ticket based on id" do 
    project = @tm.project(1)
    assert_equal true, project.instance_of?(@klass)
    assert_equal 1, project.id
  end

end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
ticketmaster-fogbugz-0.2.3 test/test_project.rb
ticketmaster-fogbugz-0.1.3 test/test_project.rb
ticketmaster-fogbugz-0.1.2 test/test_project.rb
ticketmaster-fogbugz-0.1.1 test/test_project.rb
ticketmaster-fogbugz-0.0.1 test/test_project.rb