diff options
author | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2014-09-20 11:55:58 +0300 |
---|---|---|
committer | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2014-09-20 11:55:58 +0300 |
commit | 648557048226ba98c514531135e96df9c34bdda7 (patch) | |
tree | 2bc8adf9fcd4a27abef384f8da3aa95652d51e2a /spec/features | |
parent | fe314d460efd18ea064df987a5a215904b95fd4e (diff) | |
download | gitlab-ce-648557048226ba98c514531135e96df9c34bdda7.tar.gz |
Increase atom feed test coverage. Prevent 500 error if description is missing
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
Diffstat (limited to 'spec/features')
-rw-r--r-- | spec/features/atom/dashboard_spec.rb | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/spec/features/atom/dashboard_spec.rb b/spec/features/atom/dashboard_spec.rb index e5d9f8ab5d5..a72a41fdf39 100644 --- a/spec/features/atom/dashboard_spec.rb +++ b/spec/features/atom/dashboard_spec.rb @@ -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 |