summaryrefslogtreecommitdiff
path: root/spec/lib/gitlab/slash_commands/presenters/issue_new_spec.rb
blob: 7f81ebb47dbfc487fef04dcadbb0408807b1ff69 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
require 'spec_helper'

describe Gitlab::SlashCommands::Presenters::IssueNew do
  let(:project) { create(:empty_project) }
  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)
    expect(attachment[:title]).to start_with(issue.title)
  end
end