Sha256: 27bd5c38d3daad4b7ff4d66def3a1ab1bb0a089520495b8710e27204e1bb8274

Contents?: true

Size: 1.01 KB

Versions: 3

Compression:

Stored size: 1.01 KB

Contents

describe Lita::Handlers::GithubPrList, lita_handler: true do
  before :each do
    Lita.config.handlers.github_pr_list.github_organization = 'aaaaaabbbbbbcccccc'
    Lita.config.handlers.github_pr_list.github_access_token = 'wafflesausages111111'
  end

  let(:open_pull_request_response) { [File.read("spec/fixtures/open_pull_request_response.json")] }

  it { routes_http(:post, "/pull_request_open_message_hook").to(:pull_request_open_message_hook) }

  it "sends a message to hipchat - pull request opened" do
    request = Rack::Request.new("rack.input" => StringIO.new(open_pull_request_response.first))
    response = Rack::Response.new(['Hello'], 200, {'Content-Type' => 'text/plain'})

    github_handler = Lita::Handlers::GithubPrList.new
    github_handler.pull_request_open_message_hook(request, response)

    expect(replies.last).to include("@baxterthehacker opened pull request: 'Update the README with new information' in 'baxterthehacker/public-repo'. https://github.com/baxterthehacker/public-repo/pull/48")
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
lita-github_pr_list-0.0.20 spec/lita/handlers/open_pull_request_message_hook_spec.rb
lita-github_pr_list-0.0.19 spec/lita/handlers/open_pull_request_message_hook_spec.rb
lita-github_pr_list-0.0.16 spec/lita/handlers/open_pull_request_message_hook_spec.rb