diff options
author | schwedenmut <schwedenmut@googlemail.com> | 2018-09-05 11:29:04 +0000 |
---|---|---|
committer | Rémy Coutable <remy@rymai.me> | 2018-09-05 11:29:04 +0000 |
commit | 00e42e3c454bf87a5cae580c8edfa647d6e4d7c1 (patch) | |
tree | 5565cefd67b8114e9037050ac82bfc0d16a5ed63 /spec/helpers | |
parent | 4a3a74979796e6245bd82dd06c52146caecb9b9e (diff) | |
download | gitlab-ce-00e42e3c454bf87a5cae580c8edfa647d6e4d7c1.tar.gz |
Resolve "<link href=""> and <a href=""> not properly filled in activity RSS feed"
Diffstat (limited to 'spec/helpers')
-rw-r--r-- | spec/helpers/events_helper_spec.rb | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/spec/helpers/events_helper_spec.rb b/spec/helpers/events_helper_spec.rb index fccde8b7eba..466e018d68c 100644 --- a/spec/helpers/events_helper_spec.rb +++ b/spec/helpers/events_helper_spec.rb @@ -25,4 +25,47 @@ describe EventsHelper do expect(helper.event_commit_title("foo & bar")).to eq("foo & bar") end end + + describe '#event_feed_url' do + let(:event) { create(:event) } + let(:project) { create(:project, :public, :repository) } + + it "returns project issue url" do + event.target = create(:issue) + + expect(helper.event_feed_url(event)).to eq(project_issue_url(event.project, event.issue)) + end + + it "returns project merge_request url" do + event.target = create(:merge_request) + + expect(helper.event_feed_url(event)).to eq(project_merge_request_url(event.project, event.merge_request)) + end + + it "returns project commit url" do + event.target = create(:note_on_commit, project: project) + + expect(helper.event_feed_url(event)).to eq(project_commit_url(event.project, event.note_target)) + end + + it "returns event note target url" do + event.target = create(:note) + + expect(helper.event_feed_url(event)).to eq(event_note_target_url(event)) + end + + it "returns project url" do + event.project = project + event.action = 1 + + expect(helper.event_feed_url(event)).to eq(project_url(event.project)) + end + + it "returns push event feed url" do + event = create(:push_event) + create(:push_event_payload, event: event, action: :pushed) + + expect(helper.event_feed_url(event)).to eq(push_event_feed_url(event)) + end + end end |