Commit 64855704 authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets

Increase atom feed test coverage. Prevent 500 error if description is missing

Signed-off-by: default avatarDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
parent fe314d46
%div{xmlns: "http://www.w3.org/1999/xhtml"} %div{xmlns: "http://www.w3.org/1999/xhtml"}
- if issue.description.present?
= markdown issue.description = markdown issue.description
%div{xmlns: "http://www.w3.org/1999/xhtml"} %div{xmlns: "http://www.w3.org/1999/xhtml"}
- if merge_request.description.present?
= markdown merge_request.description = markdown merge_request.description
...@@ -82,6 +82,4 @@ class EventFilters < Spinach::FeatureSteps ...@@ -82,6 +82,4 @@ class EventFilters < Spinach::FeatureSteps
When 'I click "merge" event filter' do When 'I click "merge" event filter' do
click_link("merged_event_filter") click_link("merged_event_filter")
end end
end end
...@@ -10,5 +10,34 @@ describe "Dashboard Feed", feature: true do ...@@ -10,5 +10,34 @@ describe "Dashboard Feed", feature: true do
page.body.should have_selector("feed title") page.body.should have_selector("feed title")
end end
end end
context 'feed content' do
let(:project) { create(:project) }
let(:issue) { create(:issue, project: project, author: user, description: '') }
let(:note) { create(:note, noteable: issue, author: user, note: 'Bug confirmed', project: project) }
before do
project.team << [user, :master]
issue_event(issue, user)
note_event(note, user)
visit dashboard_path(:atom, private_token: user.private_token)
end
it "should have issue opened event" do
page.body.should have_content("#{user.name} opened issue ##{issue.iid}")
end
it "should have issue comment event" do
page.body.should have_content("#{user.name} commented on issue ##{issue.iid}")
end
end
end
def issue_event(issue, user)
EventCreateService.new.open_issue(issue, user)
end
def note_event(note, user)
EventCreateService.new.leave_note(note, user)
end end
end end
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