Sha256: 1398ff9479a341a83a453952029825865a8db3d0363f99b20d8733b9695ad482

Contents?: true

Size: 1.21 KB

Versions: 1

Compression:

Stored size: 1.21 KB

Contents

# encoding: utf-8
require File.expand_path(File.dirname(__FILE__) + '/spec_helper')

describe Jiralicious::SearchResult do
  before :each do
    FakeWeb.register_uri(:get,
                         "#{Jiralicious.rest_path}/issue/HSP-1",
                         :status => "200",
                         :body => issue_json)
  end

  let(:search_data) {
    {
      "startAt" => 0,
      "maxResults" =>  50,
      "total" =>  1,
      "issues" => [{
                   "self" => "http://www.example.com/jira/rest/api/2.0/jira/rest/api/2.0/issue/HSP-1",
                   "key" =>  "HSP-1"
                 }]
    }
  }
  let(:search_result) { Jiralicious::SearchResult.new(search_data) }

  it "assigns an array to back the search results" do
    search_result.instance_variable_get('@issues').
      should == [ {"self" => "http://www.example.com/jira/rest/api/2.0/jira/rest/api/2.0/issue/HSP-1",
                  "key" => "HSP-1"} ]
  end

  it "knows it's offset" do
    search_result.offset.should == 0
  end

  it "knows how many results are returned from the web service" do
    search_result.num_results.should == 1
  end

  it "fetches issues" do
    search_result.issues.first.should be_instance_of(Jiralicious::Issue)
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
jiralicious-0.0.6 spec/search_result_spec.rb