Sha256: d422178f4f45ba7d36209c01103a21c8d49688a864d12c673b53413981a972d5

Contents?: true

Size: 1.14 KB

Versions: 10

Compression:

Stored size: 1.14 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'
    allow_any_instance_of(Lita::Configuration).to receive(:hipchat).and_return(OpenStruct.new({ rooms: ["room"] }))
  end

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

  it { is_expected.to route_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 robot
    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

10 entries across 10 versions & 1 rubygems

Version Path
lita-github_pr_list-0.3.2 spec/lita/handlers/open_pull_request_message_hook_spec.rb
lita-github_pr_list-0.3.1 spec/lita/handlers/open_pull_request_message_hook_spec.rb
lita-github_pr_list-0.3.0 spec/lita/handlers/open_pull_request_message_hook_spec.rb
lita-github_pr_list-0.2.2 spec/lita/handlers/open_pull_request_message_hook_spec.rb
lita-github_pr_list-0.2.1 spec/lita/handlers/open_pull_request_message_hook_spec.rb
lita-github_pr_list-0.2.0 spec/lita/handlers/open_pull_request_message_hook_spec.rb
lita-github_pr_list-0.1.3 spec/lita/handlers/open_pull_request_message_hook_spec.rb
lita-github_pr_list-0.1.2 spec/lita/handlers/open_pull_request_message_hook_spec.rb
lita-github_pr_list-0.1.1 spec/lita/handlers/open_pull_request_message_hook_spec.rb
lita-github_pr_list-0.1.0 spec/lita/handlers/open_pull_request_message_hook_spec.rb