gitlab-org--gitlab-foss/spec/presenters/issue_presenter_spec.rb
Brett Walker 1285b00517 Added common fields to the IssueType
and allow passing of child_complexity to the
'resolver_complexity' metho
2019-05-31 13:19:29 -05:00

29 lines
773 B
Ruby

# frozen_string_literal: true
require 'spec_helper'
describe IssuePresenter do
include Gitlab::Routing.url_helpers
let(:user) { create(:user) }
let(:group) { create(:group) }
let(:project) { create(:project, group: group) }
let(:issue) { create(:issue, project: project) }
let(:presenter) { described_class.new(issue, current_user: user) }
before do
group.add_developer(user)
end
describe '#web_url' do
it 'returns correct path' do
expect(presenter.web_url).to eq "http://localhost/#{group.name}/#{project.name}/issues/#{issue.iid}"
end
end
describe '#issue_path' do
it 'returns correct path' do
expect(presenter.issue_path).to eq "/#{group.name}/#{project.name}/issues/#{issue.iid}"
end
end
end