Sha256: 51054d6f7b4acc98e5b12ff468b45f8887b6d3970e24f50fc15d62135f19c997

Contents?: true

Size: 1018 Bytes

Versions: 4

Compression:

Stored size: 1018 Bytes

Contents

require 'spec_helper'

module GotFixed
  describe IssueFactory do
    before(:each) do
      @issue_factory = IssueFactory.new
    end

    describe "#from_github" do

      it "should create an issue from an opened Github issue" do
        open_issues = JSON.load(File.open "spec/factories/github/open.json")
        issue = @issue_factory.from_github(open_issues.first)
        issue.should_not be_nil
        issue.closed.should be_false
        issue.vendor_id.should eq 3910487
        issue.number.should eq 1
        issue.title.should eq open_issues.first["title"]
      end

      it "should create an issue from a closed Github issue" do
        open_issues = JSON.load(File.open "spec/factories/github/closed.json")
        issue = @issue_factory.from_github(open_issues.first)
        issue.should_not be_nil
        issue.closed.should be_true
        issue.vendor_id.should eq 9255225
        issue.number.should eq 6
        issue.title.should eq open_issues.first["title"]
      end

    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
got_fixed-0.0.4 spec/lib/got_fixed/issue_factory_spec.rb
got_fixed-0.0.3 spec/lib/got_fixed/issue_factory_spec.rb
got_fixed-0.0.2 spec/lib/got_fixed/issue_factory_spec.rb
got_fixed-0.0.1 spec/lib/got_fixed/issue_factory_spec.rb