diff options
author | Brett Walker <bwalker@gitlab.com> | 2019-05-31 19:46:16 +0300 |
---|---|---|
committer | Brett Walker <bwalker@gitlab.com> | 2019-05-31 21:19:29 +0300 |
commit | 1285b0051705519488fbc7ac3bf8511864560ac9 (patch) | |
tree | 81453b674e1d3719d477573e6a13e98e0a2a4b5e /spec/presenters | |
parent | b9798c157ac5973e9dd2b7ad95267014034a219f (diff) |
Added common fields to the IssueType
and allow passing of child_complexity to the
'resolver_complexity' metho
Diffstat (limited to 'spec/presenters')
-rw-r--r-- | spec/presenters/issue_presenter_spec.rb | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/spec/presenters/issue_presenter_spec.rb b/spec/presenters/issue_presenter_spec.rb new file mode 100644 index 00000000000..8e24559341b --- /dev/null +++ b/spec/presenters/issue_presenter_spec.rb @@ -0,0 +1,29 @@ +# 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 |