BigW Consortium Gitlab

issue_new_spec.rb 500 Bytes
Newer Older
1 2
require 'spec_helper'

3
describe Gitlab::SlashCommands::Presenters::IssueNew do
4
  let(:project) { create(:project) }
5 6 7 8 9 10 11 12 13 14
  let(:issue) { create(:issue, project: project) }
  let(:attachment) { subject[:attachments].first }

  subject { described_class.new(issue).present }

  it { is_expected.to be_a(Hash) }

  it 'shows the issue' do
    expect(subject[:response_type]).to be(:in_channel)
    expect(subject).to have_key(:attachments)
Z.J. van de Weg committed
15
    expect(attachment[:title]).to start_with(issue.title)
16 17
  end
end