BigW Consortium Gitlab

issue_search_spec.rb 647 Bytes
Newer Older
1 2
require 'spec_helper'

3
describe Gitlab::SlashCommands::Presenters::IssueSearch do
4
  let(:project) { create(:project) }
5 6
  let(:message) { subject[:text] }

7 8 9
  before do
    create_list(:issue, 2, project: project)
  end
10 11 12

  subject { described_class.new(project.issues).present }

Z.J. van de Weg committed
13
  it 'formats the message correct' do
14 15 16 17 18 19 20 21 22
    is_expected.to have_key(:text)
    is_expected.to have_key(:status)
    is_expected.to have_key(:response_type)
    is_expected.to have_key(:attachments)
  end

  it 'shows a list of results' do
    expect(subject[:response_type]).to be(:ephemeral)

Z.J. van de Weg committed
23
    expect(message).to start_with("Here are the 2 issues I found")
24 25
  end
end