Commit 809e72ca authored by Alex Kalderimis's avatar Alex Kalderimis

Update specs based on new wiki-page factory sequence

Also re-order conditions so that preposition test passes
parent a3982c2e
......@@ -70,10 +70,10 @@ module EventsHelper
def event_preposition(event)
if event.wiki_page?
_("Events|in the wiki for")
elsif event.push_action? || event.commented_action? || event.target
"at"
elsif event.milestone?
"in"
elsif event.push_action? || event.commented_action? || event.target
"at"
end
end
......
......@@ -121,8 +121,7 @@ describe EventsHelper do
end
end
# This branch appears to be unreachable
context 'for milestone events', :pending do
context 'for milestone events' do
let(:event) { create(:event, target: create(:milestone)) }
it 'returns a suitable phrase' do
......@@ -156,10 +155,11 @@ describe EventsHelper do
it 'produces a suitable title chunk' do
url = helper.event_wiki_page_target_url(event)
title = event.target_title
html = [
"<span class=\"event-target-type append-right-4\">wiki page</span>",
"<a title=\"Title.with.dot\" class=\"has-tooltip event-target-link append-right-4\" href=\"#{url}\">",
event.target.title,
"<a title=\"#{title}\" class=\"has-tooltip event-target-link append-right-4\" href=\"#{url}\">",
title,
"</a>"
].join
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment