summaryrefslogtreecommitdiff
path: root/spec/presenters/issue_presenter_spec.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/presenters/issue_presenter_spec.rb')
-rw-r--r--spec/presenters/issue_presenter_spec.rb18
1 files changed, 16 insertions, 2 deletions
diff --git a/spec/presenters/issue_presenter_spec.rb b/spec/presenters/issue_presenter_spec.rb
index 8e24559341b..1eb674d1f8f 100644
--- a/spec/presenters/issue_presenter_spec.rb
+++ b/spec/presenters/issue_presenter_spec.rb
@@ -17,13 +17,27 @@ describe IssuePresenter do
describe '#web_url' do
it 'returns correct path' do
- expect(presenter.web_url).to eq "http://localhost/#{group.name}/#{project.name}/issues/#{issue.iid}"
+ expect(presenter.web_url).to eq("http://localhost/#{group.name}/#{project.name}/issues/#{issue.iid}")
+ end
+ end
+
+ describe '#subscribed?' do
+ subject { presenter.subscribed? }
+
+ it 'returns not subscribed' do
+ is_expected.to be(false)
+ end
+
+ it 'returns subscribed' do
+ create(:subscription, user: user, project: project, subscribable: issue, subscribed: true)
+
+ is_expected.to be(true)
end
end
describe '#issue_path' do
it 'returns correct path' do
- expect(presenter.issue_path).to eq "/#{group.name}/#{project.name}/issues/#{issue.iid}"
+ expect(presenter.issue_path).to eq("/#{group.name}/#{project.name}/issues/#{issue.iid}")
end
end
end