2018-10-15 14:42:47 +05:30
|
|
|
require 'spec_helper'
|
|
|
|
|
2018-11-08 19:23:39 +05:30
|
|
|
describe 'Projects > Activity > User sees activity' do
|
2018-10-15 14:42:47 +05:30
|
|
|
let(:project) { create(:project, :repository, :public) }
|
|
|
|
let(:user) { project.creator }
|
2018-12-05 23:21:45 +05:30
|
|
|
let(:issue) { create(:issue, project: project) }
|
2018-10-15 14:42:47 +05:30
|
|
|
|
|
|
|
before do
|
2018-12-05 23:21:45 +05:30
|
|
|
create(:event, :created, project: project, target: issue, author: user)
|
2018-10-15 14:42:47 +05:30
|
|
|
event = create(:push_event, project: project, author: user)
|
|
|
|
create(:push_event_payload,
|
|
|
|
event: event,
|
|
|
|
action: :created,
|
|
|
|
commit_to: '6d394385cf567f80a8fd85055db1ab4c5295806f',
|
|
|
|
ref: 'fix',
|
|
|
|
commit_count: 1)
|
|
|
|
end
|
|
|
|
|
|
|
|
it 'shows the last push in the activity page', :js do
|
2018-12-05 23:21:45 +05:30
|
|
|
visit activity_project_path(project)
|
|
|
|
|
2018-12-13 13:39:08 +05:30
|
|
|
expect(page).to have_content "#{user.name} #{user.to_reference} pushed new branch fix"
|
2018-10-15 14:42:47 +05:30
|
|
|
end
|
2018-12-05 23:21:45 +05:30
|
|
|
|
|
|
|
it 'allows to filter event with the "event_filter=issue" URL param', :js do
|
|
|
|
visit activity_project_path(project, event_filter: 'issue')
|
|
|
|
|
2018-12-13 13:39:08 +05:30
|
|
|
expect(page).not_to have_content "#{user.name} #{user.to_reference} pushed new branch fix"
|
|
|
|
expect(page).to have_content "#{user.name} #{user.to_reference} opened issue #{issue.to_reference}"
|
2018-12-05 23:21:45 +05:30
|
|
|
end
|
2018-10-15 14:42:47 +05:30
|
|
|
end
|