Sha256: 545216f0c6b58b87dc9d031a25d46ae5fde6a0b8eeed8f1c6d1fbe83e72d80b8

Contents?: true

Size: 1.31 KB

Versions: 1

Compression:

Stored size: 1.31 KB

Contents

require 'helper'

describe Githu3::Repo do

  def repo
    stub_get "/repos/technoweenie/faraday", "repos/faraday"
    @client.repo("technoweenie/faraday")
  end

  def issue
    stub_get "/repos/technoweenie/faraday/issues/1", "repos/issue"
    repo.issues("1")
  end

  before do
    @client = Githu3::Client.new("myvalidtoken")
  end
  
  
  describe "Issue Events" do
    it "should fetch an issue's events" do
      stub_get "/repos/technoweenie/faraday/issues/1/events", "issues/events"
      issue.events.length.should == 1
    end
    
    it 'should Get a single event' do
      stub_get "/repos/technoweenie/faraday/issues/1/events/1", "issues/event"
      issue.events('1').event.should == "closed"
    end
  end
  
  describe "Issue Comments" do
    it "should get a comments list for the issue" do
      stub_get "/repos/technoweenie/faraday/issues/1/comments", "issues/comments"
      issue.comments.length.should == 3
    end
    
    it "should get a single comment" do
      # TODO... check if github updates the route...
      pending("Waiting for a relpy's from github's team on the route...")
    end
  end
  
  describe "Issue labels" do
    it "should list its labels" do
      stub_get "/repos/technoweenie/faraday/issues/1/labels", "repos/labels"
      issue.labels.length.should == 1
    end
    
    
  end
  
  
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
githu3-0.0.2 spec/githu3/issue_spec.rb