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

Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
This commit is contained in:
Dmitriy Zaporozhets 2014-09-20 11:55:58 +03:00
parent fe314d460e
commit 6485570482
No known key found for this signature in database
GPG key ID: 627C5F589F467F17
4 changed files with 33 additions and 4 deletions

View file

@ -1,2 +1,3 @@
%div{xmlns: "http://www.w3.org/1999/xhtml"}
= markdown issue.description
- if issue.description.present?
= markdown issue.description

View file

@ -1,2 +1,3 @@
%div{xmlns: "http://www.w3.org/1999/xhtml"}
= markdown merge_request.description
- if merge_request.description.present?
= markdown merge_request.description

View file

@ -82,6 +82,4 @@ class EventFilters < Spinach::FeatureSteps
When 'I click "merge" event filter' do
click_link("merged_event_filter")
end
end

View file

@ -10,5 +10,34 @@ describe "Dashboard Feed", feature: true do
page.body.should have_selector("feed title")
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